/* ═══════════════════════════════════════════════════
   Soletrando — Modo Competição  (competition.css)
   ═══════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --bg-dark: #0f0d1a;
  --bg-card: #1a1730;
  --bg-card-light: #231f3d;
  --bg-glass: rgba(30, 27, 55, 0.85);
  --purple: #a855f7;
  --purple-light: #c084fc;
  --purple-dark: #7c3aed;
  --pink: #ec4899;
  --pink-light: #f472b6;
  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --cyan: #06b6d4;
  --green: #22c55e;
  --green-light: #4ade80;
  --yellow: #fbbf24;
  --yellow-light: #fde68a;
  --orange: #f97316;
  --red: #ef4444;
  --red-light: #f87171;
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --text-main: #f1f0f5;
  --text-dim: #a09bb5;
  --text-muted: #6b6585;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-glow: 0 0 30px rgba(168, 85, 247, 0.3);
  --font-main: 'Outfit', 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;900&display=swap');

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

body {
  font-family: var(--font-main);
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(168, 85, 247, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(236, 72, 153, 0.1) 0%, transparent 60%);
}

.connection-status {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12000;
  background: rgba(15, 13, 26, 0.94);
  border: 2px solid var(--purple-light);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.connection-status.hidden {
  display: none;
}

/* ── Screen Manager ── */
.screen { display: none; width: 100%; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; align-items: center; animation: fadeIn 0.4s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.4); } 50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.8); } }
@keyframes shimmer { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
@keyframes countdownPulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); } 100% { transform: scale(1); opacity: 1; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
@keyframes rankShift { from { opacity: 0.5; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes podiumRise {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font-main); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
  text-transform: uppercase; letter-spacing: 0.5px;
  position: relative; overflow: hidden;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white; box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 30px rgba(168, 85, 247, 0.6); transform: translateY(-2px); }

.btn-green {
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: white; box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}
.btn-green:hover:not(:disabled) { box-shadow: 0 6px 30px rgba(34, 197, 94, 0.6); transform: translateY(-2px); }

.btn-gold {
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  color: #1a1730; box-shadow: 0 4px 20px rgba(251, 191, 36, 0.4);
}

.btn-ghost {
  background: transparent; color: var(--text-dim);
  border: 2px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--purple); color: var(--purple-light); }

.btn-danger {
  background: linear-gradient(135deg, var(--red), #dc2626);
  color: white;
}

.btn-lg { padding: 18px 40px; font-size: 1.2rem; border-radius: var(--radius); }
.btn-xl { padding: 24px 56px; font-size: 1.5rem; border-radius: var(--radius); }
.btn-sm { padding: 10px 20px; font-size: 0.9rem; }

/* ── Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(12px);
}

/* ═══════════════════════════════════════
   TEACHER SCREENS
   ═══════════════════════════════════════ */

/* ── Teacher: Setup ── */
.teacher-setup {
  justify-content: center; padding: 40px 20px; gap: 32px;
}
.teacher-setup .card { max-width: 540px; width: 100%; text-align: center; }
.teacher-setup h1 {
  font-size: 2.2rem; font-weight: 900; margin-bottom: 8px;
  background: linear-gradient(135deg, var(--purple-light), var(--pink-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.teacher-setup .subtitle { color: var(--text-dim); margin-bottom: 28px; }

.estimated-time {
  text-align: center; padding: 12px; margin-top: 8px;
  background: rgba(168, 85, 247, 0.08); border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 0.9rem;
}
.estimated-time strong { color: var(--purple-light); }

.banners-container {
  display: flex; flex-direction: column; gap: 6px;
  width: 100%; max-width: 750px; margin-top: 10px;
}

.waiting-top { text-align: center; }

.ranking-sub { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 8px; }

.config-group { margin-bottom: 24px; text-align: left; }
.config-group label {
  display: block; font-size: 0.85rem; font-weight: 600;
  color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px;
}
.config-group select,
.config-group input[type="number"] {
  width: 100%; padding: 14px 16px; background: var(--bg-card-light);
  border: 2px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm);
  color: var(--text-main); font-family: var(--font-main); font-size: 1rem;
  transition: border-color var(--transition);
  appearance: none;
}
.config-group select:focus,
.config-group input:focus { outline: none; border-color: var(--purple); }

/* ── Teacher: Lobby ── */
.teacher-lobby { padding: 32px 20px; gap: 24px; }

.room-code-display {
  text-align: center; padding: 32px;
  background: var(--bg-card);
  border: 2px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius);
  animation: glow 3s ease-in-out infinite;
}
.room-code-display .label {
  font-size: 1rem; color: var(--text-dim); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 2px;
}
.room-code-display .code {
  font-size: 5rem; font-weight: 900; letter-spacing: 16px;
  font-family: var(--font-mono);
  background: linear-gradient(135deg, var(--purple-light), var(--cyan), var(--pink-light));
  background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}
.room-code-display .url {
  font-size: 0.85rem; color: var(--text-muted); margin-top: 12px;
  font-family: var(--font-mono);
}

.players-lobby { width: 100%; max-width: 900px; }
.players-lobby h3 {
  font-size: 1.1rem; color: var(--text-dim); margin-bottom: 16px; text-align: center;
}
.players-grid {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
}
.player-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; background: var(--bg-card-light);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 50px; animation: scaleIn 0.3s ease;
}
.player-chip .chip-avatar { display: flex; align-items: center; }
.player-chip .chip-avatar svg { border-radius: 50%; }
.player-chip .name { font-weight: 600; font-size: 0.95rem; }
.player-chip .btn-kick {
  margin-left: auto;
  background: rgba(255,60,60,0.15);
  border: 1px solid rgba(255,60,60,0.3);
  color: var(--red-light);
  border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}
.player-chip:hover .btn-kick { opacity: 1; }
.player-chip .btn-kick:hover {
  background: rgba(255,60,60,0.4);
  color: #fff;
}

.lobby-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* ── Teacher: Round ── */
.teacher-round { padding: 24px 20px; gap: 20px; }

.round-header {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; max-width: 900px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 16px 24px;
}
.round-header .round-label {
  font-size: 1.3rem; font-weight: 700;
  color: var(--purple-light);
}
.round-header .round-info {
  color: var(--text-dim); font-size: 0.9rem;
}

.timer-big {
  position: relative; width: 200px; height: 200px; margin: 20px auto;
}
.timer-big svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-big .track { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 8; }
.timer-big .progress {
  fill: none; stroke: var(--green); stroke-width: 8;
  stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke 0.5s;
}
.timer-big .progress.warning { stroke: var(--yellow); }
.timer-big .progress.danger { stroke: var(--red); }
.timer-big .time-text {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 3.5rem; font-weight: 900; font-family: var(--font-mono);
}

.answers-progress {
  text-align: center; width: 100%; max-width: 600px;
}
.answers-progress .bar-bg {
  width: 100%; height: 14px; background: rgba(255,255,255,0.06);
  border-radius: 7px; overflow: hidden; margin-top: 8px;
}
.answers-progress .bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--purple), var(--cyan));
  border-radius: 7px; transition: width 0.5s ease;
}
.answers-progress .label {
  font-size: 1.1rem; color: var(--text-dim); margin-bottom: 4px;
}

