/* CardGo — cardgo.dev
   "Ai Night" palette from the app (Theme.swift) + vivid game colours (Game.swift, dark variants). */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/assets/fonts/nunito-latin-wght-normal.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;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/assets/fonts/nunito-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #050c1c;
  --bg-2: #081428;
  --navy: #0e2a66;
  --accent: #3f7bff;
  --accent-2: #2f6bff;
  --accent-soft: #14244a;
  --ice: #bfd6ff;
  --ink: #f3f6ff;
  --ink-2: rgba(226, 234, 255, .76);
  --ink-3: rgba(226, 234, 255, .52);
  --line: rgba(160, 190, 255, .16);
  --glass: rgba(12, 24, 54, .62);
  --glass-2: rgba(20, 36, 74, .72);
  --matcha: #a8d08d;
  --yuzu: #ffd25e;
  --murasaki: #c9a6ec;
  --go: #30d158;
  --route: #409cff;
  --pokemon: #ffcc1a;
  --onepiece: #ff5a66;
  --yugioh: #b57bff;
  --mtg: #ff9f33;
  --lorcana: #3cc8ff;
  --duelmasters: #4fa8ff;
  --r-card: 22px;
  --r-control: 14px;
  --font: "SF Pro Rounded", ui-rounded, "Nunito", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Apple SD Gothic Neo", "PingFang SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 64px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; }
