:root {
  --bg: #060d1a;
  --panel: rgba(10, 19, 36, 0.94);
  --panel-b: rgba(120, 160, 220, 0.18);
  --text: #e6eefc;
  --muted: #8193b2;
  --accent: #7dd3fc;
  --good: #4ade80;
  --bad: #f87171;
  --gold: #fbbf24;
  --radius: 14px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --nav-h: 62px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: 'Rubik', system-ui, sans-serif; overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: var(--bad); min-height: 1.2em; margin: 6px 0 0; font-size: 14px; }
.pos { color: var(--good) !important; } .neg { color: var(--bad) !important; } .warn { color: var(--gold) !important; }

.screen { position: fixed; inset: 0; display: none; }
.screen.active { display: block; }

/* ---------- tlačítka a vstupy ---------- */
.btn {
  background: rgba(125, 211, 252, 0.08); border: 1px solid rgba(125, 211, 252, 0.3);
  padding: 11px 16px; border-radius: 12px; cursor: pointer; font-weight: 500; min-height: 44px;
  transition: transform .08s, background .15s, border-color .15s, opacity .15s;
}
.btn:hover:not(:disabled) { background: rgba(125, 211, 252, 0.18); border-color: rgba(125, 211, 252, 0.6); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, #2563eb, #7c3aed); border-color: transparent; font-weight: 700; box-shadow: 0 6px 24px rgba(99, 102, 241, .35); }
.btn.big { padding: 14px 22px; font-size: 18px; width: 100%; }
.btn.small { padding: 6px 10px; font-size: 13px; min-height: 34px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.icon-btn { background: rgba(255,255,255,.07); border: 0; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 15px; flex: none; }
input, select { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px; padding: 11px 12px; outline: none; font-size: 16px; }
input:focus, select:focus { border-color: var(--accent); }
select option { background: #0b1628; }
input[type=range] { width: 100%; padding: 0; accent-color: var(--accent); background: transparent; border: 0; height: 30px; }

/* ---------- menu ---------- */
#menuBg { position: absolute; inset: 0; width: 100%; height: 100%; }
#menu { overflow-y: auto; }
.menu-card {
  position: relative; z-index: 1; width: min(420px, calc(100% - 32px)); margin: max(6vh, 20px) auto 20px;
  background: var(--panel); border: 1px solid var(--panel-b); border-radius: 22px; padding: 28px 22px;
  backdrop-filter: blur(10px); box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.logo { margin: 0 0 6px; font-weight: 900; font-size: 42px; line-height: .95; letter-spacing: 1px;
  background: linear-gradient(90deg, #60a5fa, #4ade80, #f87171, #facc15); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo span { font-size: 32px; }
.tagline { color: var(--muted); margin: 0 0 22px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.field input { color: var(--text); font-size: 17px; }
.or { text-align: center; color: var(--muted); margin: 14px 0; font-size: 13px; }
.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; text-transform: uppercase; letter-spacing: 6px; font-weight: 700; text-align: center; font-size: 20px; min-width: 0; }

/* ---------- lobby ---------- */
#lobby { background: radial-gradient(ellipse at top, #12234a, var(--bg) 70%); overflow-y: auto; }
.lobby-wrap { max-width: 1000px; margin: 0 auto; padding: calc(20px + var(--sat)) 16px calc(24px + var(--sab)); }
.lobby-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lobby-head h2 { margin: 0; font-size: 24px; }
.code { font-weight: 900; letter-spacing: 6px; color: var(--accent); background: rgba(125, 211, 252, .1); padding: 2px 12px; border-radius: 8px; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; }
@media (max-width: 760px) { .slots { grid-template-columns: repeat(2, 1fr); } }
.slot {
  --c: #888; position: relative; border-radius: 18px; padding: 16px 10px; min-height: 140px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 28%, transparent), rgba(255,255,255,.02));
  border: 2px solid color-mix(in srgb, var(--c) 50%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
}
.slot.me { box-shadow: 0 0 0 3px var(--c), 0 10px 40px color-mix(in srgb, var(--c) 40%, transparent); }
.slot .blob { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--c) 40%, white), var(--c)); box-shadow: 0 0 24px var(--c); }
.slot .sname { font-weight: 700; font-size: 16px; word-break: break-word; }
.slot .scolor { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: color-mix(in srgb, var(--c) 70%, white); }
.slot.empty { border-style: dashed; cursor: pointer; }
.slot.empty .sname { color: var(--muted); font-weight: 500; }
.slot .badge { position: absolute; top: 8px; right: 10px; font-size: 14px; background: none; min-width: 0; height: auto; }
.lobby-bottom { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
@media (max-width: 760px) { .lobby-bottom { grid-template-columns: 1fr; } }
.settings { background: var(--panel); border: 1px solid var(--panel-b); border-radius: var(--radius); padding: 16px; display: grid; gap: 14px; }
.settings h3 { margin: 0; font-size: 16px; }
.settings .row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 10px; font-size: 14px; }
@media (max-width: 520px) { .settings .row { grid-template-columns: 1fr; gap: 6px; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 8px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.15); cursor: pointer; font-size: 14px; background: transparent; }
.chip.on { background: rgba(125, 211, 252, .18); border-color: var(--accent); }
.chip:disabled { cursor: default; }
.lobby-actions { display: flex; flex-direction: column; gap: 10px; justify-content: flex-end; }
.rules { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }
.rules b { color: var(--text); }

/* ---------- hra ---------- */
#game { background: var(--bg); }
#mapWrap { position: absolute; inset: 0; overflow: hidden; }
#mapCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#hud { position: absolute; top: calc(8px + var(--sat)); left: 8px; right: 8px; display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; z-index: 5; pointer-events: none; }
#hud > * { pointer-events: auto; }
.pill { background: rgba(6, 13, 26, .86); border: 1px solid var(--panel-b); border-radius: 14px; padding: 7px 12px; cursor: pointer; text-align: left; backdrop-filter: blur(6px); flex: none; }
.pill .ph { font-weight: 700; font-size: 14px; display: block; white-space: nowrap; }
.pill .pt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill.build { border-color: rgba(74, 222, 128, .45); }
.pill.conquest { border-color: rgba(244, 114, 182, .6); box-shadow: 0 0 18px rgba(244, 114, 182, .2); }
.pill.soon { animation: pulse 1s infinite; border-color: var(--gold); }
@keyframes pulse { 50% { box-shadow: 0 0 18px rgba(251, 191, 36, .5); } }
.stat-pills { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; background: none; border: 0; padding: 0; cursor: pointer; }
.stat-pills span { background: rgba(6, 13, 26, .86); border: 1px solid var(--panel-b); border-radius: 999px; padding: 6px 8px; font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; backdrop-filter: blur(6px); }

.banner { position: absolute; top: calc(64px + var(--sat)); left: 50%; transform: translateX(-50%); width: min(520px, calc(100% - 16px)); z-index: 5;
  background: rgba(6, 13, 26, .92); border: 1px solid rgba(244, 114, 182, .5); border-radius: 14px; padding: 10px 14px; text-align: center; font-size: 14px; backdrop-filter: blur(6px); }
.banner.mine { border-color: var(--gold); box-shadow: 0 0 24px rgba(251, 191, 36, .3); }
.banner .bt { font-variant-numeric: tabular-nums; color: var(--muted); }

#zoomCtl { position: absolute; right: 10px; bottom: calc(var(--nav-h) + 18px + var(--sab)); display: flex; flex-direction: column; gap: 6px; z-index: 4; }
#zoomCtl button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--panel-b); background: rgba(6, 13, 26, .86); font-size: 20px; cursor: pointer; }

#nav { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 6px 8px calc(6px + var(--sab)); background: rgba(6, 13, 26, .95); border-top: 1px solid var(--panel-b); backdrop-filter: blur(8px); }
#nav button { position: relative; background: none; border: 0; border-radius: 12px; padding: 4px 0; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; min-height: 48px; }
#nav button span { font-size: 21px; line-height: 1; }
#nav button.on { color: var(--text); background: rgba(125, 211, 252, .12); }
.badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 18px; height: 18px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; font-style: normal; display: grid; place-items: center; padding: 0 4px; }

/* bottom sheet */
.sheet { position: absolute; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--sab)); max-height: min(66dvh, 640px); z-index: 5; display: flex; flex-direction: column;
  background: var(--panel); border-top: 1px solid var(--panel-b); border-radius: 20px 20px 0 0; box-shadow: 0 -20px 60px rgba(0,0,0,.5); backdrop-filter: blur(10px); animation: sheetIn .22s ease-out; }
@keyframes sheetIn { from { transform: translateY(30px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 8px; position: relative; }
.sheet-head .grab { position: absolute; top: 5px; left: 50%; width: 40px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.2); transform: translateX(-50%); }
.sheet-head h3 { margin: 0; flex: 1; font-size: 17px; }
.sheet-body { overflow-y: auto; padding: 4px 14px 16px; overscroll-behavior: contain; }
@media (min-width: 900px) {
  .sheet { left: 12px; right: auto; top: calc(70px + var(--sat)); bottom: 82px; width: 390px; max-height: none; border-radius: 18px; border: 1px solid var(--panel-b); }
  #nav { left: 50%; right: auto; transform: translateX(-50%); bottom: 10px; width: 420px; border-radius: 18px; border: 1px solid var(--panel-b); padding-bottom: 6px; }
  #zoomCtl { bottom: 20px; }
}

/* obsah panelů */
.sec { margin: 12px 0; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.sec:first-child { border-top: 0; padding-top: 0; margin-top: 4px; }
.sec h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); font-weight: 500; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: rgba(255,255,255,.04); border-radius: 12px; padding: 9px 11px; }
.stat .lbl { color: var(--muted); font-size: 12px; display: block; }
.stat .val { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); display: block; }
.slider-row { margin: 8px 0 12px; }
.slider-row .top { display: flex; justify-content: space-between; font-size: 15px; }
.slider-row .top b { font-variant-numeric: tabular-nums; }
.slider-row .hint { font-size: 12px; color: var(--muted); }
.btn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.btn-grid .btn { padding: 8px 4px; font-size: 14px; line-height: 1.2; }
.btn-grid .btn small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.upg { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; background: rgba(255,255,255,.035); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; }
.upg .n { font-weight: 500; font-size: 15px; }
.upg .d { font-size: 12px; color: var(--muted); grid-column: 1; }
.upg .pips { display: flex; gap: 3px; grid-column: 1; margin-top: 3px; }
.upg .pip { width: 16px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); }
.upg .pip.on { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.upg .btn { grid-row: 1 / span 3; grid-column: 2; font-size: 13px; padding: 8px 12px; min-width: 92px; }
.alert { background: rgba(239, 68, 68, .14); border: 1px solid rgba(239, 68, 68, .45); color: #fecaca; padding: 9px 12px; border-radius: 12px; font-size: 13px; margin-bottom: 10px; line-height: 1.4; }
.alert.gold { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .45); color: #fde68a; }
.tip { font-size: 13px; color: var(--muted); line-height: 1.45; }
.happy-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; margin: 6px 0 2px; }
.happy-bar > div { height: 100%; border-radius: 4px; transition: width .5s; }
.reg-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; color: var(--muted); font-size: 14px; }
.reg-head .sw { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 10px currentColor; background: currentColor; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; text-align: right; }
.act-list { display: grid; gap: 8px; margin-top: 10px; }
.act { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); cursor: pointer; text-align: left; width: 100%; min-height: 56px; }
.act:disabled { opacity: .45; cursor: not-allowed; }
.act:not(:disabled):active { transform: scale(.98); }
.act .ic { font-size: 24px; text-align: center; }
.act .tx b { display: block; font-size: 15px; }
.act .tx small { color: var(--muted); font-size: 12px; }
.act .pr { font-weight: 700; font-size: 14px; color: var(--gold); white-space: nowrap; }
.act.attack { border-color: rgba(244, 114, 182, .7); background: rgba(244, 114, 182, .16); }

