/* Self-hosted (no request to Google's CDN, no visitor IP sent to Google —
   fonts.googleapis.com/gstatic.com are otherwise a GDPR issue: LG München,
   Urteil v. 20.01.2022, Az. 3 O 17493/20). Both are variable fonts, so one
   file per family covers every weight used below. */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/archivo.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/jetbrains-mono.woff2') format('woff2');
}

:root {
  --bg: #0c0d12;
  --panel: #10121a;
  --panel-2: #14161f;
  --panel-soft: rgba(255, 255, 255, 0.03);
  --border: #1e2130;
  --border-2: #262a3a;
  --cyan: #00f0ff;
  --pink: #ff2bd6;
  --text: #eceef4;
  --text-dim: #c5cad8;
  --text-dimmer: #7c8296;
  --text-faint: #565c70;
  --good: #4ade80;
  --warn: #e0b355;
  --warn-2: #ffb020;
  --danger: #ff7a7a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  font-family: 'Archivo', system-ui, sans-serif;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

.app {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 16px 50px;
  gap: 24px;
}

.screen { display: none; flex-direction: column; align-items: center; gap: 18px; width: 100%; max-width: 720px; }
.screen.active { display: flex; animation: screenIn 0.3s ease; }
#screen-game { max-width: 1160px; }
#screen-lobby { max-width: 1000px; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-label { font-size: 12px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-dimmer); }

/* ---- Shared controls ---- */
.field {
  width: 100%;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  color: var(--text);
  font-family: 'Archivo', sans-serif;
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field::placeholder { color: var(--text-faint); }
.field:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,240,255,0.14); }

.btn {
  padding: 15px 22px;
  border: none;
  border-radius: 6px;
  font-family: 'Archivo', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #04161a;
  background: var(--cyan);
  cursor: pointer;
  transition: background 0.12s ease, opacity 0.12s ease;
}
.btn:hover { background: #6ff5ff; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; background: #1b1f2c; color: var(--text-faint); }
.btn.ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-2);
}
.btn.ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn.small { padding: 8px 13px; font-size: 13px; }

