/* ════════════════════════════════════════════════════════════════════════
   Zen Tile Match — site. Tokens mirror lib/core/theme/app_colors.dart and
   gem_palette.dart in the game repo: navy sky, white panels, gold accents,
   glossy 3D buttons, tiles washed in their icon's own colour.
   ════════════════════════════════════════════════════════════════════════ */

:root {
    --navy: #0D1A40;
    --blue-dark: #16327E;
    --blue: #2E63D9;
    --tray: #21418F;
    --tray-shadow: #142A63;
    --gold: #F0A91B;
    --gold-light: #FFE28A;
    --accent: #FFD166;
    --board: #EFF6FF;
    --board-deep: #D9E4F8;
    --surface: #F7FAFF;
    --ink: #24365E;
    --muted: #5A6C96;
    --faint: #9AA7C4;
    --line: #E2E8F4;
    --red: #EF4444;
    --ease: cubic-bezier(.4, 0, .2, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --r-lg: 28px;
    --r-md: 20px;
    --gutter: 24px;
    --head: 'Fredoka', 'Nunito', system-ui, sans-serif;
    --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
    font: 600 17px/1.6 var(--body);
    color: #fff;
    background: var(--navy);
    overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
.container { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gold-text { color: var(--accent); }

h1, h2, h3, .h2 { font-family: var(--head); font-weight: 700; line-height: 1.12; letter-spacing: -.01em; }
/* Chinese and Japanese break between phrases, not inside them, and need a smaller size to keep a phrase on one line. */
:lang(ja) :is(h1, .h2), :lang(zh) :is(h1, .h2) { word-break: keep-all; word-break: auto-phrase; line-height: 1.25; }
:lang(ja) .hero h1, :lang(zh) .hero h1 { font-size: clamp(30px, 5.4vw, 64px); }
.h2 { font-size: clamp(30px, 4.4vw, 46px); }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: rgba(255, 255, 255, .78); }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px 6px 8px; border-radius: 999px;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
    font-weight: 800; font-size: 14px; color: var(--gold-light);
}
.eyebrow img { width: 22px; height: 22px; }
.section { padding: clamp(72px, 10vw, 120px) 0; position: relative; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto clamp(40px, 6vw, 64px); }
.section-head .lead { margin-top: 14px; }

/* ── 3D buttons (the game's ctaTop / cta / ctaShadow trio) ─────────────── */
.btn {
    --top: #8CE05E; --base: #4CB52E; --shadow: #237014;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px 11px; border: 0; border-radius: 16px; cursor: pointer; white-space: nowrap;
    font: 700 17px/1 var(--head); color: #fff; text-decoration: none;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .22);
    background: linear-gradient(var(--top), var(--base) 70%);
    box-shadow: 0 5px 0 var(--shadow), 0 10px 18px rgba(0, 0, 0, .25), inset 0 2px 0 rgba(255, 255, 255, .45);
    transition: transform .12s var(--ease), box-shadow .12s var(--ease), filter .2s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--shadow), 0 4px 8px rgba(0, 0, 0, .25), inset 0 2px 0 rgba(255, 255, 255, .45); }
