/* =========================================================================
   Kvizarija - slogi
   Vse barve so žetoni (spremenljivke). Temna tema samo prepiše žetone.
   Ena drzna poteza: odgovori so otipljive ploščice s trdo senco, ki se ob
   pritisku "pogreznejo". Vse ostalo je umirjeno.
   ========================================================================= */

/* Pisavi (SIL Open Font License, public/fonts/README.md): Fredoka za naslove, številke in gumbe,
   Nunito za besedilo. Gostimo ju sami - brez klicev k drugim strežnikom (pravila zasebnosti). */
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("../fonts/fredoka-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("../fonts/fredoka-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 500 800; font-display: swap; src: url("../fonts/nunito-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 500 800; font-display: swap; src: url("../fonts/nunito-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    --bg: #E9EDF5;
    --surface: #FFFFFF;
    --surface-2: #F2F4F9;
    --ink: #18213A;
    --ink-soft: #5A6480;
    --line: #D3D9E6;

    --primary: #2F5BEA;
    --primary-ink: #FFFFFF;
    --accent: #FFC83D;        /* rumena "luč": timer, zmagovalec, izbran odgovor */
    --accent-ink: #3B2C00;
    --good: #0E9F6E;
    --bad: #E5484D;
    --warn: #E98A15;
    /* igralna kocka (telefon): slonokoščena s temnimi pikami v vseh temah */
    --die-bg: #FBF6EA;
    --die-ink: #1A2240;
    --die-edge: rgba(26, 34, 64, 0.28);
    --die-shadow: rgba(0, 0, 0, 0.45);

    /* Barve odgovorov A-D */
    --tile-a: #2F6BFF;
    --tile-b: #EE4D6A;
    --tile-c: #0FA36F;
    --tile-d: #8455F0;
    --tile-ink: #FFFFFF;

    --depth: rgba(24, 33, 58, 0.28);   /* trda senca pod ploščicami */
    --overlay: rgba(16, 22, 42, 0.55);

    --r-tile: 18px;
    --r-ctl: 12px;
    --r-panel: 24px;
    --gutter: 16px;

    --font: "Nunito", ui-rounded, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --font-head: "Fredoka", "Nunito", ui-rounded, system-ui, sans-serif;     /* naslovi, številke, gumbi */
    --t-xs: 0.8125rem;
    --t-sm: 0.9375rem;
    --t-md: 1.0625rem;
    --t-lg: 1.375rem;
    --t-xl: 1.75rem;
    --t-xxl: 2.5rem;
}

:root[data-theme="dark"] {
    --bg: #10162A;
    --surface: #1A2240;
    --surface-2: #232C4F;
    --ink: #EEF1FA;
    --ink-soft: #A3ACC6;
    --line: #2F3962;
    --primary: #5B82FF;
    --depth: rgba(0, 0, 0, 0.45);
    --overlay: rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #10162A;
        --surface: #1A2240;
        --surface-2: #232C4F;
        --ink: #EEF1FA;
        --ink-soft: #A3ACC6;
        --line: #2F3962;
        --primary: #5B82FF;
        --depth: rgba(0, 0, 0, 0.45);
        --overlay: rgba(0, 0, 0, 0.6);
    }
}

/* Tema "Božična noč": vklopi se sama, ko je v sobi izbran Večer z darili (data-mood="xmas" na
   <html>, nastavi lobby.js / tv.js). Nočna kot 3D plošča - velja ne glede na svetlo/temno temo,
   zato je za obema pravilom zgoraj in ima enako specifičnost. */
:root[data-mood="xmas"] {
    --bg: #0A1430;
    --surface: #15234A;
    --surface-2: #1D2E5D;
    --ink: #FBF6EA;
    --ink-soft: #B8C4E0;
    --line: #2E4380;
    --primary: #D93446;          /* božično rdeča */
    --primary-ink: #FFFFFF;
    --accent: #FFCB47;           /* zlata */
    --accent-ink: #3B2600;
    --good: #2DBE6C;
    --bad: #FF5A66;
    --warn: #FFA43A;
    --tile-a: #D93446;
    --tile-b: #1E9E5A;
    --tile-c: #2F6FDB;
    --tile-d: #8C52E0;
    --depth: rgba(0, 0, 0, 0.5);
    --overlay: rgba(2, 6, 20, 0.7);
    color-scheme: dark;
}
:root[data-mood="xmas"] body {
    background:
        radial-gradient(ellipse 120% 60% at 50% 0%, #1B3270 0%, transparent 70%),
        linear-gradient(180deg, #081128 0%, #0E1D45 55%, #13285A 100%) fixed;
}
/* sneženje: dve plasti pik v ozadju (samo CSS, brez dela za procesor) */
:root[data-mood="xmas"] body::before {
    content: ""; position: fixed; inset: -100px 0 0; z-index: -1; pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,.8) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 90px 120px, rgba(255,255,255,.6) 50%, transparent 51%),
        radial-gradient(2.5px 2.5px at 160px 60px, rgba(255,255,255,.7) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 60px 170px, rgba(255,255,255,.5) 50%, transparent 51%);
    background-size: 200px 200px;
}
:root[data-mood="xmas"] .panel, :root[data-mood="xmas"] .tv-side, :root[data-mood="xmas"] .tv-head {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
:root[data-mood="xmas"] .panel { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent), 0 18px 40px rgba(0, 0, 0, .35); }
@media (prefers-reduced-motion: no-preference) {
    :root[data-mood="xmas"] body::before { animation: xmas-snow 18s linear infinite; }
}
@keyframes xmas-snow { from { background-position: 0 0; } to { background-position: 40px 200px; } }

/* ---------- Osnova ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Brez "potegni za osvežitev" sredi igre (Chrome na Androidu bi stran naložil znova) */
html, body { overscroll-behavior-y: none; }

/* Brez zakasnitve dvojnega dotika (povečava) na gumbih in poljih */
button, a, input, label, [data-action] { touch-action: manipulation; }

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--t-md);
    line-height: 1.45;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
b { font-weight: 700; }

:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.muted { color: var(--ink-soft); font-size: var(--t-sm); }
.center-text { text-align: center; }
.lead { color: var(--ink-soft); }
.hint { color: var(--ink-soft); font-size: var(--t-xs); margin-top: -4px; }
.error { color: var(--bad); font-size: var(--t-sm); min-height: 1.2em; }

/* Prekinjena povezava (telefon v avtu): na vrhu, ne prekriva odgovorov spodaj */
.conn-banner {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 8px var(--gutter);
    background: var(--bad);
    color: #fff;
    font-size: var(--t-sm);
    font-weight: 700;
    text-align: center;
}
.error:empty { min-height: 0; }
.empty { color: var(--ink-soft); font-size: var(--t-sm); padding: 8px 0; }

/* ---------- Ogrodje ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 640px;
    margin: 0 auto;
    padding: max(10px, env(safe-area-inset-top)) var(--gutter) 6px;
}

.brand { font-weight: 800; letter-spacing: -0.01em; }
.brand-mark { margin-right: 2px; }
.topbar-actions { display: flex; gap: 6px; }

.icon-btn {
    width: 40px; height: 40px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.app {
    max-width: 640px;
    margin: 0 auto;
    padding: 8px var(--gutter) calc(96px + env(safe-area-inset-bottom));
}

.screen { display: none; }
.screen.active { display: block; animation: enter 0.22s ease-out; }

@keyframes enter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
    padding: 24px;
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.center { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding-block: 48px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.section { display: flex; flex-direction: column; gap: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-title { font-size: var(--t-md); font-weight: 750; }

/* ---------- Tipografija faz ---------- */

