/* ═══════════════════════════════════════════════════════════════════
   BEAT THE ROBOT — Styles
   ═══════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #06060f;
  --bg2: #0d0d1a;
  --surface: rgba(15, 15, 35, 0.85);
  --surface2: rgba(25, 25, 55, 0.7);
  --cyan: #00f0ff;
  --cyan-dim: #00a0aa;
  --pink: #ff006e;
  --green: #00ff88;
  --red: #ff3355;
  --yellow: #ffcc00;
  --text: #e8e8f0;
  --text-dim: #8888aa;
  --radius: 12px;
  --radius-sm: 8px;
  --font-title: 'Orbitron', monospace;
  --font-body: 'Inter', -apple-system, sans-serif;
  --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.3), 0 0 60px rgba(0, 240, 255, 0.1);
  --glow-pink: 0 0 20px rgba(255, 0, 110, 0.3), 0 0 60px rgba(255, 0, 110, 0.1);
  --glow-green: 0 0 20px rgba(0, 255, 136, 0.4);
  --glow-red: 0 0 20px rgba(255, 51, 85, 0.4);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── 3D Canvas ─────────────────────────────────────────────────────── */
#three-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Language Switcher ─────────────────────────────────────────────── */
.lang-switcher {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 300;
  display: flex;
  gap: 2px;
  background: rgba(10, 10, 30, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.15);
  padding: 3px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lang-btn {
  font-family: var(--font-title);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: var(--text-dim);
  transition: all 0.2s;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active {
  background: rgba(0, 240, 255, 0.15);
  color: var(--cyan);
}

/* ── Screens ───────────────────────────────────────────────────────── */
.screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: flex; }

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 10;
}

/* Dark backdrop behind all main content areas for text readability */
.screen::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, rgba(6, 6, 15, 0.65) 0%, rgba(6, 6, 15, 0.85) 100%);
  z-index: 1;
  pointer-events: none;
}

/* ── FX Layer ──────────────────────────────────────────────────────── */
.fx-layer {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 100;
  pointer-events: none;
}

.fx-flash {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  animation: flashAnim 0.6s ease-out forwards;
}

@keyframes flashAnim {
  0% { opacity: 0.7; }
  100% { opacity: 0; }
}

.fx-shake {
  animation: shakeAnim 0.5s ease-out;
}

@keyframes shakeAnim {
  0%, 100% { transform: translate(0); }
  10% { transform: translate(-8px, 4px); }
  20% { transform: translate(8px, -4px); }
  30% { transform: translate(-6px, 6px); }
  40% { transform: translate(6px, -2px); }
  50% { transform: translate(-4px, 4px); }
  60% { transform: translate(4px, -4px); }
  70% { transform: translate(-2px, 2px); }
  80% { transform: translate(2px, -2px); }
  90% { transform: translate(-1px, 1px); }
}

/* ── Overlay ───────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.8);
}

/* ── Typography ────────────────────────────────────────────────────── */
.game-title {
  font-family: var(--font-title);
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 900;
  text-align: center;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  letter-spacing: 4px;
  line-height: 1.2;
}

/* Glitch effect */
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  font-family: inherit; font-size: inherit; font-weight: inherit;
  letter-spacing: inherit;
}
.glitch::before {
  color: var(--pink);
  animation: glitch1 3s infinite;
  clip-path: inset(0 0 65% 0);
}
.glitch::after {
  color: var(--green);
  animation: glitch2 3s infinite;
  clip-path: inset(65% 0 0 0);
}
@keyframes glitch1 {
  0%, 93%, 100% { transform: translate(0); }
  94% { transform: translate(-3px, 1px); }
  95% { transform: translate(3px, -1px); }
  96% { transform: translate(-2px, 2px); }
}
@keyframes glitch2 {
  0%, 95%, 100% { transform: translate(0); }
  96% { transform: translate(3px, 1px); }
  97% { transform: translate(-3px, -1px); }
  98% { transform: translate(2px, 2px); }
}

.subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 1rem;
  margin-top: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 300;
}