.pcard { --c: #888; display: grid; grid-template-columns: 6px 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px 10px 0; border-radius: 12px; background: rgba(255,255,255,.035); margin-bottom: 6px; overflow: hidden; }
.pcard .bar { grid-row: 1 / span 2; align-self: stretch; background: var(--c); box-shadow: 0 0 10px var(--c); }
.pcard .pn { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pt { font-size: 12px; color: var(--muted); }
.pcard .ps { grid-column: 2 / span 2; display: flex; gap: 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.pcard .ps b { color: var(--text); font-weight: 500; }
.pcard.dead { opacity: .4; }
.pcard.me { background: color-mix(in srgb, var(--c) 14%, transparent); }
.terr-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 4px 0 12px; }
.order { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.order .o { --c: #888; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.order .o.now { background: var(--c); color: #000; font-weight: 700; }

#log { display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.4; }
#log .l { padding: 6px 9px; border-radius: 9px; background: rgba(255,255,255,.03); border-left: 3px solid var(--c, transparent); }
#log .l.k-chat { background: rgba(125, 211, 252, .08); }
#log .l.k-capture { background: rgba(251, 191, 36, .07); }
#log .l.k-elim, #log .l.k-rebel { background: rgba(239, 68, 68, .12); }
#log .l.k-phase { background: rgba(244, 114, 182, .1); font-weight: 500; }
#chatForm { display: flex; gap: 8px; margin-top: 10px; position: sticky; bottom: 0; background: var(--panel); padding-top: 6px; }
#chatForm input { flex: 1; min-width: 0; }

.tooltip { position: absolute; pointer-events: none; background: rgba(6, 13, 26, .95); border: 1px solid var(--panel-b); border-radius: 10px; padding: 8px 12px; font-size: 13px; z-index: 6; min-width: 160px; }
.tooltip .tt-n { font-weight: 700; margin-bottom: 2px; }
.tooltip .tt-r { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); }
.tooltip .tt-r b { color: var(--text); font-weight: 500; }

#toasts { position: absolute; top: calc(64px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 9; pointer-events: none; width: min(460px, calc(100% - 24px)); }
.toast { background: rgba(6, 13, 26, .96); border: 1px solid var(--panel-b); padding: 9px 14px; border-radius: 12px; font-size: 14px; animation: toastIn .3s ease-out; box-shadow: 0 10px 30px rgba(0,0,0,.4); text-align: center; }
@keyframes toastIn { from { transform: translateY(-10px); opacity: 0; } }

/* ---------- duel ---------- */
.duel { position: absolute; left: 50%; top: calc(50% - var(--nav-h) / 2); transform: translate(-50%, -50%); width: min(560px, calc(100% - 16px)); max-height: calc(100dvh - var(--nav-h) - 80px - var(--sat) - var(--sab)); overflow-y: auto; z-index: 8;
  background: rgba(8, 15, 30, .96); border: 1px solid rgba(244, 114, 182, .45); border-radius: 22px; padding: 14px; box-shadow: 0 30px 100px rgba(0,0,0,.7), 0 0 60px rgba(244, 114, 182, .15); }
.duel.minimized { top: auto; bottom: calc(var(--nav-h) + 12px + var(--sab)); transform: translateX(-50%); padding: 0; width: auto; max-width: calc(100% - 16px); border-radius: 999px; overflow: hidden; }
@media (min-width: 900px) { .duel.minimized { bottom: 90px; } }
.d-mini { background: none; border: 0; padding: 10px 16px; display: flex; gap: 6px; align-items: center; font-size: 14px; cursor: pointer; white-space: nowrap; overflow: hidden; }
.d-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.d-side { --c: #888; text-align: center; padding: 8px 6px; border-radius: 14px; background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); min-width: 0; }
.d-side.me { box-shadow: 0 0 0 2px var(--c); }
.d-role { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }
.d-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-hearts { font-size: 15px; letter-spacing: 1px; }
.d-hearts .lost { opacity: .5; }
.d-vs { text-align: center; font-size: 26px; display: flex; flex-direction: column; align-items: center; max-width: 96px; }
.d-vs small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
.d-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 0 6px; font-size: 13px; color: #f9a8d4; }
.timer { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: 12px; }
.timer > div { height: 100%; background: linear-gradient(90deg, #f472b6, #fbbf24); transition: width .25s linear; }
.d-intro { text-align: center; padding: 6px 0; }
.d-intro .big-icon { font-size: 60px; animation: spinIn .9s cubic-bezier(.2,1.4,.4,1); display: inline-block; }
.d-intro h2 { margin: 6px 0; font-size: 22px; }
@keyframes spinIn { from { transform: rotate(-360deg) scale(.2); opacity: 0; } }
.q-text { font-size: 19px; font-weight: 500; line-height: 1.35; margin: 4px 0 14px; text-align: center; }
.q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .q-opts { grid-template-columns: 1fr; } }
.q-opt { position: relative; padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); cursor: pointer; font-size: 16px; text-align: left; display: flex; gap: 10px; align-items: center; min-height: 52px; }
.q-opt .letter { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.1); font-weight: 700; flex: none; }
.q-opt:not(:disabled):active { transform: scale(.98); }
.q-opt.picked { border-color: var(--accent); background: rgba(125, 211, 252, .18); }
.q-opt.correct { border-color: var(--good); background: rgba(74, 222, 128, .2); }
.q-opt.wrong { border-color: var(--bad); background: rgba(248, 113, 113, .14); }
.q-opt.hinted { opacity: .25; text-decoration: line-through; }
.q-opt:disabled { cursor: default; }
.q-opt .who { margin-left: auto; display: flex; gap: 3px; }
.joker { display: block; margin: 10px auto 0; }
.pdot { --c: #888; width: 11px; height: 11px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); display: inline-block; flex: none; vertical-align: middle; }
.d-status { display: flex; gap: 14px; justify-content: center; margin-top: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.d-status .done { color: var(--text); }
.d-note { text-align: center; font-size: 16px; margin: 12px 0 0; }
.d-note.big { font-size: 20px; font-weight: 700; }
.num-row { display: flex; gap: 8px; justify-content: center; }
.num-row input { font-size: 20px; flex: 1; max-width: 240px; min-width: 0; text-align: center; font-weight: 700; }
.res-list { display: grid; gap: 6px; margin-top: 10px; }
.res-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.04); }
.res-item.win { background: rgba(74, 222, 128, .16); }
.res-item .rv { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; }
.big-answer { text-align: center; font-size: 28px; font-weight: 900; color: var(--good); margin: 4px 0; }
.bj-table { background: radial-gradient(ellipse at center, #136b3a, #0a3d22); border-radius: 16px; padding: 6px 12px; border: 2px solid #5b3a1a; box-shadow: inset 0 0 40px rgba(0,0,0,.5); }
.bj-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.bj-row .lbl { width: 100%; font-size: 13px; }
.bj-row .val { font-weight: 700; font-size: 18px; margin-left: 4px; }
.cards { display: flex; gap: 4px; }
.card { width: 42px; height: 58px; background: #fdfdfd; border-radius: 6px; color: #111; display: flex; flex-direction: column; justify-content: space-between; padding: 3px 4px; font-weight: 700; font-size: 15px; box-shadow: 0 3px 8px rgba(0,0,0,.4); animation: dealIn .3s ease-out; }
.card.r { color: #d11; }
.card .s2 { align-self: flex-end; font-size: 18px; line-height: 1; }
@keyframes dealIn { from { transform: translateY(-20px) rotate(-8deg); opacity: 0; } }
.bj-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.bj-actions .btn { flex: 1; max-width: 200px; }
.tag { font-size: 11px; padding: 3px 7px; border-radius: 6px; background: rgba(0,0,0,.35); font-weight: 700; }
.tag.win { background: var(--good); color: #052e14; } .tag.lose { background: var(--bad); color: #fff; } .tag.bust { background: #7f1d1d; color: #fff; }

/* ---------- konec ---------- */
.end { position: fixed; inset: 0; background: rgba(3, 7, 15, .88); display: grid; place-items: center; z-index: 20; backdrop-filter: blur(6px); overflow-y: auto; padding: 16px; }
.end-card { width: min(520px, 100%); background: var(--panel); border: 1px solid var(--panel-b); border-radius: 22px; padding: 24px 18px; text-align: center; }
.end-card h2 { font-size: 30px; margin: 0 0 4px; font-weight: 900; }
.podium { display: grid; gap: 8px; margin: 16px 0; text-align: left; }
.podium .pr { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border-left: 5px solid var(--c); }
.podium .pr .place { font-size: 20px; font-weight: 900; }
.podium .pr small { color: var(--muted); }

/* ---------- minihry ---------- */
.g-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.g-title { font-weight: 900; font-size: 21px; }
.b-phase { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: #f9a8d4; }
.countdown { font-size: 54px; font-weight: 900; color: var(--gold); margin-top: 6px; }
.aim-grid { display: grid; gap: 8px; }
.aim-btn { --c: #888; padding: 14px; border-radius: 14px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); font-weight: 700; font-size: 17px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 56px; }
.aim-btn small { font-weight: 400; color: var(--muted); font-size: 12px; }
.aim-btn.on { background: var(--c); color: #000; box-shadow: 0 0 20px var(--c); }
.aim-btn.on small { color: #000; }
.aims { display: flex; gap: 12px; justify-content: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
.ev-list { display: grid; gap: 6px; }
.ev { padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.05); font-size: 14px; line-height: 1.45; }
.snake-wrap { display: flex; justify-content: center; }
canvas.snake { width: min(100%, 420px); aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--panel-b); touch-action: none; }
.dpad { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 10px; user-select: none; -webkit-user-select: none; }
.dpad div { display: flex; gap: 6px; }
.dpad button { width: 64px; height: 52px; border-radius: 14px; border: 1px solid var(--panel-b); background: rgba(255,255,255,.07); font-size: 20px; cursor: pointer; touch-action: manipulation; }
.dpad button:active { background: rgba(125, 211, 252, .3); }
.tap-bars { display: grid; gap: 6px; margin-bottom: 14px; }
.tap-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 8px; align-items: center; font-size: 13px; }
.tap-row .tn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tap-row b { text-align: right; font-variant-numeric: tabular-nums; }
.tap-bar { height: 12px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; }
.tap-bar > div { height: 100%; width: 0; border-radius: 6px; transition: width .15s; }
.tap-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto; width: min(240px, 70vw); aspect-ratio: 1; border-radius: 50%; border: 0; font-size: 26px; font-weight: 900; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #f472b6, #9333ea); box-shadow: 0 10px 40px rgba(244, 114, 182, .5); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tap-btn span { font-size: 40px; }
.tap-btn.pop { animation: tapPop .12s; }
@keyframes tapPop { 50% { transform: scale(.93); } }
.so-round { text-align: center; font-weight: 900; font-size: 18px; color: var(--gold); }
.so-foes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.so-card { --c: #888; position: relative; min-width: 0; width: 100%; border-radius: 14px; padding: 10px 6px; border: 2px solid color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 15%, transparent); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; min-height: 96px; }
.so-card:disabled { cursor: default; }
.so-card.target { cursor: pointer; border-color: #f87171; box-shadow: 0 0 16px rgba(248, 113, 113, .5); animation: pulseRed 1s infinite; }
@keyframes pulseRed { 50% { box-shadow: 0 0 26px rgba(248, 113, 113, .8); } }
.so-card.dead { opacity: .35; }
.so-card.hit { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.so-card.me { width: 100%; flex-direction: row; justify-content: space-around; min-height: 0; padding: 12px; font-size: 15px; }
.so-n { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.so-s { font-size: 26px; }
.so-ammo { font-size: 12px; }
.so-act { position: absolute; top: -8px; right: -6px; background: rgba(6, 13, 26, .95); border: 1px solid var(--panel-b); border-radius: 10px; padding: 2px 6px; font-size: 16px; display: flex; gap: 3px; align-items: center; }
.so-act.small { font-size: 12px; }
.so-note { min-height: 20px; margin: 8px 0; font-size: 14px; }
.so-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.so-actions .btn { min-height: 56px; font-size: 17px; }
.card.back { background: repeating-linear-gradient(45deg, #7c3aed, #7c3aed 4px, #5b21b6 4px, #5b21b6 8px); border: 2px solid #fff; }
.bj-row.mine .lbl { color: var(--accent); }
.rl-bets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rl-bet { padding: 10px 4px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.05); cursor: pointer; font-weight: 500; }
.rl-bet.red { background: rgba(220, 38, 38, .35); } .rl-bet.black { background: rgba(0, 0, 0, .55); }
.rl-bet.sel { outline: 2px solid var(--gold); box-shadow: 0 0 14px rgba(251, 191, 36, .5); }
.rl-bet small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.rl-num { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 8px 0; }
.rl-num input { width: 80px; text-align: center; }
.stake-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.stake-row .sv { font-weight: 700; color: var(--gold); min-width: 80px; text-align: right; }
.wheel-box { display: flex; justify-content: center; }
.wheel-box canvas { width: min(240px, 70vw); aspect-ratio: 1; }
.rl-result { text-align: center; font-size: 24px; font-weight: 900; min-height: 30px; }
.bet-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.bet-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.06); font-size: 12px; }
.war-cd { text-align: center; color: var(--gold); font-size: 13px; margin-top: 6px; }
.garr-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.garr-btns .btn { padding: 8px 2px; font-size: 13px; min-height: 40px; }
#skipBtn { position: absolute; left: 10px; bottom: calc(var(--nav-h) + 18px + var(--sab)); z-index: 4; background: rgba(6, 13, 26, .86); }
@media (min-width: 900px) { #skipBtn { bottom: 20px; left: auto; right: 64px; } }
