/* Krillion+ — one layout, three visual worlds. Mobile first; two columns on desktop.
 *   flat  (default)  "dive computer": cool paper, ink-dark instrument hero, monospace readouts; follows OS dark mode
 *   pop              "dopamine 3D": candy colour blocks, rounded Fredoka, extruded toy buttons, glossy icons
 *   pixel            "16-bit RPG": Sweetie 16 palette, Fusion Pixel font for every script, menu windows,
 *                    bevelled A-buttons, a night sea of our own sprites
 * Components read tokens only; each theme is a token block + a short signature block at the end.
 */

/* =========================================================================================
   FONTS — self-hosted from ../fonts/ (SIL OFL 1.1, unmodified; see fonts/README.md).
   A face is only downloaded when text on the page uses it, so the default flat theme loads none.
   ========================================================================================= */
@font-face {
  font-family: "KP Fusion Pixel SC";
  src: url(../fonts/fusion-pixel-12px-proportional-sc.woff2) format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "KP Fusion Pixel JP";
  src: url(../fonts/fusion-pixel-12px-proportional-jp.woff2) format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "KP Fredoka";
  src: url(../fonts/fredoka-latin-wght.woff2) format("woff2-variations"), url(../fonts/fredoka-latin-wght.woff2) format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap;
  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: "KP Fredoka";
  src: url(../fonts/fredoka-latin-ext-wght.woff2) format("woff2-variations"), url(../fonts/fredoka-latin-ext-wght.woff2) format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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;
}

/* Flag emoji for systems that draw "🇮🇪" as two letters (Windows). The boot script in index.html adds
   html.kp-noflags only on those systems; the face covers flag code points only, so nothing else changes.
   Art: Twemoji © Twitter, Inc. and other contributors, CC BY 4.0, via country-flag-emoji-polyfill (MIT);
   credit and licence: fonts/README.md, fonts/twemoji-country-flags-LICENSE.md. */
@font-face {
  font-family: "KP Flags";
  src: url(../fonts/twemoji-country-flags.woff2) format("woff2");
  font-display: block; /* a blank instant beats a flash of "IE" letters */
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
}
:root.kp-noflags { --kp-flags: "KP Flags",; }

/* =========================================================================================
   TOKENS — flat (default, light)
   ========================================================================================= */
:root {
  --sans: var(--kp-flags,) system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans JP", sans-serif;
  --display: var(--sans);       /* headings, prompts */
  --pix: var(--kp-flags,) ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace; /* numbers & readouts */
  --label: var(--pix);          /* small uppercase labels */
  --k: .9;                      /* size scale for the readout font */
  --num-w: 600;
  --head-w: 750;
  --display-track: -.02em;
  --r: 14px;
  --r-sm: 10px;
  --r-btn: 10px;
  --gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  --tabbar-h: calc(60px + env(safe-area-inset-bottom));
  --gap: 16px;
  --depth: 0;
  --abyss-dark: 0;

  --bg: #f3f5f8;
  --bg-deep: #dfe6f0;
  --ink: #0b1324;
  --muted: #5f6b7f;
  --soft: #2c3648;
  --panel: #ffffff;
  --panel-2: #f6f8fb;
  --sunken: #eef2f7;
  --track: #e3e8f0;
  --line: #e2e7ef;
  --accent: #1f5eff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(31, 94, 255, .09);
  --gold: #9a5a00;
  --gold-soft: rgba(255, 176, 32, .13);
  --gold-line: rgba(214, 140, 0, .45);
  --bad: #d92d20;
  --warn: #c76a00;
  --ok: #12895a;
  --input-bg: #ffffff;
  --input-line: #cfd7e3;
  --hud-bg: rgba(243, 245, 248, .88);
  --tabbar-bg: rgba(255, 255, 255, .94);
  --overlay: rgba(11, 19, 36, .5);
  --modal-bg: #ffffff;
  --toast-bg: #0b1324;
  --toast-ink: #f3f6fb;
  --shadow: 0 1px 2px rgba(11, 19, 36, .05);
  --shadow-lg: 0 20px 48px rgba(11, 19, 36, .2);

  --btn-bg: var(--accent);
  --btn-ink: #ffffff;
  --btn-line: transparent;
  --btn-depth: transparent;
  --gold-bg: #ffb020;
  --gold-ink: #1b1100;
  --gold-depth: transparent;
  --ghost-bg: #ffffff;
  --ghost-ink: var(--soft);
  --ghost-line: var(--input-line);
  --hero-shadow: none;

  /* the home hero: an instrument panel */
  --hero-bg: radial-gradient(120% 90% at 100% 0%, rgba(31, 94, 255, .35), transparent 60%), #0b1324;
  --hero-ink: #f3f6fb;
  --hero-muted: #93a3bf;
  --hero-line: rgba(255, 255, 255, .12);
  --hero-accent: #ffb020;

  --t-plankton: #64748b;
  --t-tooclever: #c76a00;
  --t-schooler: #0891b2;
  --t-rare: #db2777;
  --t-deepcut: #7c3aed;
  --t-krillion: #1f5eff;
  --t-miss: #94a3b8;
  /* mode tiles */
  --c-daily: #e6eeff;
  --c-blitz: #dff5f8;
  --c-abyss: #ede8ff;
  --c-practice: #fff1d6;
  --c-archive: #fdeee4;
  --c-geo: #def5ea;
  --c-sports: #fff4cc;
  --c-movies: #e9edf3;
  --hot-tint: 16%;
}
/* flat follows the system's dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="pop"]):not([data-theme="pixel"]) {
    color-scheme: dark;
    --bg: #070b14;
    --bg-deep: #03060c;
    --ink: #e8edf6;
    --muted: #8e9bb3;
    --soft: #c3cde0;
    --panel: #0f1626;
    --panel-2: #131c30;
    --sunken: #0b1120;
    --track: #1c2740;
    --line: #1c2740;
    --accent: #5b8cff;
    --accent-soft: rgba(91, 140, 255, .15);
    --gold: #ffc14d;
    --gold-soft: rgba(255, 193, 77, .12);
    --gold-line: rgba(255, 193, 77, .4);
    --bad: #ff7a70;
    --warn: #ffb547;
    --ok: #4ade80;
    --input-bg: #0b1120;
    --input-line: #26324f;
    --hud-bg: rgba(7, 11, 20, .88);
    --tabbar-bg: rgba(15, 22, 38, .96);
    --overlay: rgba(0, 0, 0, .62);
    --modal-bg: #0f1626;
    --toast-bg: #e8edf6;
    --toast-ink: #070b14;
    --shadow: none;
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, .55);
    --ghost-bg: #0f1626;
    --hero-bg: radial-gradient(120% 90% at 100% 0%, rgba(91, 140, 255, .3), transparent 60%), #111c35;
    --hero-line: rgba(255, 255, 255, .1);
    --t-plankton: #cbd5e1;
    --t-tooclever: #fbbf24;
    --t-schooler: #22d3ee;
    --t-rare: #f472b6;
    --t-deepcut: #a78bfa;
    --t-krillion: #7aa2ff;
    --t-miss: #64748b;
    --c-daily: #14213f;
    --c-blitz: #0b2b33;
    --c-abyss: #1f1640;
    --c-practice: #33240b;
    --c-archive: #33190f;
    --c-geo: #0d2b1f;
    --c-sports: #2f2508;
    --c-movies: #1a2030;
  }
}

/* =========================================================================================
   TOKENS — pop (dopamine 3D)
   ========================================================================================= */
