/* ═══════════════════════════════════════════════════════
   BOMBERMAN · SPRAY EDITION
   ═══════════════════════════════════════════════════════ */
@font-face {
  font-family: 'Press Start 2P';
  src: url('../fonts/PressStart2P.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-400.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-600.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-700.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-800.ttf') format('truetype');
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #070a13;
  --bg-2: #0b1121;
  --panel: #101a30;
  --panel-2: #0d1526;
  --line: rgba(137, 166, 228, 0.17);
  --line-strong: rgba(137, 166, 228, 0.32);
  --text: #eef3ff;
  --muted: #8b9cc1;
  --muted-2: #5f6f92;
  --orange: #ff8a3d;
  --red: #ff5470;
  --pink: #ff5cad;
  --cyan: #59d8ff;
  --lime: #b7f34a;
  --yellow: #ffd166;
  --blue: #5a95ff;
  --green: #67e878;
  --ink: #070a13;
  --pixel: 'Press Start 2P', 'Courier New', monospace;
  --sans: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius: 18px;
  --hard-shadow: 0 6px 0 rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(255, 92, 173, 0.12), transparent 60%),
    radial-gradient(1000px 800px at 5% 10%, rgba(89, 216, 255, 0.09), transparent 55%),
    linear-gradient(180deg, #0a0f1d 0%, #070a13 60%, #06080f 100%);
  overflow-x: hidden;
}
.hidden { display: none !important; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
button { font-family: inherit; }
button, input { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--orange); color: var(--ink); }
kbd {
  font-family: var(--pixel);
  font-size: 8px;
  padding: 6px 7px;
  border-radius: 6px;
  background: #1a2742;
  color: #dfe9ff;
  border: 1px solid rgba(160, 190, 255, 0.24);
  border-bottom-width: 3px;
  white-space: nowrap;
}

.screen { min-height: 100vh; }

