/* POVIO CELJE: TEAMBUILDING — UI / HUD styles. DOM overlay lives in #ui (pointer-events:none, children opt in). */
@font-face { font-family: 'Bungee'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../assets/fonts/bungee-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: 'Bungee'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../assets/fonts/bungee-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; }

#ui {
  --navy: #0b1220; --navy2: #121b30; --navy3: #1b2745; --navy4: #26355c;
  --blue: #8fa3d9; --blue2: #6f7fa8; --amber: #f5b63c; --amber2: #ffd37a;
  --red: #ff5a5f; --green: #5fd49a; --ink: #e8edf9; --mute: #9aa6c4;
  --disp: 'Bungee', 'Arial Black', Impact, system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px);
  --gt: calc(max(10px, var(--sat)) + 4px);
  --gr: max(12px, var(--sar)); --gl: max(12px, var(--sal)); --gb: max(12px, var(--sab));
  --tap: 44px;
  position: fixed; inset: 0; z-index: 10; overflow: hidden;
  pointer-events: none; color: var(--ink); font-family: var(--sans);
  font-size: clamp(12px, min(0.4vw + 9px, 1.2vh + 7px), 24px);
  -webkit-font-smoothing: antialiased; text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
#ui *, #ui *::before, #ui *::after { box-sizing: border-box; }
#ui button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; margin: 0; touch-action: manipulation; }
#ui [hidden] { display: none !important; }
#ui kbd { font-family: var(--mono); font-size: .85em; font-weight: 700; display: inline-block; min-width: 1.7em; padding: .12em .45em; text-align: center;
  color: var(--navy); background: linear-gradient(#f2f5fd, #c8d2ee); border-radius: .35em; box-shadow: 0 .14em 0 #55658f, 0 .2em .4em #0006; }

/* ---------- mode switching ---------- */
#ui .hud, #ui .stack, #ui .toasts, #ui .ticker { display: none; }
#ui.mode-play .hud, #ui.mode-pause .hud, #ui.mode-play .stack, #ui.mode-pause .stack,
#ui.mode-play .toasts, #ui.mode-pause .toasts, #ui.mode-play .ticker, #ui.mode-pause .ticker { display: block; }
#ui .menu, #ui .pause, #ui .over { display: none; }
#ui.mode-menu .menu { display: flex; } #ui.mode-pause .pause { display: flex; } #ui.mode-over .over { display: flex; }
#ui.mode-menu .toasts, #ui.mode-over .toasts { display: block; }

/* ---------- shared bits ---------- */
#ui .btn { pointer-events: auto; min-height: max(var(--tap), 3em); padding: .55em 1.4em; border-radius: .6em; font-family: var(--disp); letter-spacing: .04em;
  text-transform: uppercase; font-size: 1.05em; display: inline-flex; align-items: center; justify-content: center; gap: .5em; position: relative;
  transition: transform .12s, filter .12s, box-shadow .12s; user-select: none; }
#ui .btn:active { transform: translateY(.12em) scale(.98); }
#ui .btn:focus-visible, #ui .ibtn:focus-visible, #ui .opt:focus-visible { outline: 3px solid var(--amber2); outline-offset: 2px; }
#ui .btn-primary { color: #2a1a00; background: linear-gradient(#ffd37a, #f5b63c 55%, #e29a1d); box-shadow: 0 .25em 0 #a8650b, 0 .6em 1.2em #0008, inset 0 .1em 0 #fff8; text-shadow: 0 1px 0 #fff6; }
#ui .btn-primary:hover { filter: brightness(1.08); }
#ui .btn-ghost { color: var(--ink); background: #1b2745cc; box-shadow: inset 0 0 0 2px var(--blue2), 0 .4em 1em #0006; backdrop-filter: blur(6px); }
#ui .btn-ghost:hover { background: #26355ce6; box-shadow: inset 0 0 0 2px var(--blue), 0 .4em 1em #0006; }
#ui .btn[disabled] { opacity: .55; pointer-events: none; }
#ui .big { font-size: 1.35em; padding: .6em 1.8em; }
#ui .ibtn { pointer-events: auto; width: var(--tap); height: var(--tap); border-radius: .7em; display: grid; place-items: center; background: #0b1220b8;
  box-shadow: inset 0 0 0 2px #8fa3d955; backdrop-filter: blur(6px); color: var(--ink); }
#ui .ibtn:hover { box-shadow: inset 0 0 0 2px var(--blue); } #ui .ibtn svg { width: 55%; height: 55%; fill: currentColor; }
#ui .ibtn.off { color: var(--red); }
#ui .tag { font-family: var(--mono); font-size: .72em; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }

/* ---------- HUD ---------- */
#ui .hud { position: absolute; inset: 0; pointer-events: none; }
#ui .hud-score { position: absolute; left: var(--gl); top: var(--gt); min-width: 7.5em; padding: .35em .9em .3em .8em; background: linear-gradient(#142042ee, #0b1220ee);
  border-radius: .7em; border-left: .35em solid var(--amber); box-shadow: 0 .4em 1.2em #0007; }
#ui .hud-score .lbl { display: block; font-family: var(--mono); font-size: .66em; letter-spacing: .18em; color: var(--blue); }
#ui .hud-score .val { display: inline-block; font-family: var(--disp); font-size: 2.1em; line-height: 1.05; color: var(--amber); text-shadow: 0 .06em 0 #7a4a06; font-variant-numeric: tabular-nums; transform-origin: left center; }
#ui .hud-score .val.pop { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
#ui .hud-score .val.hit { animation: hit .45s; color: var(--red); }
#ui .hud-score .delta { position: absolute; right: .6em; top: .3em; font-family: var(--disp); font-size: 1em; color: var(--green); opacity: 0; pointer-events: none; }
#ui .hud-score .delta.neg { color: var(--red); }
#ui .hud-score .delta.go { animation: delta 1.1s ease-out; }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.38) rotate(-3deg); color: #fff; } 100% { transform: scale(1); } }
@keyframes hit { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-.15em); } 40% { transform: translateX(.15em); } 60% { transform: translateX(-.1em); } }
@keyframes delta { 0% { opacity: 0; transform: translateY(.8em); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-1.4em); } }

#ui .hud-clock { position: absolute; left: 50%; top: var(--gt); transform: translateX(-50%); text-align: center; padding: .3em 1em .35em; border-radius: .7em;
  background: #0b1220d0; box-shadow: inset 0 0 0 2px #8fa3d944, 0 .4em 1.2em #0007; min-width: 7.5em; }
#ui .hud-clock .t { font-family: var(--mono); font-weight: 800; font-size: 1.9em; line-height: 1; letter-spacing: .04em; color: var(--ink); font-variant-numeric: tabular-nums; }
#ui .hud-clock .t i { color: var(--amber); font-style: normal; animation: blink 1s steps(2) infinite; }
#ui .hud-clock .bar { height: .28em; border-radius: .2em; background: #26355c; margin-top: .3em; overflow: hidden; }
#ui .hud-clock .bar b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f5b63c, #ff7a45 45%, #6f7fa8 70%, #8fa3d9); }
@keyframes blink { 50% { opacity: .25; } }

#ui .hud-ctrl { position: absolute; right: var(--gr); top: var(--gt); display: flex; gap: .5em; }

#ui .hud-drunk { position: absolute; right: var(--gr); top: calc(var(--gt) + var(--tap) + .6em); width: min(17em, 44vw); padding: .45em .7em .55em;
  background: #0b1220d0; border-radius: .7em; box-shadow: inset 0 0 0 2px #8fa3d944, 0 .4em 1.2em #0007; }
#ui .hud-drunk .row { display: flex; align-items: baseline; justify-content: space-between; gap: .6em; }
#ui .hud-drunk .lbl { font-family: var(--mono); font-size: .66em; letter-spacing: .18em; color: var(--blue); white-space: nowrap; }
#ui .hud-drunk .lvl { font-family: var(--disp); font-size: .9em; color: var(--amber); text-align: right; line-height: 1.1; }
#ui .hud-drunk .meter { position: relative; height: 1.05em; margin-top: .35em; border-radius: .25em; background: #1b2745; overflow: hidden; box-shadow: inset 0 .12em .3em #0009; }
#ui .hud-drunk .meter b { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #6f7fa8, #8fa3d9 25%, #f5b63c 55%, #ff7a45 80%, #ff4d5a);
  box-shadow: 0 0 .9em #f5b63c66; }