.teacher-round-actions {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 12px;
}

/* ── Teacher & Student: Ranking ── */
.ranking-screen { padding: 32px 20px; gap: 24px; }

.ranking-title {
  font-size: 2rem; font-weight: 900; text-align: center;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.ranking-word {
  text-align: center; color: var(--text-dim); font-size: 1rem; margin-bottom: 8px;
}
.ranking-word strong { color: var(--green-light); font-size: 1.2rem; }

.ranking-list {
  width: 100%; max-width: 750px; display: flex; flex-direction: column; gap: 6px;
}
.ranking-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  animation: slideInRight 0.5s ease backwards;
  transition: all 0.5s ease;
}
.ranking-item.top-1 {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 215, 0, 0.4);
  color: #1a1730;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}
.ranking-item.top-2 {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.6), rgba(124, 58, 237, 0.4));
  border-color: rgba(124, 58, 237, 0.3);
}
.ranking-item.top-3 {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.5), rgba(124, 58, 237, 0.3));
  border-color: rgba(124, 58, 237, 0.2);
}
.ranking-item:not(.top-1):not(.top-2):not(.top-3) {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(124, 58, 237, 0.2));
}

/* Position badge */
.rank-position {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 900; font-size: 1rem; flex-shrink: 0;
  background: rgba(255,255,255,0.1);
}
.ranking-item.top-1 .rank-position { background: var(--gold); color: #1a1730; font-size: 1.2rem; }
.ranking-item.top-2 .rank-position { background: rgba(255,255,255,0.2); }
.ranking-item.top-3 .rank-position { background: rgba(255,255,255,0.15); }

/* Avatar */
.rank-avatar { flex-shrink: 0; display: flex; align-items: center; }
.rank-avatar svg { border-radius: 50%; }

/* Player info */
.rank-info { flex: 1; min-width: 0; }
.rank-name {
  font-weight: 700; font-size: 1.05rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.ranking-item.top-1 .rank-name { color: #1a1730; }
.rank-meta { font-size: 0.78rem; color: var(--text-dim); display: flex; gap: 10px; align-items: center; margin-top: 2px; }
.ranking-item.top-1 .rank-meta { color: #6b6585; }

/* Streak fire */
.streak-fire {
  font-size: 1.1rem;
  animation: pulse 1s ease-in-out infinite;
}
.meta-streak { color: var(--orange); font-weight: 600; }
.ranking-item.top-1 .meta-streak { color: var(--orange); }

/* Position arrow */
.pos-arrow {
  font-size: 0.75rem; font-weight: 700; padding: 1px 4px;
  border-radius: 3px;
}
.pos-arrow.up { color: var(--green-light); }
.pos-arrow.down { color: var(--red-light); }
.ranking-item.top-1 .pos-arrow.up { color: #16a34a; }
.ranking-item.top-1 .pos-arrow.down { color: #dc2626; }

/* Result icon */
.rank-result-icon { font-size: 1.3rem; flex-shrink: 0; }

/* Points delta */
.rank-delta { font-size: 0.85rem; font-weight: 700; flex-shrink: 0; margin-right: 4px; }
.rank-delta.positive { color: var(--green-light); }
.rank-delta.zero { color: var(--red-light); }
.ranking-item.top-1 .rank-delta.positive { color: #16a34a; }
.ranking-item.top-1 .rank-delta.zero { color: #dc2626; }

/* Score */
.rank-score { font-weight: 900; font-size: 1.2rem; color: var(--yellow); flex-shrink: 0; }
.ranking-item.top-1 .rank-score { color: #1a1730; }

/* ── Streak Banner ── */
.streak-banner {
  display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: 750px;
  padding: 14px 24px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.7), rgba(124, 58, 237, 0.5));
  border-radius: var(--radius-sm);
  animation: slideUp 0.5s ease;
  margin-top: 8px;
}
.streak-banner-avatar { display: flex; align-items: center; }
.streak-banner-avatar svg { border-radius: 50%; }
.streak-banner-text { flex: 1; font-weight: 700; font-size: 1rem; }
.streak-banner-fire { font-size: 1.5rem; animation: pulse 1s ease-in-out infinite; }

/* ── Podium ── */
.podium-screen { padding: 40px 20px; gap: 32px; justify-content: center; }
.podium-title {
  font-size: 2.5rem; font-weight: 900; text-align: center;
  background: linear-gradient(135deg, var(--gold), var(--orange), var(--yellow));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.podium-subtitle { color: var(--text-dim); text-align: center; }

.podium-container {
  display: flex; align-items: flex-end; justify-content: center; gap: 16px;
  margin: 24px 0; min-height: 320px;
}
.podium-place {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: podiumRise 0.8s ease backwards;
}
.podium-place:nth-child(1) { animation-delay: 0.6s; } /* 2nd */
.podium-place:nth-child(2) { animation-delay: 1s; } /* 1st */
.podium-place:nth-child(3) { animation-delay: 0.4s; } /* 3rd */

.podium-avatar-wrap {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 3px solid rgba(255,255,255,0.2);
  overflow: hidden;
}
.podium-avatar-wrap svg { border-radius: 50%; }
.podium-place.gold .podium-avatar-wrap { border-color: var(--gold); box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); animation: bounce 2s ease-in-out infinite; }
.podium-place.silver .podium-avatar-wrap { border-color: var(--silver); }
.podium-place.bronze .podium-avatar-wrap { border-color: var(--bronze); }

.podium-name { font-weight: 700; text-align: center; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium-score { font-size: 1.2rem; font-weight: 900; color: var(--yellow); }

.podium-bar {
  width: 120px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px 12px 0 0; font-size: 2.5rem; font-weight: 900;
  padding-top: 16px;
}
.podium-bar.gold-bar {
  height: 200px; background: linear-gradient(180deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.08));
  border: 2px solid rgba(255, 215, 0, 0.4); border-bottom: none;
}
.podium-bar.silver-bar {
  height: 150px; background: linear-gradient(180deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05));
  border: 2px solid rgba(192, 192, 192, 0.3); border-bottom: none;
}
.podium-bar.bronze-bar {
  height: 110px; background: linear-gradient(180deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05));
  border: 2px solid rgba(205, 127, 50, 0.3); border-bottom: none;
}

/* ═══════════════════════════════════════
   STUDENT SCREENS
   ═══════════════════════════════════════ */

/* ── Student: Join ── */
.student-join {
  justify-content: center; padding: 40px 20px; gap: 24px;
}
.student-join .card { max-width: 420px; width: 100%; text-align: center; }
.student-join h1 {
  font-size: 1.8rem; font-weight: 900; margin-bottom: 4px;
  background: linear-gradient(135deg, var(--purple-light), var(--pink-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.student-join .subtitle { color: var(--text-dim); margin-bottom: 24px; font-size: 0.9rem; }

.code-input {
  display: flex; gap: 8px; justify-content: center; margin-bottom: 20px;
}
.code-input input {
  width: 56px; height: 64px; text-align: center;
  font-size: 1.8rem; font-weight: 900; font-family: var(--font-mono);
  background: var(--bg-card-light); border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm); color: var(--text-main);
  text-transform: uppercase; transition: border-color var(--transition);
}
.code-input input:focus { outline: none; border-color: var(--purple); }

.name-input {
  width: 100%; padding: 14px 16px; background: var(--bg-card-light);
  border: 2px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm);
  color: var(--text-main); font-family: var(--font-main); font-size: 1rem;
  margin-bottom: 16px; text-align: center;
}
.name-input:focus { outline: none; border-color: var(--purple); }

/* Avatar Creator */
.avatar-creator {
  margin-bottom: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.avatar-preview-box {
  width: 120px; height: 120px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 3px solid rgba(168, 85, 247, 0.3);
  border-radius: 50%;
  overflow: hidden;
  transition: all var(--transition);
}
.avatar-preview-box:hover { border-color: var(--purple); }
.avatar-preview-box svg { border-radius: 50%; }

.avatar-categories { width: 100%; }
.category-tabs {
  display: flex; gap: 4px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap;
}
.cat-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 12px; border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm); background: var(--bg-card-light);
  color: var(--text-dim); font-size: 0.7rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  font-family: var(--font-main); text-transform: uppercase; letter-spacing: 0.5px;
}
.cat-tab:hover { border-color: var(--purple); color: var(--text-main); }
.cat-tab.active {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  border-color: var(--purple); color: white;
}

.category-picker {
  display: flex; align-items: center; justify-content: center; gap: 16px;
}
.category-picker .btn-nav {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: none;
  color: var(--text-main); font-size: 1.2rem; cursor: pointer;
  transition: all var(--transition);
}
.category-picker .btn-nav:hover { background: var(--purple); }
.part-label {
  font-size: 0.9rem; font-weight: 600; color: var(--text-dim);
  min-width: 80px; text-align: center;
}

.join-error {
  color: var(--red-light); font-size: 0.9rem; margin-top: 8px;
  min-height: 1.2em;
}

/* ── Student: Waiting ── */
.student-waiting {
  justify-content: center; padding: 40px 20px; gap: 20px;
  text-align: center;
}
.student-waiting h2 {
  font-size: 1.5rem; font-weight: 700; color: var(--purple-light);
}
.student-waiting .waiting-dots {
  font-size: 2rem; animation: pulse 1.5s ease-in-out infinite;
}

/* ── Student: Answering ── */
.student-answering { padding: 24px 16px; gap: 16px; }

.student-timer {
  text-align: center; font-size: 3rem; font-weight: 900;
  font-family: var(--font-mono);
  color: var(--green-light);
  transition: color 0.3s;
}
.student-timer.warning { color: var(--yellow); }
.student-timer.danger { color: var(--red-light); animation: countdownPulse 1s ease infinite; }

.student-round-label {
  text-align: center; font-size: 0.9rem; color: var(--text-dim);
}
.student-prep-info {
  min-height: 1.1rem;
  margin-top: -4px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--yellow-light);
  font-weight: 700;
}

.student-answer-area {
  width: 100%; max-width: 500px;
}
.student-answer-area .field-label {
  display: block; text-align: center; font-size: 0.85rem;
  color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px;
}

.student-tiles {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  min-height: 52px; padding: 8px;
  background: rgba(255,255,255,0.03);
  border: 2px dashed rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  cursor: text;
}

.letter-tile {
  width: 42px; height: 48px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-card-light); border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xs); font-size: 1.3rem; font-weight: 700;
  font-family: var(--font-mono); text-transform: uppercase;
  transition: all 0.2s ease;
}
.letter-tile.filled { border-color: var(--purple); background: rgba(168, 85, 247, 0.15); color: var(--text-main); }
.letter-tile.empty-slot { border-style: dashed; }

.student-answer-input {
  position: absolute; left: -9999px; opacity: 0;
}

.listen-btn-row {
  display: flex; gap: 12px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap;
}

/* ── Student: Submitted ── */
.student-submitted {
  justify-content: center; padding: 40px 20px; gap: 20px;
  text-align: center;
}
.student-submitted h2 { font-size: 1.5rem; font-weight: 700; color: var(--green); }
.student-submitted .waiting-animation { font-size: 3rem; animation: pulse 2s ease-in-out infinite; }

/* ── Student: Spectator ── */
.student-spectator {
  justify-content: center;
  padding: 26px 16px;
  gap: 12px;
  text-align: center;
}
.student-spectator h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--yellow-light);
}
.spec-message {
  color: var(--text-dim);
  font-size: 0.95rem;
}
.spec-round-info {
  color: var(--purple-light);
  font-weight: 700;
  font-size: 0.95rem;
}

