/* ============================================================ tokens */
:root {
  --ink: #18171b;
  --ink-2: rgba(24, 23, 27, 0.56);
  --ink-3: rgba(24, 23, 27, 0.36);
  --paper: #efebe5;

  --surface: rgba(17, 18, 22, 0.78);
  --surface-solid: #16171b;
  --surface-2: #1f2025;
  --surface-3: #27282e;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f3ef;
  --text-2: rgba(245, 243, 239, 0.64);
  --text-3: rgba(245, 243, 239, 0.4);

  --amber: #ffc24b;
  --amber-ink: #241803;
  --green: #3ddc84;
  --red: #ff5b4f;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.2, 0.9, 0.3, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font: 500 15px/1.4 Manrope, system-ui, sans-serif;
  font-feature-settings: "tnum" 1;
  color: var(--text);
  background: #0b0c0f radial-gradient(ellipse at 50% 30%, #1b1c22 0%, #0b0c0f 70%);
  -webkit-user-select: none; user-select: none; touch-action: none;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
svg { width: 1em; height: 1em; flex: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
kbd { font: 700 11px/1 Manrope, sans-serif; }
canvas { display: block; }

/* ============================================================ device frame */
#app { position: fixed; inset: 0; overflow: hidden; background: #0f1013; isolation: isolate; }
@media (min-width: 640px) and (min-height: 640px) {
  body:not(.screen) #app {
    inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 430px; height: min(932px, calc(100dvh - 48px));
    border-radius: 40px;
    box-shadow: 0 0 0 10px #060608, 0 0 0 11px rgba(255, 255, 255, 0.07), 0 40px 120px rgba(0, 0, 0, 0.7);
  }
}

/* ============================================================ shared atoms */
.coin {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #ffe3a1, #f0a92f 70%);
  box-shadow: inset 0 0 0 2px rgba(150, 90, 0, 0.25);
}
.coin.sm { width: 14px; height: 14px; vertical-align: -2px; }
.coin-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.7); font-weight: 700; font-size: 14px; }
.coin-pill.dark { background: rgba(255, 255, 255, 0.08); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.brand svg { width: 22px; height: 22px; }

.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 54px;
  border-radius: 16px; background: #1c1b1f; color: #f6f4f0; font-size: 16px; font-weight: 800; letter-spacing: -0.01em;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18); transition: transform 0.12s var(--ease), filter 0.15s;
}
.btn-primary svg { width: 20px; height: 20px; }
.btn-primary:hover { filter: brightness(1.15); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.light { background: var(--amber); color: var(--amber-ink); box-shadow: none; height: 50px; border-radius: var(--r-md); font-size: 15px; gap: 7px; }
.btn-ghost { height: 50px; border-radius: var(--r-md); background: rgba(255, 255, 255, 0.07); font-weight: 700; font-size: 15px; color: var(--text-2); }
.btn-ghost:active { background: rgba(255, 255, 255, 0.11); }

/* ============================================================ lobby */
#lobby {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 18px) 18px calc(var(--safe-b) + 14px);
  background: linear-gradient(168deg, #f4f0ea 0%, #e8e3dc 62%, #dcd6ce 100%);
  color: var(--ink);
}
#lobby::before {
  content: ""; position: absolute; right: 0; top: 0; width: 46%; height: 64%;
  background: linear-gradient(170deg, rgba(210, 206, 210, 0.75), rgba(200, 197, 204, 0.4));
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 80%);
}
.lob-head { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; }
.lob-stage { position: relative; flex: 1; min-height: 0; }
.lob-title { position: absolute; z-index: 2; left: 2px; top: 7%; margin: 0; font-size: 30px; line-height: 1.06; font-weight: 800; letter-spacing: -0.035em; }
.lob-title em { font-style: normal; color: var(--ink-3); }
.lob-status {
  position: absolute; z-index: 2; left: 0; top: calc(7% + 146px);
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px;
  border-radius: 99px; background: rgba(255, 255, 255, 0.6); font-size: 13px; font-weight: 700;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.live-dot.on { background: #1fbf6a; box-shadow: 0 0 0 0 rgba(31, 191, 106, 0.5); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 7px rgba(31, 191, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 191, 106, 0); } }
#preview { position: absolute; inset: 0; width: 100%; height: 100%; }

.lob-panel {
  position: relative; z-index: 2; padding: 14px 16px 12px; border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px rgba(60, 45, 30, 0.1);
}
.panel-row { display: flex; align-items: baseline; justify-content: space-between; }
.panel-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.panel-value { font-size: 13px; font-weight: 800; }
.skins { display: flex; gap: 8px; overflow-x: auto; margin: 10px -16px 14px; padding: 4px 16px; scroll-padding-inline: 16px; scroll-snap-type: x proximity; scrollbar-width: none; touch-action: pan-x; }
.skins::-webkit-scrollbar { display: none; }
.skins button {
  flex: 0 0 auto; width: 60px; height: 60px; border-radius: var(--r-md); overflow: hidden; scroll-snap-align: start;
  background: linear-gradient(165deg, #d8d3cc, #c6c0b8); transition: box-shadow 0.15s, transform 0.15s var(--ease);
}
.skins button:active { transform: scale(0.94); }
.skins button.on { box-shadow: 0 0 0 2.5px var(--ink), 0 6px 14px rgba(0, 0, 0, 0.14); }
.skins canvas { width: 100%; height: 100%; }
.field { display: block; margin-bottom: 12px; }
.field .panel-label { display: block; margin-bottom: 6px; }
#name {
  display: block; width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid rgba(24, 23, 27, 0.1); background: #fff; outline: none;
  font: 700 16px Manrope, sans-serif; color: var(--ink); -webkit-user-select: text; user-select: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#name::placeholder { color: var(--ink-3); font-weight: 600; }
#name:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24, 23, 27, 0.08); }
.lob-foot { margin: 10px 0 0; text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-3); }

/* ============================================================ game: canvas + top HUD */
#game { position: absolute; inset: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; }
/* warm sunlight from the top-left + a soft vignette, composited by the browser instead of drawn every frame */
.atmo { position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(ellipse 90% 60% at 15% 0%, rgba(255, 236, 190, 0.22), transparent 70%),
  radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(10, 14, 8, 0.45)); }
.danger { position: absolute; inset: 0; pointer-events: none; }
/* red edge pulse in the last seconds: a static gradient whose opacity animates (no per-frame repaint) */
.danger { opacity: 0; background: radial-gradient(ellipse 110% 85% at 50% 50%, transparent 55%, rgba(255, 60, 50, 0.38)); }
.danger.on { animation: danger 1s infinite; }
@keyframes danger { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

.hud-top { position: absolute; z-index: 5; top: calc(var(--safe-t) + 10px); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow);
}
.timer { padding: 9px 12px 8px; min-width: 96px; }
.rounds { display: flex; gap: 3px; }
.rounds i { width: 16px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); transition: background 0.3s; }
.rounds i.done { background: var(--text-2); }
.rounds i.now { background: var(--amber); }
.time { margin-top: 5px; font-size: 26px; line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
.cap { margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.timer.urgent .time { color: var(--red); animation: tick 1s infinite; transform-origin: left center; }
@keyframes tick { 0% { transform: scale(1.08); } 30% { transform: scale(1); } }
.status { padding: 9px 12px; text-align: right; }
.status-main { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.status-main b { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.status-main span:last-child { font-size: 13px; font-weight: 600; color: var(--text-2); }
.human-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(61, 220, 132, 0.7); }
.status-sub { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.ping { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.ping.ok { background: var(--green); } .ping.mid { background: var(--amber); } .ping.bad { background: var(--red); }

/* ============================================================ toast + announcements */
.toast {
  position: absolute; z-index: 15; left: 50%; top: calc(var(--safe-t) + 90px);
  display: flex; align-items: center; gap: 9px; max-width: calc(100% - 32px); padding: 9px 16px 9px 10px;
  border-radius: 99px; background: rgba(22, 23, 27, 0.94); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 700; white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translate(-50%, -8px) scale(0.97); transition: opacity 0.2s, transform 0.25s var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast span { overflow: hidden; text-overflow: ellipsis; }
.toast-ico { width: 20px; height: 20px; border-radius: 50%; flex: none; background: rgba(255, 255, 255, 0.14) center / 12px no-repeat; }
.toast.good .toast-ico { background-color: var(--green); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5' fill='none' stroke='%23062612' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.toast.bad .toast-ico { background-color: var(--red); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 6 12 12M18 6 6 18' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.toast.info .toast-ico { background-color: var(--amber); }

.announce { position: absolute; z-index: 12; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; opacity: 0; }
.announce.show { animation: announce 2.4s var(--ease) forwards; }
@keyframes announce {
  0% { opacity: 0; transform: scale(0.9); }
  12% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.04); }
}
.announce-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); }
.announce h1 { margin: 6px 0 0; font-size: 52px; line-height: 1; font-weight: 800; letter-spacing: -0.04em; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6); }
.announce p { margin: 10px auto 0; max-width: 280px; font-size: 15px; font-weight: 600; color: var(--text); opacity: 0.85; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8); }

/* ============================================================ tasks */
.task { position: absolute; z-index: 6; left: 14px; top: calc(var(--safe-t) + 92px); display: flex; align-items: center; gap: 10px; pointer-events: none; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 4px 14px rgba(0, 0, 0, 0.35); animation: taskIn 0.4s var(--ease); }
@keyframes taskIn { from { opacity: 0; transform: translateX(-12px); } }
#taskIcon { width: 40px; height: 40px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35)); }
.task-text b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; }
.task-text span { font-size: 12.5px; font-weight: 700; opacity: 0.82; }
.task-bar { position: absolute; left: 50px; bottom: -7px; width: 120px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.28); overflow: hidden; }
.task-bar i { display: block; height: 100%; width: 100%; background: #fff; border-radius: 2px; transform-origin: left; }
.task.urgent .task-text span { color: #ffb4ad; opacity: 1; }
.task.urgent .task-bar i { background: var(--red); }
.task.urgent #taskIcon { animation: nudge 0.5s infinite; }
@keyframes nudge { 50% { transform: scale(1.12); } }

.coins-chip { position: absolute; z-index: 6; right: 12px; top: calc(var(--safe-t) + 84px); display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-size: 14px; font-weight: 800; pointer-events: none; }
.coins-chip.bump { animation: bump 0.35s var(--ease); }
@keyframes bump { 40% { transform: scale(1.18); } }
.coin-fly { position: absolute; z-index: 30; width: 20px; height: 20px; margin: -10px 0 0 -10px; pointer-events: none; }
.gain { position: absolute; z-index: 30; font-size: 22px; font-weight: 800; color: var(--amber); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); pointer-events: none; transform: translateX(-50%); animation: gain 1s var(--ease) forwards; }
@keyframes gain { from { opacity: 0; transform: translate(-50%, 10px) scale(0.8); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } to { opacity: 0; transform: translate(-50%, -46px) scale(1); } }

.use { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 30px); width: 92px; height: 92px; margin-left: -46px; border-radius: 50%; background: #fbfaf7; color: var(--ink); pointer-events: auto; touch-action: none; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), inset 0 -4px 0 rgba(0, 0, 0, 0.08); display: flex; flex-direction: column; align-items: center; justify-content: center; animation: useIn 0.3s var(--ease); transition: transform 0.08s; -webkit-touch-callout: none; }
@keyframes useIn { from { transform: scale(0.6); opacity: 0; } }
.use.down { transform: scale(0.93); }
.use.tap { animation: tapBounce 0.16s var(--ease); }
@keyframes tapBounce { 50% { transform: scale(0.9); } }
.use-ring { position: absolute; inset: -6px; width: 104px; height: 104px; transform: rotate(-90deg); pointer-events: none; }
.use-ring circle { fill: none; stroke: var(--amber); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 289; }
#useIcon { width: 48px; height: 48px; margin-top: -4px; pointer-events: none; }
#useLbl { font-size: 11.5px; font-weight: 800; margin-top: 1px; pointer-events: none; }
.use-key { display: none; position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); height: 20px; padding: 0 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); color: var(--text-2); place-items: center; font-size: 10.5px; }
body.desktop .use-key { display: grid; }