.btn-gold { --top: #FFC96B; --base: #F5980B; --shadow: #B36D06; }
.btn-blue { --top: #6FA8F2; --base: var(--blue); --shadow: #1B3D8F; }

/* ── Store badges (official artwork, localized by URL) ─────────────────── */
.store-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.store-badge { display: inline-flex; border-radius: 10px; transition: transform .2s var(--ease), filter .2s; }
.store-badge:hover { transform: translateY(-2px); filter: brightness(1.12); }
.store-badge .badge-apple { height: 48px; width: auto; }
.store-badge.gp { overflow: hidden; }
.store-badge .badge-play { height: 67px; width: auto; max-width: none; margin: -9.5px; }

/* ── Nav ────────────────────────────────────────────────────────────────── */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(13, 26, 64, .72);
    -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 20px var(--head); }
.brand img { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.nav-links { display: flex; gap: 6px; margin-left: auto; }
.nav-links a { padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 800; font-size: 15px; color: rgba(255, 255, 255, .78); transition: background .2s, color .2s; }
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav .btn { padding: 10px 16px 9px; font-size: 15px; }

/* ── Sky: the blurred tiles and sparkles behind the hero and the CTA ──── */
.sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.sky::before {
    content: ''; position: absolute; inset: -20% -10% auto; height: 120%;
    background:
        radial-gradient(60% 50% at 70% 35%, rgba(46, 99, 217, .65), transparent 70%),
        radial-gradient(40% 40% at 15% 20%, rgba(111, 168, 242, .28), transparent 70%),
        linear-gradient(180deg, var(--blue-dark), var(--navy));
}
.sky .ghost {
    position: absolute; width: calc(var(--s, 120px) * var(--k, 1)); height: calc(var(--s, 120px) * var(--k, 1));
    left: var(--x); top: var(--y);
    filter: blur(var(--b, 3px)); opacity: var(--o, .32);
    animation: drift var(--d, 14s) ease-in-out infinite alternate;
    animation-delay: var(--dl, 0s);
}
.sky .ghost .tile { position: static; width: 100%; height: 100%; transform: rotate(var(--r, 0deg)); }
.sparkle {
    position: absolute; left: var(--x); top: var(--y); width: var(--s, 14px); height: var(--s, 14px);
    background: var(--gold-light);
    clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
    animation: twinkle var(--d, 3s) ease-in-out infinite; animation-delay: var(--dl, 0s);
}
@keyframes drift {
    from { transform: translate3d(0, 0, 0) rotate(0deg); }
    to { transform: translate3d(var(--mx, 20px), var(--my, -30px), 0) rotate(var(--mr, 8deg)); }
}
@keyframes twinkle {
    0%, 100% { transform: scale(.4) rotate(0deg); opacity: .25; }
    50% { transform: scale(1) rotate(45deg); opacity: 1; }
}

/* ── Tiles (gem_palette.dart: face = 38% wash, faceLight = 16%, rim, lip) ── */
.tile {
    --c: #FFBA1F; --t: 56px;
    position: absolute; left: 0; top: 0; width: var(--t); height: var(--t);
    display: grid; place-items: center;
    border-radius: 24%;
    background: linear-gradient(155deg, color-mix(in srgb, var(--c) 16%, #fff) 15%, color-mix(in srgb, var(--c) 38%, #fff) 100%);
    border: max(2px, calc(var(--t) * .05)) solid color-mix(in srgb, var(--c) 88%, #fff);
    box-shadow:
        0 calc(var(--t) * .08) 0 color-mix(in srgb, var(--c) 85%, #000),
        0 calc(var(--t) * .14) calc(var(--t) * .2) rgba(13, 26, 64, .28),
        inset 0 calc(var(--t) * .05) 0 rgba(255, 255, 255, .75);
}
.tile img { width: 76%; height: 76%; pointer-events: none; user-select: none; -webkit-user-drag: none; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero { position: relative; padding: clamp(40px, 7vw, 88px) 0 clamp(64px, 9vw, 110px); overflow: hidden; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(32px, 5vw, 72px); }
.hero h1 { font-size: clamp(42px, 6.4vw, 74px); margin: 22px 0 18px; text-shadow: 0 4px 0 rgba(13, 26, 64, .35); }
.hero .lead { max-width: 520px; }
.hero-copy .store-row { margin-top: 32px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 30px; }
.hero-stats div { font-weight: 800; color: rgba(255, 255, 255, .7); font-size: 15px; }
.hero-stats b { display: block; font: 700 26px/1.1 var(--head); color: #fff; }

/* The playable-looking card: game_screen's white panel, board, tray, boosters. */
.game {
    --t: 52px;
    position: relative; width: min(400px, 100%); margin-inline: auto;
    padding: 16px 16px 18px; border-radius: 34px;
    background: var(--surface);
    box-shadow: 0 30px 60px rgba(5, 12, 35, .55), 0 0 0 8px rgba(255, 255, 255, .08);
    color: var(--ink);
    transform: rotate(2deg);
}
.game-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 12px; }
.game-bar .round { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 3px 0 var(--line); }
.game-bar .round i { display: block; width: 10px; height: 12px; border-inline: 3.5px solid var(--ink); }
.game-bar h3 { font-size: 20px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #fff; box-shadow: 0 3px 0 var(--line); font: 700 15px var(--head); }
.pill .mini { width: 16px; height: 13px; border-radius: 4px; background: var(--ink); box-shadow: 0 -4px 0 -1px #fff, 0 -4px 0 0 var(--ink); }
.board {
    position: relative; height: calc(var(--t) * 5.2); border-radius: 22px;
    background: linear-gradient(var(--board), var(--board-deep));
    box-shadow: inset 0 2px 8px rgba(36, 54, 94, .08);
}
.tray {
    position: relative; margin-top: 14px; padding: 9px; border-radius: 18px;
    background: var(--tray); box-shadow: 0 5px 0 var(--tray-shadow);
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px;
}
.tray .slot { aspect-ratio: 1; border-radius: 10px; background: rgba(5, 14, 40, .45); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .3); }
.boosters { display: flex; justify-content: space-between; gap: 6px; margin-top: 16px; padding-inline: 4px; }
.booster { position: relative; width: 52px; height: 52px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 4px 0 var(--line), 0 6px 12px rgba(36, 54, 94, .1); }
.booster img { width: 34px; height: 34px; }
.booster b {
    position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
    min-width: 30px; padding: 0 7px; border-radius: 999px; background: var(--red);
    font: 700 13px/18px var(--head); color: #fff; text-align: center; box-shadow: 0 2px 0 #B91C1C;
}
.stage { position: absolute; inset: 0; pointer-events: none; }
/* Position lives in translate + scale (set by site.js), so pop and deal can use transform around the tile's own centre. */
.stage .tile { --t: inherit; transition: translate .46s cubic-bezier(.3, .9, .35, 1), scale .46s cubic-bezier(.3, .9, .35, 1), filter .3s; }
.stage.still .tile { transition: none; }
.stage .tile.blocked { filter: brightness(.8) saturate(.75); }
.stage .tile.flying { z-index: 40 !important; }
.stage .tile.deal { animation: deal .5s var(--spring) backwards; animation-delay: var(--dl, 0s); }
.stage .tile.pop { animation: pop .42s var(--ease) forwards; }
@keyframes pop {
    0% { transform: scale(1); filter: brightness(1); }
    40% { transform: scale(1.28); filter: brightness(1.35) drop-shadow(0 0 10px #fff); }
    100% { transform: scale(0); opacity: 0; }
}
@keyframes deal { from { opacity: 0; transform: translateY(-46px) scale(.6); } }
.burst {
    position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; z-index: 60;
    background: var(--c, var(--gold-light));
    clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
    animation: burst .7s ease-out forwards;
}
@keyframes burst {
    from { transform: translate(0, 0) scale(1.2) rotate(0deg); opacity: 1; }
    to { transform: translate(var(--dx), var(--dy)) scale(0) rotate(180deg); opacity: 0; }
}
.win {
    position: absolute; inset: 0; z-index: 70; border-radius: inherit;
    display: grid; place-content: center; justify-items: center; gap: 14px;
    background: radial-gradient(circle at 50% 45%, rgba(255, 226, 138, .55), rgba(247, 250, 255, .9) 65%);
    opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
}
.win.show { opacity: 1; visibility: visible; }
.win h3 { font-size: 30px; color: var(--ink); }
.win .stars { display: flex; gap: 8px; }
.win .stars .tile { position: static; --t: 64px; }
.win.show .stars .tile { animation: star-in .5s var(--spring) backwards; }
.win.show .stars .tile:nth-child(2) { animation-delay: .18s; translate: 0 -10px; }
.win.show .stars .tile:nth-child(3) { animation-delay: .36s; }
@keyframes star-in { from { scale: 0; rotate: -30deg; opacity: 0; } }

/* ── How to play ────────────────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
    position: relative; padding: 28px 26px 30px; border-radius: var(--r-lg);
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
}
.step-num {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
    font: 700 20px var(--head); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .2);
    background: linear-gradient(#FFC96B, #F5980B 70%); box-shadow: 0 4px 0 #B36D06;
}
.step h3 { font-size: 22px; margin: 18px 0 6px; }
.step p { color: rgba(255, 255, 255, .72); }
.step-art { position: relative; height: 110px; margin-top: 22px; }
.step-art .tile { --t: 58px; }
/* 1: a finger ripple on a free tile */
.art-tap .tile { left: calc(50% - 29px); top: 18px; animation: press 2.4s var(--ease) infinite; }
.art-tap .ring { position: absolute; left: 50%; top: 47px; width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%; border: 3px solid var(--gold-light); animation: ring 2.4s ease-out infinite; }
@keyframes press { 0%, 30%, 100% { transform: translateY(0); } 38% { transform: translateY(4px) scale(.94); } 48% { transform: translateY(0); } }
@keyframes ring { 0%, 34% { transform: scale(.4); opacity: 0; } 38% { opacity: .9; } 70%, 100% { transform: scale(1.5); opacity: 0; } }
/* 2: a tile slides into the tray */
.art-tray .mini-tray { position: absolute; left: 0; right: 0; bottom: 8px; padding: 6px; border-radius: 14px; background: var(--tray); box-shadow: 0 4px 0 var(--tray-shadow); display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.art-tray .mini-tray i { position: relative; aspect-ratio: 1; border-radius: 8px; background: rgba(5, 14, 40, .45); }
.art-tray .tile { --t: 40px; width: 100%; height: 100%; border-width: 2px; }
.art-tray .slide { animation: slide 2.8s var(--ease) infinite; }
@keyframes slide { 0%, 15% { transform: translate(110px, -62px) scale(1.25); } 55%, 100% { transform: none; } }
/* 3: three of a kind pop */
.art-pop .tile { --t: 50px; top: 26px; animation: trio 2.8s var(--ease) infinite; }
.art-pop .tile:nth-child(1) { left: calc(50% - 85px); --to: 60px; }
.art-pop .tile:nth-child(2) { left: calc(50% - 25px); --to: 0px; }
.art-pop .tile:nth-child(3) { left: calc(50% + 35px); --to: -60px; }
.art-pop .flash { position: absolute; left: 50%; top: 51px; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; background: radial-gradient(var(--gold-light), transparent 65%); animation: flash 2.8s ease-out infinite; }
@keyframes trio { 0%, 25% { transform: none; opacity: 1; } 50% { transform: translateX(var(--to)) scale(1.15); opacity: 1; } 62%, 88% { transform: translateX(var(--to)) scale(0); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes flash { 0%, 50% { transform: scale(.2); opacity: 0; } 58% { opacity: 1; } 80%, 100% { transform: scale(1.3); opacity: 0; } }

/* ── Feature cards (white panels, like the game's dialogs) ─────────────── */
.features { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.card {
    grid-column: span 2; position: relative; overflow: hidden;
    padding: 28px 26px; border-radius: var(--r-lg);
    background: var(--surface); color: var(--ink);
    box-shadow: 0 6px 0 rgba(5, 14, 40, .35), 0 20px 40px rgba(5, 12, 35, .3);
}
.card.wide { grid-column: span 3; }
.card h3 { font-size: 23px; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: 16px; }
.card-art { position: relative; height: 150px; margin: 4px 0 18px; display: grid; place-items: center; }

/* levels: a heart of small tiles breathing in a wave */
.shape { display: grid; grid-template-columns: repeat(5, 30px); grid-auto-rows: 30px; gap: 3px; }
.shape .tile { position: relative; --t: 30px; border-width: 2px; animation: wave 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * .09s); }
.shape .gap { visibility: hidden; }
@keyframes wave { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-7px); } }

/* boosters: the power-up row bobbing in turn */
.booster-row { display: flex; gap: 12px; }
.booster-row .booster { animation: bob 3s var(--spring) infinite; animation-delay: calc(var(--i) * .2s); }
.booster-row small { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); font: 700 11px var(--head); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
@keyframes bob { 0%, 30%, 100% { transform: translateY(0) rotate(0); } 12% { transform: translateY(-12px) rotate(-6deg); } 20% { transform: translateY(0) rotate(3deg); } }

/* obstacles: the game's own intro scenes (rendered from the Flutter widgets), on its board-slice stage */
.card.full { grid-column: 1 / -1; }
.scenes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 18px; }
.scene-stage {
    aspect-ratio: 320 / 200; overflow: hidden; border-radius: 18px;
    background: linear-gradient(var(--board), var(--board-deep)); border: 1.5px solid var(--line);
}
.scene-stage img { width: 100%; height: 100%; }
.scene figcaption { margin-top: 14px; }
.scene figcaption b { display: block; margin-bottom: 4px; font: 700 19px var(--head); color: var(--ink); }
.scene figcaption span { color: var(--muted); font-size: 15.5px; }

/* league: you climb from 4th to 1st */
.league { width: 100%; max-width: 330px; position: relative; height: 148px; }
.row {
    position: absolute; left: 0; right: 0; height: 32px; top: calc(var(--p) * 38px);
    display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 12px;
    background: #fff; box-shadow: 0 3px 0 var(--line); font: 700 15px var(--head);
    animation: var(--a) 6s var(--ease) infinite;
}
.row .rank { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #fff; background: var(--faint); }
.row .bar { flex: 1; height: 8px; border-radius: 6px; background: var(--board-deep); }
.row .score { color: var(--muted); font-size: 14px; }
.row.you { background: linear-gradient(90deg, #FFF3C9, #FFE28A); box-shadow: 0 3px 0 var(--gold); z-index: 2; }
.row.you .rank { background: var(--gold); }
@keyframes climb { 0%, 20% { top: 114px; } 45% { top: 76px; } 65% { top: 38px; } 85%, 100% { top: 0; } }
@keyframes down1 { 0%, 72% { top: 0; } 85%, 100% { top: 38px; } }
@keyframes down2 { 0%, 52% { top: 38px; } 65%, 100% { top: 76px; } }
@keyframes down3 { 0%, 32% { top: 76px; } 45%, 100% { top: 114px; } }

/* daily: seven days claimed in turn, the crown on day 7 */
.week { display: grid; grid-template-columns: repeat(4, 64px); gap: 8px; }
.day {
    position: relative; height: 64px; border-radius: 14px; background: #fff; box-shadow: 0 3px 0 var(--line);
    display: grid; place-items: center; font: 700 12px var(--head); color: var(--muted);
}
.day img { width: 30px; height: 30px; }
.day::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    background: rgba(76, 181, 46, .9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 28px no-repeat;
    opacity: 0; animation: claim 7s ease-out infinite; animation-delay: calc(var(--i) * .6s);
}
.day.big { grid-column: span 2; background: linear-gradient(#FFF3C9, #FFE28A); box-shadow: 0 3px 0 var(--gold); animation: glow 2s ease-in-out infinite; }
.day.big img { width: 44px; height: 44px; }
.day.big::after { display: none; }
@keyframes claim { 0%, 4% { opacity: 0; transform: scale(.6); } 8%, 82% { opacity: 1; transform: scale(1); } 90%, 100% { opacity: 0; } }
@keyframes glow { 0%, 100% { box-shadow: 0 3px 0 var(--gold), 0 0 0 0 rgba(255, 209, 102, 0); } 50% { box-shadow: 0 3px 0 var(--gold), 0 0 22px 4px rgba(255, 209, 102, .8); } }

/* calm: a music note tile sending out soft rings */
.calm { position: relative; width: 150px; height: 150px; display: grid; place-items: center; }
.calm .tile { position: relative; --t: 70px; animation: float 4s ease-in-out infinite; }
.calm i { position: absolute; inset: 30px; border-radius: 50%; border: 2px solid color-mix(in srgb, #4A4FE0 40%, #fff); animation: wave-out 3s ease-out infinite; }
.calm i:nth-child(2) { animation-delay: 1s; }
.calm i:nth-child(3) { animation-delay: 2s; }
@keyframes wave-out { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }

/* ── Screenshots ────────────────────────────────────────────────────────── */
.shots {
    display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 10px var(--gutter) 30px; margin-inline: calc(-1 * var(--gutter));
    scrollbar-width: none;
}
.shots::-webkit-scrollbar { display: none; }
.shots figure { flex: 0 0 auto; width: clamp(220px, 24vw, 270px); scroll-snap-align: center; }
.shots img { width: 100%; height: auto; border-radius: 26px; box-shadow: 0 18px 40px rgba(5, 12, 35, .5); transition: transform .3s var(--ease); }
.shots figure:hover img { transform: translateY(-6px) rotate(-1deg); }
.shots-nav { display: flex; justify-content: center; gap: 12px; }
.shots-nav button { width: 48px; height: 48px; padding: 0; border-radius: 14px; }

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.faq { max-width: 820px; margin-inline: auto; display: grid; gap: 12px; }
.faq details { border-radius: var(--r-md); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); transition: background .2s; }
.faq details[open] { background: rgba(255, 255, 255, .1); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 56px 20px 24px; position: relative; font: 600 19px var(--head); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 22px; top: 50%; translate: 0 -50%; font: 700 26px var(--head); color: var(--accent); transition: rotate .25s var(--ease); }
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { padding: 0 24px 22px; color: rgba(255, 255, 255, .75); }
.faq a { color: var(--accent); }

/* ── CTA ────────────────────────────────────────────────────────────────── */
.cta { position: relative; overflow: hidden; text-align: center; padding: clamp(90px, 12vw, 140px) 0; }
.cta .container { position: relative; z-index: 1; display: grid; justify-items: center; }
.cta-mark { position: relative; width: 170px; height: 170px; margin-bottom: 30px; }
.cta-mark .rays {
    position: absolute; inset: -90px; border-radius: 50%;
    background: repeating-conic-gradient(rgba(255, 226, 138, .32) 0 10deg, transparent 10deg 30deg);
    -webkit-mask: radial-gradient(closest-side, #000 30%, transparent); mask: radial-gradient(closest-side, #000 30%, transparent);
    animation: spin 24s linear infinite;
}
.cta-mark img { position: relative; width: 100%; height: 100%; border-radius: 38px; box-shadow: 0 18px 40px rgba(5, 12, 35, .5); animation: float 5s ease-in-out infinite; }
.cta .lead { margin-top: 14px; }
.cta .store-row { justify-content: center; margin-top: 34px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer { padding: 44px 0 50px; border-top: 1px solid rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .6); font-size: 15px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 30px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer a { text-decoration: none; }
.lang-pick select {
    appearance: none; padding: 8px 34px 8px 14px; border-radius: 12px; cursor: pointer;
    font: 700 14px var(--body); color: #fff; border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23FFD166' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") right 12px center / 12px no-repeat;
}
.lang-pick select option { color: var(--ink); }
.nav-lang { margin-left: 4px; }
.nav-lang select { max-width: 150px; padding-block: 9px; }

/* While a non-English page loads its strings, hide the English text (i18n.js lifts this after 2.5 s at most). */
.i18n-pending body { visibility: hidden; }
.footer a:hover { color: #fff; }

/* ── Document pages (privacy, terms, support, account deletion) ─────────── */
.doc-wrap { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 80px) 0 clamp(64px, 9vw, 100px); }
.doc { position: relative; z-index: 1; max-width: 820px; }
.doc h1 { font-size: clamp(36px, 5vw, 54px); text-shadow: 0 4px 0 rgba(13, 26, 64, .35); }
.doc-date { margin-top: 8px; color: rgba(255, 255, 255, .65); font-size: 15px; }
.doc-card {
    margin-top: 28px; padding: clamp(24px, 4vw, 40px); border-radius: var(--r-lg);
    background: var(--surface); color: var(--ink); font-size: 16.5px;
    box-shadow: 0 6px 0 rgba(5, 14, 40, .35), 0 20px 40px rgba(5, 12, 35, .3);
}
.doc-card h3 { font-size: 21px; margin: 28px 0 8px; color: var(--ink); }
.doc-card > :first-child { margin-top: 0; }
.doc-card p + p { margin-top: 12px; }
.doc-card ul, .doc-card ol { padding-left: 1.3em; display: grid; gap: 10px; margin: 10px 0; }
.doc-card b { color: var(--ink); font-weight: 800; }
.doc-card a { color: var(--blue); font-weight: 800; }
.doc-card .muted { color: var(--muted); font-size: 15px; margin-top: 16px; }
.doc-sub { font-size: 28px; margin: 44px 0 18px; }
.doc .faq { max-width: none; }
.doc-note { margin-top: 22px; color: rgba(255, 255, 255, .6); font-size: 14px; }
.doc-note:empty { display: none; }

/* ── Scroll reveal; animations run only while on screen ────────────────── */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.anim:not(.is-live) *, .anim:not(.is-live)::before, .anim:not(.is-live)::after { animation-play-state: paused !important; }

@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero .lead { margin-inline: auto; }
    .hero-copy .store-row, .hero-stats { justify-content: center; }
    .features { grid-template-columns: 1fr 1fr; }
    .card, .card.wide { grid-column: span 1; }
    .card.full { grid-column: 1 / -1; }
    .steps { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
    .nav-links { display: none; }
    .nav-lang { margin-left: auto; }
}
@media (max-width: 640px) {
    :root { --gutter: 16px; }
    .sky .ghost { --k: .55; }
    .nav .brand span, .nav .btn { display: none; }
    .hero-stats { gap: 10px 18px; }
    .hero-stats div { font-size: 14px; }
    .features { grid-template-columns: 1fr; }
    .scenes { grid-template-columns: 1fr; }
    .game { transform: none; padding: 12px 12px 14px; border-radius: 28px; }
    .booster { width: 44px; height: 44px; }
    .booster img { width: 28px; height: 28px; }
    .footer-inner { flex-direction: column; text-align: center; }
    .footer nav { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
}
