/* Один спокойный тёмный облик: нейтральные поверхности, один акцент. */
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --p-ink-1000: oklch(0.155 0.008 280);
  --p-ink-950: oklch(0.18 0.01 280);
  --p-ink-900: oklch(0.205 0.012 280);
  --p-ink-850: oklch(0.24 0.014 280);
  --p-ink-800: oklch(0.285 0.016 280);
  --p-slate-500: oklch(0.67 0.014 280);
  --p-slate-300: oklch(0.81 0.01 280);
  --p-paper: oklch(0.965 0.004 280);
  --p-violet: oklch(0.79 0.12 295);
  --p-violet-strong: oklch(0.7 0.16 295);
  --p-mint: oklch(0.82 0.1 165);
  --p-danger: oklch(0.72 0.15 25);

  --surface-page: var(--p-ink-1000);
  --surface-header: oklch(0.155 0.008 280 / 0.86);
  --surface-card: var(--p-ink-900);
  --surface-raised: var(--p-ink-850);
  --surface-hover: var(--p-ink-800);
  --text-primary: var(--p-paper);
  --text-secondary: var(--p-slate-300);
  --text-muted: var(--p-slate-500);
  --accent-primary: var(--p-violet);
  --accent-interactive: var(--p-violet-strong);
  --status-positive: var(--p-mint);
  --border-subtle: oklch(0.9 0.01 280 / 0.08);
  --border-strong: oklch(0.9 0.02 280 / 0.18);

  --button-bg: var(--accent-primary);
  --button-text: var(--p-ink-1000);
  --card-radius: 14px;
  --content-max: 1320px;
  --font-display: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--surface-page); }
body {
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text-primary);
  background: var(--surface-page);
  font: 16px/1.6 var(--font-body);
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select, input[type="range"] { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 3px solid var(--accent-primary); outline-offset: 4px; }
::selection { color: var(--p-ink-1000); background: var(--accent-primary); }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--content-max); margin-inline: auto; padding-inline: 16px; }
.container.play-layout, .play-header .container { padding-inline: 8px; }
.play-header .header-inner { min-height: 44px; }
.section { padding-block: 32px; }
.section--compact { padding-block: 20px; }
.catalog-section { padding-block: 16px 32px; }
.section-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.section-heading h1, .section-heading h2 { font: 600 clamp(24px, 5vw, 36px)/1.15 var(--font-display); letter-spacing: -.025em; }
.section-heading p { max-width: 60ch; color: var(--text-muted); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow::before { width: 20px; height: 1px; content: ""; background: var(--accent-primary); }
.muted { color: var(--text-muted); }
.icon { width: 20px; height: 20px; flex: 0 0 auto; stroke-width: 1.8; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 30; padding: 12px 16px; color: var(--button-text); background: var(--button-bg); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

/* Sticky header */
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--border-subtle); background: var(--surface-header); backdrop-filter: blur(18px); }
.header-inner > .play-heading { flex: 1; }
.header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }

/* Header */
.header-inner { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: inline-flex; min-height: 44px; flex: 0 0 auto; align-items: center; gap: 8px; transition: color 160ms ease-out; }
.brand-mark { display: grid; width: 24px; height: 24px; place-items: center; color: var(--accent-primary); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font: 700 16px/1 var(--font-display); letter-spacing: .16em; }
.brand:hover { color: var(--accent-primary); }
.locale-switch { display: flex; flex: 0 0 auto; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--border-subtle); border-radius: 10px; }
.locale-button { display: grid; width: 32px; height: 28px; place-items: center; border: 0; border-radius: 7px; background: transparent; opacity: .5; transition: opacity 160ms ease-out, background-color 160ms ease-out; }
.locale-button:hover { opacity: 1; }
.locale-button[aria-current="true"] { background: var(--surface-raised); opacity: 1; }
.flag-icon { width: 20px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px var(--border-subtle); }