.home-title { font-size: var(--t-xl); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.phase-title { font-size: var(--t-lg); font-weight: 800; letter-spacing: -0.01em; }
.phase-label { color: var(--ink-soft); font-size: var(--t-sm); font-weight: 600; }
.phase-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Gumbi ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 18px;
    border: 0;
    border-radius: var(--r-ctl);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-big { min-height: 56px; font-size: var(--t-lg); }
.btn-small { min-height: 38px; padding: 6px 14px; font-size: var(--t-sm); }

.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 3px 0 var(--depth); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn-secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-google { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.google-icon { width: 18px; height: 18px; }

/* dolžina večera (Večer z darili): ime + približen čas v dveh vrsticah */
.seg-two-line { display: flex; flex-direction: column; align-items: center; gap: 0; line-height: 1.2; }
.seg-two-line small { font-size: var(--t-xs); font-weight: 600; opacity: 0.8; }

/* povezavi na pravila zasebnosti in pogoje (legal/) pod začetno kartico */
.legal-links { margin: 12px 0 0; text-align: center; font-size: var(--t-xs); color: var(--ink-soft); }
.legal-links a { color: inherit; }

.link-btn {
    border: 0;
    background: none;
    padding: 4px 2px;
    color: var(--primary);
    font-size: var(--t-sm);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

/* ---------- Vnosna polja ---------- */

.field-label { font-weight: 700; font-size: var(--t-sm); }

.input {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 2px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--surface-2);
    font-size: var(--t-md); /* >= 16px: iOS ob fokusu ne poveča strani */
}
.input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.input:disabled { opacity: 0.6; }
.input-big { min-height: 56px; font-size: var(--t-lg); font-weight: 600; }
.input-code {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.input-number { text-align: center; font-weight: 700; padding-inline: 6px; }
.input-anagram { text-align: center; text-transform: uppercase; letter-spacing: 0.12em; }
.input-anagram.correct { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--surface)); }
.input-anagram.wrong { border-color: var(--bad); animation: nudge 0.35s; }
.input-anagram.reveal-answer { border-color: var(--warn); color: var(--warn); }

.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

/* ---------- Začetni zaslon ---------- */

.auth-block { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }

.greeting-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.greeting { font-size: var(--t-lg); font-weight: 800; }
.greeting-links { display: flex; gap: 12px; }

.invite {
    padding: 14px;
    border-radius: var(--r-ctl);
    background: color-mix(in srgb, var(--accent) 30%, var(--surface));
    display: flex; flex-direction: column; gap: 10px;
}

.room-list { display: flex; flex-direction: column; gap: 6px; }
.room-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--surface-2);
    text-align: left;
    cursor: pointer;
}
.room-item:hover { border-color: var(--primary); }
/* Vrstica sobe na začetnem zaslonu: kdo, kaj se dogaja, spodaj dejanji (pridruži se / TV) */
.room-row { display: grid; gap: 8px; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--r-tile); background: var(--surface-2); }
.room-row.is-playing { border-style: dashed; }
.room-row-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-width: 0; }
.room-row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.room-row-actions .btn { min-height: 42px; padding: 6px 8px; font-size: var(--t-sm); }
.room-row .room-item-meta { white-space: normal; }
.room-item-cat { font-size: 22px; }
.room-item-host { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item-meta { display: block; color: var(--ink-soft); font-size: var(--t-xs); font-weight: 500; }
.room-item-count { color: var(--ink-soft); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }

/* ---------- Čakalnica ---------- */

.room-code-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.room-code-label { color: var(--ink-soft); font-size: var(--t-sm); font-weight: 600; }
.room-code {
    border: 0;
    background: none;
    cursor: copy;
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    padding-left: 0.18em; /* izravna letter-spacing */
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.share-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.player-list { display: flex; flex-direction: column; gap: 6px; }
.player {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--r-ctl);
    background: var(--surface-2);
}
.player.is-me { box-shadow: inset 0 0 0 2px var(--primary); }
.player.is-offline { opacity: 0.55; }
.player-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-tags { display: inline-flex; gap: 6px; margin-left: 6px; font-size: var(--t-xs); font-weight: 600; color: var(--ink-soft); }
.player-score { font-weight: 800; font-variant-numeric: tabular-nums; }

.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 800; font-size: var(--t-sm);
    color: #fff;
    object-fit: cover;
    background: var(--tile-a);
}