.section-title {
  font-family: var(--font-title);
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  color: var(--cyan);
  text-align: center;
  letter-spacing: 3px;
  margin-bottom: 16px;
  text-shadow: var(--glow-cyan);
}

.card-title {
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: var(--cyan-dim);
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #0088ff);
  color: #000;
  box-shadow: var(--glow-cyan);
}
.btn-primary:hover { filter: brightness(1.15); }
.btn-primary:disabled {
  background: #333;
  color: #666;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface2);
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
}
.btn-secondary:hover { background: rgba(0, 240, 255, 0.1); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  padding: 8px 16px;
  font-size: 0.75rem;
}
.btn-ghost:hover { color: var(--text); }

.btn-lg { padding: 16px 36px; font-size: 1rem; }

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px 8px;
  transition: transform 0.2s;
}
.btn-icon:hover { transform: scale(1.2); }

/* ── Inputs ────────────────────────────────────────────────────────── */
input[type="text"], textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus, textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

textarea {
  resize: none;
  line-height: 1.5;
}

.code-input {
  width: 90px;
  text-align: center;
  font-family: var(--font-title);
  font-size: 1.2rem;
  letter-spacing: 4px;
  text-transform: uppercase;
}

/* ── Forms ─────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: var(--font-title);
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.error-text {
  color: var(--red);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 12px;
  min-height: 20px;
}

/* ── HOME SCREEN ───────────────────────────────────────────────────── */
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 24px;
}

.title-block { margin-bottom: 8px; }

.home-card {
  width: 100%;
  max-width: 480px;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.avatar-btn {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
  padding: 6px;
  cursor: pointer;
  transition: all 0.15s;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-btn:hover { border-color: rgba(0, 240, 255, 0.4); }
.avatar-btn.selected {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.join-row {
  display: flex;
  gap: 8px;
}
.join-row .code-input { flex: 0 0 90px; }
.join-row .btn { flex: 1; }

/* ── LOBBY SCREEN ──────────────────────────────────────────────────── */
.lobby-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 40px;
  padding-bottom: 40px;
}

.lobby-header {
  text-align: center;
  margin-bottom: 24px;
}

.room-code-block {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  padding: 10px 20px;
  border-radius: var(--radius);
  margin-top: 12px;
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.room-code-label {
  font-size: 0.7rem;
  font-family: var(--font-title);
  color: var(--text-dim);
  letter-spacing: 2px;
}

.room-code {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 900;
  color: var(--cyan);
  letter-spacing: 6px;
  text-shadow: var(--glow-cyan);
}

.lobby-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.05);
}

.player-item .avatar { font-size: 1.5rem; }
.player-item .name {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
}
.player-item .host-badge {
  font-family: var(--font-title);
  font-size: 0.6rem;
  letter-spacing: 1px;
  color: var(--yellow);
  background: rgba(255, 204, 0, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 204, 0, 0.3);
}
.player-item.offline {
  opacity: 0.45;
}
.player-item .offline-badge {
  font-family: var(--font-title);
  font-size: 0.55rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Pack selector */
.pack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.pack-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.pack-item:hover { border-color: rgba(0, 240, 255, 0.3); }
.pack-item.selected {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.05);
}
.pack-item.disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.pack-item .pack-icon { font-size: 1.8rem; }
.pack-item .pack-info { flex: 1; }
.pack-item .pack-name {
  font-weight: 600;
  font-size: 0.95rem;
}
.pack-item .pack-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.pack-item .pack-check {
  font-size: 1.2rem;
  color: var(--text-dim);
  min-width: 1.4rem;
  text-align: center;
  transition: color 0.2s;
}
.pack-item.selected .pack-check {
  color: var(--cyan);
}
.pack-item .pack-count {
  color: var(--text-dim);
  font-size: 0.72rem;
}

/* ── GAME SCREEN ───────────────────────────────────────────────────── */
.game-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 20px;
}