/* Catalog */
.catalog-section { padding-block: 4px 40px; }
.catalog-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; padding-block: 20px 18px; }
.catalog-heading h1 { font: 650 26px/1.15 var(--font-display); letter-spacing: -.02em; }
.catalog-heading p { color: var(--text-muted); font-size: 14px; }
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
.game-card { position: relative; display: flex; min-width: 0; flex-direction: column; }
.game-card__link { display: flex; min-width: 0; flex-direction: column; gap: 10px; border-radius: var(--card-radius); }
.game-card__link:focus-visible { outline-offset: 3px; }
.game-card__media { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--card-radius); background: var(--surface-card); outline: 1px solid var(--border-subtle); outline-offset: -1px; isolation: isolate; transition: transform 200ms ease-out, box-shadow 200ms ease-out, outline-color 200ms ease-out; }
.game-card__media::after { position: absolute; inset: 72% 0 0; z-index: 2; pointer-events: none; content: ""; background: linear-gradient(transparent, oklch(0.1 0.01 280 / .55)); }
.game-card__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.03); transition: opacity 240ms ease-out, transform 320ms ease-out; }
.game-card__image.is-active { opacity: 1; transform: scale(1); }
.game-card__chip { position: absolute; top: 10px; left: 10px; z-index: 3; display: inline-flex; min-height: 24px; align-items: center; padding: 3px 8px; color: var(--p-paper); border: 1px solid oklch(0.95 0.01 280 / .14); border-radius: 7px; background: oklch(0.12 0.01 280 / .72); backdrop-filter: blur(10px); font-size: 12px; font-weight: 600; line-height: 1; }
.game-card__play { position: absolute; right: 12px; bottom: 12px; z-index: 4; display: grid; width: 44px; height: 44px; place-items: center; color: var(--button-text); border-radius: 50%; background: var(--accent-primary); box-shadow: 0 8px 24px oklch(0.05 0.01 280 / .35); opacity: 0; transform: translateY(6px) scale(.92); transition: opacity 180ms ease-out, transform 180ms ease-out; }
.game-card__play .icon { width: 18px; height: 18px; margin-left: 2px; fill: currentColor; }
.preview-dots { position: absolute; bottom: 14px; left: 14px; z-index: 3; display: flex; gap: 4px; pointer-events: none; opacity: 0; transition: opacity 180ms ease-out; }
.preview-dot { width: 10px; height: 2px; border-radius: 1px; background: oklch(0.95 0.01 280 / .35); transition: width 180ms ease-out, background-color 180ms ease-out; }
.preview-dot.is-active { width: 18px; background: var(--p-paper); }
.game-card__body { display: flex; min-width: 0; flex-direction: column; gap: 1px; padding-inline: 2px; }
.game-card__title { overflow: hidden; font: 600 16px/1.3 var(--font-display); letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; transition: color 160ms ease-out; }
.game-card__genre { color: var(--text-muted); font-size: 13px; line-height: 1.4; }
@media (hover: hover) and (pointer: fine) {
  .game-card__link:hover .game-card__media { outline-color: var(--border-strong); box-shadow: 0 16px 36px oklch(0.05 0.01 280 / .35); transform: translateY(-3px); }
  .game-card__link:hover .game-card__play, .game-card__link:focus-visible .game-card__play { opacity: 1; transform: none; }
  .game-card__link:hover .preview-dots { opacity: 1; }
  .game-card__link:hover .game-card__title { color: var(--accent-primary); }
}