.level-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 6px;
    font-size: var(--t-xs);
    font-weight: 800;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    vertical-align: middle;
}
.level-badge.rank-master { background: var(--primary); border-color: transparent; color: #fff; }
.level-badge.rank-legend { background: var(--accent); border-color: transparent; color: var(--accent-ink); }

.settings-summary { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.settings-summary:empty { display: none; }
.pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: var(--t-sm);
    font-weight: 600;
}

.host-panel { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.setting { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.setting legend { font-weight: 700; font-size: var(--t-sm); margin-bottom: 8px; padding: 0; }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestions-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.chip {
    min-height: 40px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    font-weight: 600;
    font-size: var(--t-sm);
    cursor: pointer;
}
.chip[aria-checked="true"], .chip.is-active { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--r-ctl); background: var(--surface-2); border: 1px solid var(--line); }
.seg { min-height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; font-size: var(--t-sm); cursor: pointer; color: var(--ink-soft); }
.seg[aria-checked="true"], .seg.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 var(--depth); }

.number-settings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.number-setting { display: flex; flex-direction: column; gap: 4px; font-size: var(--t-xs); font-weight: 700; color: var(--ink-soft); }

.waiting { color: var(--ink-soft); text-align: center; }

/* ---------- Timerji ---------- */

.timer-badge {
    min-width: 64px;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: var(--t-xl);
    font-weight: 900;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.timer-badge.is-urgent { background: var(--bad); color: #fff; }

.drain { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.drain > span { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: inherit; transform-origin: left; }

/* ---------- Kviz ---------- */

.quiz { display: flex; flex-direction: column; gap: 14px; }
.quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Branje na glas: pri vprašanju, da ga počasni bralci najdejo; vklopljeno = polno obarvan */
.tts-btn {
    margin-left: auto;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: inherit;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.tts-btn.is-on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
#question-text { cursor: pointer; }

.timer-ring {
    --p: 1;
    --ring: var(--accent);
    width: 64px; height: 64px;
    border-radius: 50%;
    display: grid; place-items: center;
    background:
        radial-gradient(closest-side, var(--bg) 78%, transparent 80%),
        conic-gradient(var(--ring) calc(var(--p) * 360deg), var(--line) 0);
    font-size: var(--t-lg);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    transition: --p 1s linear;
}
.timer-ring.is-urgent { --ring: var(--bad); color: var(--bad); }

@property --p { syntax: "<number>"; inherits: true; initial-value: 1; }

.question {
    font-size: clamp(1.375rem, 4.6vw, 2rem);
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: -0.01em;
    white-space: pre-line;
    min-height: 2.5em;
}

.quiz-feedback { text-align: center; font-weight: 700; min-height: 1.4em; color: var(--ink-soft); }
.quiz-feedback.is-good { color: var(--good); }
.quiz-feedback.is-bad { color: var(--bad); }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ans-btn {
    --tile: var(--tile-a);
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 88px;
    padding: 14px 14px 14px 12px;
    border: 0;
    border-radius: var(--r-tile);
    background: var(--tile);
    color: var(--tile-ink);
    box-shadow: 0 6px 0 color-mix(in srgb, var(--tile) 62%, #000);
    font-size: var(--t-md);
    font-weight: 750;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s ease, filter 0.2s ease;
    isolation: isolate;
}
.ans-btn[data-index="1"] { --tile: var(--tile-b); }
.ans-btn[data-index="2"] { --tile: var(--tile-c); }
.ans-btn[data-index="3"] { --tile: var(--tile-d); }

.ans-btn::before {
    content: attr(data-letter);
    flex: none;
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.22);
    font-weight: 900;
}

/* Glas ljudstva: delež odgovorov kot pas v ozadju */
.ans-btn::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--pct, 0) * 1%);
    background: rgba(255, 255, 255, 0.18);
    z-index: -1;
    transition: width 0.4s ease;
}
.ans-btn[data-pct]::before { content: attr(data-pct) "%"; font-size: var(--t-xs); width: 42px; }

.ans-btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--tile) 62%, #000); }
.ans-btn:disabled { cursor: default; }
.ans-btn.is-hidden { visibility: hidden; }
.ans-btn.is-dim { opacity: 0.32; filter: saturate(0.4); }
.ans-btn.is-selected { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--tile) 62%, #000), 0 0 0 4px var(--accent); }
.ans-btn.is-selected::before { background: var(--accent); color: var(--accent-ink); }
.ans-btn.is-correct { --tile: var(--good); opacity: 1; filter: none; box-shadow: 0 6px 0 color-mix(in srgb, var(--good) 62%, #000), 0 0 0 4px var(--accent); }
.ans-btn.is-correct::before { content: "✓"; background: #fff; color: var(--good); }
.ans-btn.is-wrong { --tile: var(--bad); opacity: 1; filter: none; animation: nudge 0.4s; }
.ans-btn.is-wrong::before { content: "✗"; background: #fff; color: var(--bad); }
.ans-btn.is-frozen { filter: grayscale(0.7) brightness(1.1); }

@keyframes nudge {
    0%, 100% { translate: 0; }
    25% { translate: -5px 0; }
    75% { translate: 5px 0; }
}

/* Jokerji */
.powerups { display: flex; flex-wrap: wrap; gap: 8px; }
.powerups:empty { display: none; }
.powerup-btn {
    --pu: var(--primary);
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 40px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 2px solid var(--pu);
    background: color-mix(in srgb, var(--pu) 12%, var(--surface));
    color: var(--ink);
    font-size: var(--t-sm);
    font-weight: 700;
    cursor: pointer;
}
.powerup-btn .count { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.powerup-btn .pu-short { display: none; } /* kratko ime samo na telefonu (ploščice) */
.powerup-btn .count.is-armed { color: var(--good); }
.powerup-btn:disabled { opacity: 0.45; cursor: default; }
.powerup-btn.joker-active { background: var(--pu); color: #fff; opacity: 1; }
.powerup-btn.joker-active .count { color: inherit; }
.pu-double { --pu: #E98A15; }
.pu-fifty { --pu: #2F6BFF; }
.pu-audience { --pu: #8455F0; }
.pu-fog { --pu: #7F8AA3; }
.pu-tornado { --pu: #3E4A6B; }
.pu-freeze { --pu: #12A9C9; }
.pu-shield { --pu: #0E9F6E; }
.pu-mirror { --pu: #7C8DB5; }
.pu-allin { --pu: #D4380D; }
.pu-thief { --pu: #6B4F2A; }
.pu-swap { --pu: #C0399A; }
.pu-insurance { --pu: #1F8A70; }
.pu-hourglass { --pu: #B7791F; }
.pu-parrot { --pu: #2E9E44; }

/* Tema in avtor vprašanja */
.question-topic { color: var(--ink-soft); font-size: var(--t-sm); font-weight: 600; margin-bottom: -6px; }
.author-banner {
    padding: 10px 14px;
    border-radius: var(--r-ctl);
    background: color-mix(in srgb, var(--accent) 30%, var(--surface));
    font-size: var(--t-sm);
    font-weight: 600;
}

/* ---------- Blef ---------- */

.bluff-write, .bluff-vote { display: flex; flex-direction: column; gap: 12px; }
.bluff-hint {
    padding: 10px 14px;
    border-radius: var(--r-ctl);
    background: color-mix(in srgb, var(--tile-d) 16%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--tile-d) 45%, var(--surface));
    font-size: var(--t-sm);
    font-weight: 600;
}
.bluff-options { display: grid; gap: 10px; }
.bluff-option {
    min-height: 60px;
    padding: 12px 16px;
    border: 0;
    border-radius: var(--r-tile);
    background: var(--tile-d);
    color: var(--tile-ink);
    box-shadow: 0 5px 0 color-mix(in srgb, var(--tile-d) 62%, #000);
    font-size: var(--t-lg);
    font-weight: 750;
    text-align: left;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s ease;
}
.bluff-option:nth-child(4n+2) { background: var(--tile-a); box-shadow: 0 5px 0 color-mix(in srgb, var(--tile-a) 62%, #000); }
.bluff-option:nth-child(4n+3) { background: var(--tile-c); box-shadow: 0 5px 0 color-mix(in srgb, var(--tile-c) 62%, #000); }
.bluff-option:nth-child(4n+4) { background: var(--tile-b); box-shadow: 0 5px 0 color-mix(in srgb, var(--tile-b) 62%, #000); }
.bluff-option:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.bluff-option:disabled { cursor: default; }
.bluff-option.is-selected { transform: translateY(4px); box-shadow: 0 0 0 4px var(--accent); }
.bluff-option.is-dim { opacity: 0.32; }
.bluff-option.is-hidden { visibility: hidden; }
.bluff-option.is-frozen { filter: grayscale(0.7) brightness(1.1); }

.bluff-reveal { display: flex; flex-direction: column; gap: 8px; }
.reveal-row {
    padding: 10px 14px;
    border-radius: var(--r-ctl);
    background: var(--surface-2);
    border: 2px solid transparent;
    animation: enter 0.3s ease-out both;
}
.reveal-row.is-truth { border-color: var(--good); background: color-mix(in srgb, var(--good) 16%, var(--surface)); }
.reveal-row.is-mine { box-shadow: inset 0 0 0 2px var(--accent); }
.reveal-text { font-size: var(--t-lg); font-weight: 800; }
.reveal-meta { font-size: var(--t-sm); color: var(--ink-soft); }
.reveal-tag { font-weight: 800; color: var(--ink); }
.reveal-row.is-truth .reveal-tag { color: var(--good); }

/* Avtor samo gleda: ploščice so vidne, a očitno neaktivne */
.answers.is-author .ans-btn:not(.is-correct):not(.is-dim) { opacity: 0.7; filter: saturate(0.6); }

/* Izbira teme */
.topic-options { display: grid; gap: 10px; }
.topic-option {
    min-height: 64px;
    padding: 14px 18px;
    border-radius: var(--r-tile);
    border: 2px solid var(--line);
    background: var(--surface-2);
    font-size: var(--t-lg);
    font-weight: 750;
    text-align: left;
    cursor: pointer;
    transition: transform 0.08s ease, border-color 0.15s ease;
}
.topic-option:hover:not(:disabled) { border-color: var(--primary); }
.topic-option:active:not(:disabled) { transform: translateY(2px); }
.topic-option:disabled { cursor: default; }
.topic-option.is-picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 30%, var(--surface)); }

/* Glasovnica: 10 tem mora na telefonu na en zaslon - dva stolpca, nižje ploščice */
.vote-options { grid-template-columns: 1fr 1fr; gap: 8px; }
.vote-options .topic-option {
    position: relative;
    min-height: 50px;
    padding: 8px 12px;
    font-size: var(--t-md, 16px);
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.vote-options .topic-option.is-picked::before {
    content: "✓";
    position: absolute; top: 4px; right: 8px;
    font-size: 14px; font-weight: 900;
}
.topic-option.is-mine { opacity: 0.55; border-style: dashed; }
.topic-tag {
    display: block;
    margin-top: 2px;
    font-size: var(--t-xs);
    font-weight: 600;
    color: var(--ink-soft);
}

/* Rezultat glasovanja */
.vote-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vote-row {
    padding: 8px 12px;
    border-radius: var(--r-tile);
    border: 1px solid var(--line);
    background: var(--surface-2);
    animation: enter 0.3s ease-out both;
}
.vote-row.is-chosen { border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.vote-row:not(.is-chosen) { opacity: 0.7; }
.vote-row.is-mine .vote-topic { text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 3px; }
.vote-row-head { display: flex; align-items: baseline; gap: 8px; }
.vote-mark { flex: none; width: 1.3em; }
.vote-topic { flex: 1; font-weight: 750; overflow-wrap: anywhere; }
.vote-count { flex: none; font-weight: 800; font-size: var(--t-sm); }
.vote-meta { margin: 2px 0 0 calc(1.3em + 8px); font-size: var(--t-xs); color: var(--ink-soft); }
@media (max-width: 480px) {
    .vote-options .topic-option { font-size: var(--t-sm); min-height: 46px; }
    #choosing-screen .lead { font-size: var(--t-sm); }
}
@media (max-width: 300px) {
    .vote-options { grid-template-columns: 1fr; }
}

/* Kdo je že odgovoril / oddal */
.status-strip { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.status-strip li {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: var(--t-xs);
    font-weight: 700;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-soft);
}
.status-strip li.is-done { background: color-mix(in srgb, var(--good) 16%, var(--surface)); border-color: var(--good); color: var(--ink); }
.status-strip li.is-done::before { content: "✓ "; color: var(--good); }
.status-strip li.is-author { border-style: dashed; }
.status-strip li.is-author::before { content: "✍️ "; }

/* ---------- Anagrami ---------- */

.anagram {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
    min-height: 56px;
}
.anagram .letter {
    display: grid; place-items: center;
    width: 44px; height: 52px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 55%, #000);
    font-size: var(--t-xl);
    font-weight: 900;
}
.anagram .done { font-size: var(--t-lg); font-weight: 800; }
/* Ploščice so tipkovnica: tapni črko, porabljena potemni */
button.letter { border: 0; padding: 0; cursor: pointer; font-family: inherit; transition: transform .08s, opacity .15s; }
button.letter:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 55%, #000); }
button.letter.is-used { opacity: .25; transform: translateY(3px); box-shadow: none; cursor: default; }
button.letter:disabled:not(.is-used) { cursor: default; }
.anagram-entry { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.anagram-back { min-width: 64px; font-size: 1.4rem; }
/* Na dotik polje anagrama ni za tipkanje (samo prikaz sestavljene besede) */
.has-osk .input-anagram { caret-color: transparent; }

/* ---------- Hitri račun in ocena ---------- */

.math-problem {
    text-align: center;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    padding: 12px 0;
}
.math-problem.is-good { color: var(--good); }
.math-problem.is-bad { color: var(--bad); animation: nudge 0.35s; }
.input-number-big { text-align: center; font-size: var(--t-xl); font-weight: 800; font-variant-numeric: tabular-nums; }

.estimate-question { font-size: var(--t-xl); font-weight: 800; line-height: 1.25; }

/* Spomin */
.memory-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 60px; }
.memory-row .mem {
    display: grid; place-items: center;
    width: 52px; height: 56px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 2px solid var(--line);
    font-size: 30px;
}
.memory-row .mem.is-placeholder { color: var(--ink-soft); font-size: var(--t-lg); border-style: dashed; }
.memory-row .mem.pop { animation: pop 0.25s ease-out; }
.memory-input.is-good .mem { border-color: var(--good); background: color-mix(in srgb, var(--good) 16%, var(--surface)); }
.memory-input.is-bad .mem { border-color: var(--bad); }
.memory-drain > span { background: var(--tile-d); }
.memory-palette { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.memory-palette button {
    height: 64px;
    border: 0;
    border-radius: var(--r-tile);
    background: var(--surface-2);
    box-shadow: 0 4px 0 var(--depth);
    font-size: 32px;
    cursor: pointer;
}
.memory-palette button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--depth); }
.memory-palette button:disabled { opacity: 0.4; cursor: default; }
@keyframes pop { from { transform: scale(0.6); } to { transform: none; } }

/* Najdi vsiljivca */
.odd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.odd-word {
    min-height: 64px;
    padding: 10px;
    border: 2px solid var(--line);
    border-radius: var(--r-tile);
    background: var(--surface-2);
    font-size: var(--t-lg);
    font-weight: 800;
    cursor: pointer;
}
.odd-word:hover:not(:disabled) { border-color: var(--primary); }
.odd-word:disabled { cursor: default; }
.odd-word.is-correct { border-color: var(--good); background: color-mix(in srgb, var(--good) 20%, var(--surface)); }
.odd-word.is-wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 16%, var(--surface)); }

/* Zemljepis: slika je pri vseh nalogah enako visoka, da se gumbi ne premikajo */
.geo-kind { margin: 0; text-align: center; font-size: var(--t-sm); font-weight: 700; color: var(--ink-soft); }
.geo-visual {
    height: 150px;
    display: grid;
    place-items: center;
}
.geo-visual img {
    max-height: 140px;
    max-width: 100%;
    border-radius: 6px;
    box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgb(0 0 0 / 0.12);
}
.geo-visual svg { width: 150px; height: 150px; }
.geo-visual path { fill: var(--ink); }
.geo-icon { font-size: 84px; line-height: 1; }
.geo-prompt { margin: 0; text-align: center; font-size: var(--t-lg); font-weight: 800; line-height: 1.25; }
#geo-options .odd-word { min-height: 54px; font-size: var(--t-md); }
@media (max-height: 700px) {
    .geo-visual { height: 120px; }
    .geo-visual img { max-height: 112px; }
    .geo-visual svg { width: 120px; height: 120px; }
}

/* Res ali ne */
.tf-statement { font-size: var(--t-xl); font-weight: 800; line-height: 1.25; text-align: center; min-height: 3.75em; display: grid; place-items: center; }
.tf-btn { min-height: 72px; font-size: var(--t-lg); color: #fff; box-shadow: 0 5px 0 var(--depth); }
.tf-yes { background: var(--good); }
.tf-no { background: var(--bad); }
.tf-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--depth); }
.quick-feedback { min-height: 2.6em; }
.quick-feedback.is-good { color: var(--good); font-weight: 700; }
.quick-feedback.is-bad { color: var(--bad); font-weight: 700; }
.estimate-answer {
    padding: 12px 16px;
    border-radius: var(--r-ctl);
    background: color-mix(in srgb, var(--accent) 30%, var(--surface));
    font-weight: 700;
}
.estimate-answer b { font-size: var(--t-xl); font-variant-numeric: tabular-nums; }

/* "Ali si vedel?" po razkritju */
.fact-box {
    padding: 12px 14px;
    border-radius: var(--r-ctl);
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
    animation: fact-in .35s ease-out;
}
.fact-label { margin: 0 0 4px; font-weight: 800; font-size: .85rem; color: var(--primary); }
.fact-text { margin: 0; color: var(--ink); line-height: 1.45; }
@keyframes fact-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Dejstva med čakanjem na AI */
.wait-fact {
    width: 100%;
    max-width: 520px;
    margin: 18px auto 0;
    padding: 16px 18px;
    border-radius: var(--r-ctl);
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
    text-align: left;
}
.wait-fact-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin: 0 0 6px; font-weight: 800; font-size: .85rem; color: var(--ink); }
.wait-fact-cat { padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft); font-weight: 700; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.wait-fact-cat:empty { display: none; }
.wait-fact-text { margin: 0; color: var(--ink); font-size: 1.05rem; line-height: 1.5; min-height: 3em; transition: opacity .3s; overflow-wrap: anywhere; }
.wait-fact.is-changing .wait-fact-text { opacity: 0; }
.wait-fact-dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.wait-fact-dots span { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--ink-soft) 45%, transparent); }
.wait-fact-dots span.is-on { background: var(--accent); }

/* Ocena vprašanja */
.rate-row { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink-soft); font-size: .9rem; flex-wrap: wrap; }
.btn-rate {
    min-width: 48px; min-height: 44px;
    font-size: 1.3rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    cursor: pointer;
    transition: transform .12s;
}
.btn-rate:hover:not(:disabled) { transform: scale(1.08); }
.btn-rate.is-selected { background: var(--accent); border-color: transparent; }
.btn-rate:disabled:not(.is-selected) { opacity: .4; cursor: default; }

/* Obvestilo o prilagojeni težavnosti in oznaka igre iz tem */
.difficulty-notice {
    margin: 0;
    padding: 8px 12px;
    border-radius: var(--r-ctl);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink);
    font-weight: 700;
    text-align: center;
}
.topical-badge {
    align-self: center;
    margin: 0;
    padding: 4px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 35%, var(--surface));
    color: var(--ink);
    font-weight: 700;
    font-size: .85rem;
    text-align: center;
}

/* Pavza: zaslon čez igro (zapre ga samo nadaljevanje) */
.pause-overlay { position: fixed; inset: 0; z-index: 2400; display: grid; place-items: center; padding: var(--gutter); background: var(--overlay); backdrop-filter: blur(3px); }
.pause-card { width: 100%; max-width: 420px; padding: 24px 20px; border-radius: var(--r-panel); background: var(--surface); border: 2px solid var(--accent); text-align: center; max-height: 92dvh; overflow-y: auto; }
.pause-card p { margin: 0; }
.pause-icon { font-size: 56px; line-height: 1; }
.pause-title { margin: 0; font-size: var(--t-xl); font-weight: 900; }
.pause-count { font-size: var(--t-lg); font-weight: 900; }
.pause-card .status-strip li.is-offline { opacity: .6; }
.pause-btn { font-size: 18px; }

/* Rekord igre med rundami (napoved, igra, rezultati) */
.record-line { margin: 0; padding: 8px 12px; border-radius: 999px; text-align: center; font-weight: 800; font-size: var(--t-sm); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border: 2px solid var(--accent); }
.record-line.is-small { padding: 4px 10px; font-size: var(--t-xs); border-width: 1px; }
.record-line.is-new { border-radius: var(--r-tile); font-size: var(--t-md); background: color-mix(in srgb, var(--good) 22%, var(--surface)); border-color: var(--good); }
@media (prefers-reduced-motion: no-preference) { .record-line.is-new { animation: bonus-in 0.5s ease-out; } }

/* "Vaš kviz" - povzetek ob koncu */
.recap { display: grid; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.recap-title { margin: 0; font-size: 1.25rem; text-align: center; }
.recap-body { display: grid; gap: 8px; }
.recap-card {
    padding: 10px 12px;
    border-radius: var(--r-ctl);
    background: var(--surface-2);
    border: 1px solid var(--line);
}
.recap-card h3 { margin: 0 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.recap-card p { margin: 0; color: var(--ink); line-height: 1.4; overflow-wrap: anywhere; }
.recap-card .recap-meta { color: var(--ink-soft); font-size: .88rem; margin-top: 2px; }
.recap-topics { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.recap-topics .chip { min-height: 0; padding: 3px 10px; font-size: var(--t-xs); cursor: default; }
.recap-duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
/* zložljiva kartica (seznam tem): naslov je gumb */
.recap-fold summary { cursor: pointer; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); min-height: 28px; display: flex; align-items: center; justify-content: space-between; list-style: none; }
.recap-fold summary::-webkit-details-marker { display: none; }
.recap-fold summary::after { content: 'pokaži ▾'; text-transform: none; letter-spacing: 0; color: var(--primary); font-weight: 600; }
.recap-fold[open] summary::after { content: 'skrij ▴'; }
.recap-fold[open] summary { margin-bottom: 6px; }

.final-banner {
    padding: 10px 14px;
    border-radius: var(--r-ctl);
    background: var(--bad);
    color: #fff;
    font-weight: 800;
    text-align: center;
}

/* ---------- Lestvice ---------- */

.ranking { display: flex; flex-direction: column; gap: 6px; }
.rank-row {
    display: grid;
    grid-template-columns: 2.2em 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--r-ctl);
    background: var(--surface-2);
}
.rank-row.is-me { box-shadow: inset 0 0 0 2px var(--primary); }
/* javna lestvica: začetnica med mestom in imenom (slike profila ni - leaderboard.js) */
.rank-row.has-avatar { grid-template-columns: 1.6em auto 1fr auto; column-gap: 10px; }
.rank-row .avatar { width: 34px; height: 34px; font-size: var(--t-sm); }
.rank-row.has-avatar .rank-detail { white-space: normal; }
.rank-row.is-first { background: color-mix(in srgb, var(--accent) 35%, var(--surface)); }
.rank-pos { font-weight: 900; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.rank-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-detail { display: block; font-size: var(--t-xs); font-weight: 500; color: var(--ink-soft); }
.rank-score { font-weight: 900; font-size: var(--t-lg); font-variant-numeric: tabular-nums; text-align: right; }
.rank-delta { display: block; font-size: var(--t-xs); font-weight: 700; color: var(--good); }
.rank-delta.is-neg { color: var(--bad); }

.ranking-final .rank-row { padding-block: 14px; }
.ranking-final .rank-row.is-first .rank-score { font-size: var(--t-xl); }
.final-title { font-size: var(--t-xxl); text-align: center; }
.final-winner { text-align: center; font-size: var(--t-lg); font-weight: 700; }
/* Kartica »tvoj rezultat« na vrhu končnega zaslona */
.final-me { display: grid; gap: 2px; justify-items: center; padding: 14px 12px; border: 2px solid var(--accent); border-radius: var(--r-tile); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); text-align: center; }
.final-me p { margin: 0; }
.final-me-label { font-size: var(--t-sm); font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.final-me-big { font-size: var(--t-xxl); font-weight: 900; line-height: 1.1; }
.final-me-sub { font-size: var(--t-md); font-weight: 700; }
.final-hint { margin: 0; text-align: center; }
.ranking-final .rank-name { white-space: normal; }
.rank-awards { margin-top: 2px; font-weight: 700; color: var(--ink); line-height: 1.35; }

.award {
    display: inline-block;
    margin: 4px 4px 0 0;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: var(--t-xs);
    font-weight: 700;
    background: var(--surface);
    border: 1px solid var(--line);
}

.drain-slow > span { transition: transform linear; }

/* ---------- Nagrada ---------- */

.reward-options { display: grid; gap: 10px; }
.reward-btn {
    --pu: var(--primary);
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    min-height: 72px;
    padding: 12px 16px;
    border-radius: var(--r-tile);
    border: 2px solid var(--pu);
    background: color-mix(in srgb, var(--pu) 10%, var(--surface));
    text-align: left;
    cursor: pointer;
}
.reward-btn .reward-emoji { grid-row: span 2; font-size: 30px; text-align: center; }
.reward-btn .reward-name { font-weight: 800; }
.reward-btn .reward-desc { font-size: var(--t-sm); color: var(--ink-soft); }
.reward-btn:disabled { opacity: 0.5; }
.reward-btn.is-picked { background: var(--pu); color: #fff; opacity: 1; }
.reward-btn.is-picked .reward-desc { color: inherit; }

/* ---------- Prehod ---------- */

.transition { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.transition .lead { color: var(--accent); font-weight: 700; font-size: var(--t-lg); }
.transition-title { font-size: var(--t-xxl); font-weight: 900; letter-spacing: -0.02em; }

/* ---------- Napoved "Sledi ..." (pred igro, pred kvizom, ob začetku igre) ---------- */

.intro { display: grid; gap: 10px; text-align: center; }
.intro-kicker { margin: 0; color: var(--ink-soft); font-weight: 700; font-size: var(--t-sm); }
.intro-kicker:empty { display: none; }
.intro-next {
    justify-self: center;
    margin: 4px 0 0;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.intro-icon { font-size: 3.2rem; line-height: 1; animation: intro-pop .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes intro-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.intro-title { margin: 0; font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; }
.intro-rules { display: grid; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; text-align: left; }
.intro-rules:empty { display: none; }
.intro-rules li {
    padding: 10px 12px;
    border-radius: var(--r-ctl);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink);
    line-height: 1.4;
    animation: intro-rule .4s ease-out both;
}
.intro-rules li:nth-child(2) { animation-delay: .12s; }
.intro-rules li:nth-child(3) { animation-delay: .24s; }
.intro-rules li:nth-child(4) { animation-delay: .36s; }
.intro-rules li:nth-child(5) { animation-delay: .48s; }
@keyframes intro-rule { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.intro-note { margin: 0; color: var(--ink); font-weight: 700; }
.intro-note:empty { display: none; }
.intro-status { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 0; color: var(--ink-soft); font-size: var(--t-sm); }
.spinner.spinner-sm { display: inline-block; width: 18px; height: 18px; border-width: 3px; flex: none; }
.intro .drain { margin-top: 4px; }
/* Nizek telefon: vse mora biti vidno brez drsenja */
@media (max-width: 480px) and (max-height: 760px) {
    .intro { gap: 8px; }
    .intro-icon { font-size: 2.4rem; }
    .intro-title { font-size: 1.45rem; }
    .intro-rules { gap: 6px; margin-top: 2px; }
    .intro-rules li { padding: 7px 10px; font-size: var(--t-sm); line-height: 1.35; }
}
.intro .wait-fact { margin-top: 6px; }

/* ---------- Nalaganje ---------- */

.spinner {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 5px solid var(--line);
    border-top-color: var(--primary);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Modali ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: var(--overlay);
}
.modal-top { z-index: 2100; }
.modal-content {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 92dvh;
    overflow-y: auto;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    border-radius: var(--r-panel) var(--r-panel) 0 0;
    background: var(--surface);
    display: flex; flex-direction: column; gap: 14px;
    animation: sheet 0.22s ease-out;
}
.modal-small { max-width: 380px; }
.modal-title { font-size: var(--t-lg); font-weight: 800; padding-right: 40px; }
.modal-close {
    position: absolute; top: 14px; right: 14px;
    width: 40px; height: 40px;
    border: 0; border-radius: 50%;
    background: var(--surface-2);
    font-size: 24px; line-height: 1;
    cursor: pointer;
}
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (min-width: 640px) {
    .modal { align-items: center; padding: 24px; }
    .modal-content { border-radius: var(--r-panel); }
}

.xp { display: flex; flex-direction: column; gap: 6px; }
.xp-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.xp-bar > span { display: block; height: 100%; width: 0; background: var(--good); border-radius: inherit; transition: width 0.6s ease; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: var(--r-ctl); background: var(--surface-2); }
.stat b { font-size: var(--t-lg); font-weight: 900; font-variant-numeric: tabular-nums; }
.stat span { font-size: var(--t-xs); color: var(--ink-soft); }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.emoji-slots { display: flex; gap: 8px; justify-content: center; }
.emoji-slot {
    width: 52px; height: 52px;
    border-radius: var(--r-ctl);
    border: 2px dashed var(--line);
    background: var(--surface-2);
    font-size: 26px;
    display: grid; place-items: center;
    cursor: pointer;
}
.emoji-slot.is-saved { border-style: solid; border-color: var(--good); cursor: default; }
.emoji-slot.is-new { border-style: solid; border-color: var(--accent); }
.emoji-slot.is-locked { cursor: not-allowed; opacity: 0.5; font-size: 18px; }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.emoji-option { height: 44px; border: 0; border-radius: 10px; background: var(--surface-2); font-size: 24px; cursor: pointer; }
.emoji-option:hover { background: var(--line); }

/* ---------- Reakcije ---------- */

.reaction-bar {
    position: fixed;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 900;
    display: flex;
    gap: 4px;
    max-width: calc(100vw - 2 * var(--gutter));
    padding: 6px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 4px 0 var(--depth);
    overflow-x: auto;
    scrollbar-width: none;
}
.reaction-bar::-webkit-scrollbar { display: none; }
.reaction-bar button {
    flex: none;
    width: 44px; height: 44px;
    border: 0; border-radius: 50%;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}
.reaction-bar button:active { transform: scale(0.88); }

/* ---------- Celozaslonski način ---------- */

#fullscreen-toggle { display: inline-grid; place-items: center; color: var(--ink); }
#fullscreen-toggle.hidden { display: none; }
#fullscreen-toggle .fs-exit, .is-fullscreen #fullscreen-toggle .fs-enter { display: none; }
.is-fullscreen #fullscreen-toggle .fs-exit { display: block; }

/* ---------- Zapusti igro ---------- */

.exit-btn { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn-danger { background: var(--bad); color: #fff; border: 0; box-shadow: 0 4px 0 color-mix(in srgb, var(--bad) 60%, #000); }
.btn-danger:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--bad) 60%, #000); }

/* Med igro je v glavi 5 gumbov (🚪 😊 ⛶ 🔊 🌙) - na telefonu ostane samo ikona igre */
@media (max-width: 419px) {
    .in-game .brand-text { display: none; }
}

/* Ozek telefon: v glavi so štirje gumbi - ime igre ostane samo kot ikona */
@media (max-width: 349px) {
    .brand-text { display: none; }
    .topbar-actions { gap: 4px; }
}

/* ---------- Vgrajena tipkovnica (naprave na dotik) ---------- */

.osk {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: grid;
    gap: 6px;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    background: var(--surface-2);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgb(0 0 0 / 0.12);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
    animation: osk-in .16s ease-out;
}
@keyframes osk-in { from { transform: translateY(30%); opacity: 0; } to { transform: none; opacity: 1; } }
.osk-row { display: flex; gap: 4px; justify-content: center; max-width: 560px; margin: 0 auto; width: 100%; }
.osk-key {
    flex: 1 1 0;
    min-width: 0;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 2px 0 var(--depth);
    font: inherit;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
}
.osk-key.is-down { background: var(--line); transform: translateY(2px); box-shadow: none; }
.osk-fn { background: color-mix(in srgb, var(--ink-soft) 16%, var(--surface)); font-size: 1rem; }
.osk-fn.is-on { background: var(--accent); color: var(--accent-ink); }
.osk-wide { flex-grow: 1.5; }
.osk-space { flex-grow: 5; font-size: .85rem; color: var(--ink-soft); }
.osk-blank { visibility: hidden; }
.osk-enter { flex-grow: 2.2; background: var(--primary); color: var(--primary-ink); font-size: 1rem; font-weight: 800; }
.osk-enter.is-down { background: color-mix(in srgb, var(--primary) 75%, #000); }
/* Številčnica: velike tipke, ožja */
.osk[data-layout="number"] .osk-row, .osk[data-layout="decimal"] .osk-row { max-width: 360px; }
.osk[data-layout="number"] .osk-key, .osk[data-layout="decimal"] .osk-key { height: 50px; font-size: 1.4rem; }
.osk[data-layout="number"] .osk-enter, .osk[data-layout="decimal"] .osk-enter { font-size: 1.05rem; }
@media (max-width: 360px) { .osk-key { height: 42px; font-size: 1.08rem; } .osk-row { gap: 3px; } }
/* Med tipkanjem: vsebina se lahko odmakne nad tipkovnico, reakcije umaknjene */
.osk-open .app { padding-bottom: calc(var(--osk-h, 240px) + 24px); }
.osk-open .reaction-bar { display: none; }

/* Na širokem zaslonu je vrstica vedno odprta spodaj, gumb v glavi ni potreben */
.reaction-toggle { display: none; }
.reaction-toggle.is-open { background: var(--accent); border-color: transparent; }

/* Telefon: vrstica bi prekrila gumbe (Pošlji, odgovori C/D), zato se odpre
   z gumbom 😊 v glavi kot plošča pod njo in se sama zapre. */
@media (max-width: 639px) {
    .reaction-toggle:not(.hidden) { display: inline-block; }
    .reaction-bar {
        top: calc(max(10px, env(safe-area-inset-top)) + 48px);
        bottom: auto;
        left: auto;
        right: var(--gutter);
        transform: none;
        flex-wrap: wrap;
        justify-content: center;
        max-width: min(300px, calc(100vw - 2 * var(--gutter)));
        border-radius: 22px;
        box-shadow: 0 10px 30px rgb(0 0 0 / 0.18), 0 4px 0 var(--depth);
        animation: tray-in .15s ease-out;
    }
    .reaction-bar:not(.is-open) { display: none; }
    .app { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
}
@keyframes tray-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

#floating-emotes-container { position: fixed; inset: 0; pointer-events: none; z-index: 950; overflow: hidden; }
.floating-emoji-container {
    position: absolute;
    bottom: -60px;
    display: flex; flex-direction: column; align-items: center;
    animation: floatUp 3s ease-in forwards;
}
.emoji-icon { font-size: 36px; }
.emoji-username {
    margin-top: -4px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--surface);
    font-size: var(--t-xs);
    font-weight: 700;
    white-space: nowrap;
}
@keyframes floatUp {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    10% { transform: translateY(-10vh) scale(1.1); opacity: 1; }
    100% { transform: translateY(-110vh) scale(1); opacity: 0; }
}

/* ---------- Obvestila ---------- */

#toast-container {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex; flex-direction: column; gap: 8px;
    width: max-content;
    max-width: calc(100vw - 2 * var(--gutter));
    pointer-events: none;
}
.toast {
    padding: 10px 18px;
    border-radius: var(--r-ctl);
    background: var(--ink);
    color: var(--surface);
    font-size: var(--t-sm);
    font-weight: 700;
    text-align: center;
    box-shadow: 0 4px 0 var(--depth);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.toast-success { background: var(--good); color: #fff; }
.toast-error { background: var(--bad); color: #fff; }
.toast-warning { background: var(--warn); color: #fff; }
.toast-hide { opacity: 0; transform: translateY(-8px); }

/* ---------- Napadi ---------- */

.fog-effect {
    position: fixed; inset: 0;
    z-index: 9999;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none; /* skozi meglo se še da klikniti */
    transition: opacity 1s ease;
}
.fog-active { opacity: 0.85; }

.freeze-effect {
    position: fixed; inset: 0;
    z-index: 10000;
    display: none;
    align-items: center; justify-content: center;
    background: radial-gradient(circle, transparent 20%, rgba(135, 206, 250, 0.6) 90%);
    box-shadow: inset 0 0 0 16px rgba(255, 255, 255, 0.75), inset 0 0 60px #12A9C9;
    pointer-events: auto; /* blokira klike */
    cursor: wait;
}
.freeze-active { display: flex; animation: freeze-in 0.3s ease-out; }
.ice-message {
    padding: 10px 22px;
    border-radius: var(--r-ctl);
    background: rgba(255, 255, 255, 0.9);
    color: #0B7C94;
    font-size: var(--t-xl);
    font-weight: 900;
    transform: rotate(-6deg);
}
@keyframes freeze-in { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }

/* ---------- Telefoni ---------- */

@media (max-width: 480px) {
    /* Jokerji: mreža ploščic (ikona, kratko ime, števec v kotu) - vsi vidni naenkrat,
       brez drsenja; pri 360 px gre jih 5 v vrsto */
    .powerups { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; }
    .powerup-btn {
        position: relative;
        flex-direction: column;
        justify-content: center;
        gap: 1px;
        min-height: 54px;
        padding: 5px 2px 4px;
        border-radius: 12px;
        border-width: 2px;
        font-size: .68rem;
        line-height: 1.1;
    }
    .powerup-btn .pu-emoji { font-size: 1.35rem; line-height: 1; }
    .powerup-btn .pu-name { display: none; }
    .powerup-btn .pu-short { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .powerup-btn .count {
        position: absolute;
        top: -6px; right: 2px;
        min-width: 18px; height: 18px;
        padding: 0 4px;
        border-radius: 999px;
        background: var(--pu);
        color: #fff;
        font-size: .68rem;
        font-weight: 800;
        line-height: 18px;
        text-align: center;
    }
    .powerup-btn.joker-active .count { background: var(--surface); color: var(--pu); }
    .quiz { gap: 12px; }
    .question.is-long { font-size: 1.2rem; line-height: 1.28; }
    .lead { font-size: var(--t-sm); }
    .panel { padding: 18px 16px; border-radius: 20px; }
    .room-code { font-size: 3rem; }
    .answers { gap: 10px; }
    .ans-btn { min-height: 76px; font-size: var(--t-sm); gap: 10px; padding: 12px 10px; }
    .ans-btn::before { width: 30px; height: 30px; }
    .timer-ring { width: 56px; height: 56px; }
    .number-settings { gap: 6px; }
    .anagram .letter { width: 38px; height: 46px; font-size: var(--t-lg); }
}

/* Zelo ozki zasloni ali dolgi odgovori: en stolpec */
@media (max-width: 340px) {
    .powerups { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 5px; }
    .powerup-btn { min-height: 46px; }
    .powerup-btn .pu-emoji { font-size: 1.15rem; }
    .answers { grid-template-columns: 1fr; }
    .ans-btn { min-height: 60px; }
}

/* Na nizkem ležečem telefonu vprašanje ne sme izriniti odgovorov */
@media (max-height: 500px) and (orientation: landscape) {
    .question { font-size: var(--t-lg); min-height: 0; }
    .ans-btn { min-height: 56px; }
    .topbar { display: none; }
}

/* =============================================================================
   Niz pravilnih odgovorov, razvrsti po vrsti, stava
   ============================================================================= */

.streak-badge {
    flex: none;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--warn) 28%, var(--surface));
    color: var(--ink);
    font-size: var(--t-sm);
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    animation: streak-pop 0.35s ease;
}
@keyframes streak-pop { from { transform: scale(0.6); } to { transform: scale(1); } }

/* Razvrsti: en stolpec, številka mesta namesto črke */
.answers.is-order { grid-template-columns: 1fr; gap: 8px; }
.answers.is-order .ans-btn { min-height: 56px; padding-block: 10px; }
.answers.is-order .ans-btn.is-ranked { box-shadow: 0 6px 0 color-mix(in srgb, var(--tile) 62%, #000), 0 0 0 3px var(--accent); }
.answers.is-order .ans-btn.is-ranked::before { background: var(--accent); color: var(--accent-ink); }
.answers.is-order .ans-btn.is-correct::before,
.answers.is-order .ans-btn.is-wrong::before { content: attr(data-letter); }
.quiz-head .timer-ring { flex: none; }
@media (max-width: 380px) {
    .streak-badge { padding: 3px 7px; }
    .quiz-head { gap: 8px; }
}
@media (max-height: 700px) {
    .answers.is-order { gap: 6px; }
    .answers.is-order .ans-btn { min-height: 46px; padding-block: 6px; }
}
.order-actions { display: flex; gap: 8px; margin-top: 10px; }
.order-actions .btn { flex: 1; }
.order-actions .btn-primary { flex: 2; }

.powerup-btn.is-blocked { opacity: 0.3; }

/* Stava */
.wager-topic { font-size: var(--t-md); font-weight: 800; text-align: center; }
.wager-form { display: grid; gap: 12px; }
.wager-amount {
    display: block;
    text-align: center;
    font-size: 48px;
    font-weight: 900;
    line-height: 1.1;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}
.wager-range { width: 100%; height: 36px; accent-color: var(--primary); }
.wager-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wager-presets .btn { min-height: 44px; font-weight: 800; }

/* Kdo med nami */
.who-emoji { font-size: 44px; line-height: 1; text-align: center; }
.who-question { margin: 0; text-align: center; font-size: var(--t-lg); line-height: 1.25; }
.who-options .odd-word { min-height: 54px; font-size: var(--t-md); }
.odd-word.is-selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 28%, var(--surface)); }
.who-result { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.who-result li {
    display: grid;
    grid-template-columns: minmax(0, 7.5em) 1fr 5.6em; /* stalna širina: stolpci so primerljivi med vrsticami */
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--r-tile);
    background: var(--surface-2, var(--surface));
    border: 1px solid var(--line);
}
.who-result li.is-winner { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--surface)); font-weight: 800; }
.who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-bar { height: 10px; border-radius: 999px; background: var(--primary); transform-origin: left; transform: scaleX(var(--w, 0)); }
.who-votes { font-size: var(--t-sm); color: var(--ink-soft); white-space: nowrap; text-align: right; }
.recap-titles { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

/* =============================================================================
   Večer z darili: plošča (skupno za telefon in TV)
   ============================================================================= */

:root {
    --tok-0: #E53935; --tok-1: #1E88E5; --tok-2: #43A047; --tok-3: #FB8C00; --tok-4: #8E24AA;
    --tok-5: #00ACC1; --tok-6: #D81B60; --tok-7: #6D4C41; --tok-8: #3949AB; --tok-9: #7CB342;
}

/* Plošča je ilustracija (board-view.js, barve v paleti P) - tu sta samo velikost in gibanje. */
.board-view { width: 100%; }
.bv-svg { display: block; width: 100%; height: auto; font-family: inherit; border-radius: var(--r-tile); }
@media (prefers-reduced-motion: no-preference) {
    .bv-flake { animation: bv-fall linear infinite; }
    .bv-twinkle { animation: bv-tw 2.4s ease-in-out infinite; }
    .bv-bob { animation: bv-bob 1.8s ease-in-out infinite; }
    .bv-smoke { animation: bv-smoke 4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
    .bv-aurora { animation: bv-aur 9s ease-in-out infinite alternate; }
}
@keyframes bv-fall { from { transform: translateY(-40px); } to { transform: translateY(820px); } }
@keyframes bv-tw { 50% { opacity: .3; } }
@keyframes bv-bob { 50% { transform: translateY(-7px); } }
@keyframes bv-smoke { from { transform: translate(0, 0) scale(.6); opacity: .55; } to { transform: translate(14px, -46px) scale(1.6); opacity: 0; } }
@keyframes bv-aur { from { opacity: .35; transform: translateX(-20px); } to { opacity: .7; transform: translateX(30px); } }

/* Čakalnica: izbira figurice (5 v vrsti tudi na 320 px) */
.figure-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.figure-btn {
    display: grid; justify-items: center; gap: 2px; min-height: 58px; padding: 6px 2px;
    border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer;
}
.figure-emoji { font-size: 1.6rem; line-height: 1; }
.figure-label { font-size: .68rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.figure-btn.is-selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.figure-btn:disabled { opacity: .45; cursor: default; }

/* Telefon: zaslon poteze */
.stack-sm { display: grid; gap: 8px; }
/* Met kock: kocke se vrtijo in se ena za drugo ustavijo */
/* Nagnjena kocka je na zaslonu ~1,45-krat širša od svoje stranice, zato razmik pol stranice; več kock = manjše */
.roll-row { --die-size: 50px; display: flex; flex-wrap: wrap; justify-content: center; gap: calc(var(--die-size) * .5) calc(var(--die-size) * .52); padding: 14px 0 16px; }
.roll-row.is-4 { --die-size: 42px; }
.roll-row.is-many { --die-size: 36px; }
/* Ploskev kocke s pikami: velikost je 1em (določi jo font-size starša). Uporabljena v 3D kocki, v
   karticah izbire in v namigu - povsod ista kocka. */
.die-face {
    box-sizing: border-box; width: 1em; height: 1em; padding: .15em; line-height: 0;
    display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
    border-radius: .17em; background: var(--die-bg);
    box-shadow: inset 0 0 0 .03em var(--die-edge), inset 0 0 .14em var(--die-edge);
}
.pip { width: 74%; aspect-ratio: 1; border-radius: 50%; background: var(--die-ink); place-self: center; }
.p1 { grid-area: 1 / 1; } .p2 { grid-area: 1 / 2; } .p3 { grid-area: 1 / 3; }
.p4 { grid-area: 2 / 1; } .p5 { grid-area: 2 / 2; } .p6 { grid-area: 2 / 3; }
.p7 { grid-area: 3 / 1; } .p8 { grid-area: 3 / 2; } .p9 { grid-area: 3 / 3; }
/* 3D kocka: .die3d (mesto in senca) > .die3d-jump (skok ob metu) > .die3d-cube (vrtenje) > 6 ploskev */
.die3d { position: relative; width: 1em; height: 1em; font-size: var(--die-size); line-height: 0; perspective: 6em; }
.die3d::after {
    content: ''; position: absolute; left: 4%; right: 4%; bottom: -.3em; height: .2em; border-radius: 50%;
    background: radial-gradient(closest-side, var(--die-shadow), transparent);
}
.die3d-jump { display: block; width: 1em; height: 1em; transform-style: preserve-3d; }
.die3d-cube {
    display: block; position: relative; width: 1em; height: 1em; transform-style: preserve-3d;
    transition: transform var(--roll-ms, 1300ms) cubic-bezier(.16, .62, .25, 1);
}
.die3d-cube .die-face { position: absolute; left: 0; top: 0; backface-visibility: hidden; }
/* vržena ploskev: zlat rob, ko se kocka ustavi */
.die3d.is-set .die-face.is-result { box-shadow: inset 0 0 0 .07em var(--accent), inset 0 0 .14em var(--die-edge); }
.die3d-cube .f1 { transform: translateZ(.5em); }
.die3d-cube .f6 { transform: rotateY(180deg) translateZ(.5em); }
.die3d-cube .f3 { transform: rotateY(90deg) translateZ(.5em); }
.die3d-cube .f4 { transform: rotateY(-90deg) translateZ(.5em); }
.die3d-cube .f5 { transform: rotateX(90deg) translateZ(.5em); }
.die3d-cube .f2 { transform: rotateX(-90deg) translateZ(.5em); }
@media (max-height: 600px) { .roll-row { --die-size: 40px; padding: 6px 0 12px; } .roll-row.is-4 { --die-size: 36px; } .roll-row.is-many { --die-size: 32px; } }
@media (prefers-reduced-motion: no-preference) {
    .die3d.is-waiting .die3d-jump { animation: die-idle 2.2s ease-in-out infinite; }
    .die3d.is-waiting:nth-child(2n) .die3d-jump { animation-delay: -.7s; }
    .die3d.is-waiting:nth-child(3n) .die3d-jump { animation-delay: -1.4s; }
    .die3d.is-rolling .die3d-jump { animation: die-throw var(--roll-ms, 1300ms) cubic-bezier(.3, 0, .4, 1); }
    .die3d.is-rolling::after { animation: die-shadow var(--roll-ms, 1300ms) cubic-bezier(.3, 0, .4, 1); }
    .die3d.is-set .die3d-jump { animation: die-land .28s ease-out; }
}
@media (prefers-reduced-motion: reduce) { .die3d-cube { transition: none; } }
@keyframes die-idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.08em); } }
@keyframes die-throw {
    0% { transform: translateY(0) scale(1); }
    16% { transform: translateY(-.5em) scale(1.1); }
    40% { transform: translateY(0) scale(1); }
    55% { transform: translateY(-.26em) scale(1.04); }
    72% { transform: translateY(0); }
    84% { transform: translateY(-.08em); }
    94%, 100% { transform: translateY(0); }
}
@keyframes die-shadow {
    0%, 40%, 72%, 100% { transform: scale(1); opacity: 1; }
    16% { transform: scale(.55); opacity: .45; }
    55% { transform: scale(.8); opacity: .7; }
}
@keyframes die-land { 0% { transform: scale(1.14); } 100% { transform: scale(1); } }
/* Gumb ? (pravila plošče) v glavi poteze: ob njem ostane števec na desni */
.help-btn {
    margin-left: auto; flex: none; width: 40px; height: 40px; border-radius: 50%;
    border: 2px solid var(--line); background: var(--surface-2); color: var(--ink);
    font-size: var(--t-md); font-weight: 900; cursor: pointer;
}
/* Zemljevid plošče na telefonu (board-map.js): ilustracija je nočna, zato temna podlaga v vseh temah */
.map-btn { margin-left: 8px; font-size: var(--t-sm); }
.phase-head .map-btn + .timer-badge, .phase-head .help-btn + .map-btn { margin-left: 0; }
.board-map-sheet { max-width: 900px; padding-inline: 12px; }
.board-map-caption { margin: 4px 0 8px; color: var(--ink-soft); font-size: var(--t-sm); min-height: 1.4em; }
.board-map-scroll { overflow: auto; border-radius: var(--r-ctl); background: #0b1530; max-height: 70dvh; overscroll-behavior: contain; }
.board-map-view .bv-svg { display: block; width: 100%; height: auto; }
.board-map-view.is-zoomed { width: 230%; }
.board-map-tools { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.board-map-tools .hint { margin: 0; }

/* Koraki poteze: vrzi - izberi - glej TV */
.board-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.board-steps li {
    padding: 4px 2px; border-radius: 999px; text-align: center; white-space: nowrap;
    font-size: var(--t-xs); font-weight: 700; color: var(--ink-soft); background: var(--surface-2);
}
.board-steps li.is-done { color: var(--ink); background: color-mix(in srgb, var(--good) 22%, var(--surface)); }
.board-steps li.is-active { color: var(--accent-ink); background: var(--accent); }
/* Cilj: piškoti, darila in napredek do naslednjega darila */
.board-goal { display: grid; gap: 5px; padding: 8px 12px; border-radius: var(--r-tile); background: var(--surface-2); }
.goal-top { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; font-size: var(--t-md); }
.goal-pill b { font-size: var(--t-lg); font-weight: 900; }
.goal-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: var(--t-sm); color: var(--ink-soft); }
.goal-row b { color: var(--ink); white-space: nowrap; }
.goal-bar { display: block; width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; appearance: none; -webkit-appearance: none; background: var(--surface); }
.goal-bar::-webkit-progress-bar { background: var(--surface); border-radius: 999px; }
.goal-bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.goal-bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.board-goal.is-ready { outline: 2px solid var(--good); }
.board-goal.is-ready .goal-row { color: var(--ink); font-weight: 800; }
.board-goal.is-ready .goal-bar::-webkit-progress-value { background: var(--good); }
.board-goal.is-ready .goal-bar::-moz-progress-bar { background: var(--good); }
.goal-note { margin: 0; font-size: var(--t-sm); text-align: center; }
.goal-row.is-where { color: var(--ink); font-weight: 700; }
/* Prva poteza: kratka razlaga cilja */
.board-intro { display: grid; gap: 2px; padding: 8px 10px; border: 2px solid var(--accent); border-radius: var(--r-tile); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); font-size: var(--t-sm); text-align: center; }
.board-intro p { margin: 0; }
.board-intro .link-btn { padding: 0 2px; color: var(--ink); font-size: inherit; font-weight: 800; text-decoration: underline; }
.board-gain { margin: 0; font-size: var(--t-sm); color: var(--ink-soft); text-align: center; }
/* zadnja poteza (vse dvojno) in bonus darila ob koncu */
.board-finale { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.finale-chip { padding: 3px 9px; border: 2px solid var(--accent); border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); font-weight: 800; font-size: var(--t-xs); white-space: nowrap; }
.bonus-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bonus-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--r-tile); background: var(--surface-2); animation: bonus-in 0.45s ease-out; }
.bonus-row.is-me { border-color: var(--accent); }
.bonus-kind { font-weight: 700; min-width: 0; }
.bonus-who { text-align: right; }
.bonus-value { grid-column: 1 / -1; font-size: var(--t-sm); color: var(--ink-soft); }
@keyframes bonus-in { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bonus-row { animation: none; } }
.board-hint { margin: 0; font-weight: 700; text-align: center; }
#board-pick-hint { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 8px; }
.hint-dice { display: inline-flex; gap: 5px; font-size: 1.45em; }
.board-dice { display: grid; gap: 8px; }
/* Kartica izbire: kocka, kam prideš, na desni kaj prinese. Levi rob pove, ali je polje dobro ali slabo. */
.board-die {
    --tone: var(--line);
    display: flex; align-items: center; gap: 10px;
    min-height: 60px; padding: 8px 10px 8px 8px;
    border: 2px solid var(--line); border-left: 8px solid var(--tone); border-radius: var(--r-tile);
    background: var(--surface-2); color: var(--ink);
    text-align: left; cursor: pointer;
}
.board-die.is-good { --tone: var(--good); }
.board-die.is-bad { --tone: var(--bad); }
.board-die.is-maybe { --tone: var(--warn); }
.board-die.has-gift { border-color: var(--good); background: color-mix(in srgb, var(--good) 16%, var(--surface)); }
.board-die:disabled { cursor: default; opacity: 0.5; }
.board-die-field { font-weight: 700; }
.board-die-note { font-size: var(--t-xs); color: var(--ink-soft); line-height: 1.25; }
.board-die-note.is-risk { color: var(--warn); font-weight: 800; }
.board-die-gift { color: var(--good); font-weight: 800; }
.board-die-badge {
    --tone: var(--line);
    margin-left: auto; flex: none; padding: 4px 9px; border-radius: 999px; white-space: nowrap;
    font-weight: 900; font-size: var(--t-sm); color: var(--ink);
    background: color-mix(in srgb, var(--tone) 30%, var(--surface)); border: 2px solid var(--tone);
}
.board-die-badge.is-good { --tone: var(--good); }
.board-die-badge.is-bad { --tone: var(--bad); }
.board-die-badge.is-maybe { --tone: var(--warn); }
/* Kocka čez razpotje: pot se izbere v drugem koraku (openFork) */
.board-die.is-fork { --tone: var(--accent); }
.board-die.is-selected { opacity: 1; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 28%, var(--surface)); }
.board-die-face { font-size: 40px; line-height: 0; flex: none; }
.board-die-info { display: grid; gap: 1px; font-size: var(--t-sm); min-width: 0; }
.board-die-info b { font-size: var(--t-md); }
/* Predmeti iz trgovine (pred metom) in zaslon trgovine */
.board-items { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.board-items-label { flex-basis: 100%; text-align: center; font-size: var(--t-xs); font-weight: 700; color: var(--ink-soft); }
.board-item { min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--ink); font-weight: 700; font-size: var(--t-sm); cursor: pointer; }
.board-item:disabled { opacity: .5; cursor: default; }
.board-item.is-passive { border-color: var(--line); background: var(--surface-2); color: var(--ink-soft); cursor: default; display: inline-flex; align-items: center; }
button.board-item.is-passive { cursor: pointer; }
.board-shop-items { display: grid; gap: 6px; }
.board-shop-item { display: grid; gap: 1px; text-align: left; padding: 7px 12px; border: 2px solid var(--line); border-radius: var(--r-tile); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.board-shop-item:disabled { opacity: .45; cursor: default; }
.board-shop-head { display: flex; justify-content: space-between; gap: 8px; font-size: var(--t-md); }
.board-shop-price { font-weight: 800; white-space: nowrap; }
.board-shop-desc { font-size: var(--t-xs); color: var(--ink-soft); line-height: 1.3; }
.board-feedback { margin: 0; min-height: 1.4em; text-align: center; font-weight: 700; }
.board-feedback.is-good { color: var(--good); }
.board-feedback.is-bad { color: var(--bad); }
/* Izid moje poteze: zgoraj velika sprememba, pod njo vrstice, kaj se je zgodilo */
.board-result { display: grid; gap: 8px; padding: 12px; border: 2px solid var(--line); border-radius: var(--r-tile); background: var(--surface-2); }
.result-head { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.result-chip { padding: 4px 14px; border-radius: 999px; font-size: var(--t-lg); font-weight: 900; background: var(--surface); border: 2px solid var(--line); }
.result-chip.is-good { border-color: var(--good); background: color-mix(in srgb, var(--good) 24%, var(--surface)); }
.result-chip.is-bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 24%, var(--surface)); }
.result-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--t-sm); }
.result-list li { padding: 4px 8px; border-radius: 8px; background: var(--surface); }
@media (prefers-reduced-motion: no-preference) { .board-result { animation: bonus-in 0.35s ease-out; } }
/* Pomoč "Kako se igra plošča" */
.help-goal { margin: 0; padding: 10px 12px; border-radius: var(--r-tile); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.help-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: var(--t-sm); line-height: 1.35; }
.help-fields { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.help-field { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 2px 8px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); }
.help-field-icon { font-size: var(--t-lg); text-align: center; }
.help-field .board-die-badge { font-size: var(--t-xs); }
.help-field-note { grid-column: 2 / -1; font-size: var(--t-xs); color: var(--ink-soft); line-height: 1.25; }
.board-summary { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.board-summary li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); }
.board-summary li.is-gift { background: color-mix(in srgb, var(--good) 20%, var(--surface)); font-weight: 800; }
.board-summary li.is-me { outline: 2px solid var(--accent); }
.board-final { display: grid; gap: 8px; }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: var(--t-sm); cursor: pointer; }
.switch-row input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }
.board-setting { display: grid; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* --- Pisava za naslove, številke in gumbe (Fredoka) --- */
h1, h2, h3, .btn, .home-title, .phase-title, .phase-label, .section-title, .modal-title, .recap-title,
.timer-badge, .room-code, .rank-pos, .rank-score, .final-me-big, .final-winner, .brand-text, .seg,
.board-steps li, .greeting, .field-label, .pill, legend, .final-me-label {
    font-family: var(--font-head);
}

/* --- Lastne ikone (public/icons.svg, js/icons.js zamenja emoji v besedilu) --- */
.icon-sheet { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -0.24em; flex: none; overflow: visible; }
.icon-btn .ic, .help-btn .ic { width: 1.45em; height: 1.45em; vertical-align: middle; }
.brand-mark .ic { width: 1.5em; height: 1.5em; }
.btn .ic { width: 1.35em; height: 1.35em; }

/* Plošča: vrstni red premikov v potezi */
.board-order { display: grid; gap: 4px; padding: 8px 10px; border: 2px solid var(--line); border-radius: var(--r-tile); background: var(--surface-2); }
.board-order-label { font-weight: 800; font-size: .9rem; }
.board-order-list { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; list-style: none; }
.order-chip { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: .82rem; font-weight: 700; white-space: nowrap; }
.order-chip.is-me { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); }
.board-order-hint { font-size: .76rem; opacity: .75; }
.board-item.is-planned { opacity: 1; font-weight: 700; }
/* Dražba pred zadnjo potezo (tekmovalni način) */
.auction-amount { margin: 0; text-align: center; font-family: var(--font-head); font-size: 2rem; font-weight: 700; }
.auction-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.auction-row .btn { padding-left: 0; padding-right: 0; min-width: 0; }
.board-shop-item.is-static { cursor: default; }
/* Najboljši v rundi: izbira dveh kock za vsoto */
.sum-dice { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sum-die { font-size: 44px; line-height: 0; padding: 6px; border: 3px solid var(--line); border-radius: var(--r-tile); background: var(--surface-2); cursor: pointer; }
.sum-die.is-selected { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 2px var(--accent); }
/* Kviz: opis jokerja pred uporabo */
.joker-info { display: grid; gap: 8px; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--r-tile); background: var(--surface-2); }
.joker-info-text { margin: 0; font-size: .95rem; }
.joker-info-row { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.joker-info-row .btn { min-width: 0; padding-top: 8px; padding-bottom: 8px; }