/* big 3-2-1 */
.countdown { position: absolute; z-index: 13; inset: 0; display: grid; place-content: center; pointer-events: none; font-size: 132px; font-weight: 800; letter-spacing: -0.06em; color: #fff; text-shadow: 0 8px 40px rgba(0, 0, 0, 0.45); opacity: 0; }
.countdown.tick { animation: tick321 1s var(--ease) forwards; }
@keyframes tick321 { 0% { opacity: 0; transform: scale(1.6); } 18% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(0.85); } }

/* ============================================================ bottom HUD: joystick, hint, check */
.hud-bottom {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: 0;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 18px calc(var(--safe-b) + 20px); pointer-events: none;
}
.joy { position: relative; width: 116px; height: 116px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.14); background: radial-gradient(circle, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015) 70%); transition: opacity 0.2s; }
.knob { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; background: rgba(245, 243, 239, 0.92); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), inset 0 -3px 0 rgba(0, 0, 0, 0.1); }
.keys { display: none; flex-direction: column; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.keycaps { display: grid; grid-template-columns: repeat(3, 30px); gap: 4px; }
.keycaps .k-w { grid-column: 2; }
.keycaps kbd:nth-child(2) { grid-column: 1; }
.keycaps kbd, .check-key { display: grid; place-items: center; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-bottom-width: 2px; color: var(--text-2); }
.hint { flex: 1; margin: 0 10px 34px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--text-2); }

.check { position: relative; width: 100px; height: 100px; border-radius: 50%; pointer-events: auto; transition: transform 0.12s var(--ease), opacity 0.2s; }
.check:active { transform: scale(0.94); }
.charges { position: absolute; inset: -4px; width: 108px; height: 108px; transform: rotate(-90deg); }
.charges .c { fill: none; stroke: var(--amber); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 90 224.16; transition: stroke 0.3s; }
.charges .c0 { stroke-dashoffset: -7; } .charges .c1 { stroke-dashoffset: -111.72; } .charges .c2 { stroke-dashoffset: -216.44; }
.charges .c.used { stroke: rgba(255, 255, 255, 0.13); }
.check-face {
  position: absolute; inset: 6px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line), 0 10px 26px rgba(0, 0, 0, 0.45); transition: background 0.18s, color 0.18s;
}
.check-ico { width: 28px; height: 28px; }
.check-lbl { font-size: 12px; font-weight: 800; }
#targetFace { display: none; width: 46px; height: 46px; margin-top: -6px; }
.check.armed .check-face { background: var(--amber); color: var(--amber-ink); }
.check.armed #targetFace { display: block; }
.check.armed .check-ico { display: none; }
.check.empty { opacity: 0.4; }
.check-key { display: none; position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); height: 22px; padding: 0 8px; font-size: 10.5px; }

/* desktop: keyboard instead of a thumbstick */
body.desktop .joy { display: none; }
body.desktop .keys { display: flex; }
body.desktop .check-key { display: grid; }
body.desktop .hud-bottom { padding-bottom: 34px; }

/* ============================================================ spectator */
.spect {
  position: absolute; z-index: 7; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 14px);
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); pointer-events: none;
}
.spect > svg { width: 22px; height: 22px; color: var(--text-2); }
.spect-text { flex: 1; min-width: 0; }
.spect-text b { display: block; font-size: 14px; font-weight: 800; }
.spect-text small { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

/* ============================================================ sheets */
.sheet {
  position: absolute; z-index: 20; left: 0; right: 0; bottom: 0;
  padding: 8px 18px calc(var(--safe-b) + 18px);
  background: var(--surface-solid); border-top: 1px solid var(--line); border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5);
  animation: sheet 0.36s var(--ease); touch-action: pan-y;
}
@keyframes sheet { from { transform: translateY(100%); } }
.grab { width: 36px; height: 4px; margin: 4px auto 14px; border-radius: 2px; background: rgba(255, 255, 255, 0.18); }