/* Footer */
.site-footer { margin-top: 32px; border-top: 1px solid var(--border-subtle); }
.footer-inner { display: flex; flex-direction: column; gap: 6px; padding-block: 18px calc(18px + env(safe-area-inset-bottom)); }
.footer-copy { color: var(--text-muted); font-size: 13px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
.footer-nav a, .footer-nav button { display: inline-flex; min-height: 36px; align-items: center; padding: 0; color: var(--text-secondary); border: 0; background: none; font-size: 13px; transition: color 160ms ease-out; }
.footer-nav a:hover, .footer-nav button:hover { color: var(--accent-primary); }

/* Documents */
.doc-tabs { position: sticky; top: 57px; z-index: 5; display: flex; gap: 4px; max-width: 780px; margin-bottom: 8px; padding: 4px; overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--surface-page); scrollbar-width: none; }
.doc-tab { display: inline-flex; min-height: 36px; flex: 1 0 auto; align-items: center; justify-content: center; padding: 6px 14px; color: var(--text-secondary); border-radius: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; transition: color 160ms ease-out, background-color 160ms ease-out; }
.doc-tab:hover { color: var(--text-primary); background: var(--surface-card); }
.doc-tab[aria-current="page"] { color: var(--text-primary); background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--border-strong); }
.doc-heading { padding-block: 24px 20px; }
.doc-heading h2 { font: 650 clamp(24px, 4.5vw, 32px)/1.15 var(--font-display); letter-spacing: -.02em; text-wrap: balance; }
.doc-heading p { max-width: 65ch; margin-top: 8px; color: var(--text-secondary); }
.page-heading__meta { margin-top: 10px; color: var(--text-muted); font-size: 13px; }
.doc { display: grid; max-width: 780px; }
.doc-section { padding-block: 22px; border-top: 1px solid var(--border-subtle); scroll-margin-top: 72px; }
.doc-section h3 { margin-bottom: 10px; font: 600 19px/1.3 var(--font-display); letter-spacing: -.01em; }
.doc-section p, .doc-section li { max-width: 72ch; color: var(--text-secondary); }
.doc-section > * + * { margin-top: 10px; }
.doc-section ul { display: grid; gap: 6px; padding-left: 20px; }
.doc-section li::marker { color: var(--text-muted); }
.doc-section b { color: var(--text-primary); font-weight: 600; }
.doc-section a, .consent a { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--accent-primary); text-underline-offset: 3px; }
.doc-section a:hover, .consent a:hover { color: var(--accent-primary); }
.doc-section:target h3 { color: var(--accent-primary); }
mark.todo { padding: 0 4px; color: oklch(0.88 0.13 85); border-radius: 4px; background: oklch(0.8 0.14 85 / .16); }
.doc-table { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: 12px; }
.doc-table table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.doc-table th, .doc-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-top: 1px solid var(--border-subtle); }
.doc-table thead th { border-top: 0; color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.doc-table td { color: var(--text-secondary); }
.doc-table__group th { color: var(--text-primary); background: var(--surface-card); font-size: 13px; font-weight: 600; }
.doc-table code { color: var(--text-primary); font: 500 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }

/* Cookie consent */
.consent { position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); left: 12px; z-index: 45; display: grid; gap: 14px; padding: 16px; color: var(--text-secondary); border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface-raised); box-shadow: 0 24px 64px oklch(0.05 0.01 280 / .55); font-size: 14px; line-height: 1.5; }
.consent__actions { display: flex; gap: 8px; }
.consent .button { min-height: 40px; flex: 1; padding: 8px 14px; border-radius: 10px; font-size: 14px; }
.consent .button:hover { transform: none; }

