:root {
  --bg: #f7f5f2;
  --bg2: #ffffff;
  --fg: #16141c;
  --mut: #625e6c;
  --line: rgba(22, 20, 28, 0.1);
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(22, 20, 28, 0.06), 0 8px 24px rgba(22, 20, 28, 0.06);
  --brand: #ff5a36;
  --brand2: #ffb020;
  --primary-fg: #ffffff;
  --radius: 20px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0d12; --bg2: #16151c; --fg: #f3f1f6; --mut: #a19dab; --line: rgba(255, 255, 255, 0.09);
    --card: #17161d; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0d12; --bg2: #16151c; --fg: #f3f1f6; --mut: #a19dab; --line: rgba(255, 255, 255, 0.09);
  --card: #17161d; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* Header */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font: 700 18px/1 var(--display); text-decoration: none; letter-spacing: -0.01em; }
.logo-mark { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--brand2)); position: relative; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.logo-mark::after { content: ""; position: absolute; inset: 8px 7px 8px 10px; background: #fff; clip-path: polygon(0 0, 100% 50%, 0 100%); border-radius: 2px; }
.top nav { display: flex; align-items: center; gap: 4px; }
.top nav a { text-decoration: none; padding: 8px 12px; border-radius: 10px; color: var(--mut); font-weight: 500; }
.top nav a:hover { color: var(--fg); background: var(--line); }
.theme { width: 40px; height: 40px; border: 0; background: transparent; color: var(--mut); border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.theme:hover { background: var(--line); color: var(--fg); }
.theme svg { width: 20px; height: 20px; grid-area: 1 / 1; }
.theme .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme .i-sun { display: none; } :root:not([data-theme="light"]) .theme .i-moon { display: block; } }
:root[data-theme="dark"] .theme .i-sun { display: none; }
:root[data-theme="dark"] .theme .i-moon { display: block; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { --h: 44px; display: inline-flex; align-items: center; gap: 8px; min-height: var(--h); padding: 0 16px; border-radius: 12px; font: 600 15px/1.1 var(--font); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, background .15s ease, box-shadow .15s ease; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-lg { --h: 52px; padding: 0 20px; font-size: 16px; border-radius: 14px; }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { box-shadow: 0 6px 18px color-mix(in srgb, var(--fg) 25%, transparent); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { background: var(--line); }
.btn-store { background: #000; color: #fff; border-color: rgba(255,255,255,.18); }
.btn-store svg { width: 22px; height: 22px; }
.btn-store span { display: flex; flex-direction: column; line-height: 1.05; font-size: 16px; }
.btn-store small { font-size: 10px; font-weight: 500; opacity: .85; }
.btn-store:hover { background: #222; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* Hero */
.hero { padding: clamp(48px, 9vw, 112px) 0 clamp(28px, 5vw, 56px); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; color: var(--brand); margin: 0 0 14px; }
.hero h1 { font-size: clamp(40px, 7.4vw, 84px); font-weight: 800; max-width: 12ch; }
.lead { font-size: clamp(17px, 2vw, 20px); color: var(--mut); max-width: 56ch; margin: 18px 0 28px; }

/* Sections + grid */
.section { padding: 24px 0 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 750; }
.section-head p { margin: 0; color: var(--mut); }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
@media (hover: hover) { .card:hover { transform: translateY(-3px); } }
.card-media { display: block; aspect-ratio: 1200 / 630; overflow: hidden; background: color-mix(in srgb, var(--accent) 22%, var(--bg2)); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-phones { height: 100%; display: flex; justify-content: center; align-items: flex-end; gap: 4%; padding: 18px 16px 0; background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%); }
.card-phones img { width: 30%; height: auto; border-radius: 14px 14px 0 0; box-shadow: 0 8px 22px rgba(0,0,0,.25); transform: translateY(8%); }
.card-phones img:nth-child(2) { transform: translateY(0); width: 32%; }
.card:not(.card-wide) .card-media { aspect-ratio: 4 / 3; }
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-body p { margin: 0; color: var(--mut); flex: 1; }
.card-head { display: flex; gap: 12px; align-items: center; }
.card-head h3 { font-size: 20px; font-weight: 750; }
.card-head h3 a { text-decoration: none; }
.card-head h3 a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card .actions { position: relative; z-index: 1; }
.app-icon { border-radius: 22.5%; flex: none; box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgba(0,0,0,.08); background: var(--bg2); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--line); color: var(--fg); }
.badge-web { background: color-mix(in srgb, #22c55e 18%, transparent); color: color-mix(in srgb, #16a34a 80%, var(--fg)); }
.badge-soft { background: transparent; border: 1px solid var(--line); color: var(--mut); }

/* Game page */
.game-hero { padding: 28px 0 28px; display: grid; gap: 22px; }
.back { color: var(--mut); text-decoration: none; font-weight: 500; width: fit-content; }
.back:hover { color: var(--fg); }
.game-title { display: flex; gap: 18px; align-items: center; }
.game-title h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 800; }
.tagline { margin: 6px 0 0; font-size: clamp(17px, 2vw, 21px); color: var(--mut); }
.note { margin: 0; color: var(--mut); font-size: 14px; }
.gallery { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.shot { margin: 0; flex: none; scroll-snap-align: start; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--bg2); }
.gallery-portrait .shot { width: min(260px, 62vw); }
.gallery-landscape .shot { width: min(640px, 86vw); }
.shot-video { background: #1b1442; }
.shot img, .shot video { width: 100%; }
.game-about { padding: 18px 0 8px; }
.grid-mini { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.mini { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); text-decoration: none; }
.mini:hover { border-color: color-mix(in srgb, var(--fg) 25%, transparent); }
.mini span { display: flex; flex-direction: column; }
.mini small { color: var(--mut); }

/* Prose */
.prose { max-width: 720px; }
.page { padding: 48px 0 56px; }
.prose h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 800; margin-bottom: 18px; }
.prose h2 { font-size: 22px; font-weight: 750; margin: 32px 0 8px; }
.prose p, .prose li { color: color-mix(in srgb, var(--fg) 82%, var(--mut)); }
.prose a { text-underline-offset: 2px; }
.legal .meta { color: var(--mut); margin-top: -8px; }

/* Footer */
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); color: var(--mut); font-size: 14px; }
.foot-in { display: grid; gap: 16px; grid-template-columns: 1fr auto; align-items: start; }
.foot strong { color: var(--fg); }
.foot p { margin: 4px 0 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot nav a, .foot .linklike { color: var(--mut); text-decoration: none; }
.foot nav a:hover, .foot .linklike:hover { color: var(--fg); }
.foot .fine { grid-column: 1 / -1; font-size: 12px; }
@media (max-width: 720px) { .foot-in { grid-template-columns: 1fr; } }

/* Consent */
.consent { position: fixed; z-index: 20; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); margin-inline: auto; max-width: 560px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,.25); padding: 14px 16px; display: flex; gap: 12px 16px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.consent[hidden] { display: none; }
.consent p { margin: 0; flex: 1 1 260px; color: var(--mut); }
.consent div { display: flex; gap: 8px; }
.consent .btn { --h: 38px; font-size: 14px; }

@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .top nav a { padding: 8px 9px; }
  .hero .actions .btn { flex: 1 1 100%; justify-content: center; }
  .game-hero .actions .btn { flex: 1 1 100%; justify-content: center; }
  .game-title .app-icon { width: 72px; height: 72px; }
}