.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  background: rgba(6, 6, 20, 0.7);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 240, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-quit {
  background: rgba(255, 51, 85, 0.15);
  border: 1px solid rgba(255, 51, 85, 0.3);
  color: #ff3355;
  font-size: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-quit:hover {
  background: rgba(255, 51, 85, 0.3);
  border-color: #ff3355;
}

.hud-round {
  font-family: var(--font-title);
  font-size: 0.8rem;
  color: var(--cyan);
  letter-spacing: 2px;
}

.hud-status {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.game-phase {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Countdown */
.big-text {
  font-family: var(--font-title);
  font-size: clamp(2rem, 10vw, 5rem);
  font-weight: 900;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  text-align: center;
  animation: pulse 1s ease-in-out infinite;
  background: rgba(6, 6, 20, 0.6);
  padding: 20px 40px;
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

/* Situation */
.situation-box {
  width: 100%;
  max-width: 600px;
  text-align: center;
  margin-bottom: 24px;
  background: rgba(6, 6, 20, 0.75);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 240, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.situation-label {
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: var(--yellow);
  margin-bottom: 12px;
}

.situation-text {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  line-height: 1.6;
  color: var(--text);
  font-weight: 600;
}

/* Response area */
.response-area {
  width: 100%;
  max-width: 600px;
  background: rgba(6, 6, 20, 0.7);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 240, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.timer-bar-container {
  position: relative;
  width: 100%;
  height: 32px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 240, 255, 0.15);
}

.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #0088ff);
  border-radius: 16px;
  width: 100%;
  transition: width 1s linear, background 0.5s;
}

.timer-bar.urgent {
  background: linear-gradient(90deg, var(--red), var(--pink));
}

.timer-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.response-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.char-count {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-title);
  letter-spacing: 1px;
}

.ready-info {
  flex: 1;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Judging */
.judging-header {
  text-align: center;
  background: rgba(6, 6, 20, 0.7);
  padding: 32px 40px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 0, 110, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.robot-speaking {
  font-family: var(--font-title);
  font-size: clamp(1rem, 4vw, 1.5rem);
  color: var(--pink);
  letter-spacing: 3px;
  text-shadow: var(--glow-pink);
  margin-bottom: 16px;
}

.loading-dots span {
  font-size: 2rem;
  color: var(--pink);
  animation: dotPulse 1.4s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 60%, 100% { opacity: 0.2; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-8px); }
}

/* Verdict */
.verdict-card {
  width: 100%;
  max-width: 600px;
  background: rgba(8, 8, 20, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.1);
  border-radius: 4px;
  padding: 28px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(0, 240, 255, 0.05);
}

.verdict-situation {
  font-size: 0.75rem;
  color: rgba(255, 204, 0, 0.6);
  font-weight: 600;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: rgba(255, 204, 0, 0.03);
  border: 1px solid rgba(255, 204, 0, 0.08);
  border-radius: 3px;
  line-height: 1.4;
  letter-spacing: 0.5px;
}

.verdict-player {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.verdict-avatar { font-size: 2.5rem; }
.verdict-name {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--cyan);
  letter-spacing: 2px;
}

.verdict-section {
  margin-bottom: 14px;
}

.verdict-section-label {
  font-family: var(--font-title);
  font-size: 0.55rem;
  color: rgba(0, 240, 255, 0.35);
  letter-spacing: 3px;
  margin-bottom: 8px;
  text-align: left;
  user-select: none;
  text-transform: uppercase;
}

.verdict-section-label--robot {
  color: rgba(255, 0, 110, 0.4);
}

.verdict-response {
  font-size: 1.05rem;
  /* color: var(--cyan); */
  color: rgba(255, 255, 255, 0.9);
  font-style: normal;
  font-weight: 400;
  line-height: 1.7;
  padding: 14px 16px;
  background: rgba(0, 240, 255, 0.03);
  border: 1px solid rgba(0, 240, 255, 0.08);
  border-radius: var(--radius-sm);
  text-align: left;
  min-height: 44px;
  position: relative;
}

.verdict-response::before {
  content: '"';
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 2.5rem;
  color: rgba(0, 240, 255, 0.08);
  font-family: Georgia, serif;
  line-height: 1;
  pointer-events: none;
}

.verdict-story {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  padding: 14px 16px;
  background: rgba(255, 0, 110, 0.02);
  border: 1px solid rgba(255, 0, 110, 0.08);
  border-radius: var(--radius-sm);
  text-align: left;
  min-height: 60px;
}

.verdict-result {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  font-weight: 900;
  letter-spacing: 4px;
  padding: 8px;
}

.verdict-result.survived {
  color: var(--green);
  text-shadow: var(--glow-green);
}

.verdict-result.death {
  color: var(--red);
  text-shadow: var(--glow-red);
}

.verdict-progress {
  text-align: center;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-dim);
  background: rgba(6, 6, 20, 0.6);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
}

.verdict-skip-btn {
  margin-top: 12px;
  font-size: 0.85rem;
  padding: 8px 24px;
}

/* Scores */
.score-table {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

.score-rank {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-dim);
  min-width: 28px;
  text-align: center;
}

.score-rank.top { color: var(--yellow); }

.score-avatar { font-size: 1.4rem; }

.score-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.score-rounds {
  display: flex;
  gap: 6px;
}

.round-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.round-icon.survived {
  background: rgba(0, 255, 136, 0.15);
  color: var(--green);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.round-icon.death {
  background: rgba(255, 51, 85, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 51, 85, 0.3);
}

.round-icon.pending {
  background: rgba(255,255,255,0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.1);
}

.score-total {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan);
  min-width: 40px;
  text-align: right;
}

/* ── RESULTS SCREEN ────────────────────────────────────────────────── */
.results-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px 20px;
}

.winner-block {
  text-align: center;
  animation: winnerAppear 1s ease-out;
  background: rgba(6, 6, 20, 0.7);
  padding: 32px 40px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 204, 0, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@keyframes winnerAppear {
  0% { opacity: 0; transform: scale(0.5) translateY(40px); }
  60% { transform: scale(1.1) translateY(-10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.winner-crown {
  font-size: 4rem;
  animation: crownBounce 2s ease-in-out infinite;
}

@keyframes crownBounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-10px) rotate(-5deg); }
  75% { transform: translateY(-10px) rotate(5deg); }
}

.winner-title {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: var(--yellow);
  letter-spacing: 6px;
  text-shadow: 0 0 30px rgba(255, 204, 0, 0.4);
  margin: 8px 0;
}

.winner-avatar { font-size: 4rem; margin: 8px 0; }

.winner-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--text);
  letter-spacing: 2px;
}

.winner-stat {
  color: var(--green);
  font-size: 1rem;
  margin-top: 4px;
}

.final-scores-card {
  width: 100%;
  max-width: 600px;
}

.final-score-table { /* same as score-table */ }

/* ── Confetti ──────────────────────────────────────────────────────── */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  z-index: 150;
  pointer-events: none;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}