/* Breadcrumbs and genres */
.breadcrumbs { padding-block: 16px 0; font-size: 13px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); }
.breadcrumbs li + li::before { content: "/"; color: var(--border-strong); }
.breadcrumbs a { color: var(--text-secondary); transition: color 160ms ease-out; }
.breadcrumbs a:hover { color: var(--accent-primary); }
.genre-nav { display: flex; gap: 6px; margin: 0 -16px 20px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
.genre-nav::-webkit-scrollbar { display: none; }
.genre-chip { display: inline-flex; min-height: 36px; flex: 0 0 auto; align-items: center; padding: 6px 14px; color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 999px; font-size: 14px; font-weight: 500; transition: color 160ms ease-out, border-color 160ms ease-out, background-color 160ms ease-out; }
.genre-chip:hover { color: var(--text-primary); border-color: var(--border-strong); }
.genre-chip[aria-current="page"] { color: var(--button-text); border-color: var(--accent-primary); background: var(--accent-primary); }
.catalog-heading--stacked { display: grid; gap: 8px; padding-top: 12px; }
.catalog-heading--stacked p { max-width: 68ch; color: var(--text-secondary); font-size: 15px; }
.seo-text { max-width: 760px; padding-block: 8px 8px; color: var(--text-muted); }
.seo-text h2 { margin-bottom: 8px; color: var(--text-secondary); font: 600 17px/1.3 var(--font-display); }
.seo-text p { font-size: 14px; }

/* Game page text below the game */
.game-page { padding-bottom: 16px; }
.game-intro { display: grid; gap: 12px; padding-block: 16px 28px; scroll-margin-top: 56px; }
.game-intro h1 { max-width: 24ch; font: 650 clamp(26px, 4.5vw, 38px)/1.12 var(--font-display); letter-spacing: -.025em; text-wrap: balance; }
.game-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag--link { color: var(--accent-primary); border-color: var(--border-strong); transition: background-color 160ms ease-out; }
.tag--link:hover { background: var(--surface-raised); }
.game-lead { max-width: 60ch; color: var(--text-secondary); font-size: 17px; line-height: 1.5; }
.article-content h3 { margin-block: 20px 8px; font: 600 16px/1.3 var(--font-display); }
.feature-list { display: grid; gap: 6px; padding-left: 20px; color: var(--text-secondary); }
.feature-list li::marker { color: var(--accent-primary); }
.controls-list { display: grid; max-width: 520px; border-top: 1px solid var(--border-subtle); }
.controls-list > div { display: flex; justify-content: space-between; gap: 16px; padding-block: 8px; border-bottom: 1px solid var(--border-subtle); font-size: 15px; }
.controls-list dt { color: var(--text-secondary); }
.controls-list dd { color: var(--text-primary); font-weight: 600; text-align: right; }
.not-found { display: grid; justify-items: start; gap: 8px; min-height: 50dvh; align-content: center; }

/* Buttons and form controls */
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 10px; padding: 12px 20px; border: 1px solid transparent; border-radius: 12px; font-weight: 700; line-height: 1.2; transition: transform 160ms ease-out, background-color 160ms ease-out, border-color 160ms ease-out; }
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0) scale(.98); }
.button--primary { color: var(--button-text); background: var(--button-bg); }
.button--primary:hover { background: var(--p-paper); }
.button--secondary { border-color: var(--border-strong); background: var(--surface-raised); }
.button--secondary:hover { background: var(--surface-hover); }
.icon-button { display: inline-flex; width: 48px; min-width: 48px; height: 48px; align-items: center; justify-content: center; border: 1px solid var(--border-subtle); border-radius: 12px; background: transparent; transition: background-color 160ms ease-out, color 160ms ease-out, transform 160ms ease-out; }
.icon-button:hover { color: var(--text-primary); background: var(--surface-hover); }
.icon-button:active { transform: scale(.94); }
.icon-button[aria-pressed="true"] { color: var(--accent-primary); border-color: var(--border-strong); background: var(--surface-hover); }

/* Homepage */
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }

.seo-section { display: grid; gap: 28px; padding-block: 48px; border-top: 1px solid var(--border-subtle); }
.about-page { min-height: calc(100dvh - 250px); align-content: center; border-top: 0; }
.seo-section h1, .seo-section h2 { max-width: 15ch; font: 600 clamp(30px, 7vw, 48px)/1.08 var(--font-display); letter-spacing: -.035em; }
.seo-copy { display: grid; gap: 18px; max-width: 70ch; color: var(--text-secondary); }
.seo-copy h2 { margin-top: 8px; color: var(--text-primary); font: 600 20px/1.25 var(--font-display); }
.text-link { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; padding: 0; color: var(--text-secondary); border: 0; background: transparent; cursor: pointer; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 5px; }
.text-link:hover { color: var(--accent-primary); }

/* Footer */

/* News and terms */
.content-page { padding-block: 40px; }
.page-heading { max-width: 760px; margin-bottom: 32px; }
.page-heading h1 { margin-block: 10px; font: 650 clamp(30px, 6vw, 44px)/1.1 var(--font-display); letter-spacing: -.03em; text-wrap: balance; }
.page-heading p { max-width: 65ch; color: var(--text-secondary); }
.news-item { display: grid; gap: 8px; padding-block: 24px; border-top: 1px solid var(--border-subtle); }
.news-item time { color: var(--accent-primary); font-size: 12px; font-weight: 700; }
.news-item h2 { font: 600 24px/1.25 var(--font-display); letter-spacing: -.02em; }
.news-item p { max-width: 72ch; color: var(--text-secondary); }