/* ═══════════════ HOME ═══════════════ */
.home {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}
.home-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.home-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 78%);
}
.paint {
  position: absolute;
  display: block;
  filter: blur(60px);
  opacity: 0.32;
  border-radius: 50%;
  animation: float 16s ease-in-out infinite;
}
.p1 { width: 560px; height: 560px; top: -180px; right: -80px; background: #ff5470; }
.p2 { width: 480px; height: 480px; bottom: -180px; left: -140px; background: #2f7bff; animation-delay: -5s; }
.p3 { width: 320px; height: 320px; top: 44%; left: 38%; background: #ff8a3d; opacity: 0.13; animation-delay: -9s; }
.p4 { width: 300px; height: 300px; top: 6%; left: 12%; background: #59d8ff; opacity: 0.12; animation-delay: -12s; }
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(24px, -28px, 0) scale(1.06); }
}
.dot-grid {
  position: absolute;
  width: 260px; height: 260px; right: 6%; bottom: 14%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  opacity: 0.28;
  transform: rotate(-8deg);
}
.tag {
  position: absolute;
  font-family: var(--pixel);
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.16);
  line-height: 1.5;
  letter-spacing: 2px;
  user-select: none;
}
.tag-a { top: 24%; left: 3%; font-size: 34px; transform: rotate(-12deg); }
.tag-b { bottom: 17%; right: 5%; font-size: 22px; transform: rotate(8deg); text-align: center; -webkit-text-stroke-color: rgba(255, 138, 61, 0.25); }
.tag-c { top: 13%; right: 12%; font-size: 15px; transform: rotate(6deg); -webkit-text-stroke-color: rgba(89, 216, 255, 0.25); }
.bomb-deco {
  position: absolute;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2f3a56, #0b1020 55%, #04060c);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  opacity: 0.55;
}
.bomb-deco::before {
  content: '';
  position: absolute;
  width: 16px; height: 26px;
  border-right: 4px solid #9dabc9;
  border-top: 4px solid #9dabc9;
  border-radius: 0 12px 0 0;
  right: 12px; top: -16px;
  transform: rotate(8deg);
}
.bomb-deco::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 18px 4px rgba(255, 138, 61, 0.65);
  right: 2px; top: -24px;
  animation: spark 1.3s steps(2) infinite;
}
@keyframes spark { 50% { transform: scale(0.6); opacity: 0.6; } }
.bd1 { left: 5%; bottom: 7%; transform: rotate(-9deg); }
.bd2 { right: 33%; top: 5%; width: 46px; height: 46px; opacity: 0.3; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 54px);
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}
.brand-mini {
  display: flex;
  align-items: baseline;
  gap: 12px;
  letter-spacing: 1px;
}
.brand-mini b {
  font-family: var(--pixel);
  font-size: 10px;
  color: #fff;
}
.brand-mini span {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-2);
  letter-spacing: 3px;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15, 24, 44, 0.6);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.status i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(95, 111, 146, 0.14);
}
.status.online i { background: var(--lime); box-shadow: 0 0 0 3px rgba(183, 243, 74, 0.15), 0 0 12px rgba(183, 243, 74, 0.7); }
.status.online { color: #d9ecc0; }
.status.offline i { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 84, 112, 0.15); }
.status.connecting i { background: var(--yellow); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(15, 24, 44, 0.7);
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.icon-btn:hover { border-color: var(--line-strong); background: #172443; transform: translateY(-1px); }
.icon-btn.off { opacity: 0.45; }
.icon-btn.active { border-color: rgba(183, 243, 74, 0.55); background: rgba(183, 243, 74, 0.1); color: var(--lime); }

.home-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.72fr);
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 10px clamp(20px, 5vw, 72px) 30px;
}
.hero { position: relative; z-index: 2; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  font-family: var(--pixel);
  font-size: 8px;
  color: #c0cbe4;
  letter-spacing: 0.6px;
  margin-bottom: 22px;
}
.eyebrow span:not(.dot) {
  padding: 8px 9px;
  border: 1px solid var(--line);
  background: rgba(13, 21, 38, 0.6);
  border-radius: 6px;
}
.eyebrow .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--orange); }
.logo-lockup { position: relative; width: fit-content; }
.logo {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--pixel);
  font-size: clamp(46px, 7.6vw, 108px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  font-weight: 400;
  transform: rotate(-1.5deg);
}
.logo-line { display: block; position: relative; width: fit-content; }
.logo-top {
  color: #f5f0e6;
  text-shadow:
    5px 5px 0 #0b0f1b,
    10px 10px 0 rgba(255, 84, 112, 0.16);
}
.logo-bottom {
  color: #ff7a3d;
  background: linear-gradient(180deg, #ffb057 0%, #ff6a4d 58%, #ff4d6d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(5px 5px 0 #0b0f1b) drop-shadow(10px 10px 0 rgba(89, 216, 255, 0.11));
  margin-left: clamp(34px, 6vw, 90px);
  margin-top: 3px;
}
.logo-drip {
  position: absolute;
  display: block;
  bottom: -9px;
  width: 6px;
  background: #ff6a4d;
  border-radius: 0 0 5px 5px;
}
.logo-drip::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -7px;
  width: 11px; height: 11px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: inherit;
}
.d1 { right: 16%; height: 24px; }
.d2 { right: 8%; height: 14px; width: 4px; }
.d3 { left: 30%; bottom: 2px; height: 12px; width: 4px; opacity: 0.7; }
.logo-badge {
  position: absolute;
  right: -18px;
  bottom: 6px;
  transform: rotate(4deg);
  background: #121a2e;
  border: 2px solid rgba(255, 138, 61, 0.65);
  color: #ffd9c2;
  font-family: var(--pixel);
  font-size: clamp(7px, 0.8vw, 10px);
  padding: 9px 11px;
  letter-spacing: 1px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
}
.logo-badge span { color: var(--lime); }
.tagline {
  margin: 26px 0 8px;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.5;
  max-width: 520px;
}
.tagline b { color: #dfe9ff; font-weight: 600; }
.hero-art {
  margin-top: 18px;
  width: min(100%, 660px);
  height: 150px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.hero-art canvas { width: 100%; height: 100%; display: block; }

.join-card {
  position: relative;
  z-index: 3;
  background: linear-gradient(155deg, rgba(20, 32, 57, 0.94), rgba(10, 16, 30, 0.97));
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 30px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
}
.join-card::before {
  content: '';
  position: absolute;
  top: -1px; left: 24px; right: 24px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--orange), var(--pink), transparent);
  opacity: 0.8;
}
.join-card::after {
  content: '2-4P';
  position: absolute;
  top: -17px; right: 22px;
  font-family: var(--pixel);
  font-size: 11px;
  background: var(--orange);
  color: var(--ink);
  padding: 8px 9px;
  transform: rotate(3deg);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
}
.join-head h2 {
  margin: 0 0 9px;
  font-family: var(--pixel);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.02em;
}
.join-head p { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}
.field input, .code-row input {
  width: 100%;
  height: 50px;
  border-radius: 11px;
  border: 1px solid rgba(150, 180, 240, 0.22);
  background: rgba(6, 10, 20, 0.72);
  color: var(--text);
  padding: 0 15px;
  font-size: 16px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder, .code-row input::placeholder { color: #51617f; }
.field input:focus, .code-row input:focus {
  border-color: rgba(255, 138, 61, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.13);
}
.quick-config {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 0 0 15px;
}
.quick-field { display: block; min-width: 0; }
.quick-field-wide { grid-column: 1 / -1; }
.quick-field > span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 7px;
}
.quick-field select {
  width: 100%;
  height: 44px;
  border-radius: 9px;
  border: 1px solid rgba(150, 180, 240, 0.22);
  background: rgba(6, 10, 20, 0.72);
  color: var(--text);
  padding: 0 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  outline: none;
  cursor: pointer;
  color-scheme: dark;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.quick-field select:focus {
  border-color: rgba(255, 138, 61, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.13);
}
.quick-field select:disabled { opacity: 0.55; cursor: wait; }
.btn {
  --btn-bg: #1b2946;
  --btn-fg: var(--text);
  appearance: none;
  border: 1px solid rgba(160, 190, 255, 0.2);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: 10px;
  padding: 13px 18px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s, filter 0.15s, border-color 0.15s;
  user-select: none;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:active { transform: translateY(1px); filter: brightness(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }
.btn-primary {
  --btn-bg: linear-gradient(180deg, #ff9c4f, #ff6b3d 62%, #ff543d);
  --btn-fg: #1a0d06;
  border-color: #ffb071;
  box-shadow: 0 5px 0 #94331f, 0 12px 26px rgba(255, 94, 61, 0.24);
}
.btn-primary:active { box-shadow: 0 2px 0 #94331f; transform: translateY(3px); }
.btn-dark { --btn-bg: rgba(22, 35, 61, 0.9); border-color: var(--line-strong); }
.btn-danger { --btn-bg: rgba(57, 21, 34, 0.9); --btn-fg: #ffb9c4; border-color: rgba(255, 84, 112, 0.35); }
.btn-sm { padding: 9px 12px; font-size: 11px; border-radius: 8px; }
.btn-lg {
  width: 100%;
  height: 62px;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 12px;
  margin-top: 4px;
}
.btn-lg span { font-family: var(--pixel); font-size: 12px; letter-spacing: 0.3px; }
.btn-lg small { font-size: 10px; letter-spacing: 2px; opacity: 0.66; font-weight: 800; }
.rooms-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  padding: 9px 12px;
  font-size: 11px;
}
.rooms-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--yellow);
  color: #191004;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 21px 0 14px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.divider::before, .divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.code-row { display: flex; gap: 9px; }
.code-row input {
  height: 48px;
  text-align: center;
  font-family: var(--pixel);
  font-size: 15px;
  letter-spacing: 6px;
  padding-left: 12px;
  text-transform: uppercase;
}
.code-row .btn { flex: 0 0 100px; }
.form-error {
  min-height: 18px;
  margin: 10px 0 0;
  color: #ff9bac;
  font-size: 12px;
  font-weight: 600;
}
.feature-strip {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.feature-strip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
}
.feature-strip i { font-style: normal; font-size: 14px; filter: grayscale(0.1); }
.home-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 18px clamp(20px, 4vw, 54px) 24px;
  color: var(--muted-2);
  font-size: 12px;
  border-top: 1px solid rgba(137, 166, 228, 0.08);
}
.home-footer kbd { font-size: 7px; padding: 4px 5px; }

/* ═══════════════ GAME SHELL ═══════════════ */
.game {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px clamp(12px, 2.4vw, 30px) 24px;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(89, 216, 255, 0.06), transparent 65%),
    linear-gradient(180deg, #080d18, #060912 70%);
}
.game-shell { width: 100%; max-width: 1280px; }
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px 14px;
}
.hud-left { flex: 1; min-width: 0; }
.room-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}
.room-code {
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--text);
  background: rgba(24, 38, 66, 0.9);
  border: 1px solid var(--line-strong);
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: border-color 0.15s, color 0.15s;
}
.room-code:hover { border-color: var(--orange); color: var(--orange); }
.hud-sub {
  margin-top: 7px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 1.6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-center { text-align: center; flex-shrink: 0; }
.timer {
  font-family: var(--pixel);
  font-size: clamp(20px, 2.5vw, 28px);
  color: #f3f7ff;
  letter-spacing: 1px;
  text-shadow: 0 0 26px rgba(89, 216, 255, 0.22);
  line-height: 1.2;
}
.timer.danger { color: var(--red); animation: timerPulse 1s steps(2) infinite; }
@keyframes timerPulse { 50% { opacity: 0.55; } }
.sudden-badge {
  margin-top: 5px;
  display: inline-block;
  font-family: var(--pixel);
  font-size: 7px;
  color: #1b0a0d;
  background: var(--red);
  padding: 5px 7px;
  letter-spacing: 1px;
  animation: blink 0.8s steps(2) infinite;
}
.hud-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.hud-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(89, 216, 255, 0.52);
  background:
    radial-gradient(circle at 50% 30%, rgba(89, 216, 255, 0.24), rgba(9, 15, 28, 0.95) 68%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 15px rgba(89, 216, 255, 0.22),
    0 6px 14px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.25s, box-shadow 0.25s, filter 0.25s;
  will-change: transform;
}
.hud-avatar::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  pointer-events: none;
}
.hud-avatar canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.hud-avatar.ko {
  border-color: rgba(255, 84, 112, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 20px rgba(255, 84, 112, 0.4),
    0 6px 14px rgba(0, 0, 0, 0.35);
  filter: saturate(0.86);
  animation: hudAvatarKnock 0.62s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
.hud-avatar.revive { animation: hudAvatarRevive 0.64s cubic-bezier(0.2, 0.9, 0.25, 1); }
.hud-avatar-ko {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 3px 4px;
  border-radius: 4px;
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1;
  color: #fff;
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 84, 112, 0.65);
  opacity: 0;
  transform: scale(0.35) rotate(-14deg);
  transition: opacity 0.16s, transform 0.28s cubic-bezier(0.2, 1.8, 0.4, 1);
  pointer-events: none;
}
.hud-avatar.ko .hud-avatar-ko {
  opacity: 1;
  transform: scale(1) rotate(-6deg);
  animation: hudKoBlink 0.9s steps(2) infinite;
}
@keyframes hudAvatarKnock {
  0% { transform: translate(0, 0) rotate(0) scale(1); }
  15% { transform: translate(-2px, 0) rotate(-7deg) scale(1.07); }
  30% { transform: translate(2px, 0) rotate(6deg) scale(0.97); }
  45% { transform: translate(-1px, 1px) rotate(-4deg) scale(1.04); }
  60% { transform: translate(1px, -1px) rotate(3deg) scale(1); }
  100% { transform: translate(0, 0) rotate(0) scale(1); }
}
@keyframes hudAvatarRevive {
  0% { transform: scale(0.55) rotate(-10deg); filter: brightness(2.2) saturate(0.4); }
  45% { transform: scale(1.14) rotate(4deg); filter: brightness(1.45); }
  70% { transform: scale(0.96) rotate(-2deg); }
  100% { transform: scale(1) rotate(0); filter: none; }
}
@keyframes hudKoBlink { 50% { opacity: 0.45; } }

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 16px;
  align-items: start;
}
.arena-col { min-width: 0; }
.arena-wrap {
  position: relative;
  width: 100%;
  background: #080d17;
  border: 2px solid #243252;
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.035) inset,
    0 22px 50px rgba(0, 0, 0, 0.42),
    0 0 80px rgba(45, 85, 160, 0.08);
  overflow: hidden;
  isolation: isolate;
}
#arena {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 720 / 624;
  background: #0b1220;
}
.arena-wrap::after {
  content: '';
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 10%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.06) 0px, rgba(0, 0, 0, 0.06) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
  border-radius: 12px;
}
.status-ribbon {
  position: absolute;
  z-index: 6;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  background: rgba(9, 14, 26, 0.88);
  border: 1px solid rgba(255, 84, 112, 0.4);
  color: #ffc1cb;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 1px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.loadout {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 12px;
  background: linear-gradient(180deg, rgba(18, 29, 51, 0.94), rgba(12, 20, 36, 0.96));
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 54px;
}
.loadout-you {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-right: 12px;
  margin-right: 2px;
  border-right: 1px solid var(--line);
  min-width: 148px;
}
.seat-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  background: var(--cyan);
  box-shadow: 0 0 12px currentColor;
  flex-shrink: 0;
}
.loadout-you b {
  display: block;
  font-size: 13px;
  line-height: 1.1;
  max-width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loadout-you small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.4px;
  color: var(--muted-2);
  font-weight: 800;
  margin-top: 3px;
}
.stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(7, 12, 23, 0.55);
  border: 1px solid rgba(137, 166, 228, 0.1);
  color: var(--muted);
}
.stat svg { width: 17px; height: 17px; flex-shrink: 0; }
.stat b { color: #e9f0ff; font-size: 14px; font-weight: 800; }
.stat:nth-of-type(1) svg { color: var(--red); }
.stat:nth-of-type(2) svg { color: var(--orange); }
.stat:nth-of-type(3) svg { color: var(--cyan); }
.stat-spray svg { color: var(--lime); }
.ability-chips { display: flex; gap: 5px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.ability-chip {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 5px 7px;
  border-radius: 5px;
  color: var(--chip-c, #fff);
  background: color-mix(in srgb, var(--chip-c, #fff) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip-c, #fff) 35%, transparent);
  white-space: nowrap;
}

/* side panels */
.side { display: flex; flex-direction: column; gap: 12px; }
.panel {
  background: linear-gradient(160deg, rgba(18, 29, 51, 0.92), rgba(10, 17, 31, 0.96));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 15px 36px rgba(0, 0, 0, 0.22);
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}
.panel-title h3 {
  margin: 0;
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.5px;
  color: #dfe8fa;
}
.panel-title > span, .kbd-hint {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: var(--muted-2);
}
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.player-card {
  --pc: #fff;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 8px;
  padding: 9px 9px 8px 12px;
  background: rgba(8, 13, 25, 0.56);
  border: 1px solid rgba(137, 166, 228, 0.1);
  border-radius: 9px;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
.player-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--pc);
  box-shadow: 0 0 12px color-mix(in srgb, var(--pc) 70%, transparent);
}
.player-card.me { border-color: color-mix(in srgb, var(--pc) 40%, transparent); background: color-mix(in srgb, var(--pc) 7%, rgba(8, 13, 25, 0.7)); }
.player-card.winner { border-color: color-mix(in srgb, var(--pc) 55%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc) 12%, transparent); }
.player-card.dead { opacity: 0.48; filter: grayscale(0.5); }
.player-card.dead .pc-name { text-decoration: line-through; text-decoration-color: rgba(255, 143, 162, 0.7); }
.player-card.empty { border-style: dashed; background: rgba(8, 13, 25, 0.3); opacity: 0.6; }
.player-card.empty::before { opacity: 0.35; box-shadow: none; }
.player-card.empty .pc-name { color: var(--muted-2); font-weight: 700; }
.player-card.empty .pc-meta { color: var(--muted-2); font-size: 8px; letter-spacing: 0.4px; }
.pc-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pc-seat {
  font-family: var(--pixel);
  font-size: 7px;
  color: color-mix(in srgb, var(--pc) 85%, #fff);
  background: color-mix(in srgb, var(--pc) 13%, transparent);
  border-radius: 4px;
  padding: 3px 4px;
  flex-shrink: 0;
}
.pc-name {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #eef3ff;
}
.pc-tag {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--ink);
  background: var(--yellow);
  padding: 2px 4px;
  border-radius: 3px;
  flex-shrink: 0;
}
.pc-tag.bot { background: #7b8cad; color: #0c1220; }
.pc-tag.you { background: var(--lime); }
.pc-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  grid-column: 1;
  font-size: 9px;
  color: var(--muted-2);
  font-weight: 700;
}
.pc-score { color: #bac8e3; font-weight: 800; }
.pc-wins { margin-left: auto; display: inline-flex; gap: 3px; align-items: center; }
.pip { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.13); }
.pip.on { background: var(--yellow); box-shadow: 0 0 7px rgba(255, 209, 102, 0.8); }
.pc-state {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #a8b9d8;
  writing-mode: vertical-rl;
  text-transform: uppercase;
  opacity: 0.8;
}
.pc-state.eliminated { color: #ff8fa2; }
.pc-state.winner { color: var(--yellow); }
.room-hint { margin: 0 0 11px; color: var(--muted-2); font-size: 11px; line-height: 1.45; }
.room-settings {
  margin: 0 0 10px;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid rgba(89, 216, 255, 0.18);
  background: rgba(89, 216, 255, 0.045);
  color: #9de9ff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-align: center;
  line-height: 1.5;
}
.room-actions { display: flex; flex-direction: column; gap: 7px; }
.code-pill {
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 1.4px;
  background: rgba(7, 12, 23, 0.7);
  color: var(--cyan);
  border: 1px solid rgba(89, 216, 255, 0.24);
  padding: 6px 7px;
  border-radius: 5px;
  cursor: pointer;
}
.code-pill:hover { border-color: var(--cyan); }
.lobby-countdown {
  margin-top: 10px;
  text-align: center;
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.7;
  color: var(--yellow);
  letter-spacing: 0.5px;
}
.keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.keys li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.keys span { font-size: 11px; color: var(--muted); font-weight: 600; }
.tips { margin: 12px 0 0; font-size: 10.5px; line-height: 1.5; color: var(--muted-2); }
.tips b { color: var(--lime); }

/* ═══════════════ OVERLAYS ═══════════════ */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 7, 14, 0.68);
  backdrop-filter: blur(7px);
  border-radius: 12px;
  animation: overlayIn 0.25s ease-out;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.overlay-card {
  width: min(100%, 510px);
  max-height: 100%;
  overflow: visible;
  background: linear-gradient(165deg, rgba(20, 32, 57, 0.97), rgba(8, 14, 27, 0.99));
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  text-align: center;
  scrollbar-width: thin;
}
.overlay-kicker {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 1px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 14px;
}
.overlay-card h2 {
  margin: 0 0 8px;
  font-family: var(--pixel);
  font-size: clamp(14px, 2.3vw, 21px);
  line-height: 1.55;
  color: #f5f8ff;
}
.overlay-card > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.overlay-card .btn { min-height: 44px; }
.overlay-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.overlay-actions .btn-primary { width: 100%; }

/* lobby slots */
.lobby-slots { display: grid; grid-template-columns: repeat(var(--slot-cols, 2), 1fr); gap: 7px; margin: 18px 0; text-align: left; }
.lobby-slot {
  --pc: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 8px 10px;
  background: rgba(8, 13, 25, 0.6);
  border: 1px solid rgba(137, 166, 228, 0.12);
  border-radius: 9px;
}
.lobby-slot.filled { border-color: color-mix(in srgb, var(--pc) 38%, transparent); background: color-mix(in srgb, var(--pc) 6%, rgba(8, 13, 25, 0.6)); }
.lobby-slot.empty { border-style: dashed; }
.lobby-ava {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--pc) 20%, #0a1020);
  border: 1px solid color-mix(in srgb, var(--pc) 50%, transparent);
  display: grid; place-items: center;
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--pc);
  flex-shrink: 0;
}
.lobby-slot-info { min-width: 0; flex: 1; }
.lobby-slot-info b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobby-slot-info small { display: block; font-size: 8px; letter-spacing: 1px; color: var(--muted-2); font-weight: 800; margin-top: 3px; }
.lobby-slot .host-mark { font-size: 9px; color: var(--yellow); font-weight: 800; letter-spacing: 0.6px; }
.lobby-auto { margin-top: 12px; font-size: 10px; color: var(--muted-2); letter-spacing: 0.6px; }
.lobby-auto b { color: var(--yellow); }
.lobby-card { padding: 18px 22px; }
.lobby-card > p { margin-bottom: 12px; }
.lobby-card .lobby-slots { margin: 8px 0; }
.lobby-card .lobby-settings { margin-bottom: 10px; }
.lobby-card .overlay-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.lobby-card .overlay-actions [data-action="start"],
.lobby-card .overlay-actions .lobby-note { grid-column: 1 / -1; }
.lobby-note { margin-top: 10px; font-size: 10px; color: var(--muted); }
.room-wait-card { width: min(100%, 560px); }
.room-wait-progress {
  height: 8px;
  margin: 12px 0 6px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(8, 13, 25, 0.85);
  border: 1px solid rgba(137, 166, 228, 0.18);
}
.room-wait-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #47a7ff, #ffd166);
  box-shadow: 0 0 14px rgba(71, 167, 255, 0.45);
  transition: width 0.35s ease;
}
.room-wait-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.8px;
}
.room-wait-meta b { color: var(--yellow); }
.room-wait-card .lobby-slots { margin-top: 12px; }
.room-wait-card .overlay-actions .lobby-note { grid-column: 1 / -1; margin-top: 0; }
.lobby-settings {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(137, 166, 228, 0.14);
  background: rgba(7, 12, 23, 0.5);
  text-align: left;
}
.lobby-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.lobby-setting + .lobby-setting { margin-top: 8px; }
.lobby-setting > span {
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 1px;
  color: var(--muted);
}
.seg { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.seg-btn {
  appearance: none;
  min-width: 31px;
  height: 28px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid rgba(137, 166, 228, 0.18);
  background: rgba(15, 25, 44, 0.9);
  color: #a9b8d5;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.seg-btn:hover:not(:disabled) { border-color: rgba(255, 138, 61, 0.6); color: #fff; }
.seg-btn.active {
  background: linear-gradient(180deg, #ff9c4f, #ff6b3d);
  border-color: #ffb071;
  color: #1a0d06;
  box-shadow: 0 2px 0 #94331f;
}
.seg-btn:disabled { opacity: 0.32; cursor: not-allowed; }
.seg-btn.active:disabled { opacity: 1; cursor: default; }
.lobby-ai {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(137, 166, 228, 0.1);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1.1px;
  color: var(--lime);
}
.vis-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid rgba(137, 166, 228, 0.16);
  background: rgba(6, 10, 20, 0.65);
}
.vis-btn {
  appearance: none;
  min-height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.5px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.vis-btn:hover:not(:disabled) { color: #fff; }
.vis-btn.active {
  background: linear-gradient(180deg, #ff9c4f, #ff6b3d);
  color: #1a0d06;
  box-shadow: 0 2px 0 #94331f;
}
.vis-btn:disabled { opacity: 0.34; cursor: not-allowed; }
.vis-btn.active:disabled { opacity: 1; cursor: default; }

/* language + player colors */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(15, 24, 44, 0.72);
}
.lang-btn {
  appearance: none;
  min-width: 24px;
  padding: 5px 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.lang-btn:hover:not(.active) { color: #fff; }
.lang-btn.active {
  background: linear-gradient(180deg, #ff9c4f, #ff6b3d);
  color: #1a0d06;
  box-shadow: 0 2px 0 #94331f;
}
.hud-lang { flex: 0 0 auto; }
.color-seg { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.color-btn {
  appearance: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background: var(--sw, #fff);
  color: #08101f;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.16);
  transition: transform 0.12s, border-color 0.12s, opacity 0.12s, box-shadow 0.12s;
}
.color-btn b {
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}
.color-btn:hover:not(:disabled) { transform: translateY(-1px); border-color: #fff; }
.color-btn.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18), 0 0 13px var(--swa, #fff);
}
.color-btn:disabled { opacity: 0.24; cursor: not-allowed; }

.avatar-seg { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.avatar-btn {
  appearance: none;
  width: 52px;
  height: 58px;
  padding: 2px 2px 3px;
  border-radius: 8px;
  border: 1px solid rgba(137, 166, 228, 0.18);
  background: rgba(15, 25, 44, 0.9);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.avatar-btn canvas { width: 44px; height: 48px; display: block; pointer-events: none; }
.avatar-btn small {
  font-family: var(--pixel);
  font-size: 5px;
  letter-spacing: 0.4px;
  color: var(--muted);
  line-height: 1;
}
.avatar-btn:hover:not(:disabled) { transform: translateY(-1px); border-color: #fff; }
.avatar-btn.active {
  border-color: #fff;
  background: rgba(30, 45, 76, 0.95);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14), 0 0 13px rgba(255, 180, 94, 0.28);
}
.avatar-btn.active small { color: #fff; }
.lobby-ava canvas { width: 100%; height: 100%; display: block; pointer-events: none; }

/* countdown */
.countdown-layer { text-align: center; width: 100%; }
.countdown-round { font-family: var(--pixel); font-size: 10px; letter-spacing: 2px; color: var(--orange); margin-bottom: 18px; }
.countdown-number {
  font-family: var(--pixel);
  font-size: clamp(70px, 13vw, 140px);
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 45px rgba(255, 138, 61, 0.38), 7px 7px 0 rgba(0, 0, 0, 0.45);
  animation: pop 0.7s cubic-bezier(0.15, 1.4, 0.4, 1);
}
@keyframes pop { 0% { transform: scale(0.35); opacity: 0; } 55% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.countdown-sub { font-family: var(--pixel); font-size: 9px; letter-spacing: 1px; color: #c9d6ef; margin-top: 18px; }
.countdown-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 26px; }
.mini-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.6px;
  padding: 5px 8px; border-radius: 999px;
  color: #dce7ff; background: rgba(8, 13, 25, 0.65);
  border: 1px solid color-mix(in srgb, var(--pc, #fff) 35%, transparent);
}
.mini-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--pc, #fff); }

/* results */
.results-card { text-align: left; }
.results-card .overlay-kicker { margin-left: 0; }
.results-title { text-align: center; }
.results-title h2 { margin-bottom: 4px; }
.winner-line { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 17px; }
.winner-name {
  display: block;
  text-align: center;
  font-family: var(--pixel);
  font-size: clamp(16px, 3vw, 25px);
  color: var(--wc, var(--yellow));
  text-shadow: 0 0 30px color-mix(in srgb, var(--wc, #ffd166) 40%, transparent);
  margin: 7px 0 4px;
  word-break: break-word;
}
.score-table { margin: 16px 0 0; border-top: 1px solid var(--line); }
.score-row {
  display: grid;
  grid-template-columns: 24px 1fr 62px 54px;
  gap: 7px;
  align-items: center;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(137, 166, 228, 0.08);
  font-size: 12px;
}
.score-row.me { background: linear-gradient(90deg, rgba(183, 243, 74, 0.05), transparent); }
.score-rank { font-family: var(--pixel); font-size: 8px; color: var(--muted-2); }
.score-name { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 700; }
.score-name i { width: 7px; height: 7px; border-radius: 2px; background: var(--pc, #fff); box-shadow: 0 0 8px var(--pc, #fff); flex-shrink: 0; }
.score-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-name em { font-style: normal; font-size: 7px; letter-spacing: 0.8px; background: var(--lime); color: var(--ink); padding: 2px 4px; border-radius: 3px; font-weight: 900; }
.score-name small { font-size: 7px; color: var(--muted-2); letter-spacing: 0.8px; }
.score-pts { text-align: right; font-weight: 800; color: #dbe7ff; font-size: 11px; }
.score-k { text-align: right; font-size: 10px; color: var(--muted-2); font-weight: 700; }
.artist-note {
  margin-top: 13px;
  padding: 9px 11px;
  background: rgba(183, 243, 74, 0.055);
  border: 1px solid rgba(183, 243, 74, 0.2);
  border-radius: 8px;
  font-size: 11px;
  color: #d9f5a4;
  line-height: 1.4;
}
.artist-note b { color: var(--lime); }
.next-note {
  margin-top: 16px;
  text-align: center;
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.7;
  color: var(--muted);
  letter-spacing: 1px;
}
.next-note b { color: var(--yellow); }
.trophy { font-size: 44px; text-align: center; margin-bottom: 2px; filter: drop-shadow(0 8px 18px rgba(255, 209, 102, 0.25)); }
.match-standings { margin-top: 15px; }
.standing-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 3px;
  border-bottom: 1px solid rgba(137, 166, 228, 0.08);
  font-size: 12px;
}
.standing-row b { color: var(--pc); }
.standing-row span { color: var(--yellow); font-weight: 800; }

/* ═══════════════ TOUCH ═══════════════ */
.touch-controls { display: none; }
body.touch .touch-controls {
  display: flex;
  position: absolute;
  inset: 0;
  z-index: 5;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 10px 10px;
  pointer-events: none;
}
body.touch .touch-controls > * { pointer-events: auto; }
.touch-dpad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 3px;
  opacity: 0.82;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.tbtn {
  display: grid;
  place-items: center;
  border: 1px solid rgba(190, 215, 255, 0.3);
  background: rgba(12, 20, 37, 0.78);
  color: #eef4ff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  touch-action: none;
  user-select: none;
  backdrop-filter: blur(4px);
  transition: background 0.08s, transform 0.08s;
}
.tbtn.active, .tbtn:active { background: rgba(255, 138, 61, 0.8); color: #140b05; transform: scale(0.95); }
.t-up { grid-column: 2; grid-row: 1; }
.t-left { grid-column: 1; grid-row: 2; }
.tcenter { grid-column: 2; grid-row: 2; border: 1px dashed rgba(190, 215, 255, 0.15); border-radius: 10px; }
.t-right { grid-column: 3; grid-row: 2; }
.t-down { grid-column: 2; grid-row: 3; }
.touch-actions { display: flex; gap: 9px; align-items: flex-end; }
.touch-actions .tbtn { width: 64px; height: 64px; border-radius: 50%; }
.touch-actions svg { width: 28px; height: 28px; }
.t-bomb { background: rgba(60, 20, 31, 0.82); border-color: rgba(255, 84, 112, 0.5); color: #ff9bac; }
.t-bomb:active, .t-bomb.active { background: var(--red); color: #19060b; }
.t-spray { background: rgba(28, 48, 18, 0.82); border-color: rgba(183, 243, 74, 0.45); color: var(--lime); }
.t-spray:active, .t-spray.active { background: var(--lime); color: #0e1804; }

/* ═══════════════ MODAL / TOAST ═══════════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 12, 0.78);
  backdrop-filter: blur(8px);
}
.modal-card {
  position: relative;
  width: min(100%, 560px);
  max-height: 88vh;
  overflow: visible;
  background: linear-gradient(165deg, #131f37, #0a1120);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.65);
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}
.modal-close:hover { color: #fff; border-color: var(--line-strong); }
.modal h2 { margin: 0 0 6px; font-family: var(--pixel); font-size: 14px; line-height: 1.6; }
.modal .muted { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 0 0 20px; }
.help-section { margin: 18px 0; padding-top: 15px; border-top: 1px solid var(--line); }
.help-section h3 { margin: 0 0 10px; font-family: var(--pixel); font-size: 8px; letter-spacing: 1px; color: var(--orange); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.help-item { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); padding: 6px 0; }
.help-item kbd { font-size: 7px; }
.power-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.power-item { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); background: rgba(6, 10, 20, 0.45); padding: 7px 8px; border-radius: 7px; border: 1px solid rgba(137, 166, 228, 0.08); }
.power-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--pc); }
.power-item b { color: #e7eeff; font-weight: 700; font-size: 11px; }
.power-item small { display: block; font-size: 9px; color: var(--muted-2); }

/* room browser */
.room-browser { display: grid; gap: 7px; text-align: left; }
.room-empty {
  padding: 18px 14px;
  text-align: center;
  border: 1px dashed rgba(137, 166, 228, 0.2);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.room-empty b { color: var(--text); }
.room-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(137, 166, 228, 0.14);
  border-radius: 10px;
  background: rgba(6, 10, 20, 0.45);
}
.room-row-main { flex: 1; min-width: 0; }
.room-row-main b {
  display: block;
  font-size: 13px;
  color: #edf3ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-row-main small {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 0.7px;
  color: var(--muted-2);
}
.room-state {
  display: inline-block;
  margin-top: 3px;
  font-family: var(--pixel);
  font-size: 6px;
  letter-spacing: 0.5px;
  color: var(--lime);
}
.room-state.playing,
.room-state.countdown,
.room-state.roundEnd,
.room-state.matchEnd { color: var(--orange); }
.room-state.playing::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
  vertical-align: 1px;
  animation: blink 1.2s infinite;
}
.room-progress-row { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.room-progress {
  flex: 0 1 92px;
  height: 4px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(137, 166, 228, 0.16);
}
.room-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--yellow));
  box-shadow: 0 0 7px rgba(255, 138, 61, 0.55);
  transition: width 0.35s ease;
}
.room-pct {
  font-family: var(--pixel);
  font-size: 7px;
  color: var(--yellow);
  line-height: 1;
}
.room-row.live { border-color: rgba(255, 138, 61, 0.26); }
.room-row .btn { flex: 0 0 auto; min-width: 84px; min-height: 36px; padding: 8px 10px; }
.room-more { padding: 2px 0 4px; text-align: center; font-size: 10px; color: var(--muted-2); }
.room-modal-actions { flex-direction: row; }
.room-modal-actions .btn { flex: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 18px);
  z-index: 80;
  background: rgba(15, 24, 44, 0.96);
  border: 1px solid var(--line-strong);
  color: #e9f0ff;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: min(90vw, 440px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (min-width: 1121px) {
  /* Keep the arena, HUD and loadout visible without scrolling on desktop. */
  .game-shell { max-width: min(1280px, calc((100vh - 172px) * 1.153846 + 322px)); }
}
@media (max-width: 1120px) {
  .home-main { grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr); gap: 30px; }
  .hero-art { height: 130px; }
  .game-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; }
  .panel { padding: 12px; }
}
@media (max-width: 980px) {
  .home-main { grid-template-columns: 1fr; padding-top: 0; gap: 26px; }
  .hero { text-align: center; }
  .eyebrow { justify-content: center; }
  .logo-lockup { margin: 0 auto; }
  .logo { font-size: clamp(50px, 11vw, 92px); align-items: center; }
  .logo-bottom { margin-left: 0; }
  .logo-badge { right: -10px; bottom: -8px; }
  .tagline { margin-left: auto; margin-right: auto; }
  .hero-art { display: none; }
  .join-card { max-width: 520px; margin: 0 auto; width: 100%; }
  .game-grid { grid-template-columns: 1fr; }
  .side { display: grid; grid-template-columns: 1fr 1fr; order: -1; }
  .players-panel { grid-column: 1 / -1; }
  .players { display: grid; grid-template-columns: 1fr 1fr; }
  .help-panel { display: none; }
  .loadout { flex-wrap: wrap; }
  .ability-chips { flex: 1 1 100%; justify-content: flex-start; margin-left: 0; padding-top: 2px; }
}
@media (max-width: 640px) {
  .topbar { padding: 14px 14px; }
  .brand-mini span { display: none; }
  .status span:last-child { display: none; }
  .status { padding: 0 9px; }
  .home-main { padding: 4px 14px 20px; }
  .logo { font-size: clamp(38px, 12.5vw, 64px); }
  .logo-badge { font-size: 7px; right: -6px; bottom: -8px; padding: 7px 8px; }
  .eyebrow { gap: 6px; margin-bottom: 16px; }
  .eyebrow span:not(.dot) { font-size: 6px; padding: 6px; }
  .tagline { font-size: 14px; margin-top: 20px; }
  .join-card { padding: 20px 18px; }
  .join-head h2 { font-size: 13px; }
  .join-head p { margin-bottom: 16px; }
  .quick-config { gap: 7px; margin-bottom: 12px; }
  .quick-field > span { font-size: 8px; margin-bottom: 6px; }
  .quick-field select { height: 40px; font-size: 9px; padding: 0 8px; }
  .feature-strip span { font-size: 8px; letter-spacing: 0.5px; }
  .home-footer { font-size: 10px; padding: 14px; }
  .home-footer span:first-child { width: 100%; }
  .tag-a, .tag-c, .dot-grid, .bomb-deco, .tag-b { display: none; }
  .game { padding: 8px 8px 18px; }
  .hud { gap: 8px; padding: 4px 2px 10px; }
  .hud-left .room-mini { font-size: 8px; }
  .hud-sub { font-size: 8px; letter-spacing: 0.8px; }
  .room-code { font-size: 8px; }
  .timer { font-size: 20px; }
  .sudden-badge { font-size: 6px; }
  .hud-right .icon-btn { display: none; }
  .hud-right .icon-btn#soundToggle2,
  .hud-right .icon-btn#fullscreenBtn { display: grid; }
  .hud-right .btn { padding: 7px 9px; font-size: 9px; }
  .hud-avatar { width: 37px; height: 37px; border-width: 1.5px; }
  .hud-avatar-ko { padding: 2px 3px; font-size: 6px; }
  .side { order: 2; grid-template-columns: 1fr; gap: 8px; }
  .arena-col { order: 1; }
  .players { grid-template-columns: 1fr 1fr; gap: 5px; }
  .player-card { padding: 7px 7px 6px 10px; }
  .pc-name { font-size: 11px; }
  .pc-state { display: none; }
  .room-panel { display: none; }
  .panel { padding: 10px; border-radius: 11px; }
  .panel-title { margin-bottom: 7px; }
  .panel-title h3 { font-size: 8px; }
  .loadout { gap: 5px; padding: 7px 8px; }
  .loadout-you { min-width: 0; flex: 1 1 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 6px; margin-bottom: 2px; }
  .stat { height: 29px; padding: 0 7px; gap: 4px; }
  .stat svg { width: 14px; height: 14px; }
  .stat b { font-size: 12px; }
  .ability-chips { display: none; }
  .overlay { padding: 10px; }
  .overlay-card { padding: 16px; border-radius: 12px; }
  .overlay-card h2 { font-size: 13px; }
  .overlay-card > p { font-size: 11px; margin-bottom: 12px; }
  .lobby-slots { gap: 5px; margin: 12px 0; }
  .room-wait-progress { margin: 9px 0 5px; }
  .room-wait-meta { font-size: 8px; margin-bottom: 8px; }
  .lobby-slot { min-height: 42px; padding: 6px 7px; gap: 6px; }
  .lobby-ava { width: 24px; height: 24px; font-size: 7px; }
  .lobby-slot-info b { font-size: 10px; }
  .lobby-slot-info small { font-size: 7px; }
  .score-row { grid-template-columns: 18px 1fr 48px 40px; font-size: 11px; padding: 8px 0; }
  .next-note { font-size: 6px; }
  .countdown-number { font-size: 88px; }
  .countdown-chips { margin-top: 18px; }
  .touch-dpad { grid-template-columns: repeat(3, 40px); grid-template-rows: repeat(3, 40px); }
  .touch-actions .tbtn { width: 56px; height: 56px; }
  .modal-card { padding: 20px; }
  .help-grid, .power-list { grid-template-columns: 1fr; }
}
@media (max-height: 760px) and (min-width: 981px) {
  .game { padding-top: 8px; }
  .hud { padding-bottom: 8px; }
  .arena-wrap { max-height: calc(100vh - 142px); display: flex; justify-content: center; }
  .arena-wrap canvas { width: auto; max-width: 100%; max-height: calc(100vh - 142px); }
  .help-panel { display: none; }
}

/* ═══════════════ MÓVIL EN HORIZONTAL / PANTALLA COMPLETA ═══════════════ */
@media (orientation: landscape) and (max-height: 620px) {
  /* Home compacta: nombre, modo y ronda caben sin hacer scroll. */
  .home { min-height: 100dvh; }
  .topbar { padding: 8px 16px; }
  .home-main {
    grid-template-columns: minmax(0, 0.9fr) minmax(280px, 390px);
    gap: 18px;
    padding: 0 16px 2px;
    align-items: center;
  }
  .hero { text-align: left; }
  .eyebrow { justify-content: flex-start; gap: 6px; margin-bottom: 9px; }
  .eyebrow span:not(.dot) { font-size: 6px; padding: 5px 6px; }
  .logo { font-size: clamp(36px, 6vw, 62px); align-items: flex-start; }
  .logo-bottom { margin-left: clamp(18px, 3vw, 38px); }
  .logo-badge { right: -8px; bottom: 2px; font-size: 6px; padding: 6px 7px; }
  .tagline { font-size: 11px; line-height: 1.4; margin: 12px 0 0; max-width: 360px; }
  .hero-art { display: none; }
  .join-card { max-width: 390px; padding: 12px 15px; border-radius: 15px; margin: 0; }
  .join-card::after { top: -12px; right: 14px; font-size: 8px; padding: 6px 7px; }
  .join-head h2 { font-size: 10px; margin-bottom: 5px; }
  .join-head p { font-size: 10px; margin-bottom: 9px; line-height: 1.35; }
  .field { margin-bottom: 7px; }
  .field > span, .quick-field > span { font-size: 8px; margin-bottom: 4px; }
  .field input { height: 34px; font-size: 13px; padding: 0 10px; }
  .quick-config { gap: 6px; margin-bottom: 8px; grid-template-columns: repeat(3, 1fr); }
  .quick-field select { height: 32px; font-size: 9px; padding: 0 7px; }
  .btn-lg { height: 42px; min-height: 42px; padding: 6px 12px; margin-top: 0; border-radius: 9px; }
  .btn-lg span { font-size: 9px; }
  .btn-lg small { font-size: 7px; letter-spacing: 1.2px; }
  .rooms-btn { min-height: 28px; height: 28px; margin-top: 5px; padding: 4px 8px; font-size: 9px; }
  .rooms-count { min-width: 17px; height: 15px; font-size: 7px; }
  .divider { margin: 8px 0 7px; font-size: 9px; }
  .code-row input { height: 33px; font-size: 12px; }
  .code-row .btn { flex-basis: 78px; padding: 8px 10px; font-size: 10px; }
  .form-error { min-height: 0; font-size: 10px; margin-top: 6px; }
  .feature-strip { display: none; }
  .home-footer { display: none; }

  /* Juego: la arena manda; los controles táctiles aprovechan los laterales. */
  body.in-game { overflow: hidden; height: 100dvh; overscroll-behavior: none; }
  .game {
    height: 100dvh;
    min-height: 0;
    align-items: stretch;
    padding: 0;
  }
  .game-shell {
    width: 100%;
    max-width: none;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .hud {
    flex: 0 0 auto;
    gap: 7px;
    padding:
      max(4px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      4px
      max(10px, env(safe-area-inset-left));
    border-bottom: 1px solid rgba(137, 166, 228, 0.09);
  }
  .hud-left { flex: 1 1 auto; }
  .room-mini { font-size: 7px; gap: 5px; letter-spacing: 1px; }
  .room-code { padding: 4px 5px; font-size: 7px; letter-spacing: 1px; }
  .hud-sub { display: none; }
  .timer { font-size: 16px; }
  .sudden-badge { margin-top: 2px; padding: 2px 4px; font-size: 5px; }
  .hud-right { flex: 0 0 auto; gap: 4px; }
  .hud-right .icon-btn { width: 31px; height: 31px; border-radius: 7px; font-size: 12px; display: none; }
  .hud-right .icon-btn#soundToggle2,
  .hud-right .icon-btn#fullscreenBtn { display: grid; }
  .hud-right .btn { min-height: 31px; padding: 5px 7px; font-size: 8px; }
  .hud-avatar { width: 32px; height: 32px; border-width: 1.5px; }
  .hud-avatar-ko { padding: 2px 3px; font-size: 5px; }
  .game-grid { display: flex; flex: 1 1 auto; min-height: 0; width: 100%; gap: 0; align-items: stretch; }
  .arena-col {
    order: 0;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .arena-wrap {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050810;
  }
  .arena-wrap::after { border-radius: 0; }
  #arena {
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 720 / 624;
    object-fit: contain;
  }
  .loadout, .side { display: none; }
  .status-ribbon { top: 5px; padding: 5px 9px; font-size: 5px; }
  .overlay { border-radius: 0; padding: 6px; }
  .overlay-card {
    width: min(100%, 650px);
    max-height: 100%;
    padding: 12px 16px;
    border-radius: 12px;
  }
  .lobby-card > p { display: none; }
  .room-wait-card > p { display: none; }
  .lobby-card .lobby-auto { display: none; }
  .room-wait-progress { height: 5px; margin: 5px 0 3px; }
  .room-wait-meta { font-size: 7px; margin-bottom: 5px; }
  .room-wait-card .lobby-slots { margin-top: 4px; }
  .overlay-card h2 { font-size: 12px; margin-bottom: 4px; }
  .overlay-card > p { font-size: 10px; margin-bottom: 8px; line-height: 1.35; }
  .overlay-kicker { font-size: 6px; padding: 4px 6px; margin-bottom: 7px; }
  .lobby-settings { margin-bottom: 2px; padding: 2px 8px; }
  .lobby-setting + .lobby-setting { margin-top: 1px; }
  .seg-btn { height: 24px; min-width: 28px; font-size: 9px; }
  .lobby-ai { display: none; }
  .vis-btn { min-height: 20px; padding: 0 7px; font-size: 6px; }
  .lang-switch { padding: 2px; }
  .lang-btn { min-width: 20px; padding: 4px; font-size: 6px; }
  .color-seg { gap: 3px; }
  .color-btn { width: 22px; height: 22px; border-width: 1px; }
  .color-btn b { font-size: 6px; }
  .avatar-seg { gap: 3px; }
  .avatar-btn { width: 36px; height: 34px; padding: 1px; border-radius: 5px; }
  .avatar-btn canvas { width: 32px; height: 32px; }
  .avatar-btn small { display: none; }
  .room-progress-row { margin-top: 2px; gap: 4px; }
  .room-progress { flex-basis: 70px; height: 3px; }
  .room-pct { font-size: 5px; }
  .lobby-slots { margin: 1px 0; gap: 5px; }
  .lobby-slot { min-height: 32px; padding: 4px 7px; gap: 6px; }
  .lobby-ava { width: 23px; height: 23px; font-size: 7px; }
  .lobby-slot-info b { font-size: 10px; }
  .lobby-slot-info small { font-size: 6px; margin-top: 2px; }
  .overlay-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 6px;
  }
  .overlay-actions .btn { min-height: 30px; padding: 6px 9px; font-size: 9px; }
  .overlay-actions .btn-primary { grid-column: 1 / -1; }
  .lobby-auto { margin-top: 6px; font-size: 8px; }
  .lobby-note { margin-top: 6px; font-size: 8px; }
  .countdown-round { font-size: 8px; margin-bottom: 6px; }
  .countdown-number { font-size: 62px; }
  .countdown-sub { font-size: 7px; margin-top: 6px; }
  .countdown-chips { margin-top: 8px; gap: 4px; }
  .mini-chip { font-size: 7px; padding: 4px 6px; }
  .results-card { padding: 10px 14px; }
  .trophy { font-size: 26px; }
  .winner-line { font-size: 10px; margin-bottom: 8px; }
  .winner-name { font-size: 15px; margin: 3px 0; }
  .score-table { margin-top: 8px; }
  .score-row { padding: 6px 1px; font-size: 10px; grid-template-columns: 18px 1fr 45px 53px; }
  .artist-note { margin-top: 7px; padding: 6px 8px; font-size: 9px; }
  .next-note { margin-top: 8px; font-size: 6px; }
  .touch-controls {
    padding:
      0
      max(10px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }
  .touch-dpad {
    grid-template-columns: repeat(3, 46px);
    grid-template-rows: repeat(3, 46px);
    gap: 3px;
    opacity: 0.92;
  }
  .touch-actions { gap: 8px; }
  .touch-actions .tbtn { width: 66px; height: 66px; }
  .touch-actions svg { width: 29px; height: 29px; }
  .toast { bottom: max(10px, env(safe-area-inset-bottom)); font-size: 10px; padding: 8px 12px; }
  .modal { padding: 8px; }
  .modal-card { max-height: 100%; padding: 12px 16px; }
  .modal h2 { font-size: 11px; margin-bottom: 4px; }
  .modal .muted { font-size: 10px; margin-bottom: 8px; line-height: 1.35; }
  .room-browser { gap: 4px; }
  .room-empty { padding: 10px; font-size: 10px; }
  .room-row { padding: 4px 6px; gap: 6px; }
  .room-row-main b { font-size: 10px; }
  .room-row-main small { font-size: 7px; margin-top: 1px; }
  .room-state { font-size: 5px; margin-top: 2px; }
  .room-row .btn { min-width: 64px; min-height: 26px; padding: 4px 6px; font-size: 8px; }
  .room-more { font-size: 8px; padding: 0; }
  .room-modal-actions { margin-top: 6px; }
  .room-modal-actions .btn { min-height: 28px; }
  .help-section { margin: 6px 0; padding-top: 6px; }
  .help-section h3 { margin-bottom: 5px; }
  .help-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .help-item { display: block; font-size: 9px; padding: 2px 0; }
  .help-item kbd { display: block; margin-top: 2px; }
  .power-list { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .power-item { font-size: 8px; padding: 4px 5px; gap: 5px; }
  .power-item svg { width: 14px; height: 14px; }
  .power-item b { font-size: 8px; }
  .power-item small { font-size: 7px; line-height: 1.2; }
  .help-sprays { display: none; }
}

/* ═══════════════ MÓVIL EN VERTICAL ═══════════════ */
@media (max-width: 700px) and (orientation: portrait) {
  /* La home cabe sin scroll en teléfonos verticales. */
  .home-main { gap: 16px; padding-bottom: 12px; }
  .join-card { padding: 22px 18px; }
  .tagline { margin: 16px 0 8px; }
  .feature-strip, .home-footer { display: none; }

  /* El overlay del lobby sale de la arena para poder cubrir toda la pantalla. */
  body.in-game { overflow: hidden; }
  .arena-wrap { z-index: 20; }
  .overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    padding: 10px;
    border-radius: 0;
  }
  .overlay-card { width: min(100%, 510px); max-height: 100%; }
}

/* En vertical estrecho, deja sitio a la ronda y al estado de la sala. */
@media (max-width: 480px) and (orientation: portrait) {
  .hud { gap: 5px; }
  .hud-right { gap: 5px; }
  .hud-right #fullscreenBtn { display: none; }
  .hud-sub { margin-top: 5px; font-size: 7px; letter-spacing: 0.4px; }
  .hud-lang { padding: 2px; }
  .hud-lang .lang-btn { min-width: 20px; padding: 4px; font-size: 6px; }
  .room-code { padding: 4px 6px; font-size: 8px; }
  .hud-avatar { width: 31px; height: 31px; }
}

@media (prefers-reduced-motion: reduce) {
  .hud-avatar.ko,
  .hud-avatar.revive,
  .hud-avatar.ko .hud-avatar-ko { animation: none; }
}

