/* Vad tänker jag på? — one glowing mind, twenty questions. */

@font-face { font-family: "Bricolage"; src: url("/fonts/bricolage-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Bricolage"; src: url("/fonts/bricolage-latin-ext.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF; }

:root {
    color-scheme: light;
    --paper: #f6f2ec;
    --paper-2: #ece5da;
    --card: #fffdf9;
    --ink: #1c1729;
    --ink-2: #4a4458;
    --muted: #8a8396;
    --line: #e5ddd0;
    --accent: #6d4aff;
    --ja: #0f9f6b;
    --nej: #ec4a3a;
    --oftast: #46b98a;
    --oftast-inte: #f08060;
    --ibland: #eda100;
    --nara: #9b4dff;
    --gray: #a29bb0;
    --ring-track: rgba(28, 23, 41, 0.1);
    --orb-a: #7d5bff;
    --orb-b: #ff6fb5;
    --orb-c: #ffb547;
    --orb-d: #35c9c1;
    --orb-glow: rgba(125, 91, 255, 0.55);
    --shadow: 0 1px 0 rgba(28, 23, 41, 0.04), 0 18px 40px -20px rgba(28, 23, 41, 0.35);
    --spring: cubic-bezier(0.2, 1.5, 0.4, 1);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font: "Bricolage", "Avenir Next", "Segoe UI", system-ui, sans-serif;
    --orb: clamp(96px, 25dvh, 220px);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
        --paper: #131020; --paper-2: #1c1730; --card: #1d182e; --ink: #f5f1ff; --ink-2: #cdc4e0; --muted: #8f87a6; --line: #2d2643;
        --ring-track: rgba(255, 255, 255, 0.1); --shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 20px 50px -20px rgba(0, 0, 0, 0.7);
        --nej: #ff6253; --ja: #23c486; --oftast-inte: #ff8d6b;
    }
}
:root[data-theme="natt"] {
    color-scheme: dark;
    --paper: #131020; --paper-2: #1c1730; --card: #1d182e; --ink: #f5f1ff; --ink-2: #cdc4e0; --muted: #8f87a6; --line: #2d2643;
    --ring-track: rgba(255, 255, 255, 0.1); --shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 20px 50px -20px rgba(0, 0, 0, 0.7);
    --nej: #ff6253; --ja: #23c486; --oftast-inte: #ff8d6b;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    min-width: 320px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(36rem 28rem at 50% -8%, color-mix(in oklab, var(--orb-a) 20%, transparent), transparent 70%),
        radial-gradient(30rem 24rem at 110% 30%, color-mix(in oklab, var(--orb-b) 12%, transparent), transparent 70%),
        radial-gradient(30rem 24rem at -10% 80%, color-mix(in oklab, var(--orb-d) 10%, transparent), transparent 70%);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Frame ---------- */

.app { display: flex; flex-direction: column; width: 100%; max-width: 540px; height: 100dvh; margin: 0 auto; padding: max(6px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
.topbar { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 8px; height: 52px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; flex: none; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff9 0 14%, transparent 30%), radial-gradient(circle at 70% 72%, var(--orb-c), transparent 55%), radial-gradient(circle at 25% 70%, var(--orb-b), transparent 60%), var(--orb-a); box-shadow: 0 6px 14px -6px var(--orb-glow); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.brand-name { overflow: hidden; font-size: 18px; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; text-overflow: ellipsis; }
.brand-partner { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 750; }
.top-actions { display: flex; gap: 2px; }
.icon-btn { display: grid; width: 40px; height: 44px; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: color-mix(in oklab, var(--ink) 7%, transparent); color: var(--ink); }
.icon-sound-off, [aria-pressed="false"] .icon-sound-on { display: none; }
[aria-pressed="false"] .icon-sound-off { display: block; }
#toggle-theme .icon-sun, #toggle-theme[aria-pressed="true"] .icon-moon { display: none; }
#toggle-theme[aria-pressed="true"] .icon-sun { display: block; }
.main { position: relative; display: flex; flex: 1; flex-direction: column; min-height: 0; }
.footer { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; padding: 6px 0 0; font-size: 12px; }
.footer a { color: var(--muted); text-decoration: none; }
.lang-switch { display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: color-mix(in oklab, var(--ink) 6%, transparent); }
.lang-switch button { min-height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; }
.lang-switch button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
:root[data-embed] .lang-switch { display: none; }
body[data-state="playing"] .footer { display: none; }
body[data-state="start"] .main, body[data-state="result"] .main { justify-content: center; }
body[data-state="start"] .panel { flex: none; padding: 8px 0 12px; }

/* ---------- The orb ---------- */

.stage { display: flex; flex: none; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 4px; }
.orb-wrap { position: relative; display: grid; width: calc(var(--orb) * 1.22); aspect-ratio: 1; place-items: center; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.seg { fill: none; stroke: var(--ring-track); stroke-width: 3.6; stroke-linecap: round; transition: stroke 0.4s var(--ease); }
.seg.is-next { stroke: color-mix(in oklab, var(--accent) 45%, var(--ring-track)); animation: next-pulse 1.6s ease-in-out infinite; }
.seg.is-used { animation: seg-in 0.55s var(--ease) both; }
.seg.is-bonus { stroke: color-mix(in oklab, var(--accent) 55%, #fff); animation: bonus 0.5s var(--ease) both; }
.seg.t-ja { stroke: var(--ja); } .seg.t-nej { stroke: var(--nej); } .seg.t-oftast { stroke: var(--oftast); } .seg.t-oftast-inte { stroke: var(--oftast-inte); }
.seg.t-ibland { stroke: var(--ibland); } .seg.t-nara { stroke: var(--nara); } .seg.t-ratt { stroke: var(--accent); }
.orb {
    position: relative;
    width: var(--orb);
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 50%;
    background:
        radial-gradient(circle at 70% 74%, var(--orb-c) 0, transparent 46%),
        radial-gradient(circle at 24% 68%, var(--orb-b) 0, transparent 52%),
        radial-gradient(circle at 62% 26%, var(--orb-d) 0, transparent 40%),
        var(--orb-a);
    box-shadow: inset -12px -16px 34px rgba(20, 0, 60, 0.28), inset 10px 12px 26px rgba(255, 255, 255, 0.32), 0 24px 60px -22px var(--orb-glow);
    animation: breathe 5.5s ease-in-out infinite;
    transition: filter 0.5s var(--ease), transform 0.5s var(--ease);
}
.orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 50%, var(--flash, transparent) 0, transparent 72%); opacity: 0; mix-blend-mode: screen; }
.orb.is-flash::after { animation: flash 0.9s var(--ease); }
.orb-swirl { position: absolute; inset: -35%; background: conic-gradient(from 0deg, transparent 0 8%, rgba(255, 255, 255, 0.5) 14%, transparent 24% 40%, rgba(255, 120, 200, 0.55) 48%, transparent 58% 72%, rgba(90, 220, 255, 0.45) 80%, transparent 90%); filter: blur(16px); mix-blend-mode: soft-light; animation: swirl 10s linear infinite; }
.orb-shine { position: absolute; top: 9%; left: 18%; width: 34%; height: 22%; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.75), transparent 70%); transform: rotate(-24deg); }
.orb-center { position: absolute; display: flex; flex-direction: column; align-items: center; color: #fff; text-align: center; pointer-events: none; text-shadow: 0 2px 12px rgba(30, 0, 70, 0.45); }
.orb-count { font-size: calc(var(--orb) * 0.36); font-weight: 850; letter-spacing: -0.05em; line-height: 0.95; font-variant-numeric: tabular-nums; }
.orb-label { font-size: clamp(11px, calc(var(--orb) * 0.075), 15px); font-weight: 750; opacity: 0.92; }
.orb-count.is-tick { animation: tick 0.45s var(--spring); }
body.is-thinking .orb-swirl { animation-duration: 1.4s; }
body.is-thinking .orb { animation: think 1.1s ease-in-out infinite; }
body.is-low .orb-label { color: #fff2c9; }
body[data-state="result"] .orb.is-won { animation: won 0.9s var(--spring) both; }
body[data-state="result"] .orb.is-lost { filter: saturate(0.35) brightness(0.92); }
body[data-state="playing"] { --orb: clamp(84px, 19dvh, 176px); }
/* A close guess warms the mind: a soft amber halo that stays for the round. */
.orb.is-warm { box-shadow: inset -12px -16px 34px rgba(20, 0, 60, 0.28), inset 10px 12px 26px rgba(255, 255, 255, 0.32), 0 0 0 3px color-mix(in oklab, var(--orb-c) 70%, transparent), 0 0 42px 6px color-mix(in oklab, var(--orb-c) 55%, transparent); }

/* ---------- Latest answer ---------- */

.latest { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; padding: 0 8px 6px; text-align: center; }
.latest-question { margin: 0; overflow: hidden; max-width: 100%; color: var(--ink-2); font-size: 15px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.latest-answer { margin: 0; font-size: clamp(30px, 8vw, 40px); font-weight: 850; letter-spacing: -0.035em; line-height: 1.05; }
.latest-answer.is-new { animation: answer-pop 0.5s var(--spring); }
.latest-answer.is-wait { color: var(--muted); font-size: 22px; font-weight: 700; }
.latest-answer.is-wait::after { content: "…"; display: inline-block; width: 1.2em; text-align: left; animation: dots 1s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
.latest-note { margin: 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.c-ja { color: var(--ja); } .c-nej { color: var(--nej); } .c-oftast { color: var(--oftast); } .c-oftast-inte { color: var(--oftast-inte); }
.c-ibland { color: var(--ibland); } .c-nara { color: var(--nara); } .c-ratt { color: var(--accent); } .c-gray { color: var(--gray); font-size: 22px !important; }

/* ---------- Panels ---------- */

.panel { display: flex; flex: 1; flex-direction: column; min-height: 0; animation: panel-in 0.45s var(--ease) both; }
.start-panel { align-items: center; justify-content: center; gap: 12px; text-align: center; }
.start-title { margin: 0; font-size: clamp(30px, 8.5vw, 42px); font-weight: 850; letter-spacing: -0.045em; line-height: 1; }
.start-lead { max-width: 340px; margin: 0 0 6px; color: var(--ink-2); font-size: 17px; line-height: 1.45; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 16px; font-size: 16px; font-weight: 800; text-decoration: none; white-space: nowrap; transition: transform 0.12s, box-shadow 0.12s, background 0.2s; }
.btn:active { transform: translateY(2px); }
.btn svg { width: 19px; height: 19px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 color-mix(in oklab, var(--accent) 62%, #000), 0 12px 24px -12px var(--accent); }
.btn-primary:active { box-shadow: 0 2px 0 color-mix(in oklab, var(--accent) 62%, #000); }
.btn-soft { background: color-mix(in oklab, var(--ink) 7%, transparent); color: var(--ink); }
.btn-big { flex-direction: column; gap: 0; width: 100%; max-width: 320px; min-height: 62px; border-radius: 20px; font-size: 18px; }
.btn-kicker { font-size: 12px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.82; }
.btn-wide { width: 100%; }
.daily-done { margin: -2px 0 2px; color: var(--ink-2); font-size: 14px; font-weight: 700; }
.streak-chip { margin: -4px 0 0; padding: 5px 12px; border-radius: 999px; background: color-mix(in oklab, var(--orb-c) 18%, transparent); color: color-mix(in oklab, var(--orb-c) 45%, var(--ink)); font-size: 13.5px; font-weight: 800; }
.fineprint { max-width: 320px; margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }

/* ---------- Playing ---------- */

.play-panel { gap: 8px; }
/* The clue board: what it is, what it is not, and warm hints. */
.board { position: relative; display: flex; flex: 1; flex-direction: column; gap: 8px; min-height: 0; padding: 2px 2px 6px; overflow-y: auto; scrollbar-width: none; mask-image: linear-gradient(to bottom, #000 88%, transparent); }
.board.is-empty::before { content: attr(data-empty); margin: auto; color: var(--muted); font-size: 14px; font-weight: 650; text-align: center; }
.board.is-empty > * { display: none; }
.board ul { display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0; list-style: none; }
.board-warm:empty { display: none; }
.board-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.board-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.board-head { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0 4px; color: var(--muted); font-size: 11.5px; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.board-head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ja); }
.is-no .board-head::before { background: var(--nej); }
.board li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; padding: 7px 9px; border-radius: 12px; background: var(--card); box-shadow: 0 1px 0 var(--line); font-size: 14px; font-weight: 650; line-height: 1.3; }
.is-yes li { box-shadow: inset 3px 0 0 var(--ja), 0 1px 0 var(--line); }
.is-no li { box-shadow: inset 3px 0 0 var(--nej), 0 1px 0 var(--line); }
.board-warm li { background: color-mix(in oklab, var(--nara) 10%, var(--card)); box-shadow: inset 3px 0 0 var(--nara), 0 1px 0 var(--line); }
.board li.is-new { animation: clue-in 0.55s var(--spring) both; }
.board li.is-echo { animation: clue-echo 1.2s ease-out; }
@keyframes clue-echo { 0%, 40% { box-shadow: 0 0 0 2px var(--accent), 0 1px 0 var(--line); } 100% { box-shadow: 0 0 0 0 transparent, 0 1px 0 var(--line); } }
.b-n { color: var(--muted); font-size: 11.5px; font-weight: 850; font-variant-numeric: tabular-nums; }
.b-q { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.b-tag { padding: 1px 7px; border-radius: 999px; background: color-mix(in oklab, var(--ink) 7%, transparent); color: var(--ink-2); font-size: 11.5px; font-weight: 800; }
.b-ibland .b-tag { background: color-mix(in oklab, var(--ibland) 20%, transparent); color: color-mix(in oklab, var(--ibland) 70%, var(--ink)); }
.b-nara .b-tag { background: color-mix(in oklab, var(--nara) 16%, transparent); color: var(--nara); }
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 850; white-space: nowrap; }
.a-ja { background: color-mix(in oklab, var(--ja) 16%, transparent); color: var(--ja); }
.a-nej { background: color-mix(in oklab, var(--nej) 14%, transparent); color: var(--nej); }
.a-oftast { background: color-mix(in oklab, var(--oftast) 16%, transparent); color: color-mix(in oklab, var(--oftast) 80%, var(--ink)); }
.a-oftast-inte { background: color-mix(in oklab, var(--oftast-inte) 16%, transparent); color: color-mix(in oklab, var(--oftast-inte) 85%, var(--ink)); }
.a-ibland { background: color-mix(in oklab, var(--ibland) 20%, transparent); color: color-mix(in oklab, var(--ibland) 70%, var(--ink)); }
.a-nara { background: color-mix(in oklab, var(--nara) 16%, transparent); color: var(--nara); }
.a-ratt { background: var(--accent); color: #fff; }
.a-gray { background: color-mix(in oklab, var(--ink) 7%, transparent); color: var(--muted); }
.starters { display: flex; flex: none; justify-content: safe center; gap: 6px; margin: 0 -14px; padding: 2px 14px; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
.starters::-webkit-scrollbar { display: none; }
.chip { flex: none; }
.chip { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink-2); font-size: 14px; font-weight: 650; animation: row-in 0.4s var(--ease) both; }
.chip:active { transform: scale(0.97); }
.ask { position: relative; display: flex; flex: none; align-items: center; gap: 8px; padding: 6px; border: 2px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: var(--shadow); transition: border-color 0.2s; }
.ask:focus-within { border-color: color-mix(in oklab, var(--accent) 55%, var(--line)); }
.ask input { flex: 1; min-width: 0; height: 46px; padding: 0 10px; border: 0; background: transparent; font-size: 17px; font-weight: 600; outline: none; }
.ask input::placeholder { color: var(--muted); font-weight: 500; }
.char-left { color: var(--muted); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.send { display: grid; width: 46px; height: 46px; flex: none; place-items: center; border: 0; border-radius: 16px; background: var(--accent); color: #fff; box-shadow: 0 3px 0 color-mix(in oklab, var(--accent) 60%, #000); transition: transform 0.12s, opacity 0.2s; }
.send:active { transform: translateY(2px); box-shadow: none; }
.send:disabled { opacity: 0.45; }
.ask.is-shake { animation: shake 0.4s ease-out; }

/* ---------- Result ---------- */

.result-panel { align-items: center; gap: 10px; padding-bottom: 6px; overflow-y: auto; text-align: center; scrollbar-width: none; }
.eyebrow { margin: 0; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.word-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.word-tiles span { display: grid; width: clamp(34px, 9vw, 46px); height: clamp(42px, 11vw, 54px); place-items: center; border-radius: 12px; background: var(--accent); box-shadow: 0 4px 0 color-mix(in oklab, var(--accent) 60%, #000); color: #fff; font-size: clamp(22px, 6vw, 28px); font-weight: 850; animation: tile-flip 0.6s var(--ease) both; }
.word-tiles.is-lost span { background: var(--card); box-shadow: 0 4px 0 var(--line); color: var(--ink); }
.result-title { margin: 4px 0 0; font-size: clamp(26px, 7vw, 34px); font-weight: 850; letter-spacing: -0.04em; line-height: 1.05; }
.result-lead { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.trail { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 300px; }
.trail i { width: 13px; height: 13px; border-radius: 4px; animation: dot-in 0.35s var(--spring) both; }
.trail .t-ja { background: var(--ja); } .trail .t-nej { background: var(--nej); } .trail .t-oftast { background: var(--oftast); } .trail .t-oftast-inte { background: var(--oftast-inte); }
.trail .t-ibland { background: var(--ibland); } .trail .t-nara { background: var(--nara); } .trail .t-ratt { background: var(--accent); border-radius: 50%; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.result-stats { display: flex; justify-content: center; gap: 18px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.result-stats b { display: block; color: var(--ink); font-size: 20px; font-weight: 850; }
.countdown { margin: 0; color: var(--ink-2); font-size: 14px; font-weight: 700; }
.countdown b { font-variant-numeric: tabular-nums; }
.ad-slot { width: 100%; min-height: 0; margin-top: 6px; }
/* This week's chain: solved days show how many questions they took. */
.week-strip { display: flex; justify-content: center; gap: 8px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 800; }
.week-day i { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: color-mix(in oklab, var(--ink) 7%, transparent); color: #fff; font-size: 11.5px; font-style: normal; font-weight: 850; }
.week-day.is-won i { background: linear-gradient(135deg, var(--orb-a), var(--orb-b)); box-shadow: 0 4px 10px -5px var(--orb-glow); animation: dot-in 0.45s var(--spring) both; animation-delay: calc(var(--i) * 60ms + 400ms); }
.week-day.is-played i { background: color-mix(in oklab, var(--orb-a) 35%, transparent); }
.week-day.is-today i { box-shadow: inset 0 0 0 2px var(--accent); }
.week-day.is-future { opacity: 0.45; }
.best-ribbon { margin: 0; padding: 5px 14px; border-radius: 999px; background: linear-gradient(135deg, var(--orb-c), var(--orb-b)); color: #2b0f1d; font-size: 12.5px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; animation: answer-pop 0.6s var(--spring) both; }
.link-btn { min-height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }
.word-tiles span.is-space { width: 14px; background: transparent; box-shadow: none; }

/* ---------- Overlays ---------- */

.toast { position: fixed; top: calc(env(safe-area-inset-top) + 62px); left: 50%; z-index: 30; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 14px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 750; text-align: center; opacity: 0; transform: translate(-50%, -8px); pointer-events: none; transition: opacity 0.25s, transform 0.25s var(--ease); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; z-index: 40; width: 100vw; height: 100vh; pointer-events: none; }
.modal { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow-y: auto; border: 0; border-radius: 26px; background: transparent; color: var(--ink); scrollbar-width: none; }
.modal::backdrop { background: rgba(14, 10, 26, 0.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal[open] { animation: panel-in 0.35s var(--spring); }
.modal-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px 20px 20px; border-radius: 26px; background: var(--card); }
.modal-close { position: absolute; top: 10px; right: 10px; display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 12px; background: color-mix(in oklab, var(--ink) 6%, transparent); }
.modal-title { margin: 0; padding-right: 44px; font-size: 25px; font-weight: 850; letter-spacing: -0.035em; line-height: 1.1; }
.modal-text { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.modal-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in oklab, var(--ink) 5%, transparent); color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.steps { display: grid; gap: 8px; margin: 0 0 6px; padding-left: 20px; color: var(--ink-2); font-size: 14.5px; line-height: 1.45; }
.steps b { color: var(--ink); }
.legend { display: grid; gap: 8px; margin: 0 0 6px; padding: 0; list-style: none; color: var(--ink-2); font-size: 14px; }
.legend li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.theme-row { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 750; }
.theme-row span { margin-right: auto; }
.theme-row button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 13px; font-weight: 750; }
.theme-row button[aria-checked="true"], .theme-row button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat-grid div { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 14px; background: color-mix(in oklab, var(--ink) 5%, transparent); }
.stat-grid b { font-size: 24px; font-weight: 850; letter-spacing: -0.03em; }
.stat-grid span { color: var(--muted); font-size: 11.5px; font-weight: 700; text-align: center; }
.dist { display: grid; gap: 6px; }
.dist-row { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 8px; font-size: 13px; font-weight: 750; color: var(--ink-2); }
.dist-bar { min-width: 26px; padding: 3px 8px; border-radius: 8px; background: color-mix(in oklab, var(--accent) 22%, transparent); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.dist-bar.is-top { background: var(--accent); color: #fff; }

/* Publisher embeds: calmer frame, no extras. */
:root[data-embed] .app { padding-top: 4px; }
:root[data-embed] .ad-slot { display: none !important; }

/* ---------- Keyframes ---------- */

@keyframes swirl { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@keyframes think { 0%, 100% { transform: scale(0.97); } 50% { transform: scale(1.04); } }
@keyframes flash { 0% { opacity: 0; } 25% { opacity: 0.95; } 100% { opacity: 0; } }
@keyframes won { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes tick { 0% { transform: translateY(-30%); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes next-pulse { 50% { stroke: color-mix(in oklab, var(--accent) 80%, var(--ring-track)); } }
@keyframes bonus { from { stroke: var(--ring-track); stroke-width: 3.6; } 60% { stroke-width: 6; } to { stroke-width: 3.6; } }
@keyframes seg-in { from { stroke-dashoffset: 20; } to { stroke-dashoffset: 0; } }
@keyframes answer-pop { 0% { opacity: 0; transform: scale(0.6); } 60% { transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes dots { from { width: 0; } to { width: 1.2em; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes row-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes clue-in { 0% { opacity: 0; transform: translateY(-8px) scale(0.96); } 100% { opacity: 1; transform: none; } }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@keyframes tile-flip { 0% { opacity: 0; transform: rotateX(90deg) translateY(-8px); } 100% { opacity: 1; transform: none; } }
@keyframes dot-in { from { opacity: 0; transform: scale(0.2); } }

/* ---------- Space ---------- */

@media (max-height: 640px) {
    :root { --orb: clamp(80px, 20dvh, 150px); }
    .latest { min-height: 54px; }
    .latest-question { font-size: 13px; }
    .topbar { height: 46px; }
}
@media (max-height: 520px) {
    body[data-state="playing"] .latest-question { display: none; }
    body[data-state="playing"] .starters { display: none; }
}
@media (max-width: 440px) {
    .icon-btn { width: 36px; }
    .brand { gap: 8px; }
    .brand-name { display: -webkit-box; font-size: 16px; white-space: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (max-width: 360px) {
    .board-cols { gap: 6px; }
    .board li { padding: 6px 7px; font-size: 13px; }
    .lang-switch button { padding: 0 7px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Legal pages ---------- */

.legal-container { max-width: 720px; margin: 0 auto; padding: 32px 20px 60px; line-height: 1.6; }
.legal-header h1 { margin: 0; font-size: 34px; letter-spacing: -0.04em; }
.legal-date { color: var(--muted); }
.legal-section h2 { margin-top: 28px; font-size: 21px; letter-spacing: -0.02em; }
.legal-section h3 { font-size: 16px; }
.legal-section p, .legal-section li { color: var(--ink-2); }
.legal-container a { color: var(--accent); }