/* Game showcase */
.tag { display: inline-flex; min-height: 28px; align-items: center; padding: 4px 8px; color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 8px; font-size: 12px; line-height: 1.2; }
.screenshot-strip { position: relative; width: 100%; }
.screenshot-grid { display: grid; width: 100%; grid-auto-flow: column; grid-auto-columns: max-content; gap: 12px; padding-bottom: 6px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; }
.screenshot-grid::-webkit-scrollbar { display: none; }
.strip-scroll { position: absolute; top: 50%; z-index: 5; width: 32px; min-width: 32px; height: 32px; color: var(--text-primary); border-radius: 50%; background: oklch(0.18 0.022 275 / .88); backdrop-filter: blur(10px); transform: translateY(-50%); }
.strip-scroll--left { left: 8px; }
.strip-scroll--right { right: 8px; }
.strip-scroll:active { transform: translateY(-50%) scale(.94); }
.strip-scroll .icon { width: 17px; height: 17px; }
.screenshot-button { position: relative; height: clamp(220px, 42vw, 360px); overflow: hidden; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--surface-card); scroll-snap-align: start; }
.screenshot-button img { width: auto; height: 100%; object-fit: contain; transition: transform 200ms ease-out; }
.screenshot-button:hover img { transform: scale(1.025); }
.screenshot-button .icon { position: absolute; right: 14px; bottom: 14px; width: 24px; height: 24px; filter: drop-shadow(0 2px 5px #000); }
.article-section { padding-block: 28px; border-top: 1px solid var(--border-subtle); }
.article-content { max-width: 72ch; }
.article-content h2 { margin-block: 0 12px; font: 600 30px/1.2 var(--font-display); letter-spacing: -.025em; }
.article-content p { color: var(--text-secondary); }
.article-content p + p { margin-top: 12px; }
.controls-copy { color: var(--text-muted); font-size: 14px; }
.faq-list { display: grid; gap: 8px; margin-top: 20px; }
.faq-item { border-bottom: 1px solid var(--border-subtle); }
.faq-item summary { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; font-weight: 700; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--text-muted); font-size: 24px; font-weight: 400; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding-bottom: 18px; color: var(--text-secondary); }
.related-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 42%; gap: 12px; padding-bottom: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-color: var(--border-strong) transparent; scrollbar-width: thin; }
.related-grid .game-card { min-width: 0; }
.lightbox { inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: clamp(64px, 8vh, 88px) clamp(16px, 5vw, 72px) clamp(24px, 5vh, 56px); overflow: hidden; border: 0; background: transparent; }
.lightbox[open] { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); place-items: center; }
.lightbox::backdrop { background: oklch(0.08 0.01 275 / .86); backdrop-filter: blur(12px); }
.lightbox img { width: auto; max-width: 100%; height: auto; max-height: 100%; min-height: 0; object-fit: contain; border: 1px solid var(--border-strong); border-radius: 16px; }
.lightbox-close { position: absolute; top: 16px; right: 16px; z-index: 2; color: var(--p-paper); background: var(--surface-raised); }
.lightbox-nav { position: absolute; top: 50%; z-index: 2; width: 44px; min-width: 44px; height: 44px; color: var(--p-paper); border-radius: 50%; background: oklch(0.18 0.022 275 / .82); backdrop-filter: blur(10px); transform: translateY(-50%); }
.lightbox-nav--prev { left: 16px; }
.lightbox-nav--next { right: 16px; }
.lightbox-nav:active { transform: translateY(-50%) scale(.94); }
.lightbox-nav .icon { width: 22px; height: 22px; }
.lightbox-counter { position: absolute; bottom: 16px; left: 50%; z-index: 2; padding: 4px 10px; color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 8px; background: oklch(0.18 0.022 275 / .82); font-size: 12px; line-height: 1.3; white-space: nowrap; transform: translateX(-50%); }
.back-to-top { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30; color: var(--text-primary); background: var(--surface-raised); box-shadow: 0 12px 36px oklch(0.05 0.01 275 / .45); }