:root[data-theme="pop"] {
  --sans: var(--kp-flags,) ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: var(--kp-flags,) "KP Fredoka", ui-rounded, "SF Pro Rounded", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  --pix: var(--display);
  --label: var(--display);
  --k: .98;
  --num-w: 700;
  --head-w: 700;
  --display-track: 0;
  --r: 24px;
  --r-sm: 16px;
  --r-btn: 999px;
  --bg: #fff3ea;
  --bg-deep: #f6e8ff;
  --ink: #2a1640;
  --muted: #7d6a91;
  --soft: #4a3760;
  --panel: #ffffff;
  --panel-2: #fff5fb;
  --sunken: #fff0f7;
  --track: #f3e6ff;
  --line: #f4dfef;
  --accent: #7c3aed;
  --accent-ink: #ffffff;
  --accent-soft: rgba(124, 58, 237, .1);
  --gold: #c2410c;
  --gold-soft: rgba(255, 184, 0, .16);
  --gold-line: rgba(249, 115, 22, .45);
  --bad: #e11d48;
  --warn: #ea580c;
  --ok: #059669;
  --input-bg: #ffffff;
  --input-line: #ead6ff;
  --hud-bg: rgba(255, 243, 234, .8);
  --tabbar-bg: rgba(255, 255, 255, .92);
  --overlay: rgba(42, 22, 64, .45);
  --modal-bg: #ffffff;
  --toast-bg: #2a1640;
  --toast-ink: #ffffff;
  --shadow: 0 6px 0 rgba(124, 58, 237, .1), 0 14px 30px rgba(124, 58, 237, .1);
  --shadow-lg: 0 10px 0 rgba(124, 58, 237, .14), 0 26px 54px rgba(124, 58, 237, .26);
  --btn-bg: linear-gradient(180deg, #a78bfa, #7c3aed);
  --btn-ink: #ffffff;
  --btn-depth: #5b21b6;
  --gold-bg: linear-gradient(180deg, #ffe45c, #ffb000);
  --gold-ink: #3b1d00;
  --gold-depth: #d9620b;
  --ghost-bg: #ffffff;
  --ghost-ink: #6d28d9;
  --ghost-line: #ead6ff;
  --hero-bg: radial-gradient(90% 120% at 100% 0%, rgba(255, 255, 255, .35), transparent 50%), linear-gradient(140deg, #ff4f9a 0%, #ff7a45 48%, #ffb627 100%);
  --hero-ink: #ffffff;
  --hero-muted: rgba(255, 255, 255, .88);
  --hero-line: rgba(255, 255, 255, .35);
  --hero-accent: #ffe45c;
  --hero-shadow: 0 2px 0 rgba(120, 20, 60, .25);
  --t-plankton: #0ea5e9;
  --t-tooclever: #f97316;
  --t-schooler: #0d9488;
  --t-rare: #db2777;
  --t-deepcut: #7c3aed;
  --t-krillion: #2563eb;
  --t-miss: #a8a29e;
  /* mode tiles are full colour blocks in pop (text turns white, see signature) */
  --c-daily: linear-gradient(150deg, #ffd166, #ff7aa2);
  --c-blitz: linear-gradient(150deg, #34d6c8, #2f7bf5);
  --c-abyss: linear-gradient(150deg, #b48cff, #5b2bd6);
  --c-practice: linear-gradient(150deg, #ffcb3d, #ff7a2f);
  --c-archive: linear-gradient(150deg, #ff8fb8, #ef3e7d);
  --c-geo: linear-gradient(150deg, #7be38b, #12a37b);
  --c-sports: linear-gradient(150deg, #ffd84d, #f08a00);
  --c-movies: linear-gradient(150deg, #8b9cff, #4338ca);
  --m-blitz: #1e5fc8;
  --m-abyss: #4220a8;
  --m-practice: #d3561b;
  --m-archive: #b9205a;
  --m-geo: #0b7d5e;
  --m-sports: #b45d00;
  --m-movies: #312a9e;
  --hot-tint: 30%;
}

/* =========================================================================================
   TOKENS — pixel (16-bit RPG; colours are the Sweetie 16 palette)
   ========================================================================================= */
:root[data-theme="pixel"] {
  --night: #1a1c2c; --plum: #5d275d; --red: #b13e53; --orange: #ef7d57;
  --yellow: #ffcd75; --lime: #a7f070; --green: #38b764; --teal: #257179;
  --navy: #29366f; --blue: #3b5dc9; --sky: #41a6f6; --cyan: #73eff7;
  --white: #f4f4f4; --lgrey: #94b0c2; --grey: #566c86; --slate: #333c57;

  /* one bitmap font for every script (Fusion Pixel, self-hosted; the JP build on Japanese pages) */
  --sans: var(--kp-flags,) "KP Fusion Pixel SC", ui-monospace, "Microsoft YaHei", monospace;
  --display: var(--sans);
  --pix: var(--sans);
  --label: var(--sans);
  --k: 1;
  --num-w: 400;
  --head-w: 400;
  --display-track: 0;
  --r: 0px;
  --r-sm: 0px;
  --r-btn: 0px;
  --px: 3px;
  --frame: var(--night);
  --bg: var(--night);
  --bg-deep: #0f101b;
  --ink: var(--white);
  --muted: var(--lgrey);
  --soft: #d5dfe8;
  --panel: var(--navy);
  --panel-2: var(--slate);
  --sunken: rgba(26, 28, 44, .55);
  --track: var(--night);
  --line: var(--lgrey);
  --accent: var(--cyan);
  --accent-ink: var(--night);
  --accent-soft: rgba(115, 239, 247, .14);
  --gold: var(--yellow);
  --gold-soft: rgba(255, 205, 117, .14);
  --gold-line: var(--yellow);
  --bad: #ff7d8c;
  --warn: var(--orange);
  --ok: var(--lime);
  --input-bg: var(--night);
  --input-line: var(--lgrey);
  --hud-bg: var(--night);
  --tabbar-bg: var(--night);
  --overlay: rgba(15, 16, 27, .78);
  --modal-bg: var(--navy);
  --toast-bg: var(--night);
  --toast-ink: var(--white);
  /* outline on four sides only, so corners stay notched like a sprite */
  --px-frame: 0 calc(-1 * var(--px)) 0 0 var(--frame), 0 var(--px) 0 0 var(--frame), calc(-1 * var(--px)) 0 0 0 var(--frame), var(--px) 0 0 0 var(--frame);
  --shadow: var(--px-frame), calc(2 * var(--px)) calc(2 * var(--px)) 0 0 rgba(15, 16, 27, .55);
  --shadow-lg: var(--px-frame), calc(3 * var(--px)) calc(3 * var(--px)) 0 0 rgba(15, 16, 27, .7);
  --btn-bg: var(--sky);
  --btn-ink: var(--night);
  --btn-depth: var(--blue);
  --gold-bg: var(--yellow);
  --gold-ink: var(--night);
  --gold-depth: var(--orange);
  --ghost-bg: var(--slate);
  --ghost-ink: var(--white);
  --ghost-line: var(--night);
  --hero-bg: var(--navy);
  --hero-ink: var(--white);
  --hero-muted: var(--lgrey);
  --hero-line: var(--blue);
  --hero-accent: var(--yellow);
  --hero-shadow: 2px 2px 0 var(--night);
  --t-plankton: var(--lgrey);
  --t-tooclever: var(--yellow);
  --t-schooler: var(--sky);
  --t-rare: var(--orange);
  --t-deepcut: #e0607a;
  --t-krillion: var(--cyan);
  --t-miss: var(--grey);
  --c-daily: var(--blue);
  --c-blitz: var(--teal);
  --c-abyss: var(--plum);
  --c-practice: var(--orange);
  --c-archive: var(--red);
  --c-geo: var(--green);
  --c-sports: #c98a2a;
  --c-movies: var(--slate);
  --hot-tint: 30%;
}
:root[data-theme="pixel"]:lang(ja) { --sans: var(--kp-flags,) "KP Fusion Pixel JP", ui-monospace, "Hiragino Sans", "Meiryo", monospace; }

/* =========================================================================================
   BASE
   ========================================================================================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); }
body { min-height: 100vh; min-height: 100dvh; overscroll-behavior-y: none; }
body.modal-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
a, button, summary, .mode, .tab, .seg, .tool, .btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.center { text-align: center; display: block; }
small { font-size: .82em; }
/* long compound words (de, fi, nl, sv, da, no) hyphenate by the page language instead of overflowing */
.mode-body, .hot-banner, .zone, .stat small, .buddy, .ach, .tab, .seg, .lb-you, .about, .faq { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
h1, h2, h3 { line-height: 1.2; font-weight: var(--head-w); font-family: var(--display); letter-spacing: var(--display-track); text-wrap: balance; }
.noscript { padding: 24px; text-align: center; }
.kp-svg { display: block; overflow: visible; }
.tier-ico { display: inline-grid; place-items: center; flex: none; line-height: 0; }
.sec-title { margin: 0 0 10px; font: 600 12px/1 var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* =========================================================================================
   BACKGROUNDS
   ========================================================================================= */
#ocean { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
/* flat: one quiet colour that deepens a touch as you dive */
:root:not([data-theme="pop"]):not([data-theme="pixel"]) #ocean {
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) calc((1 - var(--depth)) * 100%), var(--bg-deep));
  transition: background .8s;
}
/* pop: the canvas sea (js/sea.js) paints over this */
:root[data-theme="pop"] #ocean { background: var(--bg); }
/* pixel: a night sea six screens tall (ui.mountPixelSea), scrolled by --depth via ui.setDepth */
:root[data-theme="pixel"] #ocean { background: #0f101b; }
.px-sea {
  position: absolute; left: 50%; top: 0; width: 100%; height: 600vh; transform: translate(-50%, 0);
  transition: transform 1.4s cubic-bezier(.2, .7, .2, 1); will-change: transform;
  background: linear-gradient(180deg,
    #14152a 0 7vh, #191b33 7vh 14vh, #1e213e 14vh 20vh, #232849 20vh 25vh, #29305a 25vh 28.5vh, #313a6b 28.5vh 30.5vh,
    #73eff7 30.5vh 30.9vh, #41a6f6 30.9vh 31.6vh, #3b5dc9 31.6vh 38vh, #3554b8 38vh 48vh, #2f4ba6 48vh 62vh, #2b4396 62vh 80vh,
    #29366f 80vh 104vh, #253163 104vh 132vh, #212b58 132vh 166vh, #1e264e 166vh 206vh, #1b2245 206vh 252vh,
    #191e3d 252vh 304vh, #171b35 304vh 364vh, #15182e 364vh 430vh, #131527 430vh 500vh, #111320 500vh 560vh, #0f101b 560vh);
}
.px-thing { position: absolute; line-height: 0; }
.px-thing .kp-svg { display: block; }
.px-stars { position: absolute; left: 0; top: 0; width: 3px; height: 3px; animation: px-twinkle 3.2s steps(2) infinite; }
.px-stars.b { animation-duration: 4.6s; animation-delay: -1.3s; }
@keyframes px-twinkle { 50% { opacity: .3; } }
.px-moon { top: 6vh; right: 12%; filter: drop-shadow(0 0 16px rgba(255, 205, 117, .35)); }
.px-reflect { position: absolute; top: 32.4vh; right: calc(12% + 6px); width: 48px; display: grid; justify-items: center; gap: 6px; animation: px-twinkle 2.4s steps(2) infinite; }
.px-reflect i { height: 3px; background: #ffcd75; opacity: .4; }
.px-surface { position: absolute; left: 0; right: 0; top: 30.3vh; height: 6px; background: repeating-linear-gradient(90deg, #f4f4f4 0 9px, #73eff7 9px 18px, transparent 18px 42px); opacity: .8; animation: px-wave 6s steps(10) infinite linear; }
@keyframes px-wave { to { background-position: 42px 0; } }
.px-rays { position: absolute; left: 0; right: 0; top: 31.6vh; height: 100vh; background: repeating-linear-gradient(100deg, rgba(115, 239, 247, .05) 0 27px, transparent 27px 96px); -webkit-mask: linear-gradient(#000, transparent); mask: linear-gradient(#000, transparent); }
.px-fish { left: 0; animation: px-swim-l var(--dur, 50s) linear infinite; }
.px-fish.flip { animation-name: px-swim-r; }
.px-fish.flip .kp-svg { transform: scaleX(-1); }
@keyframes px-swim-l { from { transform: translateX(110vw); } to { transform: translateX(-30vw); } }
@keyframes px-swim-r { from { transform: translateX(-30vw); } to { transform: translateX(110vw); } }
.px-jelly { animation: px-bob 3s steps(4) infinite; }
.px-jelly.b { animation-duration: 3.8s; animation-delay: -1.2s; }
@keyframes px-bob { 50% { transform: translateY(-12px); } }
.px-angler { animation: px-bob 5s steps(4) infinite; }
.px-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 22vh; background: linear-gradient(180deg, transparent 0 55%, #333c57 55% 59%, #29304a 59% 74%, #1a1c2c 74%); }
.px-floor .px-thing { bottom: 45%; }
.px-kelp { transform-origin: bottom center; animation: px-sway 2.8s steps(2) infinite; }
.px-kelp.b { animation-duration: 3.4s; animation-delay: -1s; }
@keyframes px-sway { 50% { transform: skewX(-5deg); } }
.px-bubbles i { position: absolute; bottom: -12px; border: 3px solid rgba(115, 239, 247, .5); animation: px-rise linear infinite; }
@keyframes px-rise { to { transform: translateY(-110vh); } }
.px-dark { position: absolute; inset: 0; background: #000; opacity: var(--abyss-dark); transition: opacity 1.2s; pointer-events: none; }

/* the living sea (js/sea.js): canvas, the swimming buddy, the depth gauge */
.sea-canvas { position: absolute; inset: 0; display: block; }
.sea-buddy { position: absolute; left: 0; top: 0; margin: -26px 0 0 -26px; line-height: 0; z-index: 1; transition: opacity .5s; will-change: transform; filter: drop-shadow(0 6px 8px rgba(20, 10, 50, .22)); }
.sea-buddy.off { opacity: 0; }
.sea-gauge { position: fixed; z-index: 3; right: 22px; top: 22vh; bottom: 16vh; width: 5px; display: none; pointer-events: none; }
@media (min-width: 1000px) { .sea-gauge.on { display: block; } }
.sg-track { position: absolute; inset: 0; border-radius: 5px; background: rgba(255, 255, 255, .25); }
.sg-fill { position: absolute; left: 0; right: 0; top: 0; border-radius: 5px; background: linear-gradient(#fff, var(--accent)); transition: height 1.6s cubic-bezier(.2, .7, .2, 1); }
.sg-read { position: absolute; right: 14px; transform: translateY(-50%); display: grid; justify-items: end; color: #fff; white-space: nowrap; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); transition: top 1.6s cubic-bezier(.2, .7, .2, 1); }
.sg-read b { font: var(--head-w) 20px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.sg-read small { font-size: 12px; opacity: .9; }
/* during a dive: depth on the left, the buddy (with its speech bubble) on the right */
.dive-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 8px; min-height: 52px; }
.depth-chip { font-variant-numeric: tabular-nums; }
.buddy-dock { position: relative; width: 52px; height: 50px; flex: none; }
.bd-body { line-height: 0; transform-origin: 50% 80%; animation: bd-idle 3.2s ease-in-out infinite; }
.bd-bubble { position: absolute; right: calc(100% + 8px); top: 50%; padding: 6px 11px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); font: 650 13px/1.25 var(--sans); white-space: nowrap; box-shadow: var(--shadow); opacity: 0; transform: translate(6px, -50%) scale(.9); transition: opacity .2s, transform .2s; pointer-events: none; }
.bd-bubble::after { content: ""; position: absolute; right: -6px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-right: 0; border-left-color: var(--panel); }
.buddy-dock.talk .bd-bubble { opacity: 1; transform: translate(0, -50%); }
.buddy-dock.mood-great .bd-body { animation: bd-jump .55s ease 2; }
.buddy-dock.mood-good .bd-body { animation: bd-wiggle .45s ease 2; }
.buddy-dock.mood-common .bd-body { animation: bd-shrug .8s ease; }
.buddy-dock.mood-miss .bd-body { animation: bd-droop 1.3s ease; }
@keyframes bd-idle { 50% { transform: translateY(-4px) rotate(-3deg); } }
@keyframes bd-jump { 40% { transform: translateY(-16px) rotate(-10deg) scale(1.08); } }
@keyframes bd-wiggle { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes bd-shrug { 50% { transform: scaleY(.84) translateY(4px); } }
@keyframes bd-droop { 35%, 70% { transform: translateY(6px) rotate(16deg); } }
.toast.fact { border-color: var(--accent); }
/* friends board: add form, the list, the invite link, answers under each row */
.friends-cta p { margin: 0 0 10px; }
.friends-tools .me-name { margin: 0; }
.friend-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.friend-chips p { margin: 0; }
.chip.friend { gap: 2px; padding-right: 2px; }
.chip-x { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; min-width: 26px; min-height: 26px; cursor: pointer; border-radius: 50%; }
.chip-x:hover { color: var(--bad); }
.friends-invite { margin-top: 10px; }
.lb-answers { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 3px 10px; margin: -2px 0 4px; font-size: 12px; color: var(--muted); }
.lb-answers span { display: inline-flex; align-items: center; gap: 3px; }
.lb-answers .tier-ico { width: 16px; height: 16px; }
/* deep water (html[data-deep], set by ui.dive below ~100 m): text that sits straight on the sea turns light.
   Pixel is a night sea throughout and already uses light text. */
:root[data-deep]:not([data-theme="pixel"]) :is(.dive-head > b, .endless-bar, .endless-bar b, .hero.landing h1, .hero.landing p, .screen-title) { color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
:root[data-deep]:not([data-theme="pixel"]) .endless-hint { background: rgba(255, 255, 255, .14); color: #eef2ff; }
:root[data-deep]:not([data-theme="pixel"]) .pips i:not([class]) { background: rgba(255, 255, 255, .28); }
.reached { margin: 0 0 8px; font-weight: 650; color: var(--accent); }
/* meme stickers: a little drop shadow, a wobble at rest, and the meme caption under a reveal */
.kp-svg.meme { filter: drop-shadow(0 2px 1px rgba(20, 10, 40, .22)); }
.reveal-icon .kp-svg.meme, .buddy-preview .kp-svg.meme, .bd-body .kp-svg.meme { animation: meme-wobble 2.4s ease-in-out infinite; }
@keyframes meme-wobble { 25% { transform: rotate(-4deg) scale(1.03); } 75% { transform: rotate(4deg) scale(.98); } }
.meme-cap { margin: -2px 0 6px; font: 700 13px var(--sans); letter-spacing: .02em; color: var(--accent); text-transform: uppercase; }
.seg-group { display: flex; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .kp-svg.meme { animation: none !important; } }
@media (prefers-reduced-motion: reduce) { .bd-body, .buddy-dock .bd-body, .buddy-preview { animation: none !important; } }

/* =========================================================================================
   SHELL: app, HUD, tab bar
   ========================================================================================= */
#app { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 0 var(--gutter) calc(var(--tabbar-h) + 24px); min-height: 100vh; min-height: 100dvh; }
body.in-game #app { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
#screen { padding-top: 6px; }
#hud { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; margin: 0 calc(-1 * var(--gutter)); padding: max(8px, env(safe-area-inset-top)) var(--gutter) 8px; background: var(--hud-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.logo { display: flex; align-items: center; gap: 8px; font: var(--head-w) 19px/1 var(--display); letter-spacing: var(--display-track); color: var(--ink); min-width: 0; }
.logo .tier-ico { width: 28px; height: 28px; flex: none; }
.logo span { white-space: nowrap; }
.logo b { color: var(--accent); font-weight: inherit; }
.hud-right { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 2px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font: var(--num-w) calc(15px * var(--k))/1.2 var(--pix); color: var(--ink); white-space: nowrap; box-shadow: var(--shadow); }
.chip .tier-ico { width: 18px; height: 18px; }
.chip small { font-size: .82em; }
.chip.small { font-size: calc(13px * var(--k)); min-height: 24px; padding: 1px 9px; box-shadow: none; }
.chip.fire { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.chip.cold { color: var(--muted); }
.chip.icon { cursor: pointer; min-width: 34px; justify-content: center; font-family: var(--sans); font-size: 15px; }
.hud-lang { position: relative; }
.lang-chip span { font: 700 13px/1 var(--label); letter-spacing: .04em; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; display: grid; grid-template-columns: repeat(2, minmax(118px, 1fr)); gap: 2px; min-width: 250px; max-height: calc(100dvh - 90px); overflow: auto; padding: 6px; border-radius: var(--r-sm); background: var(--modal-bg); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.lang-menu[hidden] { display: none; }
.lang-menu a { padding: 10px 12px; border-radius: calc(var(--r-sm) - 4px); color: var(--ink); font: 600 15px/1.2 var(--sans); }
.lang-menu a:hover, .lang-menu a:focus-visible { background: var(--panel-2); outline: none; }
.lang-menu a.on { color: var(--accent); background: var(--accent-soft); }
.lang-menu a.on::after { content: " ✓"; }
body.in-game .hud-lang { display: none; }
.xpbar { display: inline-block; width: 38px; height: 5px; background: var(--track); border-radius: 3px; overflow: hidden; }
.xpbar > i { display: block; height: 100%; background: var(--gold-bg); }
.xpbar.big { width: 100%; height: 8px; margin: 6px 0; }

#tabbar { position: fixed; z-index: 6; left: 50%; bottom: 0; transform: translateX(-50%); width: min(640px, 100%); display: grid; grid-template-columns: repeat(6, 1fr); background: var(--tabbar-bg); border-top: 1px solid var(--line); padding: 4px max(4px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-right)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
#tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 52px; padding: 0 2px; font-size: 11px; white-space: nowrap; overflow: hidden; color: var(--muted); border-radius: 12px; }
#tabbar a span { font-size: 20px; line-height: 1.2; }
#tabbar a.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
body.in-game #tabbar { display: none; }

/* =========================================================================================
   GENERIC
   ========================================================================================= */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 14px 0; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.panel h2, .panel h3, .panel-head h2 { margin: 0; font-size: 17px; }
/* buttons: one shape per theme (see signatures); .big is the page's single primary action */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: var(--r-btn); border: 1px solid var(--btn-line); background: var(--btn-bg); color: var(--btn-ink); font: 650 15px/1.2 var(--sans); cursor: pointer; transition: transform .08s, filter .2s, box-shadow .08s; text-align: center; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: var(--gold-bg); color: var(--gold-ink); border-color: transparent; }
.btn.ghost { background: var(--ghost-bg); color: var(--ghost-ink); border-color: var(--ghost-line); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.btn.big { min-height: 56px; padding: 14px 26px; font-size: 17px; }
.btn.wide { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 16px 0 6px; }
.footnote { font-size: 12px; color: var(--muted); margin: 0 2px; }
.screen-title { font: var(--head-w) clamp(26px, 7vw, 32px)/1.1 var(--display); letter-spacing: var(--display-track); margin: 12px 0 12px; text-shadow: var(--hero-shadow); }
input.text, select.text { background: var(--input-bg); border: 1px solid var(--input-line); border-radius: var(--r-sm); color: var(--ink); padding: 10px 12px; font: 16px var(--sans); min-height: 46px; }
.link-danger { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--bad); font-size: 13px; text-decoration: underline; cursor: pointer; min-height: 36px; }
.link-x { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; min-width: 36px; min-height: 36px; }

/* =========================================================================================
   HOME
   ========================================================================================= */
/* phones: one column in this order — hero, board, event, modes, teaser, quests, league */
.home { display: flex; flex-direction: column; gap: var(--gap); padding-top: 4px; }
.home-main, .home-side { display: contents; }
.home .panel { margin: 0; }
.home-hero { order: 1; }
.home-board { order: 2; }
.home .hot-banner { order: 3; }
.home-modes { order: 4; }
.home .soon { order: 5; }
.home .quests { order: 6; }
.home .league-strip { order: 7; }
.home .footnote { order: 8; }

/* the hero: the daily dive */
.home-hero { position: relative; overflow: hidden; padding: 20px 18px 18px; border-radius: calc(var(--r) + 4px); background: var(--hero-bg); color: var(--hero-ink); box-shadow: var(--shadow-lg); }
.hh-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font: 600 12px/1.3 var(--label); letter-spacing: .08em; text-transform: uppercase; color: var(--hero-muted); }
.hh-dive { color: var(--hero-accent); }
.hh-reset b { color: var(--hero-ink); font-weight: inherit; }
.hh-streak { margin-left: auto; text-transform: none; letter-spacing: 0; color: var(--hero-ink); }
.home-hero h1 { margin: 12px 0 18px; font-size: clamp(27px, 7.6vw, 40px); line-height: 1.08; color: var(--hero-ink); text-shadow: var(--hero-shadow); }
.home-hero h1 em { font-style: normal; color: var(--hero-accent); }
.hh-label { margin: 0 0 10px; font: 600 11px/1.2 var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--hero-muted); }
/* tiers as a staircase: each one sits a step deeper, which is the scoring rule */
.depth-ladder { list-style: none; margin: 0; padding: 0 0 4px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: start; gap: 4px; position: relative; }
.depth-ladder::before { content: ""; position: absolute; left: 8%; right: 8%; top: 16px; height: 0; border-top: 1px dashed var(--hero-line); transform: rotate(4deg); transform-origin: left; }
.depth-ladder li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; min-width: 0; }
.depth-ladder li:nth-child(2) { margin-top: 6px; } .depth-ladder li:nth-child(3) { margin-top: 12px; }
.depth-ladder li:nth-child(4) { margin-top: 18px; } .depth-ladder li:nth-child(5) { margin-top: 24px; } .depth-ladder li:nth-child(6) { margin-top: 30px; }
.depth-ladder b { font: var(--num-w) calc(17px * var(--k))/1.1 var(--pix); color: var(--hero-ink); }
.depth-ladder li:last-child b { color: var(--hero-accent); }
@media (max-width: 420px) { .depth-ladder .tier-ico { width: 28px !important; height: 28px !important; } .depth-ladder small { font-size: 10px !important; } .depth-ladder b { font-size: 15px; } }
.depth-ladder small { font-size: 11px; line-height: 1.2; color: var(--hero-muted); overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.hh-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 18px; }
.hh-cta .btn.big { flex: 1 1 220px; }
.hh-link { color: var(--hero-ink); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hero-line); }
.hh-done { display: flex; flex-direction: column; gap: 2px; font: var(--num-w) calc(15px * var(--k)) var(--pix); color: var(--hero-ink); }
.hh-grid { font-size: 13px; letter-spacing: 1px; }

/* mode cards */
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mode { display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; background: var(--panel); border: 1px solid var(--line); color: var(--ink); transition: transform .15s, box-shadow .15s; box-shadow: var(--shadow); }
.mode:hover { transform: translateY(-2px); }
.mode:active { transform: scale(.98); }
.mode-art { aspect-ratio: 16 / 8; position: relative; display: grid; place-items: center; overflow: hidden; }
.mode.daily .mode-art { background: var(--c-daily); }
.mode.blitz .mode-art { background: var(--c-blitz); }
.mode.abyss .mode-art { background: var(--c-abyss); }
.mode.practice .mode-art { background: var(--c-practice); }
.mode.archive .mode-art { background: var(--c-archive); }
.mode.geo .mode-art { background: var(--c-geo); }
.mode.sports .mode-art { background: var(--c-sports); }
.mode.movies .mode-art { background: var(--c-movies); }
.mode-art .tier-ico { position: relative; z-index: 1; width: 58px !important; height: 58px !important; transition: transform .25s; }
.mode:hover .mode-art .tier-ico { transform: scale(1.08) rotate(-4deg); }
.mode-art .tag { position: absolute; z-index: 2; top: 8px; left: 8px; font: 600 10.5px/1.5 var(--label); letter-spacing: .06em; text-transform: uppercase; padding: 1px 8px; border-radius: 999px; background: var(--panel); color: var(--soft); }
.mode-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; gap: 3px; }
.mode-body h2 { margin: 0; font-size: 16px; }
.mode-body p { margin: 0 0 4px; font-size: 12.5px; color: var(--muted); line-height: 1.4; flex: 1; }
.mode-stat { font: var(--num-w) calc(13px * var(--k))/1.3 var(--pix); color: var(--accent); overflow-wrap: anywhere; }
/* the featured mode spans the row: art on the left */
.mode.wide { grid-column: 1 / -1; flex-direction: row; }
.mode.wide .mode-art { aspect-ratio: auto; flex: 0 0 38%; min-height: 128px; }
.mode.wide .mode-art .tier-ico { width: 72px !important; height: 72px !important; }
.mode.wide .mode-body { justify-content: center; padding: 14px 16px; }
.mode.wide .mode-body h2 { font-size: 20px; }

/* trending event */
.hot-banner { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; padding: 16px; border-radius: var(--r); color: var(--ink); background: linear-gradient(135deg, color-mix(in srgb, var(--hot) var(--hot-tint), var(--panel)), var(--panel) 70%); border: 1px solid color-mix(in srgb, var(--hot) 45%, transparent); box-shadow: var(--shadow); }
.hot-emoji { font-size: 46px; grid-row: span 2; animation: bob 2.4s ease-in-out infinite; }
.hot-kicker { font: 600 11px/1.4 var(--label); letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--hot) 75%, var(--ink)); }
.hot-banner h2 { margin: 2px 0; font-size: 20px; }
.hot-banner p { margin: 2px 0; font-size: 13px; color: var(--soft); }
.hot-banner .hot-reward { color: var(--gold); }
.hot-banner .btn { grid-column: 2; justify-self: start; margin-top: 8px; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-4deg); } }

.soon { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r); border: 1px dashed color-mix(in srgb, var(--hot) 55%, transparent); background: var(--panel); }
.soon > div:not(.soon-actions) { flex: 1; min-width: 160px; }
.soon-emoji { font-size: 28px; }
.soon-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.quest { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.quest .q-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--muted); display: grid; place-items: center; font-size: 12px; color: #fff; }
.quest.done .q-check { background: var(--ok); border-color: var(--ok); }
.quest.done .q-name { color: var(--muted); text-decoration: line-through; }
.q-prog { font: var(--num-w) calc(13px * var(--k)) var(--pix); color: var(--muted); }
.q-xp { font: var(--num-w) calc(13px * var(--k)) var(--pix); color: var(--gold); }
.league-strip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; border-radius: var(--r); background: var(--panel); border: 1px solid color-mix(in srgb, var(--lg) 50%, var(--line)); color: var(--ink); box-shadow: var(--shadow); }
.league-strip .tier-ico { width: 36px !important; height: 36px !important; }
.league-strip div { flex: 1; }
.league-strip small { color: var(--muted); }

/* home leaderboard teaser */
.home-board { padding: 14px; border-color: var(--gold-line); }
.hb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hb-head h2 { margin: 0; font-size: 17px; }
.hb-count { margin-left: auto; font-family: var(--pix); }
.live { display: inline-flex; align-items: center; gap: 5px; font: 700 10.5px/1 var(--label); letter-spacing: .1em; color: #e11d48; border: 1px solid rgba(225, 29, 72, .4); border-radius: 999px; padding: 4px 8px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #f43f5e; box-shadow: 0 0 6px #f43f5e; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.hb-tabs { display: flex; gap: 6px; margin: 12px 0 6px; }
.hb-tabs .seg { flex: 1; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 6px; margin: 22px 0 6px; }
.pod { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.pod .crown { position: absolute; top: -18px; font-size: 18px; animation: bob 2.4s ease-in-out infinite; }
.pod .medal { font-size: 26px; line-height: 1.1; }
.pod.p1 .medal { font-size: 32px; }
.pod .who { font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.pod .sc { font: var(--num-w) calc(18px * var(--k))/1.1 var(--pix); color: var(--ink); }
.pod .sc small { font-size: 11px; color: var(--muted); font-weight: 400; }
.pod .base { width: 100%; margin-top: 4px; display: grid; place-items: center; font: var(--num-w) calc(22px * var(--k)) var(--pix); color: rgba(0, 0, 0, .45); border-radius: var(--r-sm) var(--r-sm) 4px 4px; }
.pod.p1 .base { height: 58px; background: linear-gradient(180deg, #ffd977, #ffefc2); border: 1px solid #f5c542; }
.pod.p2 .base { height: 42px; background: linear-gradient(180deg, #dfe6ef, #f4f7fb); border: 1px solid #c3cfdd; }
.pod.p3 .base { height: 32px; background: linear-gradient(180deg, #f0b98b, #fbe3cf); border: 1px solid #dc9a66; }
.pod.p1 .sc { color: var(--gold); }
.pod.you .who { color: var(--gold); font-weight: 700; }
.pod.open .who { color: var(--muted); font-style: italic; }
.pod.open .medal { opacity: .45; filter: grayscale(.6); }
.hb-rows { margin-top: 8px; }
.hb-rows .lb-row { min-height: 36px; padding: 4px 10px; }
.hb-you { border-color: var(--gold-line); }
.hb-cta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.hb-line { flex: 1 1 180px; margin: 0; font-size: 14px; font-weight: 600; color: var(--gold); }
.hb-cta .btn { flex: none; }
.hb-all { display: block; text-align: center; margin-top: 10px; font-size: 13px; min-height: 32px; line-height: 32px; }
.howto-ranks { color: var(--gold); }

/* =========================================================================================
   LANDING / ABOUT / FOOTER
   ========================================================================================= */
.hero h1 { font-size: clamp(24px, 6.6vw, 32px); margin: 14px 0 6px; text-shadow: var(--hero-shadow); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: 0; font-size: 14px; color: var(--muted); text-shadow: var(--hero-shadow); }
.hero p b { color: var(--gold); }
.about { margin: 28px 0 8px; }
body:not([data-landing="1"]) .about:not(.about-on) { display: none; }
.hero.landing h1 { margin-bottom: 6px; }
.hero.landing p { font-size: 15px; color: var(--soft); max-width: 60ch; }
.about-inner { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 18px; box-shadow: var(--shadow); }
.about h2 { font-size: 21px; margin: 0 0 8px; }
.about h3 { font-size: 16px; margin: 22px 0 8px; color: var(--accent); }
.about p, .about li, .about dd { color: var(--soft); font-size: 14.5px; max-width: 68ch; }
.about-lead { font-size: 15.5px !important; }
.about-steps { padding-left: 20px; }
.about-steps li { margin: 6px 0; }
.about-note { margin: 4px 0 0; font-size: 14px; color: var(--soft); }
.about-tiers { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.about-tiers li { display: grid; grid-template-columns: 32px 1fr auto; grid-template-rows: auto auto; gap: 0 12px; align-items: center; }
.about-tiers .tier-ico { grid-row: span 2; }
.about-tiers .pts { font: var(--num-w) calc(18px * var(--k)) var(--pix); color: var(--gold); grid-column: 3; grid-row: 1; }
.about-tiers span:last-child { grid-column: 2 / 4; color: var(--muted); }
.about-modes dt { font-weight: 700; margin-top: 10px; color: var(--ink); }
.about-modes dd { margin: 2px 0 0; }
.faq details { border-top: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; padding: 10px 0; font-weight: 600; min-height: 44px; color: var(--ink); }
.faq p { margin: 0 0 10px; }
.games-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.games-list li { padding: 12px 14px; border-radius: var(--r-sm); background: var(--sunken); }
.games-list b { color: var(--ink); }
.games-list small { color: var(--muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }
.archive-day { padding: 12px 0; border-top: 1px solid var(--line); }
.archive-day h3 { margin: 0 0 4px !important; font-size: 15px !important; color: var(--ink) !important; }
.archive-day ol { margin: 4px 0 8px; padding-left: 18px; }
.archive-day li { margin: 2px 0; }
.archive-day .gem { color: var(--gold); font-weight: 600; }

.site-foot { margin: 28px 0 8px; padding: 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.site-foot nav a { font-size: 13px; font-weight: 600; }
.site-foot p { margin: 0; }
.site-foot .foot-langs { align-items: center; gap: 6px 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.site-foot .foot-langs a { font-weight: 500; color: var(--soft); }
.site-foot .foot-langs a[aria-current] { color: var(--ink); font-weight: 700; }
body.in-game .site-foot { display: none; }

/* =========================================================================================
   DIVE (daily, practice, unlimited, archive, geography, hot)
   ========================================================================================= */
.dive-head { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; }
.dive-head b { font: var(--head-w) 17px/1.2 var(--display); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { font-size: 22px; color: var(--ink); width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--panel); border: 1px solid var(--line); }
.pips { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.pips i { flex: 1; max-width: 32px; height: 8px; border-radius: 4px; background: var(--track); }
.pip-plankton { background: var(--t-plankton) !important; }
.pip-tooclever { background: var(--t-tooclever) !important; }
.pip-schooler { background: var(--t-schooler) !important; }
.pip-rare { background: var(--t-rare) !important; }
.pip-deepcut { background: var(--t-deepcut) !important; }
.pip-krillion { background: var(--t-krillion) !important; }
.pip-miss { background: var(--t-miss) !important; }
.endless-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.endless-bar b { font: var(--num-w) calc(17px * var(--k)) var(--pix); color: var(--ink); }
.endless-hint { font-size: 13px; color: var(--soft); background: var(--accent-soft); border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 12px; }

.prompt-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.prompt-card.compact { padding: 12px 14px; }
.prompt-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; margin-bottom: 8px; }
.prompt { font: var(--head-w) clamp(23px, 6.6vw, 30px)/1.2 var(--display); letter-spacing: var(--display-track); margin: 4px 0; overflow-wrap: anywhere; text-wrap: balance; }
.compact .prompt { font-size: clamp(20px, 5.6vw, 24px); }
.prompt-zh { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.o2 { display: grid; grid-template-columns: auto 1fr 38px; align-items: center; gap: 10px; margin: 4px 0 12px; font: var(--num-w) calc(16px * var(--k)) var(--pix); }
.o2-bar { height: 10px; border-radius: 6px; background: var(--track); overflow: hidden; }
.o2-bar > i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), #38bdf8); transition: width .1s linear; border-radius: inherit; }
.o2-bar.low > i { background: linear-gradient(90deg, #ef4444, #f59e0b); animation: blink .6s infinite; }
.o2.big .o2-bar { height: 16px; }
.o2.buffered .o2-bar > i { background: linear-gradient(90deg, #10b981, #6ee7b7); }
.buffer-badge { display: inline-block; font-size: 12px; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); border-radius: 999px; padding: 1px 10px; margin: -4px 0 6px; }
@keyframes blink { 50% { opacity: .55; } }
.answer-row { display: flex; gap: 8px; }
.answer-row .btn { flex: none; min-width: 76px; }
input.answer { flex: 1; min-width: 0; min-height: 52px; background: var(--input-bg); border: 2px solid var(--input-line); border-radius: var(--r-sm); color: var(--ink); padding: 10px 14px; font: 600 18px var(--sans); outline: none; }
input.answer:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input.answer::placeholder { color: var(--muted); opacity: .75; font-weight: 400; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.feedback { min-height: 22px; font-size: 13px; margin: 8px 2px; color: var(--muted); }
.feedback.bad { color: var(--bad); }
.feedback.warn { color: var(--warn); }
.sonar-out { font-size: 14px; color: var(--accent); margin: 4px 2px; }
.sonar-out code { font: 700 18px var(--pix); letter-spacing: 3px; color: var(--gold); background: var(--sunken); padding: 0 6px; border-radius: 6px; word-break: break-all; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tool { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 14px; box-shadow: var(--shadow); }
.tool small { color: var(--muted); }
.tool.on { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.tool:disabled, .tool.used { opacity: .45; cursor: not-allowed; }
.tool.quiet { margin-left: auto; background: transparent; box-shadow: none; }

/* reveal */
.reveal { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 16px; --tc: var(--ink); box-shadow: var(--shadow); }
.reveal h2 { margin: 8px 0 2px; color: var(--tc); font-size: 24px; }
.reveal h2 small { font-size: 14px; color: var(--muted); font-weight: 500; }
.reveal-icon { display: grid; place-items: center; }
.reveal-icon > * { width: min(112px, 28vw) !important; height: auto !important; animation: drop .7s cubic-bezier(.3, 1.6, .5, 1); }
.reveal-icon .kp-svg { width: 100%; height: auto; }
@keyframes drop { from { transform: translateY(-60px) scale(.6); opacity: 0; } }
.t-plankton { --tc: var(--t-plankton); } .t-tooclever { --tc: var(--t-tooclever); } .t-schooler { --tc: var(--t-schooler); }
.t-rare { --tc: var(--t-rare); } .t-deepcut { --tc: var(--t-deepcut); } .t-krillion { --tc: var(--t-krillion); } .t-miss { --tc: var(--t-miss); }
.reveal.t-krillion { box-shadow: 0 0 0 3px color-mix(in srgb, var(--t-krillion) 35%, transparent), var(--shadow); border-color: color-mix(in srgb, var(--t-krillion) 60%, transparent); }
.reveal-answer { margin: 4px 0; overflow-wrap: anywhere; }
.reveal-points { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.pts { font: var(--num-w) calc(32px * var(--k))/1 var(--pix); color: var(--tc, var(--gold)); }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.crowd { font-size: 13px; margin: 4px 0; }
.quip { margin: 12px 0; padding: 10px 12px; border-left: 3px solid var(--tc); background: var(--sunken); text-align: left; font-size: 13px; border-radius: 0 8px 8px 0; color: var(--soft); }
.sheet { text-align: left; font-size: 13px; margin: 12px 0 14px; overflow-wrap: anywhere; }
.sheet p { margin: 3px 0; }

/* summary */
.summary { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 14px; box-shadow: var(--shadow); }
.sum-icon { display: grid; place-items: center; }
.sum-icon > * { width: min(120px, 30vw) !important; height: auto !important; animation: drop .8s cubic-bezier(.3, 1.6, .5, 1); }
.verdict { margin: 6px 0; font-size: 15px; }
.total b { font: var(--num-w) clamp(calc(52px * var(--k)), calc(17vw * var(--k)), calc(68px * var(--k)))/1 var(--pix); color: var(--gold); }
.total small { display: block; color: var(--muted); }
.breakdown { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.breakdown span { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--sunken); }
.breakdown .bad { color: var(--bad); }
.grid { display: flex; gap: 4px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.grid span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-sm); background: var(--sunken); }
.rank-line { font-size: 14px; }
.fresh { color: var(--ok); font-size: 14px; margin: 4px 0; font-weight: 600; }
.recap { list-style: none; padding: 0; margin: 0; }
.recap li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.recap li div { display: flex; flex-direction: column; min-width: 0; }
.recap .pts { font-size: calc(17px * var(--k)); color: var(--muted); }
.share-box { width: 100%; height: 140px; background: var(--sunken); color: var(--ink); font: 14px var(--sans); border: 1px solid var(--line); border-radius: var(--r-sm); }

/* =========================================================================================
   BLITZ · ABYSS
   ========================================================================================= */
.lobby { text-align: center; }
.lobby .prompt-meta { justify-content: center; }
.rules { padding-left: 18px; font-size: 13px; color: var(--soft); }
.rules li { margin: 5px 0; }
.blitz-hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.blitz-hud > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 4px; text-align: center; min-width: 0; box-shadow: var(--shadow); }
.blitz-hud small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blitz-hud b { font: var(--num-w) clamp(calc(20px * var(--k)), calc(6.4vw * var(--k)), calc(26px * var(--k)))/1 var(--pix); }
.big-timer.low { color: var(--bad); animation: blink .5s infinite; }
.combo-bar { display: block; height: 3px; margin-top: 3px; background: var(--track); border-radius: 2px; overflow: hidden; }
.combo-bar > i { display: block; height: 100%; background: var(--gold-bg); }
.blitz-input { position: relative; }
.fx-layer { position: absolute; inset: 0; pointer-events: none; }
.pop { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); white-space: nowrap; font: var(--num-w) calc(20px * var(--k)) var(--pix); color: var(--tc, var(--ink)); text-shadow: 0 1px 6px var(--bg); animation: pop 1s ease-out forwards; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pop.bad { color: var(--bad); }
.pop.time { color: var(--ok); left: 80%; }
@keyframes pop { to { transform: translate(-50%, -54px); opacity: 0; } }
.feed { display: flex; flex-wrap: wrap; gap: 6px; max-height: 40vh; overflow: auto; }
.fish { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 5px; border-radius: 999px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--tc) 50%, transparent); color: var(--tc); font-size: 13px; font-weight: 600; animation: drop .35s; }
.countdown { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; font: var(--num-w) min(calc(150px * var(--k)), 40vw) var(--pix); color: var(--gold); background: var(--overlay); pointer-events: none; }
.histo { margin: 10px auto; max-width: 320px; }
.hbar { display: grid; grid-template-columns: 26px 1fr 30px; align-items: center; gap: 6px; margin: 3px 0; }
.hbar i { display: block; height: 10px; border-radius: 5px; background: var(--tc); min-width: 2px; }
.hbar b { font: var(--num-w) calc(16px * var(--k)) var(--pix); text-align: right; }

.abyss-intro h1 { font-size: 19px; margin: 0 0 12px; }
.zones { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 10px; }
.zone { border-top: 3px solid var(--c); padding: 5px 2px; text-align: center; background: var(--sunken); border-radius: 0 0 8px 8px; min-width: 0; }
.zone b { display: block; font-size: clamp(10px, 3vw, 12px); color: var(--ink); overflow-wrap: anywhere; } /* "Midnight" fits a 375px phone */
.zone small { font-size: 10px; color: var(--muted); }
.abyss-hud { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.depth-box { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.zone-name { font-size: 14px; font-weight: 600; color: var(--t-schooler); }
.depth { font: var(--num-w) calc(38px * var(--k))/1 var(--pix); color: var(--ink); }
.perk-row { display: flex; gap: 6px; flex-wrap: wrap; min-height: 4px; }
.perk { font-size: 18px; background: var(--sunken); border-radius: 8px; padding: 1px 6px; }
.perk small { font-size: 11px; color: var(--muted); }
.perk-pick { text-align: center; }
.perk-pick h3 { margin: 0; }
.perk-cards { display: grid; gap: 8px; margin-top: 12px; }
.perk-card { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; text-align: left; gap: 0 10px; padding: 12px; min-height: 64px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; transition: transform .1s, border-color .2s; }
.perk-card:hover, .perk-card:focus-visible { border-color: var(--gold); transform: translateY(-1px); }
.perk-card span { grid-row: span 2; font-size: 30px; align-self: center; }
.perk-card small { color: var(--muted); }

/* =========================================================================================
   LEADERBOARDS · PROFILE
   ========================================================================================= */
.tabs { display: flex; gap: 4px; background: var(--panel); border-radius: var(--r-sm); padding: 4px; border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; box-shadow: var(--shadow); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; min-height: 40px; padding: 6px 12px; border: 0; border-radius: calc(var(--r-sm) - 3px); background: transparent; cursor: pointer; color: var(--muted); white-space: nowrap; font-weight: 600; }
.tab.on { background: var(--accent-soft); color: var(--accent); }
.scope { display: flex; gap: 6px; margin: 12px 0; }
.seg { min-height: 36px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.seg.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.lb-meta { margin: 6px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; }
.lb-you { background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; color: var(--gold); margin: 8px 0; font-weight: 600; }
.lb-you.empty { color: var(--muted); border-style: dashed; background: var(--panel); font-weight: 400; }
.lb-list { list-style: none; padding: 0; margin: 0; background: var(--panel); border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.lb-list.tail { margin-top: 6px; }
.lb-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 42px; padding: 6px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.lb-row:first-child { border-top: 0; }
.lb-row.you { background: var(--gold-soft); }
.lb-row.you em { color: var(--gold); font-style: normal; }
.lb-row.up { box-shadow: inset 3px 0 0 var(--ok); }
.lb-row.down { box-shadow: inset 3px 0 0 var(--bad); }
.lb-rank { font: var(--num-w) calc(17px * var(--k)) var(--pix); text-align: center; color: var(--muted); }
.lb-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; }
.lb-name .nm { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lb-name em { flex: none; }
/* country flags: their own slot, a touch larger than the text */
.flag { flex: none; display: inline-block; font-size: 1.25em; line-height: 1; }
.pod .flag { font-size: 26px; margin: 2px 0 1px; }
.pod.p1 .flag { font-size: 30px; }
.me-who .flag { margin-right: 8px; }
.lb-score { font: var(--num-w) calc(17px * var(--k)) var(--pix); color: var(--accent); white-space: nowrap; }
.lb-score small { font-size: 11px; color: var(--muted); font-weight: 400; }
.lb-gap { text-align: center; color: var(--muted); padding: 2px; }
.league-head { display: flex; gap: 12px; align-items: center; margin: 10px 0; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); }
.league-head .tier-ico { width: 40px !important; height: 40px !important; }
.league-head b { color: var(--accent); font-size: 18px; }
.league-ladder { display: flex; justify-content: space-between; margin: 6px 0 12px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); }
.league-ladder span { opacity: .35; line-height: 0; }
.league-ladder span.on { opacity: 1; transform: scale(1.25); }

.me-head { display: grid; gap: 10px; }
.me-who { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 17px; }
.me-lv b { font: var(--num-w) calc(30px * var(--k)) var(--pix); color: var(--gold); }
.me-name { display: flex; gap: 8px; }
.me-name input { flex: 1; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 4px; text-align: center; min-width: 0; box-shadow: var(--shadow); }
.stat b { display: block; font: var(--num-w) calc(24px * var(--k))/1.15 var(--pix); }
.stat small { color: var(--muted); display: block; overflow-wrap: anywhere; }
.buddies { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.buddy { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 6px; border-radius: var(--r-sm); background: var(--sunken); }
.buddy .tier-ico { width: 52px !important; height: 52px !important; }
button.buddy { border: 2px solid transparent; font: inherit; color: inherit; cursor: pointer; transition: transform .1s; }
button.buddy:active { transform: scale(.96); }
button.buddy.on { border-color: var(--accent); background: var(--accent-soft); }
.buddy.locked { opacity: .55; }
.buddy.locked .tier-ico, .buddy.locked .wear-ico { filter: grayscale(.7); }
.buddy-stage { display: grid; place-items: center; height: 124px; margin: 2px 0 12px; border-radius: var(--r-sm); background: linear-gradient(180deg, #8fdcf0 0%, #3d8fd0 100%); overflow: hidden; }
:root[data-theme="pop"] .buddy-stage { background: linear-gradient(180deg, #52e4d8 0%, #5b7cff 100%); }
.buddy-preview { line-height: 0; animation: bd-idle 3.2s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(10, 20, 60, .25)); }
.buddy-preview svg, .wear-ico svg { overflow: visible; }
.wears { grid-template-columns: repeat(4, 1fr); }
.wear-ico { display: block; line-height: 0; margin: 4px 0 2px; }
@media (max-width: 420px) { .wears { grid-template-columns: repeat(3, 1fr); } }
.buddy b, .buddy small { display: block; font-size: 12px; }
.buddy small { color: var(--muted); }
.buddy.locked .tier-ico { filter: grayscale(1) opacity(.35); }
.achs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ach { display: grid; grid-template-columns: 30px 1fr; gap: 0 6px; padding: 8px; border-radius: var(--r-sm); background: var(--sunken); opacity: .5; }
.ach span { grid-row: span 2; font-size: 22px; }
.ach b { font-size: 13px; }
.ach small { font-size: 11px; color: var(--muted); }
.ach.got { opacity: 1; border: 1px solid var(--gold-line); }
.codex { display: grid; gap: 6px; }
.gem { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 8px; border-radius: var(--r-sm); background: var(--sunken); border-left: 3px solid var(--tc); }
.gem b { color: var(--tc); }
.gem small { display: block; }
.gem p { margin: 4px 0 0; font-size: 12px; color: var(--soft); }

/* =========================================================================================
   SETTINGS · ONBOARDING · TOASTS · MODAL
   ========================================================================================= */
.settings h3 { margin: 0 0 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.set-row.col { flex-direction: column; align-items: stretch; }
.set-label { font-weight: 600; }

/* account: the card on the Me page / in settings, and the sign-up / log-in form */
.acct-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.acct-ico { font-size: 28px; line-height: 1; flex: none; }
.acct-txt { flex: 1 1 170px; min-width: 0; display: grid; gap: 2px; }
.acct-txt b { overflow-wrap: anywhere; }
.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.acct-card.on .btn { margin-left: auto; }
.acct-name { display: grid; gap: 2px; margin: 0; }
.acct { text-align: center; }
.acct h3 { margin: 4px 0 6px; }
.acct > p { margin: 0 auto; max-width: 34ch; font-size: 14px; }
.acct-badge { font-size: 44px; line-height: 1; margin-top: 4px; }
.acct-form { display: grid; gap: 6px; margin-top: 16px; text-align: start; }
.acct-form .field { font-weight: 650; font-size: 14px; margin-top: 6px; }
.pass-wrap { position: relative; display: flex; }
.pass-wrap input { flex: 1; min-width: 0; padding-inline-end: 84px; }
.pass-eye { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); min-height: 38px; padding: 6px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--accent); font: 650 13px var(--sans); cursor: pointer; }
.pass-hint { font-size: 12px; }
.acct-err { margin: 6px 0 0; color: var(--bad); font-size: 14px; font-weight: 600; }
.acct-err:empty { display: none; }
.btn.block { width: 100%; margin-top: 10px; }
.btn:disabled { opacity: .6; cursor: progress; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 8px; padding: 6px 10px; border: 0; background: none; color: var(--accent); font: 600 14px var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.acct-cta { margin: 2px auto 0; }
select.country { width: 100%; min-height: 46px; padding: 8px 10px; }
.langs { display: flex; gap: 6px; flex-wrap: wrap; }
.theme-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; width: 100%; }
.theme-pick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: var(--r-sm); border: 2px solid var(--line); background: var(--panel-2); cursor: pointer; font-size: 12px; font-weight: 600; color: var(--soft); }
.theme-pick button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.theme-pick .sw { display: flex; gap: 3px; }
.theme-pick .sw i { width: 14px; height: 14px; border-radius: 50%; }
.howto { text-align: center; min-height: 230px; }
.howto h3 { font-size: 20px; margin: 6px 0; }
.howto p { color: var(--soft); }
.howto-eg { font-size: 13px; background: var(--sunken); border-radius: var(--r-sm); padding: 8px; color: var(--gold) !important; }
.howto-tiers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 12px 0; }
.howto-tiers div { display: flex; flex-direction: column; align-items: center; }
.howto-tiers b { font: var(--num-w) calc(20px * var(--k)) var(--pix); color: var(--gold); }
.howto-tiers small { font-size: 10px; color: var(--muted); line-height: 1.2; }
.howto-modes { text-align: left; padding-left: 18px; }
.howto-modes li { margin: 8px 0; }
.howto-dots { display: flex; gap: 6px; justify-content: center; margin: 12px 0; }
.howto-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--track); }
.howto-dots i.on { background: var(--accent); }

#toasts { position: fixed; z-index: 30; top: calc(max(8px, env(safe-area-inset-top)) + 56px); left: 50%; transform: translateX(-50%); display: grid; gap: 6px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 10px 14px; border-radius: var(--r-sm); background: var(--toast-bg); color: var(--toast-ink); font-size: 14px; box-shadow: var(--shadow-lg); animation: tin .3s; transition: opacity .4s, transform .4s; border: 1px solid transparent; }
.toast.gold { border-color: #f5c542; }
.toast.ok { border-color: #22c55e; }
.toast.warn { border-color: #f59e0b; }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes tin { from { transform: translateY(-10px); opacity: 0; } }
.modal-wrap { position: fixed; inset: 0; z-index: 25; background: var(--overlay); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) var(--gutter) max(16px, env(safe-area-inset-bottom)); animation: tin .2s; }
.modal { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; background: var(--modal-bg); border: 1px solid var(--line); border-radius: calc(var(--r) + 2px); padding: 20px; box-shadow: var(--shadow-lg); }
.modal h3 { padding: 0 32px; }
.modal-x { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); font-size: 26px; cursor: pointer; border-radius: var(--r-sm); }
.big-emoji { font-size: 64px; line-height: 1.1; }
.desktop-only { display: none; }
@media (hover: hover) and (pointer: fine) { .desktop-only { display: block; } }

/* =========================================================================================
   SIGNATURE · flat — "dive computer"
   Quiet light UI; the boldness lives in the dark instrument hero. Readouts in monospace.
   ========================================================================================= */
:root:not([data-theme="pop"]):not([data-theme="pixel"]) .home-hero::after {
  /* sonar rings in the corner */
  content: ""; position: absolute; right: -70px; top: -70px; width: 220px; height: 220px; border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle, transparent 0 22px, rgba(255, 255, 255, .06) 22px 23px);
}
:root:not([data-theme="pop"]):not([data-theme="pixel"]) .mode-art .tag { background: rgba(255, 255, 255, .8); color: var(--soft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="pop"]):not([data-theme="pixel"]) .mode-art .tag { background: rgba(0, 0, 0, .35); color: var(--soft); } }
:root:not([data-theme="pop"]):not([data-theme="pixel"]) .btn.gold:hover { filter: brightness(1.04); }
:root:not([data-theme="pop"]):not([data-theme="pixel"]) .home-hero .btn.gold { box-shadow: 0 8px 24px rgba(255, 176, 32, .28); }

/* =========================================================================================
   SIGNATURE · pop — "dopamine 3D"
   Colour blocks, extruded toy buttons, rounded type, white text on saturated tiles.
   ========================================================================================= */
:root[data-theme="pop"] h1, :root[data-theme="pop"] h2, :root[data-theme="pop"] h3 { font-weight: 700; }
:root[data-theme="pop"] .btn { border: 0; font: 700 16px/1.2 var(--display); letter-spacing: .01em; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 5px 0 var(--btn-depth), 0 10px 18px rgba(124, 58, 237, .22); }
:root[data-theme="pop"] .btn:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 1px 0 var(--btn-depth); }
:root[data-theme="pop"] .btn.gold { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 5px 0 var(--gold-depth), 0 10px 18px rgba(255, 140, 0, .28); }
:root[data-theme="pop"] .btn.gold:active { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 1px 0 var(--gold-depth); }
:root[data-theme="pop"] .btn.ghost { border: 2px solid var(--ghost-line); box-shadow: 0 4px 0 var(--ghost-line); }
:root[data-theme="pop"] .btn.ghost:active { box-shadow: 0 1px 0 var(--ghost-line); }
:root[data-theme="pop"] .btn.big { font-size: 19px; min-height: 60px; }
:root[data-theme="pop"] .home-hero { box-shadow: 0 10px 0 #d9407a, 0 26px 50px rgba(255, 79, 154, .35); }
:root[data-theme="pop"] .home-hero::after { content: ""; position: absolute; right: -70px; top: -80px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .14); pointer-events: none; }
:root[data-theme="pop"] .depth-ladder li:last-child b { color: #fff; text-shadow: 0 2px 0 rgba(160, 60, 0, .35); }
:root[data-theme="pop"] .hh-meta { font-weight: 700; }
:root[data-theme="pop"] .depth-ladder .tier-ico { background: rgba(255, 255, 255, .92); border-radius: 50%; padding: 3px; box-shadow: 0 4px 0 rgba(120, 20, 60, .18); }
:root[data-theme="pop"] .depth-ladder::before { border-top: 3px dotted rgba(255, 255, 255, .55); }
/* mode tiles: the whole card is the colour */
:root[data-theme="pop"] .mode { border: 0; color: #fff; background: var(--c-practice); box-shadow: 0 7px 0 var(--m-practice), 0 16px 26px rgba(42, 22, 64, .16); }
:root[data-theme="pop"] .mode.blitz { background: var(--c-blitz); box-shadow: 0 7px 0 var(--m-blitz), 0 16px 26px rgba(42, 22, 64, .16); }
:root[data-theme="pop"] .mode.abyss { background: var(--c-abyss); box-shadow: 0 7px 0 var(--m-abyss), 0 16px 26px rgba(42, 22, 64, .16); }
:root[data-theme="pop"] .mode.archive { background: var(--c-archive); box-shadow: 0 7px 0 var(--m-archive), 0 16px 26px rgba(42, 22, 64, .16); }
:root[data-theme="pop"] .mode.geo { background: var(--c-geo); box-shadow: 0 7px 0 var(--m-geo), 0 16px 26px rgba(42, 22, 64, .16); }
:root[data-theme="pop"] .mode.sports { background: var(--c-sports); box-shadow: 0 7px 0 var(--m-sports), 0 16px 26px rgba(42, 22, 64, .16); }
:root[data-theme="pop"] .mode.movies { background: var(--c-movies); box-shadow: 0 7px 0 var(--m-movies), 0 16px 26px rgba(42, 22, 64, .16); }
:root[data-theme="pop"] .mode .mode-art { background: transparent !important; }
:root[data-theme="pop"] .mode-art::before { content: ""; position: absolute; width: 84px; height: 84px; border-radius: 50%; background: rgba(255, 255, 255, .25); }
:root[data-theme="pop"] .mode-body p { color: rgba(255, 255, 255, .9); }
:root[data-theme="pop"] .mode-stat { color: #fff; background: rgba(0, 0, 0, .14); align-self: flex-start; padding: 3px 10px; border-radius: 999px; }
:root[data-theme="pop"] .mode-art .tag { background: rgba(255, 255, 255, .92); color: var(--ink); }
:root[data-theme="pop"] .mode:hover { transform: translateY(-3px) rotate(-.6deg); }
:root[data-theme="pop"] .mode:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
:root[data-theme="pop"] .sec-title { font-size: 15px; letter-spacing: .02em; text-transform: none; color: var(--ink); font-weight: 700; }
:root[data-theme="pop"] .chip, :root[data-theme="pop"] .seg { border-width: 2px; }
:root[data-theme="pop"] .seg.on, :root[data-theme="pop"] .tab.on { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 3px 0 #5b21b6; }
:root[data-theme="pop"] .hero h1 em { background: linear-gradient(90deg, #ff4d9d, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="pop"] .home-hero h1 em { background: none; color: var(--hero-accent); }
:root[data-theme="pop"] .o2-bar > i { background: linear-gradient(90deg, #8b5cf6, #ec4899, #fb923c); }
:root[data-theme="pop"] .total b { background: linear-gradient(180deg, #ffb800, #ff4d9d); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="pop"] .pod .base { border: 0; border-radius: 14px 14px 6px 6px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .6), 0 4px 0 rgba(0, 0, 0, .1); }

/* =========================================================================================
   SIGNATURE · pixel — "16-bit RPG"
   Menu windows (navy, white frame, notched outline), A-buttons with bevel + bottom shade,
   steps() animation, a ▶ cursor on hover. Font sizes stay on the 12 px pixel grid where they can.
   ========================================================================================= */
:root[data-theme="pixel"] *, :root[data-theme="pixel"] *::before, :root[data-theme="pixel"] *::after { border-radius: 0 !important; }
:root[data-theme="pixel"] body { font-size: 16px; line-height: 1.5; -webkit-font-smoothing: none; }
:root[data-theme="pixel"] :is(h1, h2, h3, .screen-title, .prompt, .logo, .total b, .pts, .depth) { text-shadow: 2px 2px 0 var(--night); }
:root[data-theme="pixel"] .sec-title { font-size: 12px; letter-spacing: .08em; color: var(--yellow); text-shadow: 2px 2px 0 var(--night); }
:root[data-theme="pixel"] .sec-title::before { content: "▼ "; }
/* windows: navy panel, white frame, notched dark outline, hard shadow */
:root[data-theme="pixel"] :is(.panel, .mode, .prompt-card, .reveal, .summary, .about-inner, .site-foot, .abyss-hud, .blitz-hud > div, .stat, .lb-list, .lb-meta, .league-head, .league-ladder, .tabs, .hot-banner, .league-strip, .back, .tool, .perk-card, .lb-you, .lang-menu, .modal, .toast, .soon, .endless-hint) {
  background-color: var(--navy); border: 3px solid var(--white); box-shadow: var(--shadow);
}
:root[data-theme="pixel"] .hot-banner { background: var(--navy); }
:root[data-theme="pixel"] .lb-you.empty, :root[data-theme="pixel"] .soon { border-style: solid; border-color: var(--lgrey); }
:root[data-theme="pixel"] .lb-you { color: var(--yellow); }
:root[data-theme="pixel"] :is(.modes, .stats, .blitz-hud, .buddies) { gap: 16px; }
:root[data-theme="pixel"] .home { gap: 22px; }
:root[data-theme="pixel"] .home-board { border-color: var(--yellow); background: var(--navy); }
:root[data-theme="pixel"] .panel h2, :root[data-theme="pixel"] .hb-head h2 { font-size: 18px; }
/* hero: the start screen — banded sky window with a gold frame */
:root[data-theme="pixel"] .home-hero { border: 3px solid var(--yellow); box-shadow: var(--shadow-lg); background: linear-gradient(180deg, var(--blue) 0 34%, #3352b6 34% 60%, var(--navy) 60%); }
:root[data-theme="pixel"] .hh-meta { font-size: 12px; letter-spacing: .04em; }
:root[data-theme="pixel"] .hh-dive { background: var(--night); color: var(--yellow); padding: 2px 8px; }
:root[data-theme="pixel"] .home-hero h1 { font-size: clamp(27px, 7.6vw, 36px); line-height: 1.2; }
:root[data-theme="pixel"] .depth-ladder::before { border-top: 3px dashed rgba(244, 244, 244, .35); }
:root[data-theme="pixel"] .depth-ladder .tier-ico { background: var(--night); padding: 2px; box-shadow: var(--px-frame); }
:root[data-theme="pixel"] .depth-ladder b { font-size: 18px; }
:root[data-theme="pixel"] .depth-ladder small { font-size: 12px; }
:root[data-theme="pixel"] .home-hero .btn.big::before { content: "▶"; animation: px-blink 1s steps(1) infinite; }
@keyframes px-blink { 50% { opacity: 0; } }
/* buttons: face + light top bevel + dark bottom shade inside a notched outline; pressing drops 3px */
:root[data-theme="pixel"] .btn {
  border: 0; font: 400 16px/1.2 var(--sans); letter-spacing: .02em; transition: none; padding-bottom: 13px;
  box-shadow: inset 0 calc(-1 * var(--px) - 1px) 0 0 var(--btn-depth), inset 0 var(--px) 0 0 rgba(255, 255, 255, .45), var(--px-frame), var(--px) var(--px) 0 var(--px) rgba(15, 16, 27, .5);
}
:root[data-theme="pixel"] .btn.gold { box-shadow: inset 0 calc(-1 * var(--px) - 1px) 0 0 var(--gold-depth), inset 0 var(--px) 0 0 rgba(255, 255, 255, .55), var(--px-frame), var(--px) var(--px) 0 var(--px) rgba(15, 16, 27, .5); }
:root[data-theme="pixel"] .btn.ghost { box-shadow: inset 0 calc(-1 * var(--px) - 1px) 0 0 var(--night), inset 0 var(--px) 0 0 rgba(255, 255, 255, .15), var(--px-frame), var(--px) var(--px) 0 var(--px) rgba(15, 16, 27, .5); }
:root[data-theme="pixel"] .btn:hover { filter: brightness(1.1); }
:root[data-theme="pixel"] .btn:active { transform: translateY(var(--px)); box-shadow: inset 0 var(--px) 0 0 rgba(0, 0, 0, .2), var(--px-frame); }
:root[data-theme="pixel"] .btn.big { font-size: 18px; min-height: 58px; }
:root[data-theme="pixel"] .btn.small { font-size: 14px; }
/* tabs, chips, segments */
:root[data-theme="pixel"] :is(.seg, .tab) { border: 3px solid var(--night); background: var(--slate); color: var(--white); font-weight: 400; }
:root[data-theme="pixel"] :is(.seg.on, .tab.on) { background: var(--yellow); color: var(--night); border-color: var(--night); }
:root[data-theme="pixel"] .tabs { padding: 6px; gap: 6px; }
:root[data-theme="pixel"] .chip { border: 3px solid var(--slate); background: var(--night); box-shadow: none; font-weight: 400; }
:root[data-theme="pixel"] .chip.icon { font-family: var(--sans); }
:root[data-theme="pixel"] .chip.fire { color: var(--orange); border-color: var(--orange); }
:root[data-theme="pixel"] .lang-chip span { font-size: 15px; font-weight: 400; }
:root[data-theme="pixel"] .lang-menu a { font-weight: 400; }
:root[data-theme="pixel"] .lang-menu a:hover::before, :root[data-theme="pixel"] .lang-menu a:focus-visible::before { content: "▶ "; color: var(--yellow); }
:root[data-theme="pixel"] .lang-menu a.on::after { content: ""; }
/* HUD + tab bar */
:root[data-theme="pixel"] #hud { box-shadow: 0 var(--px) 0 var(--slate); backdrop-filter: none; -webkit-backdrop-filter: none; }
:root[data-theme="pixel"] .logo { font: 400 22px/1 var(--display); }
:root[data-theme="pixel"] .logo b { color: var(--yellow); }
:root[data-theme="pixel"] #tabbar { border-top: var(--px) solid var(--slate); backdrop-filter: none; -webkit-backdrop-filter: none; }
:root[data-theme="pixel"] #tabbar a { font-size: 12px; }
:root[data-theme="pixel"] #tabbar a.on { background: transparent; color: var(--yellow); font-weight: 400; box-shadow: inset 0 calc(-1 * var(--px)) 0 var(--yellow); }
/* mode cards: the art tile is the mode's colour, the ▶ cursor appears on the title */
:root[data-theme="pixel"] .mode-art { border-bottom: 3px solid var(--white); background-image: linear-gradient(180deg, rgba(255, 255, 255, .12) 0 30%, transparent 30% 60%, rgba(0, 0, 0, .12) 60%) !important; }
:root[data-theme="pixel"] .mode.wide .mode-art { border-bottom: 0; border-right: 3px solid var(--white); }
:root[data-theme="pixel"] .mode-art .tier-ico { animation: px-idle 1.1s steps(1) infinite; }
:root[data-theme="pixel"] .mode:hover .mode-art .tier-ico { transform: none; }
@keyframes px-idle { 50% { transform: translateY(-3px); } }
:root[data-theme="pixel"] .mode-art .tag { background: var(--night); color: var(--yellow); font-size: 12px; letter-spacing: .02em; font-weight: 400; }
:root[data-theme="pixel"] .mode-body h2 { font-size: 18px; }
:root[data-theme="pixel"] .mode-body p { font-size: 13px; color: var(--soft); }
:root[data-theme="pixel"] .mode-stat { color: var(--yellow); font-size: 13px; }
:root[data-theme="pixel"] .mode:hover { transform: translate(-2px, -2px); }
:root[data-theme="pixel"] .mode:hover .mode-body h2::before { content: "▶ "; color: var(--yellow); }
:root[data-theme="pixel"] .mode:active { transform: translate(2px, 2px); box-shadow: var(--px-frame); }
/* bars and pips: chunky blocks */
:root[data-theme="pixel"] :is(.o2-bar, .xpbar, .combo-bar, .pips i) { box-shadow: 0 0 0 3px var(--night); }
:root[data-theme="pixel"] .o2-bar { height: 14px; }
:root[data-theme="pixel"] :is(.o2-bar > i, .xpbar > i, .combo-bar > i) { -webkit-mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 12px); mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 12px); }
:root[data-theme="pixel"] .o2-bar > i { background: var(--cyan); }
:root[data-theme="pixel"] .o2-bar.low > i { background: #ff7d8c; }
:root[data-theme="pixel"] .o2.buffered .o2-bar > i { background: var(--lime); }
:root[data-theme="pixel"] .pips i { height: 12px; }
/* inputs: sunken black wells */
:root[data-theme="pixel"] :is(input.answer, input.text) { border: 3px solid var(--lgrey); box-shadow: inset var(--px) var(--px) 0 rgba(0, 0, 0, .45); font-family: var(--sans); font-weight: 400; }
:root[data-theme="pixel"] input.answer { font-size: 18px; }
:root[data-theme="pixel"] input.answer:focus { border-color: var(--yellow); box-shadow: inset var(--px) var(--px) 0 rgba(0, 0, 0, .45); }
/* podium: solid bevelled blocks */
:root[data-theme="pixel"] .pod .base { border: 0; color: var(--night); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), inset 0 3px 0 rgba(255, 255, 255, .45), var(--px-frame); }
:root[data-theme="pixel"] .pod.p1 .base { background: var(--yellow); }
:root[data-theme="pixel"] .pod.p2 .base { background: var(--lgrey); }
:root[data-theme="pixel"] .pod.p3 .base { background: var(--orange); }
:root[data-theme="pixel"] .live { color: #ff7d8c; border: 3px solid #ff7d8c; font-weight: 400; }
:root[data-theme="pixel"] .live i { box-shadow: none; background: #ff7d8c; animation: px-blink 1s steps(1) infinite; }
:root[data-theme="pixel"] .lb-row { border-top: 3px solid var(--slate); }
:root[data-theme="pixel"] * { font-style: normal !important; } /* a bitmap font has no italic; synthetic slant smears it */
:root[data-theme="pixel"] .lb-score { color: var(--cyan); }
:root[data-theme="pixel"] .hb-line { color: var(--yellow); font-weight: 400; }
/* reveal: the sprite drops in on a few frames and glows in its tier colour */
:root[data-theme="pixel"] :is(.reveal-icon, .sum-icon) > * { animation-timing-function: steps(7, end); filter: drop-shadow(0 0 14px color-mix(in srgb, var(--tc, var(--accent)) 45%, transparent)); }
:root[data-theme="pixel"] .reveal.t-krillion { border-color: var(--cyan); }
:root[data-theme="pixel"] .quip { border-left: var(--px) solid var(--tc); background: var(--night); }
:root[data-theme="pixel"] :is(.badge, .breakdown span, .buffer-badge, .perk, .zone, .buddy, .ach, .gem, .games-list li, .howto-eg, .grid span) { background: var(--night); }
:root[data-theme="pixel"] .toast.gold { color: var(--yellow); border-color: var(--yellow); }
:root[data-theme="pixel"] .theme-pick button { border: 3px solid var(--slate); background: var(--night); color: var(--white); font-weight: 400; }
:root[data-theme="pixel"] .theme-pick button.on { border-color: var(--yellow); color: var(--yellow); background: var(--night); }
:root[data-theme="pixel"] .theme-pick .sw i { border: 2px solid var(--night); }
:root[data-theme="pixel"] .hero h1 em, :root[data-theme="pixel"] .home-hero h1 em { color: var(--yellow); }
:root[data-theme="pixel"] .about h3 { color: var(--cyan); }
:root[data-theme="pixel"] .faq details, :root[data-theme="pixel"] .quest, :root[data-theme="pixel"] .set-row, :root[data-theme="pixel"] .archive-day, :root[data-theme="pixel"] .recap li { border-top: 3px solid var(--slate); }
:root[data-theme="pixel"] .quest .q-check { border: 3px solid var(--lgrey); }
:root[data-theme="pixel"] a:not(.btn):not(.mode):not(.logo):not(.chip):not(.league-strip):not(.hot-banner):hover { color: var(--yellow); }

/* =========================================================================================
   RESPONSIVE
   ========================================================================================= */
/* compact top bar up to 600px (the full one needs ~520px): room for the wordmark + language / style
   switches. The league badge lives on home and the Rankings tab, the freeze count in the streak tooltip
   and on the profile, the XP bar on the profile. */
@media (max-width: 600px) {
  #hud .xpbar, #hud .chip.league, #hud .chip > small { display: none; }
}
@media (max-width: 400px) {
  .logo { font-size: 17px; }
  .logo .tier-ico { width: 24px; height: 24px; }
  .chip { padding: 2px 7px; }
  .hud-right { gap: 4px; }
  .chip.icon { min-width: 30px; padding: 2px 5px; }
  .hot-emoji { font-size: 36px; }
  .tool { padding: 8px 10px; font-size: 13px; }
  .tool.quiet { margin-left: 0; }
  .howto-tiers small { display: none; }
  .home-hero { padding: 18px 14px 16px; }
  .hh-cta .btn.big { flex-basis: 100%; } /* long labels (ja, es) keep one line; the guide link goes underneath */
  .mode.wide .mode-art { flex-basis: 34%; }
  :root[data-theme="pixel"] .logo { font-size: 19px; }
  :root[data-theme="pixel"] :is(.modes, .stats, .buddies) { gap: 14px; }
}
@media (max-width: 340px) {
  .modes { grid-template-columns: 1fr; }
  .logo span { display: none; }
  .stats, .buddies { grid-template-columns: repeat(2, 1fr); }
  .achs { grid-template-columns: 1fr; }
  .zones { grid-template-columns: repeat(3, 1fr); }
  .depth-ladder small { display: none; }
}
/* phones in landscape: little height, keep the input in view */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --tabbar-h: calc(40px + env(safe-area-inset-bottom)); }
  #tabbar a { min-height: 36px; font-size: 0; }
  #tabbar a span { font-size: 18px; }
  .prompt-card { padding: 10px 14px; margin-bottom: 8px; }
  .reveal-icon > *, .sum-icon > * { width: 64px !important; }
}
/* desktop: the navigation moves into the header, home becomes two columns,
   game screens stay a focused 640 px column */
@media (min-width: 1024px) {
  :root { --gap: 22px; --tabbar-h: 0px; }
  #app { max-width: 1160px; padding-bottom: 40px; }
  #hud { min-height: 64px; }
  #screen:not(.screen-home), .about, .site-foot { max-width: 680px; margin-inline: auto; }
  /* sits right after the logo, clear of the chips on the right */
  #tabbar { top: 0; bottom: auto; left: calc(max(0px, (100vw - 1160px) / 2) + var(--gutter) + 150px); transform: none; height: 64px; width: auto; display: flex; gap: 2px; align-items: center; padding: 0; background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
  #tabbar a { flex-direction: row; gap: 6px; min-height: 40px; padding: 0 10px; font-size: 14px; font-weight: 600; }
  #tabbar a span { font-size: 17px; }
  :root[data-theme="pixel"] #tabbar { border: 0; }
  :root[data-theme="pixel"] #tabbar a { font-size: 15px; }
  #toasts { top: 76px; }
  .home { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: var(--gap); }
  .home-main, .home-side { display: flex; flex-direction: column; gap: var(--gap); }
  .home-side { position: sticky; top: 84px; }
  .home-hero { padding: 30px 30px 28px; }
  .home-hero h1 { font-size: 44px; }
  :root[data-theme="pixel"] .home-hero h1 { font-size: 36px; }
  .depth-ladder small { font-size: 12px; }
  .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .mode.wide .mode-art { min-height: 150px; }
  .hero h1 { font-size: 36px; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  #tabbar a { padding: 0 10px; }
  #tabbar a span { display: none; }
  #hud .xpbar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