.bet-row { display: flex; align-items: center; gap: 14px; }
#betSkin { width: 60px; height: 60px; border-radius: 16px; background: var(--surface-3); }
.bet-text h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.bet-text p { margin: 3px 0 0; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.bet-text b { color: var(--amber); }
.btn-row { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; margin-top: 16px; }

.results { max-height: 56%; overflow-y: auto; scrollbar-width: none; }
.results::-webkit-scrollbar { display: none; }
.res-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.res-kicker { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.res-head h2 { margin: 2px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chip.good { background: rgba(61, 220, 132, 0.13); color: var(--green); }
.chip.bad { background: rgba(255, 91, 79, 0.13); color: var(--red); }
.chip.gold { background: rgba(255, 194, 75, 0.13); color: var(--amber); }

.mimic { margin: 14px 0 10px; padding: 14px; border-radius: 18px; background: var(--surface-2); }
.mimic-top { display: flex; align-items: baseline; justify-content: space-between; }
.mimic-top span { font-size: 13px; font-weight: 700; color: var(--text-2); }
.mimic-top b { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.bar { height: 8px; margin: 10px 0 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--green), var(--amber) 60%, var(--red)); transition: width 1.1s var(--ease) 0.2s; }
.mimic p { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); }

.you { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--surface-2); }
.avatar { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-3); flex: none; }
.avatar.sm { width: 40px; height: 40px; border-radius: 12px; }
.you-name { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.section-title { margin: 18px 0 4px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.roast { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.roast:last-child { border-bottom: 0; }
.roast-name { font-size: 14px; font-weight: 800; }
.roast-name em { font-style: normal; font-weight: 700; color: var(--amber); font-size: 12px; margin-left: 6px; }
.roast p { margin: 2px 0 0; font-size: 14px; font-weight: 500; line-height: 1.45; color: rgba(245, 243, 239, 0.86); -webkit-user-select: text; user-select: text; }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 18px 0 6px; }
.pod { display: flex; flex-direction: column; align-items: center; width: 31%; }
.pod canvas { width: 60px; height: 60px; }
.pod.p1 canvas { width: 84px; height: 84px; }
.pod-name { margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 800; }
.pod-pts { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.pod-block { width: 100%; margin-top: 8px; display: grid; place-items: start center; padding-top: 8px; border-radius: 14px 14px 4px 4px; background: var(--surface-2); font-size: 20px; font-weight: 800; color: var(--text-3); }
.pod.p1 .pod-block { height: 74px; background: linear-gradient(180deg, rgba(255, 194, 75, 0.22), var(--surface-2)); color: var(--amber); }
.pod.p2 .pod-block { height: 54px; }
.pod.p3 .pod-block { height: 40px; }
.board-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.board-row .rank { width: 20px; color: var(--text-3); }
.board-row .nm { flex: 1; }
.board-row.me .nm { color: var(--amber); }
.board-row .pts { color: var(--text-2); }

/* ============================================================ caught */
.caught { position: absolute; z-index: 25; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35), rgba(110, 10, 8, 0.6)); animation: fade 0.25s; pointer-events: none; }
@keyframes fade { from { opacity: 0; } }
.caught-card { width: min(300px, 86%); padding: 22px 22px 20px; border-radius: var(--r-xl); text-align: center; background: var(--surface-solid); border: 1px solid rgba(255, 91, 79, 0.35); box-shadow: var(--shadow); animation: shake 0.45s; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
#caughtFace { width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 18px; background: var(--surface-3); }
.caught-card h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.caught-card p { margin: 4px 0 10px; font-size: 15px; font-weight: 600; color: var(--red); }
.caught-card small { font-size: 13px; font-weight: 600; color: var(--text-2); line-height: 1.45; }

/* ============================================================ big screen */
.side { position: absolute; z-index: 30; right: 0; top: 0; bottom: 0; width: 380px; padding: 32px 30px; display: flex; flex-direction: column; gap: 20px; background: var(--paper); color: var(--ink); }
.qr-card { padding: 16px 16px 12px; border-radius: 24px; background: #fff; box-shadow: 0 14px 40px rgba(60, 45, 30, 0.1); }
.qr-card img { display: block; width: 100%; }
.url { margin: 10px 0 0; text-align: center; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; word-break: break-all; }
.side-lead { margin: 0; font-size: 15px; line-height: 1.55; font-weight: 600; color: var(--ink-2); }
.side-stat { display: flex; align-items: baseline; gap: 10px; }
.side-stat b { font-size: 48px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.side-stat span { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.side .btn-primary { margin-top: auto; }
body.screen .hud-bottom { display: none; }
body.screen .hud-top { right: 392px; }
body.screen .sheet { left: 20px; right: 400px; bottom: 20px; border-radius: 26px; max-width: 560px; }
body.screen .announce { right: 380px; }
@media (max-width: 899px) {
  body.screen .side { display: none; }
  body.screen .hud-top { right: 12px; }
  body.screen .sheet { right: 20px; }
  body.screen .announce { right: 0; }
}


/* ============================================================ HUD without boxes
   Bold white type with a dark outline straight over the scene. No backdrop blur anywhere in the game view:
   blurring a moving canvas every frame was what dragged phones down to ~20 fps. */
:root { --outline: 0 2px 0 rgba(10, 14, 8, 0.65), 1.5px 1.5px 0 rgba(10, 14, 8, 0.6), -1.5px 1.5px 0 rgba(10, 14, 8, 0.6), 1.5px -1.5px 0 rgba(10, 14, 8, 0.6), -1.5px -1.5px 0 rgba(10, 14, 8, 0.6), 0 6px 16px rgba(0, 0, 0, 0.3); }
.coin { background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><defs><linearGradient id='g' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%2397f5a6'/><stop offset='.5' stop-color='%2326b85a'/><stop offset='1' stop-color='%23117a3c'/></linearGradient></defs><text x='32' y='55' text-anchor='middle' font-family='Arial Black,Arial,Helvetica,sans-serif' font-weight='900' font-size='60' fill='%230b4d26' stroke='%23fff' stroke-width='9' stroke-linejoin='round' paint-order='stroke'>$</text><text x='32' y='51' text-anchor='middle' font-family='Arial Black,Arial,Helvetica,sans-serif' font-weight='900' font-size='60' fill='url(%23g)'>$</text></svg>") center / contain no-repeat; box-shadow: none; border-radius: 0; }
#game .card { background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.timer, .status { padding: 2px 4px; color: #fff; text-shadow: var(--outline); }
.time { font-size: 34px; margin-top: 4px; }
.cap { color: #fff; opacity: 0.92; font-size: 12.5px; font-weight: 700; }
.rounds i { background: rgba(255, 255, 255, 0.45); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); height: 4px; }
.rounds i.done { background: #fff; }
.status-main b { font-size: 32px; }
.status-main span:last-child { font-size: 15px; font-weight: 800; color: #fff; }
.status-sub { display: none; color: #fff; }
body.debug .status-sub { display: flex; }
.coins-chip { background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; height: auto; gap: 6px; font-size: 22px; color: #fff; text-shadow: var(--outline); top: calc(var(--safe-t) + 66px); right: 14px; }
.coins-chip .coin { width: 26px; height: 26px; }
.spect { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(17, 18, 22, 0.94); }

/* the task: centred under the top HUD, big and impossible to miss */
.task { left: 50%; top: calc(var(--safe-t) + 104px); transform: translateX(-50%); flex-direction: column; align-items: center; gap: 7px; text-align: center; animation: none; }
.task-head { display: flex; align-items: center; gap: 8px; }
.task-head b { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
#taskIcon { width: 38px; height: 38px; }
.task-row { display: flex; align-items: center; gap: 8px; }
.task-bar { position: static; width: 170px; height: 9px; border-radius: 6px; background: rgba(0, 0, 0, 0.4); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 3px 10px rgba(0, 0, 0, 0.35); overflow: hidden; }
.task-bar i { background: linear-gradient(90deg, #fff, #ffe9a8); }
#taskWhere { font-size: 15px; font-weight: 800; min-width: 30px; text-align: left; opacity: 1; }
.task.fresh { animation: taskPop 0.9s var(--ease); }
@keyframes taskPop { 0% { opacity: 0; transform: translateX(-50%) scale(1.5); } 25% { opacity: 1; transform: translateX(-50%) scale(0.94); } 45% { transform: translateX(-50%) scale(1.04); } 100% { transform: translateX(-50%) scale(1); } }
.task.urgent { animation: taskBlink 0.6s steps(2, jump-none) infinite; }
@keyframes taskBlink { 50% { opacity: 0.45; } }
.task.urgent .task-bar i { background: var(--red); }
.task.urgent #taskWhere { color: #ffb4ad; }

/* combo multiplier: slasher style, fire behind, slammed in and shaken (transform/opacity only) */
.combo { position: absolute; z-index: 14; left: 50%; top: 31%; display: flex; flex-direction: column; align-items: center; pointer-events: none; transform: translateX(-50%); }
.combo::before { content: ""; position: absolute; left: 50%; top: 52%; width: 230px; height: 150px; margin: -75px 0 0 -115px; border-radius: 50%;
  background: radial-gradient(ellipse 30% 45% at 35% 60%, rgba(255, 200, 60, 0.9), transparent 70%), radial-gradient(ellipse 32% 50% at 65% 55%, rgba(255, 120, 30, 0.85), transparent 70%), radial-gradient(ellipse 50% 60% at 50% 70%, rgba(220, 40, 20, 0.75), transparent 72%);
  animation: flame 0.18s infinite alternate; z-index: -1; }
@keyframes flame { from { transform: scale(1, 0.94) skewX(-3deg); opacity: 0.85; } to { transform: scale(0.97, 1.06) skewX(3deg); opacity: 1; } }
#comboX { font-size: 96px; line-height: 0.9; font-weight: 800; font-style: italic; letter-spacing: -0.05em; color: #fff3c2; text-shadow: 0 0 0 #000, 4px 4px 0 #7a1405, -2px -2px 0 #ffcf4a, 2px -2px 0 #ff9a2b, -2px 2px 0 #c22a0e, 0 10px 24px rgba(120, 20, 0, 0.6); }
#comboCash { margin-top: 2px; font-size: 26px; font-weight: 800; color: #b8ffcb; text-shadow: var(--outline); }
.combo.show { animation: slam 1.25s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes slam {
  0% { opacity: 0; transform: translateX(-50%) scale(2.6) rotate(-14deg); }
  14% { opacity: 1; transform: translateX(-50%) scale(0.92) rotate(-6deg); }
  20% { transform: translate(calc(-50% + 6px), 3px) scale(1.04) rotate(-7deg); }
  26% { transform: translate(calc(-50% - 5px), -2px) scale(1) rotate(-5deg); }
  32% { transform: translate(calc(-50% + 3px), 1px) scale(1) rotate(-6deg); }
  80% { opacity: 1; transform: translateX(-50%) scale(1) rotate(-6deg); }
  100% { opacity: 0; transform: translateX(-50%) scale(1.1) rotate(-6deg); }
}
.gain { color: #b8ffcb; }

/* ============================================================ paper HUD
   Torn-paper cards from assets/ui with brown Fredoka lettering, like a Paper Mario menu.
   Plain images and text only: no blur, no animated shadows. */
:root { --paper-ink: #4a2f1c; --paper-ink-2: #7a5636; --paper-font: 'Fredoka', 'Manrope', system-ui, sans-serif; }
.hud-top, .coins-chip, .hint, .task, .mult, .mult-big, .countdown, .gain { font-family: var(--paper-font); }
.timer, .status { text-shadow: none; color: var(--paper-ink); }

/* round card (top left): time on top, three round holes, "Round 1 of 3" on the bottom strip */
#game .timer { position: relative; width: 136px; height: 101px; min-width: 0; padding: 0; background: url(/assets/ui/round.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 4px 6px rgba(30, 20, 5, 0.35)); }
.timer .time { position: absolute; left: 0; right: 0; top: 10%; margin: 0; text-align: center; font-size: 33px; font-weight: 700; letter-spacing: 0; line-height: 1; color: var(--paper-ink); }
.timer .rounds { position: absolute; inset: 0; display: block; }
.timer .rounds i { position: absolute; top: 62.5%; width: 13.2%; height: auto; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); background: transparent; box-shadow: none; transition: background 0.3s, transform 0.3s; }
.timer .rounds i:nth-child(1) { left: 31.2%; } .timer .rounds i:nth-child(2) { left: 49.4%; } .timer .rounds i:nth-child(3) { left: 67.6%; }
.timer .rounds i.done { background: radial-gradient(circle at 40% 35%, #a77a4f, #7a5233); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2); }
.timer .rounds i.now { background: radial-gradient(circle at 40% 35%, #ffe066, #f2b705); box-shadow: inset 0 -2px 0 rgba(150, 90, 0, 0.35); animation: holePulse 1.4s ease-in-out infinite; }
@keyframes holePulse { 50% { transform: translate(-50%, -50%) scale(1.15); } }
.timer .cap { position: absolute; left: 0; right: 0; top: 77%; margin: 0; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--paper-ink); opacity: 1; }
.timer.urgent .time { color: #c62a1c; animation: tick 1s infinite; transform-origin: center; }

/* players (top right) */
#game .status { width: 150px; height: 49px; padding: 0 10px; display: flex; flex-direction: column; justify-content: center; background: url(/assets/ui/players.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 4px 6px rgba(30, 20, 5, 0.35)); }
.status .status-main { justify-content: center; gap: 5px; align-items: baseline; }
.status .status-main b { font-size: 25px; font-weight: 700; color: var(--paper-ink); }
.status .status-main span:last-child { font-size: 16px; font-weight: 600; color: var(--paper-ink); }
.status .status-sub { position: absolute; top: 52px; right: 0; white-space: nowrap; color: #fff; text-shadow: var(--outline); font-family: Manrope, sans-serif; }

/* money (under players) */
.coins-chip { top: calc(var(--safe-t) + 66px); right: 12px; box-sizing: border-box; width: 116px; height: 54px; padding: 0 10px 0 52px; justify-content: center; gap: 0; background: url(/assets/ui/money.webp) center / 100% 100% no-repeat; color: var(--paper-ink); text-shadow: none; font-size: 25px; font-weight: 700; filter: drop-shadow(0 4px 6px rgba(30, 20, 5, 0.35)); }
.coins-chip .coin { display: none; }

/* hint strip (bottom middle) */
.hint { align-self: flex-end; max-width: 210px; min-height: 58px; margin: 0 8px 30px; padding: 9px 18px 10px; display: grid; place-items: center; background: url(/assets/ui/hint.webp) center / 100% 100% no-repeat; color: var(--paper-ink); font-size: 14px; font-weight: 600; line-height: 1.2; filter: drop-shadow(0 4px 6px rgba(30, 20, 5, 0.35)); }
.hint:empty { visibility: hidden; }

/* the task: paper lettering too */
.task-head b { color: #fff; }

/* multiplier badge (left, under the round card): always wobbling a little, more the higher it is */
.mult { position: absolute; z-index: 6; left: 10px; top: calc(var(--safe-t) + 118px); height: 58px; pointer-events: none; transform-origin: 50% 60%; }
.mult img { height: 100%; width: auto; display: block; filter: drop-shadow(0 4px 5px rgba(30, 20, 5, 0.35)); animation: multIdle 1.5s ease-in-out infinite; }
.mult[data-lvl="2"] img { animation-duration: 1.1s; }
.mult[data-lvl="3"] { height: 64px; } .mult[data-lvl="3"] img { animation: multHot 0.7s ease-in-out infinite; }
.mult[data-lvl="4"] { height: 70px; } .mult[data-lvl="4"] img { animation: multHot 0.45s ease-in-out infinite; }
@keyframes multIdle { 0%, 100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.07); } }
@keyframes multHot { 0%, 100% { transform: rotate(-6deg) scale(1); } 25% { transform: rotate(5deg) scale(1.1); } 50% { transform: rotate(-3deg) scale(1.03); } 75% { transform: rotate(6deg) scale(1.12); } }

/* the full-screen slam */
.mult-big { position: absolute; z-index: 30; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 18%; pointer-events: none; }
.mult-big img { width: min(78vw, 360px); height: auto; filter: drop-shadow(0 14px 18px rgba(20, 10, 0, 0.45)); will-change: transform; }
.mult-big[data-lvl="3"] img { width: min(86vw, 400px); } .mult-big[data-lvl="4"] img { width: min(92vw, 430px); }
.mult-big b { margin-top: 4px; font-size: 40px; font-weight: 700; color: #fff; -webkit-text-stroke: 7px var(--paper-ink); paint-order: stroke fill; letter-spacing: 0.01em; }
.mult-rays { position: absolute; left: 50%; top: 41%; width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%; opacity: 0;
  background: repeating-conic-gradient(rgba(255, 236, 160, 0.55) 0 10deg, transparent 10deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%); }
.mult-big[data-lvl="3"] .mult-rays { background: repeating-conic-gradient(rgba(214, 160, 255, 0.6) 0 10deg, transparent 10deg 22deg); }
.mult-big[data-lvl="4"] .mult-rays { background: repeating-conic-gradient(rgba(255, 210, 60, 0.75) 0 9deg, transparent 9deg 18deg); }
.mult-flash { position: absolute; z-index: 29; inset: 0; background: #fff8e6; opacity: 0; pointer-events: none; }
.confetti { position: absolute; z-index: 31; width: 10px; height: 14px; border-radius: 2px; pointer-events: none; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18); }

/* last 10 seconds: red edges pulsing like a heartbeat, harder in the last 5 */
.danger { background: radial-gradient(ellipse 80% 66% at 50% 50%, transparent 40%, rgba(235, 25, 15, 0.6) 72%, rgba(190, 0, 0, 0.95)); z-index: 4; }
.danger.on { animation: dangerBeat 1s ease-out infinite; }
.danger.hot { animation: dangerBeat 0.5s ease-out infinite; }
@keyframes dangerBeat { 0% { opacity: 1; } 18% { opacity: 0.55; } 30% { opacity: 0.95; } 100% { opacity: 0.25; } }

/* round intro on torn paper ("Find the humans") */
.announce-card { position: relative; min-width: 280px; max-width: 330px; padding: 26px 34px 28px; background: url(/assets/ui/hint.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 10px 16px rgba(30, 20, 5, 0.45)); font-family: var(--paper-font); }
.announce .announce-kicker { font-size: 14px; font-weight: 600; letter-spacing: 0.08em; color: #b5651d; }
.announce h1 { margin: 4px 0 0; font-size: 44px; font-weight: 700; letter-spacing: 0; line-height: 1; color: var(--paper-ink); text-shadow: none; }
.announce p { margin: 8px auto 0; font-size: 15px; font-weight: 500; color: var(--paper-ink-2); opacity: 1; text-shadow: none; }
.announce.show { animation: paperIn 2.6s cubic-bezier(.2, 1.3, .4, 1) forwards; }
@keyframes paperIn {
  0% { opacity: 0; transform: translateY(-40px) scale(1.4) rotate(-8deg); }
  12% { opacity: 1; transform: translateY(0) scale(0.96) rotate(2deg); }
  18% { transform: scale(1.02) rotate(-1.5deg); }
  24%, 82% { opacity: 1; transform: scale(1) rotate(-1.5deg); }
  100% { opacity: 0; transform: translateY(-20px) scale(0.9) rotate(-4deg); }
}

/* intro: the camera is zoomed on you in the middle of the screen, so the 3-2-1 sits above you and the round card
   lands low, above the controls, never over your character while the camera pulls out */
.countdown { place-content: start center; padding-top: calc(var(--safe-t) + 118px); font-family: var(--paper-font); font-weight: 700; font-size: 112px; letter-spacing: 0; color: #fff; -webkit-text-stroke: 9px var(--paper-ink); paint-order: stroke fill; text-shadow: 0 8px 18px rgba(30, 20, 5, 0.35); }
.announce { place-content: end center; padding-bottom: calc(var(--safe-b) + 150px); }
.announce-card { min-width: 270px; padding: 20px 30px 22px; }
.announce h1 { font-size: 38px; }

/* the task on a torn-paper strip, brown lettering like the rest of the HUD */
.task { top: calc(var(--safe-t) + 118px); max-width: 228px; padding: 11px 20px 13px; gap: 6px; background: url(/assets/ui/hint.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 6px 8px rgba(30, 20, 5, 0.35)); text-shadow: none; color: var(--paper-ink); font-family: var(--paper-font); }
.task-head { gap: 6px; }
.task-head b, .task .task-head b { color: var(--paper-ink); font-size: 18px; font-weight: 700; letter-spacing: 0; }
#taskIcon { width: 30px; height: 30px; filter: drop-shadow(0 2px 2px rgba(30, 20, 5, 0.25)); }
.task-bar { width: 130px; height: 10px; border-radius: 6px; background: rgba(74, 47, 28, 0.18); box-shadow: inset 0 1px 2px rgba(74, 47, 28, 0.35); }
.task-bar i { background: linear-gradient(90deg, #3aa64a, #7cd35a); border-radius: 6px; }
#taskWhere { color: var(--paper-ink); font-size: 15px; font-weight: 700; }
.task.urgent { animation: taskShake 0.5s ease-in-out infinite; }
@keyframes taskShake { 0%, 100% { transform: translateX(-50%) rotate(0deg); } 25% { transform: translateX(-50%) rotate(-1.5deg); } 75% { transform: translateX(-50%) rotate(1.5deg); } }
.task.urgent .task-bar i { background: linear-gradient(90deg, #d23a2a, #ff6a4a); }
.task.urgent #taskWhere { color: #c62a1c; }

/* multiplier badge a bit smaller so it never touches the centred task strip */
.mult { height: 48px; } .mult[data-lvl="3"] { height: 52px; } .mult[data-lvl="4"] { height: 56px; }

/* the round card shows first (~1.8 s), then the 3-2-1 takes the stage */
.announce.show { animation-duration: 1.9s; }

/* paper buttons: Catch and the task button are cut from the same cream card as the HUD, brown ink, Fredoka */
.check-face, .use { font-family: var(--paper-font); }
.check-face { inset: 6px; background: radial-gradient(circle at 42% 32%, #fbf1da, #ead2a2 78%); color: var(--paper-ink);
  box-shadow: inset 0 0 0 3px #b98e5c, inset 0 -5px 0 rgba(122, 86, 54, 0.22), 0 8px 14px rgba(30, 20, 5, 0.4); }
.check-ico { color: var(--paper-ink); }
.check-lbl { font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.charges .c { stroke: #f2b705; stroke-width: 5; }
.charges .c.used { stroke: rgba(74, 47, 28, 0.25); }
.check.armed .check-face { background: radial-gradient(circle at 42% 32%, #ffe58a, #f2b705 80%); color: var(--paper-ink); box-shadow: inset 0 0 0 3px #a8740c, inset 0 -5px 0 rgba(122, 70, 0, 0.25), 0 8px 16px rgba(30, 20, 5, 0.45); }
.check.empty { opacity: 0.55; filter: grayscale(0.6); }
.use { background: radial-gradient(circle at 42% 32%, #fbf1da, #ead2a2 78%); color: var(--paper-ink);
  box-shadow: inset 0 0 0 3px #b98e5c, inset 0 -5px 0 rgba(122, 86, 54, 0.22), 0 8px 14px rgba(30, 20, 5, 0.4); }
.use-ring circle { stroke: #3aa64a; stroke-width: 7; }
#useLbl { font-size: 14px; font-weight: 700; color: var(--paper-ink); }

/* the multiplier slam: a big badge, not a wall */
.mult-big { padding-bottom: 30%; }
.mult-big img, .mult-big[data-lvl="3"] img, .mult-big[data-lvl="4"] img { width: min(46vw, 200px); }
.mult-big[data-lvl="3"] img { width: min(52vw, 225px); } .mult-big[data-lvl="4"] img { width: min(56vw, 245px); }
.mult-big b { font-size: 30px; -webkit-text-stroke: 6px var(--paper-ink); }
.mult-rays { width: 420px; height: 420px; margin: -210px 0 0 -210px; top: 36%; }

/* the round card sits in the middle again: it leaves, then the 3-2-1 and the pull-out */
.announce { place-content: center; padding-bottom: 0; }

/* living light over the painted map: two big soft light patches drifting and breathing very slowly.
   Pure compositor work (transform/opacity on static gradients), nothing is repainted per frame. */
.atmo { overflow: hidden; }
.atmo::before, .atmo::after { content: ""; position: absolute; inset: -30%; pointer-events: none; will-change: transform, opacity; }
.atmo::before { background: radial-gradient(ellipse 38% 30% at 35% 35%, rgba(255, 238, 190, 0.22), transparent 70%);
  animation: lightDrift 19s ease-in-out infinite alternate; }
.atmo::after { background: radial-gradient(ellipse 34% 26% at 70% 70%, rgba(255, 250, 225, 0.16), transparent 70%);
  animation: lightBreathe 11s ease-in-out infinite alternate; mix-blend-mode: normal; }
@keyframes lightDrift { 0% { transform: translate(-6%, -4%) scale(1); } 100% { transform: translate(8%, 6%) scale(1.12); } }
@keyframes lightBreathe { 0% { opacity: 0.35; transform: translate(4%, 0) scale(1); } 100% { opacity: 1; transform: translate(-5%, -4%) scale(1.08); } }
/* the coworking hall: warmer, lamp-coloured light */
#app[data-map="hackathon"] .atmo::before { background: radial-gradient(ellipse 40% 30% at 45% 25%, rgba(255, 200, 120, 0.24), transparent 70%); }
#app[data-map="hackathon"] .atmo::after { background: radial-gradient(ellipse 34% 26% at 65% 72%, rgba(255, 214, 160, 0.16), transparent 70%); }
@media (prefers-reduced-motion: reduce) { .atmo::before, .atmo::after { animation: none; } }

/* no red screen edges in the last seconds (it read like taking damage): only the timer turns red and jumps */
.danger, .danger.on, .danger.hot { display: none; }
.timer.urgent .time { color: #d62b1c; animation: timerJump 1s ease-out infinite; transform-origin: center bottom; }
@keyframes timerJump { 0% { transform: translateY(-7px) scale(1.2); } 22% { transform: translateY(0) scale(0.97); } 34% { transform: scale(1.03); } 50%, 100% { transform: none; } }

/* catch verdict: a short paper slam in the middle of the screen */
.verdict { position: absolute; z-index: 30; inset: 0; display: grid; place-items: center; padding-bottom: 22%; pointer-events: none; }
.verdict img { display: none; width: min(70vw, 300px); height: auto; filter: drop-shadow(0 12px 16px rgba(30, 20, 5, 0.45)); }
.verdict.has-art img { display: block; }
.verdict.has-art .verdict-card { display: none; }
.verdict-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 22px 34px 24px; min-width: 250px;
  background: url(/assets/ui/hint.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 12px 16px rgba(30, 20, 5, 0.45)); font-family: var(--paper-font); }
.verdict-card b { font-size: 50px; line-height: 1; font-weight: 700; letter-spacing: 0.01em; }
.verdict-card span { font-size: 16px; font-weight: 600; color: var(--paper-ink-2); }
.verdict[data-kind="caught"] .verdict-card b { color: #1f9a3a; }
.verdict[data-kind="bot"] .verdict-card b { color: #c62a1c; font-size: 42px; }

/* ============================================================ Gold Stars, shop, podium, slot machine (paper) */
.star-ico { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.16em; background: url(/assets/ui/star.webp) center / contain no-repeat; }
.stars-pill { gap: 6px; font-family: var(--paper-font); font-size: 17px; color: var(--paper-ink); background: #fbf1da; box-shadow: inset 0 0 0 2px #d8b98a; }

.paper-btn { font-family: var(--paper-font); font-weight: 700; font-size: 20px; color: var(--paper-ink); padding: 12px 28px; border-radius: 16px; border: 0; cursor: pointer;
  background: radial-gradient(circle at 40% 30%, #ffe58a, #f2b705 85%); box-shadow: inset 0 0 0 3px #a8740c, inset 0 -5px 0 rgba(122, 70, 0, 0.25), 0 6px 12px rgba(30, 20, 5, 0.35); transition: transform 0.1s; }
.paper-btn:active { transform: scale(0.95); }
.paper-btn:disabled { filter: grayscale(0.7); opacity: 0.6; }
.paper-btn.small { font-size: 15px; padding: 8px 14px; border-radius: 12px; }
.link-btn { background: none; border: 0; color: var(--text-2, #6b5a48); font: 600 13px var(--paper-font); text-decoration: underline; cursor: pointer; padding: 4px; }
.restore { display: flex; gap: 6px; align-items: center; }
.restore input, .pod-save input { min-width: 0; flex: 1; height: 38px; border-radius: 10px; border: 2px solid #d8b98a; background: #fffaf0; padding: 0 10px; font: 600 15px var(--paper-font); color: var(--paper-ink); }

/* lobby shop tiles */
.skins .shop-tile { position: relative; }
.shop-tag { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); white-space: nowrap; font: 700 12px var(--paper-font); color: var(--paper-ink); background: #fbf1da; border-radius: 8px; padding: 1px 6px; box-shadow: inset 0 0 0 1.5px #d8b98a; }
.shop-tile:not(.owned) canvas { filter: saturate(0.7) brightness(0.95); }

/* podium overlay */
.podium { position: absolute; z-index: 40; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(30, 22, 14, 0.45); overflow-y: auto; font-family: var(--paper-font); color: var(--paper-ink); }
.pod-card { width: min(100%, 380px); padding: 22px 18px 18px; border-radius: 22px; text-align: center;
  background: radial-gradient(ellipse at 50% 0%, #fffaf0, #f3e3c3 80%); box-shadow: inset 0 0 0 3px #d8b98a, 0 16px 30px rgba(20, 12, 4, 0.5); }
.pod-kicker { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #b5651d; }
.pod-card h2 { margin: 2px 0 12px; font-size: 34px; font-weight: 700; line-height: 1.05; }
.pod-steps { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 6px; }
.pod-col { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pod-av { width: 64px; height: 64px; }
.p1 .pod-av { width: 80px; height: 80px; }
.pod-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.pod-step { width: 100%; display: flex; flex-direction: column; justify-content: flex-start; padding-top: 6px; border-radius: 10px 10px 4px 4px; box-shadow: inset 0 0 0 3px rgba(74, 47, 28, 0.35), inset 0 -6px 0 rgba(74, 47, 28, 0.15); }
.pod-step b { font-size: 26px; line-height: 1; } .pod-step span { font-size: 14px; font-weight: 600; }
.p1 .pod-step { height: 96px; background: linear-gradient(#ffe58a, #f2b705); }
.p2 .pod-step { height: 72px; background: linear-gradient(#f1ece0, #cfc6b2); }
.p3 .pod-step { height: 56px; background: linear-gradient(#f2c79a, #c98a55); }
.pod-me { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 4px; font-size: 22px; font-weight: 700; flex-wrap: wrap; }
.pod-arrow { opacity: 0.6; } .pod-earn { color: #a8740c; }
.pod-total { margin-left: 6px; padding: 2px 10px; border-radius: 12px; background: #fbf1da; box-shadow: inset 0 0 0 2px #d8b98a; }
.pod-save { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 10px; font-size: 13px; font-weight: 600; }
.pod-save > span:first-child { width: 100%; }
.pod-saved { color: #1f9a3a; font-size: 15px; }

/* slot machine: three clipped windows, each a strip that slides (transform only) */
.slot { position: relative; margin-top: 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.slot-body { padding: 10px 12px 12px; border-radius: 18px; background: linear-gradient(#e2483a, #b8322a); box-shadow: inset 0 0 0 3px #7a1e17, inset 0 -6px 0 rgba(0, 0, 0, 0.18), 0 8px 14px rgba(30, 20, 5, 0.35); }
.slot-title { font-size: 15px; font-weight: 700; color: #fff3d6; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.slot-win { display: flex; gap: 8px; }
.reel { width: 64px; height: 64px; overflow: hidden; border-radius: 10px; background: #fffaf0; box-shadow: inset 0 0 0 3px #7a1e17, inset 0 8px 10px rgba(0, 0, 0, 0.18), inset 0 -8px 10px rgba(0, 0, 0, 0.18); }
.strip { will-change: transform; }
.strip img { display: block; width: 64px; height: 64px; padding: 8px; box-sizing: border-box; }
.slot-prize { position: absolute; left: 50%; top: 18%; translate: -50% 0; z-index: 2; padding: 12px 22px; border-radius: 16px; white-space: nowrap; pointer-events: none;
  background: radial-gradient(circle at 50% 30%, #fffaf0, #f3e3c3); box-shadow: inset 0 0 0 3px #d8b98a, 0 10px 18px rgba(30, 20, 5, 0.45); display: flex; flex-direction: column; align-items: center; }
.slot-prize b { font-size: 30px; line-height: 1; color: #1f9a3a; }
.slot-prize span { font-size: 14px; font-weight: 600; }
.slot-prize.jackpot { background: radial-gradient(circle at 50% 30%, #fff3b0, #f2b705); box-shadow: inset 0 0 0 3px #a8740c, 0 0 0 6px rgba(255, 210, 60, 0.45), 0 12px 22px rgba(30, 20, 5, 0.5); }
.slot-prize.jackpot b { color: #b8322a; font-size: 38px; }
.link-btn { margin-top: 10px; align-self: center; }

/* golden bonus button + the 3 cards */
.use.gold { background: radial-gradient(circle at 42% 32%, #fff3b0, #f2c14e 80%); box-shadow: inset 0 0 0 3px #a8740c, inset 0 -5px 0 rgba(122, 70, 0, 0.25), 0 8px 14px rgba(30, 20, 5, 0.4); }
.use.gold .use-ring circle { stroke: #fff; }
.cards { position: absolute; z-index: 25; left: 0; right: 0; bottom: calc(var(--safe-b) + 150px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; font-family: var(--paper-font); color: var(--paper-ink); }
.cards-title { font-size: 20px; font-weight: 700; color: #fff; -webkit-text-stroke: 5px var(--paper-ink); paint-order: stroke fill; }
.cards-row { display: flex; gap: 8px; padding: 0 10px; }
.card-pick { pointer-events: auto; width: 108px; padding: 10px 6px 12px; border: 0; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font-family: var(--paper-font); color: var(--paper-ink);
  background: radial-gradient(circle at 50% 25%, #fffaf0, #f3e3c3 80%); box-shadow: inset 0 0 0 3px #d8b98a, 0 8px 14px rgba(30, 20, 5, 0.4);
  animation: cardIn 0.35s cubic-bezier(.2,1.4,.4,1) both; animation-delay: calc(var(--i) * 70ms); }
.card-pick:active { transform: scale(0.94); }
.card-pick img { width: 46px; height: 46px; object-fit: contain; }
.card-pick b { font-size: 19px; font-weight: 700; line-height: 1.1; }
.card-pick span { font-size: 12px; font-weight: 600; color: var(--paper-ink-2); }
.cards-timer { display: block; width: 200px; height: 6px; border-radius: 3px; background: #f2b705; transform-origin: left; box-shadow: 0 0 0 2px rgba(74, 47, 28, 0.4); }
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) rotate(-6deg) scale(0.8); } to { opacity: 1; transform: none; } }

/* currency + machine art */
.star-ico { background-image: url(/assets/ui/star.webp); }
.coin { background: url(/assets/ui/dollar.webp) center / contain no-repeat; }
.slot-body, .slot-title, .slot-win { all: unset; }
.slot-machine { position: relative; width: min(74vw, 290px); aspect-ratio: 1156 / 980; margin-right: 46px; }
.slot-machine .slot-body { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; filter: drop-shadow(0 10px 14px rgba(30, 20, 5, 0.4)); }
.slot-machine .reel { position: absolute; z-index: 0; width: auto; height: auto; border-radius: 6px; overflow: hidden; background: #fffaf0; box-shadow: none; }
.slot-machine .strip img { width: 100%; height: auto; aspect-ratio: 1; padding: 6%; box-sizing: border-box; display: block; }
.slot-lever { position: absolute; z-index: 2; right: -46px; top: 14%; height: 70%; width: auto; transform-origin: 50% 100%; cursor: pointer; filter: drop-shadow(0 8px 10px rgba(30, 20, 5, 0.35)); }
.jackpot-slam { position: absolute; z-index: 5; left: 50%; top: 42%; width: min(92vw, 420px); pointer-events: none; filter: drop-shadow(0 16px 20px rgba(30, 20, 5, 0.5)); }

/* bonus cards: each one tinted in its icon's colour, so the colour reads before the picture */
.card-pick img { width: 58px; height: 58px; }
.card-pick.c-cash { background: radial-gradient(circle at 50% 25%, #f4fff0, #bfe8b4 85%); box-shadow: inset 0 0 0 3px #3aa64a, 0 8px 14px rgba(30, 20, 5, 0.4); }
.card-pick.c-mult { background: radial-gradient(circle at 50% 25%, #fff6ea, #ffcf99 85%); box-shadow: inset 0 0 0 3px #f08a24, 0 8px 14px rgba(30, 20, 5, 0.4); }
.card-pick.c-hint { background: radial-gradient(circle at 50% 25%, #f1f8ff, #b9daf5 85%); box-shadow: inset 0 0 0 3px #3a8fd6, 0 8px 14px rgba(30, 20, 5, 0.4); }
.card-pick.c-catch { background: radial-gradient(circle at 50% 25%, #fffbea, #ffe38a 85%); box-shadow: inset 0 0 0 3px #e0a800, 0 8px 14px rgba(30, 20, 5, 0.4); }
.card-pick.c-disguise { background: radial-gradient(circle at 50% 25%, #f8f2ff, #d9c4f2 85%); box-shadow: inset 0 0 0 3px #8a4fc2, 0 8px 14px rgba(30, 20, 5, 0.4); }

/* end of round: survivors, then the 3-round progress */
.round-end { position: absolute; z-index: 38; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(30, 22, 14, 0.35); pointer-events: none; font-family: var(--paper-font); color: var(--paper-ink); }
.re-card { width: min(100%, 340px); padding: 20px 18px 18px; border-radius: 22px; text-align: center; background: radial-gradient(ellipse at 50% 0%, #fffaf0, #f3e3c3 80%); box-shadow: inset 0 0 0 3px #d8b98a, 0 16px 30px rgba(20, 12, 4, 0.5); }
.re-card h2 { margin: 2px 0 10px; font-size: 32px; font-weight: 700; line-height: 1.05; }
.re-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: hidden; }
.re-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.55); text-align: left; }
.re-row b { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.re-row b em { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--paper-ink); border-radius: 6px; padding: 1px 5px; margin-left: 4px; vertical-align: 2px; }
.re-row span { font-size: 13px; font-weight: 700; }
.re-row.alive span { color: #1f9a3a; }
.re-row.out { opacity: 0.6; } .re-row.out span { color: #c62a1c; }
.re-av { width: 44px; height: 44px; }
.re-next h2 { font-size: 40px; margin-top: 8px; }
.re-next p { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.re-next p b { color: #c62a1c; font-size: 20px; }
.re-steps { display: flex; align-items: center; justify-content: center; gap: 0; }
.re-steps i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 20px; font-weight: 700; background: #efe2c6; box-shadow: inset 0 0 0 3px #d8b98a; color: rgba(74, 47, 28, 0.5); }
.re-steps i.done { background: #3aa64a; color: #fff; box-shadow: inset 0 0 0 3px #1f7a30; }
.re-steps i.now { background: #f2b705; color: var(--paper-ink); box-shadow: inset 0 0 0 3px #a8740c; transform: scale(1.2); animation: holePulse 1s ease-in-out infinite; }
.re-steps s { width: 26px; height: 4px; background: #d8b98a; border-radius: 2px; }

/* end of the game: dark screen with the machine */
.podium.dark { background: rgba(14, 10, 6, 0.86); }
.slot-screen { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(100%, 380px); }
.ss-stars { display: flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 14px; background: #fbf1da; box-shadow: inset 0 0 0 2px #d8b98a; font-size: 26px; font-weight: 700; }
.slot-screen .slot-machine { width: min(76vw, 320px); }
.slot-screen .pod-save { color: #fbf1da; }
.ss-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 4px; }
.ss-actions .paper-btn { min-width: 220px; }
.link-btn.light { color: #e9d9bb; }

/* paper buttons: the same torn-paper strip as the hint, brown ink (no gold) */
.paper-btn { background: url(/assets/ui/hint.webp) center / 100% 100% no-repeat; box-shadow: none; filter: drop-shadow(0 5px 7px rgba(30, 20, 5, 0.4)); padding: 14px 34px 15px; border-radius: 0; color: var(--paper-ink); }
.paper-btn.small { padding: 10px 22px 11px; font-size: 15px; }
.paper-btn.ghost { filter: drop-shadow(0 3px 4px rgba(30, 20, 5, 0.3)) saturate(0.6) brightness(0.92); }
.paper-btn:disabled { filter: grayscale(0.5) opacity(0.7); }

/* intro card stays twice as long */
.announce.show { animation-duration: 3.7s; }

/* the slot screen: truly full-screen dark, machine centred, lever hanging off its right side */
.podium.dark { position: fixed; inset: -60px 0; padding: 76px 16px; }
.slot-screen .slot { width: 100%; }
.slot-screen .slot-machine, .slot-machine { margin: 0 auto; width: min(70vw, 290px); }
.slot-lever { right: -15%; }
.ss-actions { gap: 8px; }
.ss-actions .paper-btn:first-child { min-width: 240px; font-size: 22px; }

/* save popup (after the spin) */
.save-pop { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px; background: rgba(14, 10, 6, 0.55); }
.sp-card { width: min(100%, 330px); display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 22px 20px 18px; border-radius: 22px; text-align: center;
  background: radial-gradient(ellipse at 50% 0%, #fffaf0, #f3e3c3 80%); box-shadow: inset 0 0 0 3px #d8b98a, 0 16px 30px rgba(20, 12, 4, 0.5); font-family: var(--paper-font); color: var(--paper-ink); }
.sp-card h3 { margin: 0; font-size: 28px; font-weight: 700; }
.sp-card p { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--paper-ink-2); }
.sp-card input { height: 46px; border-radius: 12px; border: 2px solid #d8b98a; background: #fffaf0; padding: 0 12px; font: 600 18px var(--paper-font); color: var(--paper-ink); text-align: center; }
.sp-card .paper-btn { align-self: center; min-width: 200px; }

/* lobby skin row: arrows for desktop */
.skins-wrap { position: relative; display: flex; align-items: center; gap: 4px; }
.skins-wrap .skins { flex: 1; min-width: 0; margin-left: 0; margin-right: 0; padding-left: 2px; padding-right: 2px; }
.skins-arrow { flex: none; width: 28px; height: 48px; border: 0; border-radius: 10px; background: #fbf1da; box-shadow: inset 0 0 0 2px #d8b98a; color: var(--paper-ink); font: 700 24px var(--paper-font); line-height: 1; cursor: pointer; }

/* ============================================================ main menu (paper) */
#lobby { background: #2e2420; color: var(--paper-ink); font-family: var(--paper-font); padding: calc(var(--safe-t) + 14px) 16px calc(var(--safe-b) + 46px); overflow: hidden; }
#lobby::before { content: none; }
/* the hackathon hall itself, softly out of focus and slowly drifting: you see where you'll play */
.lob-bg { position: absolute; inset: -8%; background: url(/assets/bg/hackathon.webp) center 30% / cover no-repeat; filter: blur(3px) saturate(0.85) brightness(0.72);
  animation: lobPan 28s ease-in-out infinite alternate; will-change: transform; }
.lob-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 55% at 50% 42%, transparent 30%, rgba(30, 20, 12, 0.55)); }
@keyframes lobPan { from { transform: translate(-3%, -2%) scale(1.04); } to { transform: translate(3%, 3%) scale(1.1); } }
.lob-head { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; }
.lob-status { position: static; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 0;
  background: url(/assets/ui/hint.webp) center / 100% 100% no-repeat; font: 600 14px var(--paper-font); color: var(--paper-ink); filter: drop-shadow(0 4px 6px rgba(20, 12, 4, 0.4)); }
.lob-logo { position: relative; z-index: 2; display: block; width: min(86%, 360px); margin: 6px auto 0; filter: drop-shadow(0 10px 16px rgba(20, 12, 4, 0.5)); animation: logoBob 4s ease-in-out infinite; transform-origin: 50% 70%; }
@keyframes logoBob { 0%, 100% { transform: rotate(-1.5deg) translateY(0); } 50% { transform: rotate(1.5deg) translateY(-4px); } }
.lob-stage { position: relative; z-index: 1; flex: 1; min-height: 140px; }
#preview { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.pedestal { position: absolute; left: 50%; bottom: 4%; width: 46%; max-width: 190px; aspect-ratio: 3.4; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, #fbf1da, #e2c99a 75%); box-shadow: inset 0 0 0 3px #b98e5c, inset 0 -8px 0 rgba(122, 86, 54, 0.25), 0 10px 18px rgba(20, 12, 4, 0.5); }
.lob-panel { position: relative; z-index: 2; padding: 14px 14px 10px; border-radius: 22px; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  background: radial-gradient(ellipse at 50% 0%, #fffaf0, #f3e3c3 85%); box-shadow: inset 0 0 0 3px #d8b98a, 0 14px 28px rgba(20, 12, 4, 0.5); display: flex; flex-direction: column; }
.lob-panel .panel-label, .lob-panel .panel-value { font-family: var(--paper-font); color: var(--paper-ink); font-weight: 600; }
.lob-panel .skins { margin: 8px 0 10px; }
.skins button { background: linear-gradient(165deg, #f6ead2, #e6d2ad); box-shadow: inset 0 0 0 2px #d8b98a; border-radius: 14px; }
.skins button.on { box-shadow: inset 0 0 0 3px var(--paper-ink), 0 6px 12px rgba(20, 12, 4, 0.25); }
#name { height: 48px; border-radius: 14px; border: 2px solid #d8b98a; background: #fffaf0; font: 600 18px var(--paper-font); color: var(--paper-ink); text-align: center; margin-bottom: 10px; }
#name:focus { border-color: var(--paper-ink); box-shadow: none; }
.play-btn { align-self: center; min-width: 78%; font-size: 30px; padding: 16px 40px 18px; animation: playPulse 1.8s ease-in-out infinite; }
@keyframes playPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
#lobby .link-btn { color: var(--paper-ink-2); }

/* the room ticker along the bottom */
.ticker { position: absolute; z-index: 3; left: 0; right: 0; bottom: calc(var(--safe-b) + 6px); height: 34px; overflow: hidden; background: url(/assets/ui/hint.webp) center / 100% 100% no-repeat;
  filter: drop-shadow(0 -2px 6px rgba(20, 12, 4, 0.35)); -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: inline-flex; align-items: center; height: 100%; white-space: nowrap; animation: tickerRoll 30s linear infinite; will-change: transform; }
@keyframes tickerRoll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk { display: inline-flex; align-items: center; gap: 6px; padding: 0 22px; font: 600 14px var(--paper-font); color: var(--paper-ink); }
.tk img { width: 20px; height: 20px; object-fit: contain; }
.tk em { font-style: normal; font-size: 12px; opacity: 0.6; }
.tk-jackpot b { color: #c62a1c; } .tk-win b { color: #a8740c; }

/* ============================================================ spectating: follow one character, arrows + one button */
.watch { position: absolute; z-index: 7; left: 0; right: 0; bottom: calc(var(--safe-b) + 18px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; font-family: var(--paper-font); }
.watch-tag { padding: 6px 16px 7px; background: url(/assets/ui/hint.webp) center / 100% 100% no-repeat; font-size: 13px; font-weight: 600; color: var(--paper-ink); filter: drop-shadow(0 4px 6px rgba(20, 12, 4, 0.4)); }
.watch-row { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.watch-arrow { font-size: 34px; line-height: 1; padding: 10px 18px 14px; }
.watch-bet { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 170px; padding: 12px 26px 14px; }
.watch-bet b { font-size: 24px; line-height: 1.05; } .watch-bet span { font-size: 12px; font-weight: 600; opacity: 0.75; }
.watch-bet.picked b { color: #a8740c; }

/* casino drama */
.slot-machine.spinning .slot-body { animation: marquee 0.25s steps(2) infinite; }
@keyframes marquee { 50% { filter: drop-shadow(0 10px 14px rgba(30, 20, 5, 0.4)) brightness(1.18) saturate(1.2); } }
.slot-flash { position: absolute; inset: 0; z-index: 4; background: #fff8e6; pointer-events: none; }

/* remaining pop-ups (lobby / account) in paper too */
.toast { font-family: var(--paper-font); color: var(--paper-ink); background: url(/assets/ui/hint.webp) center / 100% 100% no-repeat !important; border: 0 !important; box-shadow: none !important; backdrop-filter: none !important; filter: drop-shadow(0 6px 8px rgba(20, 12, 4, 0.4)); padding: 12px 22px !important; }
.toast .toast-ico { display: none; }
.caught-card { font-family: var(--paper-font); color: var(--paper-ink); background: radial-gradient(ellipse at 50% 0%, #fffaf0, #f3e3c3 85%) !important; box-shadow: inset 0 0 0 3px #d8b98a, 0 16px 30px rgba(20, 12, 4, 0.5) !important; border: 0 !important; backdrop-filter: none !important; }
.caught-card h2 { color: #c62a1c; font-weight: 700; }
.caught-card p, .caught-card small { color: var(--paper-ink-2); }

/* ============================================================ round rules card: 3 lines, pictures first */
.rules .rules-card { min-width: 300px; max-width: 340px; padding: 22px 26px 24px; }
.rules.show { animation: paperIn 4.3s cubic-bezier(.2, 1.3, .4, 1) forwards; }
.rules-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.rules-list li { display: flex; align-items: center; gap: 10px; }
.rules-list b { font-size: 20px; font-weight: 700; color: var(--paper-ink); line-height: 1.1; }
.rn { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 16px; font-weight: 700; color: #fff; background: var(--paper-ink); }
.ri { flex: none; width: 46px; height: 46px; display: grid; place-items: center; }
.ri img, .ri canvas { width: 46px; height: 46px; object-fit: contain; }
/* the task icon sits in a little patch of ground with the white task ring, like in the game */
.ri-task { border-radius: 50%; background: radial-gradient(circle, #8fc46a, #6aa64a); box-shadow: inset 0 0 0 3px #fff, 0 3px 6px rgba(20, 12, 4, 0.3); }
.ri-task img { width: 36px; height: 36px; }
.r2 { align-items: flex-start !important; }
.r2 .rn { margin-top: 9px; }
.r2-col { display: flex; flex-direction: column; gap: 0; }
.r2-row { display: flex; align-items: center; gap: 10px; }
.r2-col em { font-style: normal; font-size: 14px; font-weight: 700; color: #b5651d; margin: -2px 0 -2px 56px; text-transform: uppercase; letter-spacing: 0.08em; }

/* pause button, left of the round card */
.pause-btn { pointer-events: auto; align-self: flex-start; width: 40px; height: 40px; margin-right: 6px; border: 0; cursor: pointer;
  background: url(/assets/ui/hint.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 4px 6px rgba(30, 20, 5, 0.35));
  font: 700 19px var(--paper-font); color: var(--paper-ink); letter-spacing: -1px; }
.hud-top > .pause-btn + .card { margin-right: auto; }
.leave-pop { position: absolute; inset: 0; z-index: 45; display: grid; place-items: center; padding: 16px; background: rgba(14, 10, 6, 0.6); }

/* lobby: Play turns into Buy for a skin you're trying on */
.play-btn.buy { animation: none; color: #1f7a30; }
.play-btn.short { color: #a0522d; font-size: 22px; }
.play-btn .star-ico { width: 0.9em; height: 0.9em; vertical-align: -0.08em; margin: 0 2px; }

/* rules card v2: centred, roomy, readable at a glance */
.rules .rules-card { min-width: 290px; max-width: 320px; padding: 22px 24px 26px; text-align: center; }
.rules .announce-kicker { font-size: 24px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--paper-ink); }
.rules-list { margin: 14px 0 0; gap: 18px; text-align: center; align-items: center; }
.rules-list li { flex-direction: column; align-items: center; gap: 4px; }
.rules-list b { font-size: 18px; font-weight: 600; line-height: 1.2; }
.rules-list em { font-style: normal; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #b5651d; margin: 2px 0; }
.rn { width: 26px; height: 26px; font-size: 15px; margin-bottom: 2px; }

/* ============================================================ big screen (?screen): 16:9, phone in the middle */
body.screen { background: #2a1f18; }
body.screen::before { content: ""; position: fixed; inset: -6%; background: url(/assets/bg/hackathon.webp) center / cover no-repeat; filter: blur(6px) brightness(0.45) saturate(0.8); animation: lobPan 40s ease-in-out infinite alternate; }
body.screen #app { inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(46vh, 430px); height: min(96vh, 932px); border-radius: 36px;
  box-shadow: 0 0 0 10px #1a120c, 0 0 0 13px #d8b98a, 0 40px 120px rgba(0, 0, 0, 0.7); }
body.screen .side { display: none !important; }
body.screen .hud-top { right: 12px; }
body.screen .announce { right: 0; }
.scr-left, .scr-right { position: fixed; z-index: 5; top: 0; bottom: 0; width: calc((100vw - min(46vh, 430px)) / 2 - 40px); display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 3vh 2vw; font-family: var(--paper-font); color: var(--paper-ink); }
.scr-left { left: 0; align-items: flex-end; }
.scr-right { right: 0; align-items: flex-start; }
.scr-logo { width: min(100%, 380px); filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.5)); animation: logoBob 4s ease-in-out infinite; }
.scr-card { width: min(100%, 380px); padding: 18px 20px; border-radius: 22px; background: radial-gradient(ellipse at 50% 0%, #fffaf0, #f3e3c3 85%); box-shadow: inset 0 0 0 3px #d8b98a, 0 14px 28px rgba(0, 0, 0, 0.45); }
.scr-title { font-size: 24px; font-weight: 700; margin-bottom: 10px; text-align: center; }
.scr-board { position: relative; transition: height 0.4s; }
.scr-empty { text-align: center; font-weight: 600; opacity: 0.6; padding: 10px 0; }
.scr-row { position: absolute; left: 0; right: 0; top: 0; height: 52px; display: grid; grid-template-columns: 28px 44px 1fr auto auto; align-items: center; gap: 10px; padding: 0 12px 0 6px;
  border-radius: 14px; background: rgba(255, 255, 255, 0.6); transition: transform 0.5s cubic-bezier(.2, 1.2, .4, 1); }
.scr-row canvas { width: 44px; height: 44px; }
.scr-rank { font-style: normal; font-size: 20px; font-weight: 700; text-align: center; }
.scr-name { font-size: 20px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scr-state { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.scr-state.playing { background: #3aa64a; color: #fff; } .scr-state.caught { background: #c62a1c; color: #fff; } .scr-state.watching { background: #d8c3a0; }
.scr-cash { font-size: 22px; font-weight: 700; color: #1f7a30; min-width: 54px; text-align: right; }
.scr-qr { display: flex; flex-direction: column; align-items: center; }
.scr-qr img { width: min(100%, 260px); aspect-ratio: 1; background: #fff; border-radius: 14px; padding: 10px; box-shadow: inset 0 0 0 3px #d8b98a; }
.scr-url { margin-top: 8px; font-size: 18px; font-weight: 700; }
.scr-stat { display: flex; align-items: baseline; justify-content: center; gap: 10px; } .scr-stat b { font-size: 46px; line-height: 1; } .scr-stat span { font-size: 18px; font-weight: 600; }
.scr-how { display: flex; flex-direction: column; gap: 10px; font-size: 19px; font-weight: 600; } .scr-how div { display: flex; align-items: center; gap: 10px; }
.scr-right .paper-btn { font-size: 22px; }
.scr-gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(14, 10, 6, 0.8); }
.scr-cam { position: absolute; z-index: 7; left: 0; right: 0; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; font-family: var(--paper-font); }
@media (max-aspect-ratio: 4/3) { .scr-left, .scr-right { display: none !important; } }

/* big screen: the QR stands on its own, big */
.scr-qr { background: none; box-shadow: none; padding: 0; width: min(100%, 420px); gap: 12px; }
.scr-qr .scr-title { margin: 0; padding: 10px 28px 12px; background: url(/assets/ui/hint.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4)); font-size: 26px; }
.scr-qr img { width: min(100%, 400px); padding: 16px; border-radius: 20px; background: #fff; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55); }
.scr-qr .scr-url { color: #fbf1da; font-size: 22px; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }

/* rules: brown numbers in the text, one picture per line */
.rules-list li { flex-direction: row !important; justify-content: flex-start; gap: 14px; }
.rules-list { align-items: stretch; gap: 14px; }
.rules .rules-card { min-width: 280px; }
.ri-one { flex: none; width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(30, 20, 5, 0.3)); }
.rules-list b { font-size: 20px; font-weight: 700; text-align: left; }

/* caught: the world turns monochrome (HUD stays in colour) + a red banner */
#app.caught-mode #cv { filter: grayscale(1) contrast(1.05); transition: filter 0.6s; }
.out-banner { position: absolute; z-index: 8; left: 50%; top: calc(var(--safe-t) + 130px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center;
  padding: 12px 28px 14px; background: url(/assets/ui/hint.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 6px 10px rgba(20, 12, 4, 0.45));
  font-family: var(--paper-font); color: var(--paper-ink); pointer-events: none; white-space: nowrap; }
.out-banner b { font-size: 26px; font-weight: 700; color: #c62a1c; line-height: 1.05; }
#app:not(.caught-mode) .out-banner b { color: var(--paper-ink); font-size: 22px; }
.out-banner span { font-size: 16px; font-weight: 600; }

/* lobby links + promo */
.lob-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
/* big screen: rooms */
.scr-room-list { display: flex; flex-direction: column; gap: 8px; max-height: 32vh; overflow: auto; }
.scr-room { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.55); box-shadow: inset 0 0 0 2px #d8b98a; font-family: var(--paper-font); color: var(--paper-ink); cursor: pointer; text-align: left; }
.scr-room b { font-size: 20px; } .scr-room span { font-size: 14px; font-weight: 600; opacity: 0.75; }
.scr-room.on { background: #ffe58a; box-shadow: inset 0 0 0 3px #a8740c; }
.scr-state.done { background: #d8c3a0; }
.scr-board-card { max-height: 70vh; overflow: hidden; }
.scr-qr img { width: min(100%, 34vh); }
.scr-right { gap: 12px; }
.scr-how { display: none; }

/* lobby Play/Buy button: one fixed size whatever it says (no panel jumps), text never wraps, no shadow box */
.play-btn { box-sizing: border-box; height: 76px; padding: 0 24px; display: flex; align-items: center; justify-content: center; gap: 4px;
  white-space: nowrap; overflow: hidden; filter: none; will-change: transform; }
.play-btn.buy, .play-btn.short { font-size: 24px; }
.shop-tag { height: 18px; line-height: 16px; display: flex; align-items: center; gap: 1px; }
.shop-tag .star-ico { width: 12px; height: 12px; }

/* round-steps dot: pulse in place (the shared keyframes also moved it) */
.re-steps i.now { animation: stepPulse 1s ease-in-out infinite; }
@keyframes stepPulse { 0%, 100% { transform: scale(1.15); } 50% { transform: scale(1.3); } }
.watch-bet.used, #watchBet.used { filter: grayscale(0.8); opacity: 0.6; }
/* skins row: no rubber-band past the last skin */
.skins { overscroll-behavior-x: contain; }
#promoCode { text-transform: uppercase; letter-spacing: 0.12em; }

/* no text selection or long-press callouts anywhere except the text fields */
*, *::before, *::after { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea { -webkit-user-select: text !important; user-select: text !important; -webkit-touch-callout: default; }

/* leaderboard: just the dollars */
.scr-row .scr-state { display: none; }
.scr-row { grid-template-columns: 28px 44px 1fr auto; }

/* lobby inside the game: a big centred "waiting for players" */
.wait-big { position: absolute; z-index: 9; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 22px 34px 24px; background: url(/assets/ui/hint.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 8px 14px rgba(20, 12, 4, 0.5));
  font-family: var(--paper-font); color: var(--paper-ink); pointer-events: none; white-space: nowrap; text-align: center; }
.wait-big b { font-size: 32px; font-weight: 700; line-height: 1.05; }
.wait-big span { font-size: 20px; font-weight: 600; }