/* Play page */
.play-heading { display: flex; min-width: 0; align-items: center; gap: 10px; }
.play-heading__divider { width: 1px; height: 24px; flex: 0 0 auto; background: var(--border-strong); }
.play-heading__game { display: flex; min-width: 0; flex: 0 1 auto; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 14px; }
.play-heading__game > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.play-heading__game { min-height: 44px; transition: color 160ms ease-out; }
a.play-heading__game:hover { color: var(--accent-primary); }
.play-layout { display: grid; height: calc(100dvh - 45px); grid-template-rows: clamp(104px, 17dvh, 136px) minmax(0, 1fr); gap: 8px; padding-block: 8px; }
.play-main { display: flex; min-width: 0; min-height: 0; order: 2; }
.game-shell { display: flex; min-height: 0; flex: 1; flex-direction: column; overflow: hidden; border: 1px solid var(--border-subtle); border-radius: 16px; background: var(--surface-card); }
.game-stage { position: relative; min-height: 0; flex: 1; overflow: hidden; background: #000; isolation: isolate; }
.game-frame { display: block; width: 100%; height: 100%; border: 0; background: #000; }

/* «Реклама» портала: промо другой нашей игры поверх игры */
.ad-overlay { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: oklch(0.1 0.01 280 / .9); backdrop-filter: blur(6px); }
.ad-card { display: grid; width: min(100%, 440px); gap: 14px; padding: 18px; border: 1px solid var(--border-strong); border-radius: 18px; background: var(--surface-raised); box-shadow: 0 24px 64px oklch(0.05 0.01 280 / .55); }
.ad-card__eyebrow { color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.ad-card__promo { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center; border-radius: 12px; }
.ad-card__cover { width: 112px; height: 150px; object-fit: cover; border-radius: 10px; outline: 1px solid var(--border-subtle); outline-offset: -1px; }
.ad-card__body { display: grid; gap: 6px; }
.ad-card__title { font: 650 20px/1.2 var(--font-display); letter-spacing: -.01em; }
.ad-card__text { color: var(--text-secondary); font-size: 14px; line-height: 1.45; }
.ad-card__play { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--accent-primary); font-weight: 600; }
.ad-card__play .icon { width: 16px; height: 16px; fill: currentColor; }
.ad-card__promo:hover .ad-card__title { color: var(--accent-primary); }
.ad-card__close { width: 100%; min-height: 44px; }
.ad-card__close:disabled { cursor: default; opacity: .7; }
@media (max-width: 420px) { .ad-card__promo { grid-template-columns: 88px minmax(0, 1fr); } .ad-card__cover { width: 88px; height: 118px; } .ad-card__text { display: none; } }

/* «Нравится?» по просьбе игры */
.game-dialog { position: absolute; left: 50%; bottom: 16px; z-index: 11; display: grid; width: min(calc(100% - 32px), 360px); gap: 12px; padding: 16px; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface-raised); box-shadow: 0 24px 64px oklch(0.05 0.01 280 / .55); transform: translateX(-50%); }
.game-dialog[hidden] { display: none; }
.game-dialog__title { font: 600 17px/1.3 var(--font-display); text-align: center; }
.game-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.game-dialog__actions .button { min-height: 44px; padding: 8px 12px; }
.game-dialog__later { justify-self: center; min-height: 32px; padding: 0 8px; color: var(--text-muted); border: 0; background: none; font-size: 13px; }
.game-dialog__later:hover { color: var(--text-primary); }
.service-panel { display: grid; flex: 0 0 auto; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 2px 8px; border-top: 1px solid var(--border-subtle); background: var(--surface-card); }
.service-panel .icon-button { width: 36px; min-width: 36px; height: 32px; border-radius: 6px; }
.service-panel .icon-button .icon { width: 17px; height: 17px; }
.service-about { display: inline-flex; height: 32px; min-height: 32px; align-items: center; justify-self: start; gap: 6px; padding: 4px 8px; color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 6px; font-size: 12px; font-weight: 700; line-height: 1; transition: color 160ms ease-out, background-color 160ms ease-out; }
.service-about:hover { color: var(--text-primary); background: var(--surface-hover); }
.service-about .icon { width: 16px; height: 16px; }
.service-group { display: flex; align-items: center; gap: 6px; }
.service-group--votes { justify-content: center; }
.service-group--controls { justify-self: end; }
.vote-count { min-width: 28px; color: var(--text-muted); font-size: 12px; text-align: center; }
.recommendations { position: relative; display: flex; min-width: 0; min-height: 0; flex-direction: column; order: 1; overflow: hidden; }
.recommendation-list { display: grid; min-height: 0; flex: 1; grid-auto-flow: column; grid-auto-columns: calc((100% - 12px) / 2); grid-template-rows: minmax(0, 1fr); align-content: start; gap: 12px; padding: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; scrollbar-width: none; }
.recommendation-list::-webkit-scrollbar { display: none; }
/* ⚠️ На широком экране список шире своей колонки на 80 px влево — под увеличение
   карточки при наведении. Этот запас лежит поверх правого края игры и кнопок
   звука и полного экрана, поэтому клики ловят только карточки и кнопки списка. */
.recommendation-list { pointer-events: none; }
.recommendation-card, .recommendation-more { pointer-events: auto; }
html.is-game-fullscreen, html.is-game-fullscreen body { overflow: hidden; }
.recommendation-card { position: relative; display: block; min-width: 0; min-height: 0; height: 100%; overflow: hidden; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--surface-card); }
.recommendation-card img { width: 100%; height: 100%; object-fit: cover; }
.recommendation-card__overlay { position: absolute; right: 0; bottom: 0; left: 0; padding: 8px 10px; color: var(--text-primary); background: oklch(0.12 0.02 275 / .82); font: 600 13px/1.25 var(--font-display); opacity: 0; transform: translateY(8px); transition: opacity 160ms ease-out, transform 160ms ease-out; }
.recommendation-more { position: absolute; bottom: 4px; left: 50%; z-index: 8; display: inline-flex; width: min(75%, 140px); min-height: 32px; align-items: center; justify-content: center; gap: 6px; color: var(--text-secondary); border: 1px solid var(--border-strong); border-radius: 10px; background: oklch(0.18 0.022 275 / .88); backdrop-filter: blur(10px); font-size: 12px; font-weight: 700; transform: translateX(-50%); transition: color 160ms ease-out, background-color 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out; }
.recommendation-more--up { top: 4px; bottom: auto; }
.recommendation-more.is-pointer-target { z-index: 12; }
.recommendation-more:hover, .recommendation-more:focus-visible { color: var(--text-primary); border-color: var(--accent-primary); background: oklch(0.26 0.03 275 / .94); }
.recommendation-more:active { transform: translateX(-50%) scale(.97); }
.recommendation-more .icon { width: 14px; height: 14px; }
.game-shell:fullscreen, .game-shell.is-fullscreen { display: flex; width: 100%; height: 100dvh; flex-direction: column; border: 0; border-radius: 0; background: var(--surface-page); }
.game-shell.is-fullscreen { position: fixed; inset: 0; z-index: 1000; height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
.game-shell:fullscreen .game-stage, .game-shell.is-fullscreen .game-stage { min-height: 0; flex: 1; aspect-ratio: auto; }
.game-shell:fullscreen .service-panel, .game-shell.is-fullscreen .service-panel { width: 100%; align-self: stretch; margin: 0; padding: 2px 8px calc(2px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--border-subtle); border-radius: 0; background: var(--surface-card); }
.game-shell:fullscreen .service-panel .icon-button, .game-shell.is-fullscreen .service-panel .icon-button { width: 26px; min-width: 26px; height: 22px; border-radius: 6px; }
.game-shell:fullscreen .service-panel .icon, .game-shell.is-fullscreen .service-panel .icon { width: 14px; height: 14px; }
.game-shell:fullscreen .service-about, .game-shell.is-fullscreen .service-about { height: 22px; min-height: 22px; padding: 2px 6px; border-radius: 6px; font-size: 10px; }
.game-shell:fullscreen .service-group, .game-shell.is-fullscreen .service-group { gap: 4px; }
.game-shell:fullscreen .vote-count, .game-shell.is-fullscreen .vote-count { font-size: 10px; }

.toast { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); left: 16px; z-index: 40; padding: 14px 18px; color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-raised); box-shadow: 0 16px 50px oklch(0.05 0.01 275 / .4); font-size: 14px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity 180ms ease-out, transform 180ms ease-out; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