/* ── Student: Round Result ── */
.student-result {
  justify-content: center; padding: 32px 20px; gap: 20px;
  text-align: center;
}
.student-result .result-icon { font-size: 4rem; }
.student-result .result-title { font-size: 1.5rem; font-weight: 900; }
.student-result .result-title.correct { color: var(--green-light); }
.student-result .result-title.wrong { color: var(--red-light); }

.result-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  width: 100%; max-width: 340px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 16px; text-align: center;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 900; }
.stat-card .stat-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.stat-card .stat-value.points { color: var(--yellow); }
.stat-card .stat-value.position { color: var(--purple-light); }
.stat-card .stat-value.streak { color: var(--orange); }

.word-reveal {
  color: var(--text-dim); font-size: 0.95rem;
}
.word-reveal strong { color: var(--green-light); font-size: 1.1rem; }

.sr-tiles-container {
  display: flex; flex-direction: column; gap: 4px; align-items: center; width: 100%;
}
.sr-tiles-label {
  font-size: 0.85rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
}
.result-tiles {
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;
  padding: 4px;
}
.result-tiles .letter-tile {
  width: 32px; height: 38px; font-size: 1.1rem;
  border-width: 2px; border-style: solid;
  animation: tilePopIn 0.2s ease-out both; color: white;
}
.letter-tile.tile-correct {
  background: var(--green); border-color: var(--green-light); text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.letter-tile.tile-wrong {
  background: var(--red); border-color: var(--red-light); text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.letter-tile.tile-missing {
  background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.2); border-style: dashed; color: rgba(255,255,255,0.4);
}
.letter-tile.tile-reference {
  background: var(--purple-light); border-color: var(--pink); text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

@keyframes tilePopIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ── Student: Final ── */
.student-final {
  justify-content: center; padding: 40px 20px; gap: 24px; text-align: center;
}
.student-final h2 {
  font-size: 1.8rem; font-weight: 900;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ── Confetti ── */
.confetti-container {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999; overflow: hidden;
}
.confetti-piece {
  position: absolute; top: -20px;
  animation: confettiFall 3s ease-in forwards;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .room-code-display .code { font-size: 3rem; letter-spacing: 10px; }
  .timer-big { width: 150px; height: 150px; }
  .timer-big .time-text { font-size: 2.5rem; }
  .podium-container { gap: 8px; }
  .podium-bar { width: 90px; }
  .podium-bar.gold-bar { height: 160px; }
  .podium-bar.silver-bar { height: 120px; }
  .podium-bar.bronze-bar { height: 90px; }
  .podium-avatar { width: 60px; height: 60px; }
  .ranking-item { padding: 10px 14px; }
  .letter-tile { width: 36px; height: 42px; font-size: 1.1rem; }
}

/* Hide scrollbar but allow scroll */
body::-webkit-scrollbar { width: 6px; }
body::-webkit-scrollbar-track { background: transparent; }
body::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.3); border-radius: 3px; }
