html, body { height: 100%; overflow: hidden; background: #1a1010; }

#arena {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  image-rendering: pixelated;
  background: #1a1010;
}

.hud-top {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  z-index: 5;
  pointer-events: none;
}
.hud-top .chip { background: rgba(30, 15, 15, 0.82); }
.quit-btn {
  pointer-events: auto;
  background: rgba(120, 30, 20, 0.85);
  border: 1px solid #c95a4a;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--danger);
  cursor: pointer;
}
.quit-btn:hover { background: rgba(160, 40, 30, 0.9); }
.quit-btn:active { transform: translateY(1px); }
.timer {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  min-width: 70px;
  text-align: center;
  text-shadow: 0 2px 0 rgba(0,0,0,0.5);
}
.timer.warn { color: var(--danger); animation: blink 0.5s step-end infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.score-chip {
  background: rgba(30, 15, 15, 0.82);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}
.score-chip b { color: #fff3e0; font-weight: 800; }
.queue-warn {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(120, 30, 20, 0.9);
  border: 1px solid #c98f2a;
  border-radius: 10px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #ffd93d;
  z-index: 5;
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.55; } }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 5, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.overlay.hidden { display: none; }

.lobby-card, .results-card, .host-lost-card {
  background: linear-gradient(180deg, #4a2820, #3a1f1a);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 26px 34px;
  text-align: center;
  max-width: 520px;
  width: 92%;
  box-shadow: 0 0 0 4px rgba(201,143,42,0.25), 0 14px 40px rgba(0,0,0,0.5);
}
.logo {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--accent);
  text-shadow: 0 3px 0 #8a5f1e;
  margin-bottom: 4px;
}
.logo-sub { color: var(--dim); font-size: 13px; margin-bottom: 18px; letter-spacing: 1px; }

.qr-box {
  display: inline-block;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  margin: 8px 0;
}
.qr-box img { display: block; width: 210px; height: 210px; image-rendering: pixelated; }

.room-code {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--ink);
  margin: 6px 0 2px;
}
.join-hint { color: var(--dim); font-size: 13px; margin: 6px 0; }

.lineup { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0; min-height: 40px; }
.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 12px 4px 6px;
  font-size: 13px;
}
.player-chip img { width: 26px; height: 26px; image-rendering: pixelated; }
.player-chip .dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.4); }

.host-controls { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 6px; }
.rounds-sel {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

.announce {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 90px;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 5px 0 #8a5f1e, 0 0 40px rgba(255,217,61,0.4);
  z-index: 10;
  pointer-events: none;
}
.announce.small { font-size: 34px; }

.countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 6px 0 #8a5f1e;
  z-index: 15;
  pointer-events: none;
}

.results-card h2 {
  font-size: 30px;
  color: var(--accent);
  margin-bottom: 6px;
}
.results-team {
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 10px;
}
.results-team b { color: var(--accent); font-size: 30px; }
.podium { margin: 14px 0; }
.podium-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 6px;
}
.podium-row .rank { font-size: 20px; font-weight: 900; color: var(--accent); width: 30px; }
.podium-row img { width: 34px; height: 34px; image-rendering: pixelated; }
.podium-row .nm { flex: 1; text-align: left; font-weight: 700; }
.podium-row .sc { font-size: 18px; font-weight: 800; color: var(--accent); }
.stats-line { color: var(--dim); font-size: 13px; margin-bottom: 14px; }

.controls-legend {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(20, 10, 10, 0.75);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--dim);
  z-index: 5;
  pointer-events: none;
}
.cl-title { color: var(--accent); font-weight: 800; margin-bottom: 4px; }

.host-lost-card { font-size: 22px; font-weight: 800; }