#ui .hud-drunk .meter b::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 .55em, #0b122055 .55em .7em); }
#ui .hud-drunk .meter i { position: absolute; top: 0; bottom: 0; width: 2px; background: #0b1220aa; }
#ui .hud-drunk.wob .lvl { animation: wob .5s ease-in-out infinite alternate; }
#ui .hud-drunk.crit { animation: crit .6s ease-in-out infinite alternate; }
@keyframes wob { from { transform: rotate(-2.5deg) translateX(-.05em); } to { transform: rotate(2.5deg) translateX(.05em); } }
@keyframes crit { from { box-shadow: inset 0 0 0 2px #ff5a5f, 0 0 .5em #ff5a5f66; } to { box-shadow: inset 0 0 0 2px #ff5a5f, 0 0 1.4em #ff5a5faa; } }

#ui .hud-missions { position: absolute; left: var(--gl); top: calc(var(--gt) + 4.3em); width: min(19em, 52vw); pointer-events: none; }
#ui .hud-missions .head { pointer-events: auto; display: flex; align-items: center; gap: .6em; width: 100%; min-height: var(--tap); padding: .3em .8em; text-align: left;
  background: #0b1220d0; border-radius: .7em .7em 0 0; box-shadow: inset 0 0 0 2px #8fa3d944; font-family: var(--mono); font-weight: 700; font-size: .78em; letter-spacing: .12em; color: var(--blue); }
#ui .hud-missions .head .n { margin-left: auto; color: var(--amber); }
#ui .hud-missions .head .car { transition: transform .2s; display: inline-block; }
#ui .hud-missions.closed .head { border-radius: .7em; } #ui .hud-missions.closed .head .car { transform: rotate(-90deg); }
#ui .hud-missions.closed .list { display: none; }
#ui .hud-missions .list { margin: 0; padding: .3em .45em .45em; list-style: none; background: #0b1220b8; border-radius: 0 0 .7em .7em; box-shadow: inset 0 0 0 2px #8fa3d922; max-height: 38vh; overflow: hidden; }
#ui .hud-missions li { display: grid; grid-template-columns: auto 1fr auto; gap: .2em .55em; align-items: start; padding: .4em .45em; margin-top: .25em; border-radius: .4em;
  background: #1b2745aa; border-left: .22em solid var(--blue2); font-size: .86em; line-height: 1.25; }
#ui .hud-missions li .box { width: 1.15em; height: 1.15em; margin-top: .05em; border-radius: .25em; box-shadow: inset 0 0 0 2px var(--blue2); display: grid; place-items: center; font-size: .95em; color: transparent; }
#ui .hud-missions li .key { grid-column: 2; font-family: var(--mono); font-size: .68em; color: var(--blue2); letter-spacing: .08em; order: -1; }
#ui .hud-missions li .tx { grid-column: 2; }
#ui .hud-missions li .box { grid-row: 1 / span 2; }
#ui .hud-missions li .pts { grid-row: 1 / span 2; grid-column: 3; align-self: center; font-family: var(--mono); font-weight: 800; font-size: .8em; color: var(--amber); }
#ui .hud-missions li.done { border-left-color: var(--green); opacity: .72; }
#ui .hud-missions li.done .tx { text-decoration: line-through; text-decoration-color: var(--green); color: var(--mute); }
#ui .hud-missions li.done .box { background: var(--green); box-shadow: none; color: var(--navy); font-weight: 900; }
#ui .hud-missions li.just { animation: just 1.2s ease-out; }
@keyframes just { 0% { background: #5fd49a; transform: scale(1.06); } 100% { background: #1b2745aa; transform: scale(1); } }

/* ticker (under the clock) */
#ui .ticker { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--gt) + 4.3em); width: min(26em, calc(100vw - 38em)); pointer-events: none; font-family: var(--mono); font-size: .78em; }
#ui .ticker div { padding: .2em .7em; margin-bottom: .2em; border-radius: .3em; background: #0b1220a8; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
  animation: tick-in .35s ease-out; transition: opacity .6s; }
#ui .ticker div.out { opacity: 0; }
#ui .ticker div b { color: var(--green); } #ui .ticker div b.neg { color: var(--red); } #ui .ticker div em { font-style: normal; color: var(--blue); }
#ui .ticker div.sc { color: var(--amber2); }
@keyframes tick-in { from { transform: translateY(-.7em); opacity: 0; } }

/* toasts (right column under drunk meter) */
#ui .toasts { position: absolute; right: var(--gr); top: calc(var(--gt) + var(--tap) + 5.6em); width: min(20em, 56vw); display: none; pointer-events: none; }
#ui.mode-menu .toasts, #ui.mode-over .toasts { top: var(--gt); }
#ui .toast { position: relative; margin-top: .4em; padding: .5em .8em .5em 1em; border-radius: .5em; background: #121b30f2; font-weight: 700; font-size: .95em; line-height: 1.25; text-align: right;
  border-right: .3em solid var(--blue); box-shadow: 0 .3em 1em #0009; animation: toast-in .35s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .35s, transform .35s; overflow-wrap: anywhere; }
#ui .toast.good { border-right-color: var(--green); background: linear-gradient(270deg, #123024f2, #121b30f2 60%); }
#ui .toast.bad { border-right-color: var(--red); background: linear-gradient(270deg, #3a1520f2, #121b30f2 60%); }
#ui .toast.out { opacity: 0; transform: translateX(1.5em); }
#ui .toast .x { color: var(--amber); font-family: var(--mono); margin-left: .4em; }
@keyframes toast-in { from { opacity: 0; transform: translateX(2em) scale(.9); } }

/* bottom centre stack: prompt, subtitle, held chip */
#ui .stack { position: absolute; left: 50%; transform: translateX(-50%); bottom: var(--gb); width: min(44em, calc(100vw - 2 * var(--gl) - 2 * 11em)); min-width: 17em;
  display: none; flex-direction: column; align-items: center; gap: .6em; pointer-events: none; }
#ui.mode-play .stack, #ui.mode-pause .stack { display: flex; }
#ui .prompt { padding: .5em 1.1em; border-radius: 2em; background: #0b1220e6; box-shadow: inset 0 0 0 2px var(--amber), 0 .4em 1.2em #0009; font-weight: 800; font-size: 1.1em; text-align: center;
  display: flex; align-items: center; gap: .6em; animation: prompt-in .2s ease-out; }
#ui .prompt[hidden], #ui:not(.mode-play) .prompt { display: none; }
@keyframes prompt-in { from { transform: translateY(.6em) scale(.9); opacity: 0; } }
#ui .sub { max-width: 100%; padding: .55em 1.1em .6em; border-radius: .6em; background: #0b1220e0; box-shadow: 0 .4em 1.4em #000a; text-align: center; font-size: 1.15em; line-height: 1.3; transition: opacity .3s; animation: prompt-in .25s ease-out; }
#ui .sub.out { opacity: 0; }
#ui .sub .who { display: block; font-family: var(--disp); font-size: .72em; letter-spacing: .08em; color: var(--amber); text-transform: uppercase; margin-bottom: .1em; }
#ui .held { display: inline-flex; align-items: center; gap: .6em; padding: .35em .9em; border-radius: .6em; background: #1b2745ee; box-shadow: inset 0 0 0 2px var(--blue2), 0 .3em 1em #0008; font-size: .95em; }
#ui .held .lbl { font-family: var(--mono); font-size: .7em; letter-spacing: .12em; color: var(--blue); }
#ui .held .it { font-family: var(--disp); color: var(--amber); font-size: 1.05em; }
#ui .held[hidden] { display: none; }

/* touch: prompt hugs the action-button area; stack keeps clear of both thumb zones */
#ui.touch .stack { width: calc(100vw - 2 * var(--gl) - 2 * 9.5em); min-width: 12em; }
#ui.touch .prompt { position: absolute; right: var(--gr); bottom: calc(var(--gb) + 11.5em); transform: none; max-width: 42vw; border-radius: .8em; font-size: 1em; }
#ui.touch .sub { font-size: 1.05em; }

/* ---------- banner / flash / fade ---------- */
#ui .bannerL { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; overflow: hidden; }
#ui .banner { position: relative; width: 100%; padding: 1.1em var(--gr) 1.2em var(--gl); text-align: center; transform: rotate(-2.5deg); animation: slam .55s cubic-bezier(.15, 1.2, .3, 1) both;
  background: repeating-linear-gradient(-45deg, #f5b63c 0 1.2em, #e29a1d 1.2em 2.4em); box-shadow: 0 0 0 .35em #0b1220, 0 1em 4em #000b; color: #1a1000; }
#ui .banner::before, #ui .banner::after { content: ''; position: absolute; left: 0; right: 0; height: .5em; background: repeating-linear-gradient(90deg, #0b1220 0 1em, transparent 1em 2em); }
#ui .banner::before { top: .4em; } #ui .banner::after { bottom: .4em; }
#ui .banner .in { position: relative; display: inline-block; max-width: 92%; padding: .15em 1em; background: #0b1220; transform: rotate(.8deg); box-shadow: .25em .25em 0 #6f7fa8; }
#ui .banner h2 { margin: 0; font-family: var(--disp); font-weight: 400; font-size: clamp(2em, 7.5vw, 6.5em); line-height: 1.05; letter-spacing: .02em; color: var(--amber);
  text-shadow: .05em .05em 0 #7a4a06, 0 0 .6em #f5b63c55; text-transform: uppercase; overflow-wrap: anywhere; }
#ui .banner p { margin: .1em 0 .2em; font-family: var(--mono); font-weight: 700; font-size: clamp(1em, 2vw, 1.8em); color: var(--ink); letter-spacing: .06em; }
#ui .banner.out { animation: slam-out .4s ease-in both; }
@keyframes slam { 0% { transform: translateX(-120%) rotate(-2.5deg) scale(1.6); opacity: 0; } 55% { transform: translateX(2%) rotate(-2.5deg) scale(1.04); opacity: 1; } 75% { transform: translateX(-1%) rotate(-2.5deg) scale(.99); } 100% { transform: translateX(0) rotate(-2.5deg) scale(1); opacity: 1; } }
@keyframes slam-out { to { transform: translateX(130%) rotate(-2.5deg); opacity: 0; } }
#ui .flash, #ui .fade { position: absolute; inset: 0; pointer-events: none; }
#ui .fade { background: #000; opacity: 0; z-index: 90; }

/* ---------- choice modal ---------- */
#ui .modal { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; padding: max(var(--sat), 12px) var(--gr) max(var(--sab), 12px) var(--gl);
  background: radial-gradient(ellipse at center, #0b122099, #0b1220dd); pointer-events: auto; animation: fade-in .2s; overflow: auto; }
#ui .modal .card { width: min(32em, 100%); max-height: 100%; overflow: auto; border-radius: .8em; background: linear-gradient(#17223f, #0f1830); box-shadow: 0 0 0 3px #0b1220, 0 0 0 5px var(--blue2), 0 1.5em 4em #000c; animation: card-in .3s cubic-bezier(.2, 1.4, .4, 1); }
#ui .modal .ch { padding: .8em 1.1em .7em; background: repeating-linear-gradient(-45deg, #f5b63c 0 .9em, #e29a1d .9em 1.8em); color: #1a1000; font-family: var(--disp); font-size: 1.15em; line-height: 1.2; text-transform: uppercase; }
#ui .modal .opts { padding: .7em; display: grid; gap: .5em; }
#ui .opt { display: grid; grid-template-columns: 2em 1fr; gap: .2em .8em; align-items: center; width: 100%; min-height: var(--tap); text-align: left; padding: .6em .8em; border-radius: .55em; background: #1b2745;
  box-shadow: inset 0 0 0 2px #2e3f6b; transition: transform .1s, background .1s, box-shadow .1s; }
#ui .opt:hover, #ui .opt.sel { background: #26355c; box-shadow: inset 0 0 0 2px var(--amber); transform: translateX(.2em); }
#ui .opt .k { grid-row: 1 / span 2; align-self: center; width: 1.9em; height: 1.9em; display: grid; place-items: center; border-radius: .4em; background: var(--amber); color: #2a1a00; font-family: var(--disp); }
#ui .opt .l { font-weight: 800; line-height: 1.2; } #ui .opt .d { grid-column: 2; font-size: .85em; color: var(--mute); line-height: 1.3; }
#ui .modal .esc { padding: 0 1.1em .8em; font-size: .78em; color: var(--mute); font-family: var(--mono); }
@keyframes fade-in { from { opacity: 0; } } @keyframes card-in { from { transform: translateY(1.5em) scale(.9); opacity: 0; } }

/* ---------- big overlays (menu / pause / over) ---------- */
#ui .menu, #ui .pause, #ui .over { position: absolute; inset: 0; pointer-events: auto; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y;
  padding: max(var(--sat), 14px) var(--gr) max(var(--sab), 14px) var(--gl); }
#ui .menu { background: linear-gradient(90deg, #0b1220ee 0%, #0b1220cc 38%, #0b122033 68%, #0b122066 100%), radial-gradient(ellipse at 100% 100%, #0b1220cc, transparent 60%);
  align-items: center; gap: 2em; justify-content: space-between; animation: fade-in .6s; }
#ui .menu::after { content: ''; position: fixed; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, #0000 0 3px, #0b122022 3px 4px); }
#ui .m-left { flex: 1 1 52%; max-width: 46em; display: flex; flex-direction: column; gap: 1.1em; align-items: flex-start; position: relative; z-index: 1; margin: auto 0; }
#ui .m-right { flex: 0 1 25em; display: flex; flex-direction: column; gap: 1em; position: relative; z-index: 1; margin: auto 0; }
#ui .brand { display: flex; align-items: center; gap: .7em; font-family: var(--mono); font-weight: 700; letter-spacing: .2em; font-size: .85em; color: var(--blue); }
#ui .brand img { width: 3.2em; height: 3.2em; border-radius: .8em; box-shadow: 0 0 0 2px #8fa3d966, 0 .3em .8em #0008; }
#ui .title { margin: 0; font-family: var(--disp); font-weight: 400; line-height: .92; text-transform: uppercase; }
#ui .title .t1 { display: block; font-size: clamp(2.6em, 9vw, 6.4em); color: #e8edf9; text-shadow: .045em .045em 0 var(--blue2), .09em .09em 0 #0b1220, 0 0 .7em #8fa3d944; }
#ui .title .t2 { display: inline-block; margin-top: .22em; padding: .12em .45em .16em; font-size: clamp(1.5em, 5.2vw, 3.7em); color: #2a1a00; transform: rotate(-2deg);
  background: repeating-linear-gradient(-45deg, #f5b63c 0 .28em, #e8a42c .28em .56em); box-shadow: .1em .1em 0 #0b1220, 0 0 0 .06em #0b1220, .1em .1em 0 .06em #0b1220; }
#ui .tag-line { margin: .2em 0 0; font-size: clamp(1.1em, 2.2vw, 1.7em); font-style: italic; font-weight: 600; color: var(--amber2); text-shadow: 0 .08em .3em #000a; }
#ui .m-btns { display: flex; flex-wrap: wrap; gap: .9em; align-items: center; margin-top: .4em; }
#ui .m-btns .hint { font-size: .78em; color: var(--mute); display: flex; align-items: center; gap: .4em; }
#ui .btn-primary.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.04); filter: brightness(1.12); } }
#ui .tipbox { max-width: 34em; padding: .6em .9em; border-radius: .5em; background: #0b1220b0; border-left: .25em solid var(--amber); font-family: var(--mono); font-size: .86em; line-height: 1.4; color: var(--ink); min-height: 3.6em; transition: opacity .3s; }
#ui .tipbox.out { opacity: 0; } #ui .tipbox b { color: var(--amber); }
#ui .disc { max-width: 38em; font-size: .72em; color: var(--mute); line-height: 1.4; }
#ui .disc b { display: inline-block; padding: .05em .45em; margin-right: .5em; border-radius: .3em; background: var(--red); color: #fff; font-family: var(--disp); }

/* draw card (Jira-ticket style) */
#ui .draw { position: relative; border-radius: .8em; overflow: hidden; background: linear-gradient(#17223f, #0f1830); box-shadow: 0 0 0 3px #0b1220, 0 0 0 5px var(--blue2), 0 1.2em 3em #000b; transform: rotate(1.2deg); }
#ui .draw .dh { display: flex; justify-content: space-between; gap: .5em; padding: .55em .9em; background: repeating-linear-gradient(-45deg, #f5b63c 0 .8em, #e29a1d .8em 1.6em); color: #1a1000; font-family: var(--disp); font-size: .85em; text-transform: uppercase; }
#ui .draw .db { display: flex; gap: 1em; padding: 1em; align-items: center; }
#ui .face { flex: none; width: 7.6em; aspect-ratio: 1; border-radius: .6em; background: #26355c no-repeat; box-shadow: 0 0 0 .2em #fff, 0 0 0 .3em #0b1220, .3em .4em 1em #000a; transform: rotate(-3deg); }
#ui .draw.spin .face { filter: saturate(.6) contrast(1.2) blur(.4px); animation: shake-face .12s linear infinite; }
#ui .draw.spin .nm, #ui .draw.spin .cp { opacity: .6; }
#ui .draw.land { animation: land .55s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes shake-face { 0% { transform: rotate(-3deg) translateY(-.15em); } 50% { transform: rotate(-1deg) translateY(.15em); } 100% { transform: rotate(-3deg) translateY(-.15em); } }
@keyframes land { 0% { transform: rotate(1.2deg) scale(1.12); } 100% { transform: rotate(1.2deg) scale(1); } }
#ui .draw .nm { font-family: var(--disp); font-size: 1.5em; line-height: 1.05; color: var(--ink); overflow-wrap: anywhere; }
#ui .draw .rl { margin-top: .3em; font-size: .82em; color: var(--blue); line-height: 1.3; }
#ui .draw .cp { padding: .8em 1em 1em; border-top: 2px dashed #2e3f6b; font-style: italic; font-weight: 700; font-size: 1.05em; color: var(--amber2); text-align: center; position: relative; line-height: 1.3; }
#ui .draw .ty { display: inline-block; margin-top: .45em; padding: .1em .55em; border-radius: .3em; background: #26355c; color: var(--blue); font-family: var(--mono); font-size: .66em; letter-spacing: .12em; }
#ui .draw-cap { font-family: var(--disp); font-size: 1.05em; color: var(--ink); text-shadow: 0 .1em .3em #000; }

#ui .help { border-radius: .6em; background: #0b1220c4; box-shadow: inset 0 0 0 2px #8fa3d933; font-size: .85em; overflow: hidden; }
#ui .help summary { cursor: pointer; padding: .7em 1em; min-height: var(--tap); display: flex; align-items: center; font-family: var(--mono); font-weight: 700; letter-spacing: .14em; color: var(--blue); list-style: none; }
#ui .help summary::-webkit-details-marker { display: none; }
#ui .help summary::after { content: '+'; margin-left: auto; color: var(--amber); font-size: 1.3em; } #ui .help[open] summary::after { content: '–'; }
#ui .help .body { padding: 0 1em .9em; display: grid; gap: .8em; }
#ui .help h4 { margin: 0 0 .35em; font-family: var(--mono); font-size: .8em; letter-spacing: .14em; color: var(--amber); }
#ui .help dl { display: grid; grid-template-columns: auto 1fr; gap: .35em .8em; margin: 0; align-items: center; }
#ui .help dt { white-space: nowrap; } #ui .help dd { margin: 0; color: var(--mute); }

/* pause */
#ui .pause { background: radial-gradient(ellipse at center, #0b122099, #0b1220ee); align-items: center; justify-content: center; flex-direction: column; text-align: center; gap: 1.2em; animation: fade-in .25s; }
#ui .pause h2 { margin: 0; font-family: var(--disp); font-weight: 400; font-size: clamp(1.8em, 6vw, 4.2em); line-height: 1.05; color: var(--amber); text-shadow: .05em .05em 0 #7a4a06; text-transform: uppercase; max-width: 14em; }
#ui .pause p { margin: 0; color: var(--blue); font-family: var(--mono); font-size: 1em; }
#ui .pause .btns { display: flex; flex-wrap: wrap; gap: .9em; justify-content: center; }

/* game over */
#ui .over { background: radial-gradient(ellipse at 30% 20%, #1b2745f0, #0b1220f8 70%); gap: 2em; align-items: stretch; justify-content: center; animation: fade-in .8s; }
#ui .o-left { flex: 0 1 30em; display: flex; flex-direction: column; gap: 1em; margin: auto 0; }
#ui .o-right { flex: 0 1 34em; display: flex; flex-direction: column; min-height: 0; margin: auto 0; max-height: 100%; }
#ui .over h2 { margin: 0; font-family: var(--disp); font-weight: 400; text-transform: uppercase; font-size: clamp(1.7em, 5vw, 3.4em); line-height: 1; color: var(--ink); text-shadow: .045em .045em 0 var(--blue2); }
#ui .o-score { display: flex; align-items: flex-end; gap: .8em; flex-wrap: wrap; }
#ui .o-score .num { font-family: var(--disp); font-size: clamp(2.6em, 8vw, 5em); line-height: .95; color: var(--amber); text-shadow: .05em .05em 0 #7a4a06; font-variant-numeric: tabular-nums; }
#ui .o-score .u { font-family: var(--mono); letter-spacing: .18em; color: var(--blue); padding-bottom: .5em; font-size: .85em; }
#ui .o-rank { padding: .8em 1em; border-radius: .7em; background: repeating-linear-gradient(-45deg, #f5b63c 0 .9em, #e29a1d .9em 1.8em); color: #1a1000; box-shadow: .25em .25em 0 #0b1220, .25em .25em 0 .12em var(--blue2); transform: rotate(-1deg); }
#ui .o-rank .rk { font-family: var(--disp); font-size: 1.35em; line-height: 1.1; text-transform: uppercase; }
#ui .o-rank .rt { margin-top: .3em; font-weight: 700; font-size: .92em; line-height: 1.3; }
#ui .o-head { font-family: var(--mono); font-size: .85em; color: var(--blue); font-style: italic; line-height: 1.4; }
#ui .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(8em, 1fr)); gap: .5em; }
#ui .stat { padding: .5em .7em; border-radius: .5em; background: #1b2745; box-shadow: inset 0 0 0 2px #2e3f6b; }
#ui .stat .v { display: block; font-family: var(--disp); font-size: 1.7em; line-height: 1; color: var(--amber); }
#ui .stat .k { display: block; margin-top: .2em; font-size: .78em; color: var(--mute); line-height: 1.2; }
#ui .o-btns { display: flex; gap: .8em; flex-wrap: wrap; }
#ui .tl-h { font-family: var(--mono); letter-spacing: .14em; font-weight: 700; color: var(--blue); font-size: .85em; padding: 0 .3em .6em; display: flex; justify-content: space-between; }
#ui .tl { flex: 1 1 auto; min-height: 12em; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: .4em .6em .8em .4em; display: grid; gap: .8em; align-content: start;
  scrollbar-width: thin; scrollbar-color: var(--blue2) transparent; max-height: calc(100vh - 8em); }
#ui .tk { position: relative; display: grid; grid-template-columns: 1fr auto; gap: .2em .8em; padding: .65em .8em .7em 1em; border-radius: .35em; background: #f1f3fa; color: #14203a; box-shadow: .2em .3em .7em #0009;
  border-left: .4em solid var(--blue2); transform: rotate(var(--r, 0deg)); }