.btn-toggle {
  padding: 15px 22px;
  border-radius: 6px;
  font-family: 'Archivo', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  color: var(--text-dim);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-toggle:hover { border-color: var(--cyan); }
.btn-toggle.on {
  background: #163427;
  border-color: #2f6b45;
  color: var(--good);
}

.link-quiet {
  background: none;
  border: none;
  color: var(--text-dimmer);
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s ease;
}
.link-quiet:hover { color: var(--danger); }

.link-cta {
  background: none;
  border: 0;
  color: var(--cyan);
  font-family: 'Archivo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 9px 2px;
}
.link-cta:hover { color: #7ff6ff; }

.error-box {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  min-height: 0;
}

/* ---- Landing ---- */
.card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.landing-card { align-items: center; text-align: center; gap: 30px; }
.landing-logo { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 4px; width: 100%; }

@keyframes headBob {
  0%, 20%, 100% { transform: rotate(0deg); }
  6%  { transform: rotate(-4deg); }
  12% { transform: rotate(3deg); }
}
@keyframes headGlow {
  0%, 24%, 100% { filter: drop-shadow(0 0 8px rgba(0,255,180,0.7)) drop-shadow(0 0 18px rgba(255,0,230,0.55)) drop-shadow(0 0 28px rgba(0,240,255,0.35)); }
  8%            { filter: drop-shadow(0 0 18px rgba(166,255,0,1)) drop-shadow(0 0 38px rgba(255,0,230,1)) drop-shadow(0 0 56px rgba(0,240,255,0.7)); }
}
@keyframes tongueFlick {
  0%, 20%, 100% { transform: scaleX(0); opacity: 0; }
  5%            { transform: scaleX(1); opacity: 1; }
  9%            { transform: scaleX(0.25); opacity: 1; }
  13%           { transform: scaleX(1); opacity: 1; }
  18%           { transform: scaleX(0); opacity: 0; }
}
@keyframes eyeBlink {
  0%, 40%, 46%, 100% { transform: scaleY(1); }
  43%                { transform: scaleY(0.1); }
}
.snake-face { animation: headBob 2.4s ease-in-out infinite; flex-shrink: 0; }
.snake-face-lg { width: 84px; height: 72px; transform-origin: 15px 52.5px; }
.snake-face-sm { width: 30px; height: 26px; transform-origin: 5.4px 18.8px; }
.snake-face-glow { animation: headGlow 2.4s ease-in-out infinite; display: flex; }
.tongue { animation: tongueFlick 2.4s ease-in-out infinite; transform-origin: 118px 58px; }
.pupil { animation: eyeBlink 2.4s ease-in-out infinite; transform-origin: 58px 50px; }

.wordmark {
  font-weight: 800; letter-spacing: -1.5px;
  background: linear-gradient(100deg, #ff2bd6 0%, #00f0ff 50%, #ff2bd6 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: textFlow 2.6s linear infinite;
  display: inline-block;
}
@keyframes textFlow {
  0% { background-position: 0% 0; }
  100% { background-position: -260% 0; }
}
.wordmark-wrap {
  position: relative; display: inline-block; animation: textJolt 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255,43,214,0.6)) drop-shadow(0 0 24px rgba(0,240,255,0.5));
  font-size: 56px; line-height: 1; font-family: 'Archivo', system-ui, sans-serif;
}
@keyframes textJolt {
  0%, 4%, 22%, 100% { transform: translate(0, 0); }
  6%  { transform: translate(-3px, 1px) skewX(-3deg); }
  8%  { transform: translate(3px, -1px) skewX(2deg); }
  10% { transform: translate(-1px, 0); }
}
.wordmark-ghost {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  font-weight: 800; letter-spacing: -1.5px; white-space: nowrap;
}
.wordmark-ghost.cyan { color: #00f0ff; mix-blend-mode: screen; animation: glitchTop 2.4s steps(1) infinite; }
.wordmark-ghost.pink { color: #ff2bd6; mix-blend-mode: screen; animation: glitchBottom 2.4s steps(1) infinite; }
@keyframes glitchTop {
  0%, 4%, 22%, 100% { clip-path: inset(0 0 100% 0); opacity: 0; transform: translate(0,0); }
  5%  { clip-path: inset(10% 0 55% 0); opacity: 0.85; transform: translate(-4px,0); }
  7%  { clip-path: inset(0 0 70% 0); opacity: 0.85; transform: translate(3px,-1px); }
  9%  { clip-path: inset(20% 0 40% 0); opacity: 0.7; transform: translate(-2px,0); }
  11% { opacity: 0; }
}
@keyframes glitchBottom {
  0%, 4%, 22%, 100% { clip-path: inset(100% 0 0 0); opacity: 0; transform: translate(0,0); }
  5%  { clip-path: inset(55% 0 5% 0); opacity: 0.85; transform: translate(4px,0); }
  7%  { clip-path: inset(70% 0 0 0); opacity: 0.85; transform: translate(-3px,1px); }
  9%  { clip-path: inset(40% 0 15% 0); opacity: 0.7; transform: translate(2px,0); }
  11% { opacity: 0; }
}
.landing-form { width: 100%; display: flex; flex-direction: column; gap: 12px; }
#create-new, #join-existing { display: flex; flex-direction: column; gap: 12px; }
.join-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 2px; }
.join-row .code-field { flex: 1; min-width: 0; text-align: center; letter-spacing: 2px; text-transform: uppercase; font-size: 14px; padding: 10px; }
.landing-hint { margin: 0; font-size: 13px; color: var(--text-faint); }

/* ---- Lobby ---- */
.lobby-card {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.lobby-header {
  display: flex; align-items: center; gap: 14px; padding: 16px 24px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.lobby-sep { width: 1px; height: 18px; background: var(--border-2); }
.lobby-room-label { font-size: 13px; color: var(--text-dimmer); }
.room-code { font-family: 'JetBrains Mono', monospace; font-size: 17px; font-weight: 700; letter-spacing: 3px; color: #f7f8fb; }
.lobby-leave { margin-left: auto; }

.lobby-body { display: grid; grid-template-columns: 1fr 300px; }
@media (max-width: 760px) { .lobby-body { grid-template-columns: 1fr; } }

.lobby-seats { padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.lobby-seats-head { display: flex; align-items: baseline; justify-content: space-between; }
.seats-ready-count { font-size: 13px; color: var(--text-dimmer); }

.player-list { display: flex; flex-direction: column; gap: 8px; }
.player-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 8px; border: 1px solid var(--border-2); background: var(--panel-2);
}
.player-row.open { border-style: dashed; background: transparent; }
.player-avatar {
  width: 30px; height: 30px; border-radius: 7px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 13px; color: #0a0118;
  background: var(--dot);
}
.player-avatar.open-slot { border: 1px dashed var(--border-2); background: transparent; }
.player-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.player-name { font-weight: 600; font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-name .you-tag { font-size: 11px; font-weight: 600; color: var(--pink); margin-left: 4px; }
.player-sub { font-size: 12px; color: var(--text-dimmer); }
.player-open-text { flex: 1; font-size: 14px; color: var(--text-faint); }
.player-status { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 5px; white-space: nowrap; }
.player-status.yes { color: var(--good); background: #163427; }
.player-status.no { color: var(--warn); border: 1px solid #4a3c22; }

.lobby-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.waiting-note {
  padding: 10px 13px; border-radius: 6px; background: #1b1710; border: 1px solid #3a2f1c;
  color: var(--warn); text-align: left; font-size: 13px;
}
.lobby-buttons { display: flex; gap: 10px; }
.lobby-buttons .btn, .lobby-buttons .btn-toggle { flex: 1; }

.lobby-rules {
  border-left: 1px solid var(--border); background: var(--panel);
  padding: 20px; display: flex; flex-direction: column; gap: 16px;
}
.rules-block { display: flex; flex-direction: column; gap: 7px; }
.rules-label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.rules-row-head { display: flex; align-items: baseline; justify-content: space-between; }
.rules-sub { font-size: 12px; color: var(--text-dimmer); }
.mode-hint { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--text-dimmer); }

.mode-toggle { display: flex; padding: 3px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 7px; }
.mode-btn {
  flex: 1; padding: 9px 0; border: none; border-radius: 5px; background: transparent;
  color: var(--text-dimmer); font-family: 'Archivo', sans-serif; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.mode-btn:hover { color: var(--text-dim); }
.mode-btn.active { background: #0d2f34; color: var(--cyan); font-weight: 700; }
.mode-btn:disabled { cursor: not-allowed; }

.stepper {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--border-2); background: var(--panel-2); border-radius: 6px; padding: 4px;
}
.stepper-btn {
  width: 34px; height: 34px; border-radius: 6px; border: none;
  background: transparent; color: var(--text-dim);
  font-family: 'Archivo', sans-serif; font-size: 17px; font-weight: 700;
  cursor: pointer; transition: border-color 0.12s ease;
}
.stepper-btn:hover { color: var(--cyan); }
.stepper-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper-value { font-family: 'JetBrains Mono', monospace; font-size: 17px; font-weight: 700; color: #f7f8fb; min-width: 24px; text-align: center; }

.rules-board-row { display: flex; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-dimmer); }
.board-size-value { color: var(--text-dim); font-weight: 600; }

/* ---- Game screen ---- */
.game-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.game-layout { display: flex; gap: 20px; align-items: flex-start; justify-content: center; width: 100%; }

.sidebar { width: 280px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 12px; }
.sidebar-round-row { display: flex; align-items: baseline; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.sidebar-round-value { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 700; color: #f7f8fb; }
.hud-mode-tag { margin-left: auto; padding: 4px 9px; border-radius: 5px; background: #1b1f2c; font-size: 12px; font-weight: 600; color: var(--text-dim); }
.sidebar-sub-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-dimmer); padding: 0 2px; }
.sidebar-sub-row span:last-child { color: var(--text-dim); font-weight: 700; font-family: 'JetBrains Mono', monospace; }

.ammo-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-dimmer); padding: 0 2px; }
.ammo-badge {
  padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 11px;
  font-family: 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: 0.5px;
  border: 1px solid var(--border-2); color: var(--text-faint); background: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ammo-badge.ready { background: rgba(0,240,255,0.16); color: var(--cyan); border-color: rgba(0,240,255,0.5); }
.ammo-key-hint { font-size: 11px; color: var(--text-faint); }

.leave-match { align-self: center; margin-top: -4px; }

.dead-banner {
  flex-direction: column; gap: 4px; text-align: left;
  padding: 12px 14px; border-radius: 8px; background: #1c1015; border: 1px solid #3a1f26;
}
.dead-banner strong { color: var(--danger); font-size: 13.5px; }
.dead-banner span { color: #c0a6ac; font-size: 12.5px; line-height: 1.4; }

.scoreboard { display: flex; flex-direction: column; gap: 8px; }
.score-card {
  display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 8px;
  border: 1px solid var(--border-2); background: var(--panel-2); transition: opacity 0.2s ease;
}
.score-card.me { background: #161a26; border-color: var(--dot); }
.score-card.dead { opacity: 0.55; }
.score-card-top { display: flex; align-items: center; gap: 10px; }
.score-card-top .dot { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; background: var(--dot); }
.score-card-top .nm { flex: 1; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-card-top .tag { font-size: 11.5px; font-weight: 700; }
.score-card-top .tag.you { color: var(--dot); }
.score-card-top .tag.out { color: var(--danger); }
.score-card-body { display: flex; align-items: baseline; gap: 8px; }
.score-card-body .sc { font-family: 'JetBrains Mono', monospace; font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.score-card.me .score-card-body .sc { font-size: 26px; color: #f7f8fb; }
.score-card-body .pts { font-size: 12px; color: var(--text-dimmer); }
.score-card-body .meta { margin-left: auto; font-size: 11.5px; color: var(--text-dimmer); }

.score-card-buffs { display: flex; flex-direction: column; gap: 5px; padding-top: 8px; border-top: 1px solid var(--border-2); }
.buff-row { display: flex; align-items: center; gap: 8px; }
.buff-row .lbl { flex: 1; font-size: 12px; font-weight: 600; color: var(--text-dim); }
.buff-row .tm { font-size: 11px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.buff-track { height: 3px; border-radius: 2px; background: #1b1f2c; overflow: hidden; }
.buff-fill { height: 3px; border-radius: 2px; transition: width 0.1s linear; }

.sidebar-section { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--panel-soft); }
.board-panel { margin-top: auto; }
.pickup-hint { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--text-faint); }
.pickup-row { display: flex; align-items: center; gap: 10px; }
.pickup-icon {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 5px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--ic); color: var(--ic); font-size: 11px; font-weight: 700; background: rgba(10,4,26,0.4);
}
.pickup-icon.bad { border-style: dashed; }
.pickup-text { display: flex; flex-direction: column; }
.pickup-text .nm { font-size: 13px; font-weight: 600; color: var(--text); }
.pickup-text .nm em { font-style: normal; font-weight: 500; color: var(--text-dimmer); }
.pickup-timer { margin-left: auto; font-size: 11.5px; color: var(--text-dimmer); font-family: 'JetBrains Mono', monospace; }

.hint { display: flex; align-items: center; gap: 6px; color: var(--text-dimmer); justify-content: center; padding: 4px 0; }
.key { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 5px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text-dim); font-size: 12px; }
.key.big { width: 44px; height: 44px; border-radius: 8px; border-color: var(--cyan); color: var(--cyan); background: var(--panel-2); font-size: 18px; }
.key.big.wide { width: auto; padding: 0 16px; font-size: 14px; font-weight: 700; }
.hint-text { margin-left: 4px; text-transform: uppercase; letter-spacing: 1.5px; font-size: 10.5px; }

.board-wrap { position: relative; border-radius: 6px; flex: 0 0 auto; background: #08090e; padding: 0; }
#board {
  display: block;
  background: #0a0b11;
  border-radius: 4px;
  border: 1px solid var(--border);
  outline: none;
}

.spectate-pill {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  padding: 9px 16px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border-2);
  font-size: 13px; color: var(--text-dim); z-index: 9;
}

.wave-banner {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.7);
  font-family: 'JetBrains Mono', monospace; font-size: 26px; font-weight: 700; letter-spacing: 3px;
  color: #fff; text-shadow: 0 0 10px var(--pink), 0 0 26px var(--cyan); opacity: 0; pointer-events: none; z-index: 10; white-space: nowrap;
}
.wave-banner.show { animation: waveIn 1.4s ease-out forwards; }
@keyframes waveIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  30% { transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.flash { position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: 0; mix-blend-mode: screen; }
.flash.active { animation: flashPulse 0.5s ease-out; }
@keyframes flashPulse { 0% { opacity: 1; } 100% { opacity: 0; } }

.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center; background: rgba(8,9,14,0.86); border-radius: 4px; box-sizing: border-box;
}
.overlay.hidden { display: none; }
.overlay-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dimmer); }
.overlay-title { margin: 0; font-size: 22px; font-weight: 700; color: #f7f8fb; letter-spacing: -0.3px; }
.overlay-message { margin: 0; max-width: 280px; font-size: 14px; line-height: 1.5; color: var(--text-dim); }

.results-list { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 340px; }
.results-row { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-radius: 7px; background: #181c28; border: 1px solid var(--border-2); }
.results-row .rank { width: 16px; font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; color: var(--text-dimmer); }
.results-row .dot { width: 11px; height: 11px; border-radius: 3px; background: var(--dot); flex: 0 0 auto; }
.results-row .nm { flex: 1; font-weight: 600; font-size: 14px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results-row .nm .you-tag { font-size: 11px; color: var(--pink); font-weight: 600; margin-left: 3px; }
.results-row .meta { font-size: 11.5px; color: var(--text-dimmer); }
.results-row .sc { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--text); font-size: 15px; }
.results-row.winner { background: #1e1a0f; border-color: #6b5320; }
.results-row.winner .rank { color: var(--warn); }

.next-round-bar { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.next-round-bar-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 12.5px; color: var(--text-dimmer); }
.next-round-time { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--cyan); }
.launch-bar-track { width: 100%; height: 4px; border-radius: 2px; background: #1b1f2c; overflow: hidden; }
.launch-bar-fill { height: 4px; border-radius: 2px; background: var(--cyan); width: 100%; transition: width 0.1s linear, background 0.2s ease; }

/* Lighter than the base .overlay backdrop — you're choosing a direction
   here, so you need to actually see where your own dot is on the board
   before committing to one. */
.launch-overlay { gap: 16px; background: rgba(8,9,14,0.55); }
.launch-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-dimmer); }
.launch-keys { display: flex; gap: 10px; }
.launch-shoot-hint { display: flex; align-items: center; gap: 10px; }
.launch-shoot-label { font-size: 13px; color: var(--text-dimmer); }
.launch-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 260px; }
.launch-bar-text { font-size: 13px; color: var(--warn); }

.match-stats { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.match-stats-row { display: flex; justify-content: space-between; font-size: 13px; }
.match-stats-row span:first-child { color: var(--text-dimmer); }
.match-stats-row span:last-child { color: var(--text); font-weight: 600; }

.round-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 14px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-dimmer); margin-bottom: -4px;
}
.countdown-number {
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 68px; color: #fff;
  text-shadow: 0 0 14px var(--pink), 0 0 34px var(--cyan);
}

@media (max-width: 900px) {
  .game-layout { flex-direction: column; align-items: center; }
  .sidebar { width: 100%; max-width: 480px; }
}

/* ---- Power-ups guide modal ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(6,7,11,0.78); padding: 24px;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  width: 100%; max-width: 460px; max-height: 82vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border-2); border-radius: 12px; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; }
.modal-close {
  background: none; border: 1px solid var(--border-2); border-radius: 6px; color: var(--text-dim);
  width: 28px; height: 28px; font-size: 18px; line-height: 1; cursor: pointer;
}
.modal-close:hover { border-color: var(--cyan); color: var(--cyan); }

.powerups-list { display: flex; flex-direction: column; gap: 4px; }
.powerups-group-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-faint); margin: 10px 0 2px; }
.powerups-group-label:first-child { margin-top: 0; }
.powerup-guide-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px 6px; border-radius: 8px; }
.powerup-guide-item:hover { background: var(--panel-soft); }
.powerup-guide-icon {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--ic); color: var(--ic); font-size: 11px; font-weight: 700; background: rgba(10,4,26,0.4); margin-top: 1px;
}
.powerup-guide-icon.bad { border-style: dashed; }
.powerup-guide-text { display: flex; flex-direction: column; gap: 2px; }
.powerup-guide-text .nm { font-size: 14px; font-weight: 600; color: var(--text); }
.powerup-guide-text .ds { font-size: 12.5px; line-height: 1.4; color: var(--text-dimmer); }