a { color: var(--ice); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.02em; margin: 0; font-weight: 850; text-wrap: balance; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { letter-spacing: 0; line-height: 1.25; line-break: strict; }
@supports (word-break: auto-phrase) { :lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(ja) .lede { word-break: auto-phrase; } }
:lang(ja) .hero h1 { font-size: clamp(34px, 6.2vw, 78px); }
p { margin: 0; text-wrap: pretty; }
b, strong { font-weight: 800; color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: #fff; color: var(--bg); border-radius: 10px; font-weight: 800; }
.skip:focus { top: 12px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- 3D scene layer ---------- */
.scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--bg); }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .9s ease; }
.scene-ready .scene canvas { opacity: 1; }
.scene-fallback {
  position: absolute; inset: 0; overflow: hidden;
  background:
    radial-gradient(60vmax 40vmax at 70% 30%, rgba(47, 107, 255, .32), transparent 60%),
    radial-gradient(40vmax 30vmax at 15% 80%, rgba(181, 123, 255, .18), transparent 60%),
    linear-gradient(180deg, #050c1c 0%, #0a1a3d 55%, #0e2a66 100%);
  transition: opacity .9s ease;
}
.scene-fallback::before {
  /* City grid seen from above at an angle */
  content: ""; position: absolute; left: -50%; right: -50%; top: 35%; height: 120%;
  background:
    repeating-linear-gradient(90deg, rgba(120, 160, 255, .16) 0 2px, transparent 2px 64px),
    repeating-linear-gradient(0deg, rgba(120, 160, 255, .16) 0 2px, transparent 2px 64px);
  transform: perspective(600px) rotateX(58deg);
  transform-origin: top center;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.scene-fallback::after {
  /* A few glowing shop pins */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 62% 58%, var(--pokemon) 0 5px, rgba(255, 204, 26, .35) 6px 18px, transparent 19px),
    radial-gradient(circle at 74% 66%, var(--onepiece) 0 5px, rgba(255, 90, 102, .35) 6px 18px, transparent 19px),
    radial-gradient(circle at 55% 72%, var(--yugioh) 0 5px, rgba(181, 123, 255, .35) 6px 18px, transparent 19px),
    radial-gradient(circle at 82% 52%, var(--mtg) 0 4px, rgba(255, 159, 51, .3) 5px 15px, transparent 16px),
    radial-gradient(circle at 44% 62%, var(--lorcana) 0 4px, rgba(60, 200, 255, .3) 5px 15px, transparent 16px),
    radial-gradient(circle at 68% 80%, var(--duelmasters) 0 4px, rgba(79, 168, 255, .3) 5px 15px, transparent 16px),
    radial-gradient(circle at 88% 74%, var(--pokemon) 0 4px, rgba(255, 204, 26, .3) 5px 15px, transparent 16px);
}
.scene-ready .scene-fallback { opacity: 0; }
.scene-shade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(5, 12, 28, .9) 0%, rgba(5, 12, 28, .62) 34%, rgba(5, 12, 28, .08) 62%, rgba(5, 12, 28, 0) 100%),
              linear-gradient(180deg, rgba(5, 12, 28, .55) 0%, transparent 18%, transparent 80%, rgba(5, 12, 28, .7) 100%);
  transition: background .6s ease;
}
body[data-chapter="6"] .scene-shade, body[data-chapter="7"] .scene-shade, body[data-chapter="8"] .scene-shade { background: rgba(5, 12, 28, .72); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: var(--nav-h);
  padding-top: env(safe-area-inset-top);
  background: linear-gradient(180deg, rgba(5, 12, 28, .85), rgba(5, 12, 28, .55));
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-in { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 900; font-size: 20px; letter-spacing: -.01em; }
.brand img { border-radius: 8px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.nav-links { display: flex; gap: 22px; margin-right: auto; }
.nav-links a, .lang { color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 15px; }
.nav-links a:hover, .lang:hover { color: #fff; }
.nav-end { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.nav-links + .nav-end { margin-left: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 0;
  background: var(--accent-2); color: #fff; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(47, 107, 255, .8), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { color: #fff; filter: brightness(1.1); }
.btn:active { transform: scale(.97); }
.btn-small { padding: 8px 16px; font-size: 15px; }

/* ---------- Story (hero + chapters with a sticky phone) ---------- */
main { position: relative; z-index: 1; }
.story { position: relative; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr); }
.stage { display: none; }

.chapter { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: 36px; padding: calc(var(--nav-h) + 48px) 0 64px; }
.chapter .copy { max-width: 560px; }
.chapter h2 { font-size: clamp(34px, 4.6vw, 56px); margin: 10px 0 18px; }
.chapter .copy > p:not(.kicker):not(.eyebrow) { color: var(--ink-2); font-size: clamp(17px, 1.6vw, 19px); }

.hero h1 { font-size: clamp(46px, 7.4vw, 92px); margin: 16px 0 20px; }
.hero .lede { font-size: clamp(18px, 2vw, 22px); color: var(--ink-2); max-width: 30em; }
.grad { background: linear-gradient(92deg, #7fb0ff 0%, #b57bff 45%, #ffcc1a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-weight: 800; font-size: 14px; color: var(--ink); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--route); box-shadow: 0 0 0 0 rgba(64, 156, 255, .7); animation: pulse 2.2s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(64, 156, 255, .7); } 80%, 100% { box-shadow: 0 0 0 12px rgba(64, 156, 255, 0); } }
.scroll-hint { display: none; }

.kicker { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--ice); }
:lang(ja) .kicker { letter-spacing: .04em; }
.kicker .num { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--accent-2); color: #fff; font-size: 13px; letter-spacing: 0; }

.points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.points li { position: relative; padding-left: 32px; color: var(--ink-2); }
.points li::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%237fb0ff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
  box-shadow: inset 0 0 0 1px rgba(127, 176, 255, .35);
}

/* Game chips */
.game-chips { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line); color: var(--ink); font: inherit; font-weight: 750; font-size: 15px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.chip-more { color: var(--ink-3); }
button.chip { cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .12s ease; }
button.chip:hover { border-color: rgba(160, 190, 255, .4); }
button.chip:active { transform: scale(.96); }
button.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--c, var(--accent)) 26%, rgba(12, 24, 54, .8)); border-color: var(--c, var(--accent)); }
.filter-try { margin-top: 26px; }
.try-label { font-weight: 800; font-size: 14px; color: var(--ink-3); margin-bottom: 10px !important; }
.game-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.services { margin-top: 22px !important; font-size: 15px !important; color: var(--ink-3) !important; }

/* Levels */
.levels { margin-top: 26px; }
.levels ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.levels li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 6px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-weight: 750; font-size: 14px; color: var(--ink-2); }
.levels li i { font-style: normal; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 900; color: #071229; background: var(--c); }
.levels li.here { color: #fff; border-color: var(--yuzu); box-shadow: 0 0 18px -4px rgba(255, 210, 94, .6); }

/* ---------- Phone frame ---------- */
.phone {
  --pw: 280px; --b: calc(var(--pw) * .035); --sw: calc(var(--pw) - 2 * var(--b));
  position: relative; width: var(--pw); padding: var(--b); border-radius: calc(var(--pw) * .165);
  background: linear-gradient(150deg, #3a4670 0%, #10172b 30%, #0a0f1d 70%, #2a3557 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 0 0 3px #05080f, 0 40px 80px -24px rgba(0, 0, 0, .8), 0 0 80px -20px rgba(63, 123, 255, .45);
}
.phone > img, .phone .screens { display: block; width: 100%; height: auto; aspect-ratio: 590 / 1283; border-radius: calc(var(--pw) * .13); background: #0b1630; }
.island { position: absolute; left: calc(var(--b) + var(--sw) * .344); top: calc(var(--b) + var(--sw) * 2.1746 * .016); width: calc(var(--sw) * .311); height: calc(var(--sw) * .0905); border-radius: 999px; background: #000; pointer-events: none; }

.shots { margin: 0; display: grid; place-items: center; padding: 10px 0 20px; }
.shots > .phone { grid-area: 1 / 1; }
.shots:not(.one) > .phone { --pw: min(230px, 46vw); }
.shots:not(.one) > .phone.back { transform: translateX(-34%) rotate(-6deg) scale(.9); filter: brightness(.78); }
.shots:not(.one) > .phone:not(.back) { transform: translateX(30%) rotate(3deg); }
.shots.one > .phone { --pw: min(280px, 70vw); }

/* Stage (desktop, JS): one sticky phone that swaps screens per chapter */
.screens { position: relative; overflow: hidden; }
.screens img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transform: scale(1.03); transition: opacity .5s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
.screens img.on { opacity: 1; transform: none; }

@media (min-width: 960px) {
  .story { grid-template-columns: minmax(0, 1fr) 360px; column-gap: 48px; }
  .js .story .chapter .shots { display: none; }
  .js .stage { display: block; position: relative; }
  .stage-in { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; justify-content: center; padding-top: var(--nav-h); }
  .stage-phone { --pw: min(330px, calc((100vh - var(--nav-h) - 80px) / 2.3)); transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
  body[data-chapter="0"] .stage-phone { transform: rotate(4deg) translateY(10px); }
  body[data-chapter="2"] .stage-phone { transform: rotate(-3deg); }
  body[data-chapter="4"] .stage-phone { transform: rotate(3deg) scale(1.02); }
  .no-js .chapter { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .scroll-hint { display: flex; align-items: center; gap: 10px; position: absolute; bottom: 28px; color: var(--ink-3); font-weight: 700; font-size: 14px; }
  .hero { position: relative; }
  .scroll-hint span { width: 20px; height: 32px; border: 2px solid var(--ink-3); border-radius: 12px; position: relative; }
  .scroll-hint span::after { content: ""; position: absolute; left: 50%; top: 6px; width: 4px; height: 7px; margin-left: -2px; border-radius: 2px; background: var(--ink-2); animation: wheel 1.8s ease-in-out infinite; }
  @keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(9px); opacity: 0; } 100% { opacity: 0; } }
}

/* ---------- Store buttons ---------- */
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.store {
  position: relative; display: inline-flex; align-items: center; gap: 12px; min-width: 200px;
  padding: 10px 18px 10px 14px; border-radius: 16px; text-decoration: none; color: var(--ink);
  background: var(--glass-2); border: 1px solid rgba(160, 190, 255, .28);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform .15s ease, background .15s ease, box-shadow .2s ease;
}
.store:hover { color: #fff; background: rgba(30, 52, 104, .8); }
.store:active { transform: scale(.97); }
.store svg { width: 28px; height: 28px; flex: none; }
.store .st { display: flex; flex-direction: column; line-height: 1.1; }
.store small { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.store strong { font-size: 20px; font-weight: 850; letter-spacing: -.01em; }
.store.primary { background: #fff; color: #071229; border-color: #fff; box-shadow: 0 12px 30px -10px rgba(127, 176, 255, .7); }
.store.primary small { color: #3b4a6b; }
.store.primary strong { color: #071229; }
.store.primary:hover { background: #eef3ff; color: #071229; }
.soon-tag { position: absolute; top: -9px; right: -8px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .02em; background: var(--yuzu); color: #2a1d00; box-shadow: 0 4px 12px -4px rgba(255, 210, 94, .8); }
.store:not(.soon) .soon-tag { display: none; }

/* ---------- Bands after the story ---------- */
.band { position: relative; padding: 110px 0; }
.band h2 { font-size: clamp(32px, 4.2vw, 52px); }
.more h2 { text-align: center; margin-bottom: 48px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile {
  padding: 26px; border-radius: var(--r-card); background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.tile h3 { font-size: 21px; margin: 14px 0 6px; }
.tile p { color: var(--ink-2); font-size: 16px; }
.ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); }
.ico svg { width: 24px; height: 24px; }
.tile-widgets { grid-row: span 2; display: flex; flex-direction: column; }
.tile-widgets h3 { margin-top: auto; padding-top: 22px; }
.tile-games { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: center; }
.all-games { margin: 0; }
.all-games .chip { font-size: 14px; padding: 6px 12px; }

/* Widgets recreated from the app's WidgetKit views (HomeWidgets.swift) */
.widgets { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; padding: 8px 0; }
.w { width: 158px; height: 158px; border-radius: 24px; padding: 14px; display: flex; flex-direction: column; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .7); font-family: -apple-system, "SF Pro Text", var(--font); line-height: 1.2; }
.w-near { background: #fff; color: #111; }
.w-row { display: flex; justify-content: space-between; align-items: baseline; }
.w-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: #2f6bff; }
.w-dist { font-size: 12px; font-weight: 700; color: #8a8a8e; }
.w-mono { display: grid; place-items: center; width: 30px; height: 30px; margin: 9px 0 7px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; font-size: 15px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.w-name { font-size: 14px; font-weight: 700; color: #111; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w-open { margin-top: auto; font-size: 12px; font-weight: 700; color: #d9730d; }
.w-stamps { background: linear-gradient(160deg, #1a3570, #0b1630 70%); color: #fff; }
.w-stamps .w-label { color: rgba(255, 255, 255, .7); }
.w-big { font-size: 46px; font-weight: 800; line-height: 1; margin-top: 6px; }
.w-level { margin-top: auto; font-size: 12px; font-weight: 700; }
.w-bar { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .15); margin: 5px 0; }
.w-bar i { display: block; width: 92%; height: 100%; border-radius: 2px; background: var(--yuzu); }
.w-next { font-size: 11px; color: rgba(255, 255, 255, .65); font-weight: 600; }

.shops-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 56px; align-items: center; }
.shops-copy .lede { color: var(--ink-2); font-size: 19px; margin-top: 16px; max-width: 34em; }
.shops .kicker { margin-bottom: 12px; }
.shop-points { list-style: none; padding: 0; margin: 34px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.shop-points li { padding: 18px 20px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.shop-points b { display: block; font-size: 17px; margin-bottom: 4px; }
.shop-points span { color: var(--ink-2); font-size: 15px; }

.cta { text-align: center; padding: 120px 0 140px; }
.cta-in { display: flex; flex-direction: column; align-items: center; }
.cta-icon { border-radius: 22px; box-shadow: 0 20px 60px -10px rgba(63, 123, 255, .7); margin-bottom: 26px; }
.cta .lede { color: var(--ink-2); font-size: 19px; margin-top: 14px; }
.cta .store-buttons { justify-content: center; }

.footer { position: relative; z-index: 1; border-top: 1px solid var(--line); background: rgba(5, 12, 28, .92); padding: 36px 0 calc(40px + env(safe-area-inset-bottom)); }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer nav a { color: var(--ink-2); text-decoration: none; font-weight: 700; }
.footer nav a:hover { color: #fff; }
.fine { color: var(--ink-3); font-size: 13px; max-width: 70em; }
.fine + .fine { margin-top: 8px; }

/* ---------- Phones & tablets ---------- */
@media (max-width: 959px) {
  .scene-shade { background: linear-gradient(180deg, rgba(5, 12, 28, .82) 0%, rgba(5, 12, 28, .6) 55%, rgba(5, 12, 28, .55) 100%); }
  .chapter { min-height: 0; padding: 72px 0 24px; gap: 28px; }
  .hero { min-height: 100svh; padding-top: calc(var(--nav-h) + 36px); }
  .chapter:not(.hero) .copy { padding: 24px 22px; border-radius: var(--r-card); background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-widgets { grid-column: 1 / -1; grid-row: auto; }
  .tile-games { grid-template-columns: 1fr; gap: 18px; }
  .shops-grid { grid-template-columns: 1fr; }
  .band { padding: 80px 0; }
}
@media (max-width: 640px) {
  :root { --nav-h: 56px; }
  body { font-size: 16px; }
  .nav-links { display: none; }
  .nav-in { gap: 12px; }
  .brand { font-size: 18px; }
  .tiles, .shop-points { grid-template-columns: 1fr; }
  .store { min-width: 0; flex: 1 1 160px; }
  .store strong { font-size: 18px; }
  .w { width: 140px; height: 140px; padding: 12px; }
  .w-big { font-size: 40px; }
}
@media (max-width: 420px) {
  .store { flex: 1 1 100%; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Simple pages (store, open, 404, legal) ---------- */
.page { position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.page-main { flex: 1; display: grid; place-items: center; padding: calc(var(--nav-h) + 40px) var(--gutter) 60px; }
.card {
  width: 100%; max-width: 520px; text-align: center; padding: 40px 32px; border-radius: 28px;
  background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.card img.app-icon { border-radius: 22px; box-shadow: 0 16px 50px -10px rgba(63, 123, 255, .7); }
.card h1 { font-size: clamp(28px, 6vw, 38px); margin: 22px 0 12px; }
.card p { color: var(--ink-2); }
.card .store-buttons { justify-content: center; }
.card .soft-links { margin-top: 26px; display: flex; flex-direction: column; gap: 8px; font-weight: 700; }
.static-scene { position: fixed; inset: 0; z-index: 0; }
.static-scene .scene-fallback { opacity: 1; }

/* Legal pages: readable long text on the night background */
.legal-main { position: relative; z-index: 1; padding: calc(var(--nav-h) + 40px) var(--gutter) 80px; }
.legal { max-width: 780px; margin: 0 auto; padding: clamp(24px, 5vw, 56px); border-radius: 28px; background: rgba(8, 18, 42, .9); border: 1px solid var(--line); }
.legal h1 { font-size: clamp(34px, 6vw, 48px); margin-bottom: 10px; }
.legal h2 { font-size: 24px; margin: 44px 0 12px; padding-top: 8px; }
.legal h3 { font-size: 19px; margin: 26px 0 8px; }
.legal p, .legal li { color: var(--ink-2); line-height: 1.7; }
.legal p + p { margin-top: 12px; }
.legal ul, .legal ol { padding-left: 1.3em; }
.legal li + li { margin-top: 6px; }
.legal .meta { color: var(--ink-3); font-weight: 700; margin-bottom: 22px; }
.legal .lede { font-size: 19px; }
.legal .summary { margin: 28px 0; padding: 22px 26px; border-radius: 20px; background: linear-gradient(160deg, rgba(47, 107, 255, .18), rgba(47, 107, 255, .06)); border: 1px solid rgba(127, 176, 255, .3); }
.legal .summary h2 { margin-top: 0; padding-top: 0; font-size: 20px; }
.legal .toc { margin: 28px 0; padding: 20px 24px; border-radius: 18px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.legal .toc ol { columns: 2; column-gap: 32px; margin: 10px 0 0; }
.legal .toc li { break-inside: avoid; }
.legal .note { padding: 14px 18px; border-left: 3px solid var(--yuzu); background: rgba(255, 210, 94, .08); border-radius: 0 12px 12px 0; }
.legal .path { font-weight: 800; color: var(--ink); white-space: nowrap; }
.legal .ph { background: rgba(255, 210, 94, .16); color: var(--yuzu); padding: 0 4px; border-radius: 4px; }
.legal .table-wrap { overflow-x: auto; margin: 16px 0; }
.legal table { border-collapse: collapse; width: 100%; font-size: 15px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.legal th { color: var(--ink); font-weight: 800; }
.legal details { margin: 10px 0; padding: 14px 18px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.legal details[open] { background: rgba(47, 107, 255, .08); }
.legal summary { cursor: pointer; font-weight: 800; color: var(--ink); }
.legal details > :not(summary) { margin-top: 10px; }
.legal-nav a[aria-current="page"] { color: #fff; }
@media (max-width: 640px) { .legal .toc ol { columns: 1; } }