#ui .tk:nth-child(3n+1) { --r: -.7deg; } #ui .tk:nth-child(3n+2) { --r: .6deg; } #ui .tk:nth-child(3n) { --r: -.2deg; }
#ui .tk .key { font-family: var(--mono); font-size: .7em; font-weight: 800; letter-spacing: .1em; color: #5a6b96; }
#ui .tk .key i { font-style: normal; margin-left: .7em; color: #8a94b0; }
#ui .tk .tx { grid-column: 1; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
#ui .tk .pt { grid-column: 2; grid-row: 1 / span 2; align-self: center; padding: .15em .6em; border-radius: 2em; background: #14203a; color: var(--green); font-family: var(--mono); font-weight: 800; }
#ui .tk .pt.neg { color: var(--red); }
#ui .tk.best { border-left-color: var(--amber); background: #fff4d8; } #ui .tk.best::after { content: 'NAJBOLJŠI MOMENT'; position: absolute; right: .6em; top: -.7em; padding: .1em .6em; border-radius: .3em; background: var(--amber); color: #2a1a00; font-family: var(--disp); font-size: .62em; }
#ui .tk.bad { border-left-color: var(--red); }
#ui .tk.good { border-left-color: var(--green); }
#ui .tl-empty { padding: 1em; text-align: center; color: var(--mute); font-style: italic; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  #ui .menu { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 1.2em; background: linear-gradient(180deg, #0b1220ee, #0b1220bb 55%, #0b1220ee); }
  #ui .m-left, #ui .m-right { flex: none; max-width: none; margin: 0; }
  #ui .draw { transform: none; } #ui .draw.land { animation: none; }
  #ui .over { flex-direction: column; justify-content: flex-start; }
  #ui .o-left, #ui .o-right { flex: none; margin: 0; }
  #ui .tl { max-height: none; overflow: visible; }
  #ui .over { gap: 1.2em; }
}
@media (max-width: 620px) {
  #ui .ticker { display: none !important; }
  #ui .hud-score { min-width: 0; } #ui .hud-score .val { font-size: 1.7em; }
  #ui .hud-clock { min-width: 0; padding: .25em .6em .3em; } #ui .hud-clock .t { font-size: 1.45em; }
  #ui .hud-drunk { width: min(14em, 46vw); }
  #ui .hud-missions { width: min(16em, 48vw); }
  #ui .toasts { width: min(15em, 52vw); font-size: .92em; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #ui .hud-score .val { font-size: 1.6em; } #ui .hud-clock .t { font-size: 1.4em; }
  #ui .hud-drunk { padding: .3em .6em .4em; } #ui .hud-drunk .meter { height: .8em; }
  #ui .hud-missions { top: calc(var(--gt) + 3.6em); }
  #ui .hud-missions .list { max-height: 30vh; }
  #ui .ticker { top: calc(var(--gt) + 3.6em); }
  #ui.touch .prompt { bottom: calc(var(--gb) + 9.5em); }
  #ui .menu { gap: 1em; } #ui .title .t1 { font-size: clamp(2.2em, 8vw, 4.2em); } #ui .face { width: 5.6em; }
  #ui .brand img { width: 2.4em; height: 2.4em; }
}
@media (orientation: portrait) and (max-width: 620px) {
  #ui.touch .stack { bottom: calc(var(--gb) + 12.5em); width: calc(100vw - 2 * var(--gl)); }
  #ui.touch .prompt { bottom: calc(var(--gb) + 12em); }
}
@media (prefers-reduced-motion: reduce) {
  #ui *, #ui *::before, #ui *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