/* Visual rhythm and restrained motion */
.text-link .icon { width: 16px; height: 16px; transition: transform 160ms ease-out; }
.text-link:hover .icon { transform: translateX(3px); }
.content-page { padding-block: 28px 32px; }
.page-heading { margin-bottom: 24px; }
.screenshot-button { transition: border-color 160ms ease-out, box-shadow 160ms ease-out; }
.screenshot-button:hover { border-color: var(--border-strong); box-shadow: 0 8px 20px oklch(0.05 0.01 275 / .2); }
.screenshot-button .icon { right: 10px; bottom: 10px; width: 30px; height: 30px; padding: 6px; border-radius: 8px; background: oklch(0.12 0.02 275 / .72); backdrop-filter: blur(8px); }
.faq-item summary { transition: color 160ms ease-out; }
.faq-item summary:hover { color: var(--accent-primary); }
.lightbox img { box-shadow: 0 24px 72px oklch(0.05 0.01 275 / .42); }

@keyframes surface-enter {
  from { opacity: 0; transform: translateY(8px) scale(.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes popover-enter {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes lightbox-enter {
  from { opacity: 0; transform: scale(.985); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes target-pulse {
  0% { opacity: .45; transform: scale(1); }
  75%, 100% { opacity: 0; transform: scale(1.35); }
}

@media (prefers-reduced-motion: no-preference) {
  .game-card, .showcase-art, .showcase-info, .play-main, .recommendations, .page-heading, .news-item, .doc-section, .seo-section > * { animation: surface-enter 260ms ease-out backwards; }
  .game-card:nth-child(2), .news-item:nth-child(2) { animation-delay: 20ms; }
  .game-card:nth-child(3), .news-item:nth-child(3) { animation-delay: 40ms; }
  .game-card:nth-child(4), .news-item:nth-child(4) { animation-delay: 60ms; }
  .game-card:nth-child(5) { animation-delay: 80ms; }
  .game-card:nth-child(6) { animation-delay: 100ms; }
  .game-card:nth-child(7) { animation-delay: 120ms; }
  .game-card:nth-child(8) { animation-delay: 140ms; }
  .consent { animation: surface-enter 220ms ease-out 300ms backwards; }
  .faq-item[open] p { animation: surface-enter 180ms ease-out; }
  .lightbox[open] img { animation: lightbox-enter 200ms ease-out; }
  .demo-target::after { animation: target-pulse 1.8s ease-out infinite; }
}

@media (min-width: 600px) {
  .footer-inner { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; }
  .consent { right: auto; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: 420px; }
  .catalog-heading h1 { font-size: 30px; }
  .container { padding-inline: 20px; }
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; }
  .related-grid { grid-template-columns: none; grid-auto-columns: 30%; gap: 16px; }
  .toast { right: 12px; left: auto; max-width: 360px; }
}

@media (min-width: 800px) {
  .game-card__title { font-size: 17px; }
  .section { padding-block: 44px; }
  .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 20px; }
  .related-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-columns: minmax(0, 1fr); gap: 20px; }
  .seo-section { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 64px; padding-block: 64px; }
  .play-layout { grid-template-columns: minmax(0, 1fr) minmax(130px, 155px); grid-template-rows: minmax(0, 1fr); gap: 8px; }
  .play-main { order: initial; }
  .recommendations { position: relative; z-index: 6; order: initial; overflow: visible; }
  .recommendation-list { width: calc(100% + 80px); grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: calc((100% - 48px) / 5); margin-left: -80px; padding-left: 80px; overflow-x: hidden; overflow-y: auto; }
  .recommendation-card { transition: transform 180ms ease-out, border-color 160ms ease-out; }
  .recommendation-card:hover, .recommendation-card:focus-visible { z-index: 10; border-color: var(--border-strong); transform: scale(1.45); transform-origin: right center; }
  .recommendation-card:first-child:hover, .recommendation-card:first-child:focus-visible { transform-origin: right top; }
  .recommendation-card:last-child:hover, .recommendation-card:last-child:focus-visible { transform-origin: right bottom; }
  .recommendation-card:hover .recommendation-card__overlay, .recommendation-card:focus-visible .recommendation-card__overlay { opacity: 1; transform: translateY(0); }
}

@media (max-width: 799px) {
  .recommendation-more { top: 50%; right: 8px; bottom: auto; left: auto; width: 32px; min-height: 32px; border-radius: 50%; transform: translateY(-50%); }
  .recommendation-more--up { right: auto; left: 8px; }
  .recommendation-more:active { transform: translateY(-50%) scale(.97); }
  .recommendation-more span { display: none; }
}

@media (min-width: 1180px) {
  .container { padding-inline: 32px; }
  .play-layout { grid-template-columns: minmax(0, 1fr) 165px; gap: 8px; }
}

@media (max-width: 600px) {
}

@media (max-width: 420px) {
  .service-panel { gap: 4px; }
  .service-group { gap: 4px; }
  .vote-count { display: none; }
}

@media (max-width: 360px) {
  .service-about span { display: none; }
}

@media (max-height: 560px) {
  .game-start { gap: 10px; padding: 12px; }
  .game-start__mark, .game-start p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