/* ── Typewriter cursor ─────────────────────────────────────────────── */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--cyan);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.7s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: 16px; }

  .avatar-grid {
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
  }
  .avatar-btn { font-size: 1.2rem; padding: 4px; }

  .room-code { font-size: 1.5rem; letter-spacing: 4px; }
  .room-code-block { padding: 8px 14px; }

  .card { padding: 16px; }

  .verdict-card { padding: 20px; }
  .verdict-avatar { font-size: 2rem; }
  .verdict-name { font-size: 1rem; }
  .verdict-response { font-size: 1rem; padding: 12px 14px; }
  .verdict-story { font-size: 0.9rem; padding: 12px 14px; }

  .score-row { padding: 10px 12px; gap: 8px; }
  .round-icon { width: 24px; height: 24px; font-size: 0.7rem; }

  .response-footer { flex-wrap: wrap; }

  .btn-lg { padding: 14px 24px; font-size: 0.9rem; }
}

@media (max-width: 380px) {
  .avatar-grid { grid-template-columns: repeat(6, 1fr); }
  .score-rounds { gap: 3px; }
  .round-icon { width: 20px; height: 20px; font-size: 0.6rem; }
}

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 240, 255, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 240, 255, 0.4); }

/* ── Utility animations ────────────────────────────────────────────── */
.fade-in {
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-up {
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Submitted state */
.response-area.submitted textarea {
  opacity: 0.5;
  pointer-events: none;
}
.response-area.submitted .btn {
  background: var(--green);
  color: #000;
}
