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

:root {
  --primary:      #7C4DFF;
  --primary-dark: #5B2FD1;
  --accent:       #FF6B35;
  --accent2:      #00D9B1;
  --bg:           #0A0A12;
  --surface:      #14142A;
  --surface2:     #1E1E38;
  --text:         #F0F0FF;
  --text-muted:   #8080A8;
  --danger:       #FF4560;
  --warning:      #FFB020;
  --success:      #00E396;
  --radius:       14px;
  --shadow:       0 8px 32px rgba(0,0,0,0.5);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── Tipografía ────────────────────────────────────────────────────── */
h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 1.05rem; font-weight: 600; }
p  { color: var(--text-muted); line-height: 1.6; }

/* ─── Layout ────────────────────────────────────────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 1rem; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.06);
}

/* ─── Botones ───────────────────────────────────────────────────────── */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(124,77,255,0.35);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124,77,255,0.45);
}
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { filter: brightness(0.85); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ─── Option letter badge ───────────────────────────────────────────── */
.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
}

/* ─── Game over screen ──────────────────────────────────────────────── */
.gameover-screen {
  text-align: center;
  padding: 3rem 1rem;
  background: rgba(255,69,96,0.05);
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  margin: 1rem 0;
}

/* ─── Waiting screen (genérico) ─────────────────────────────────────── */
.waiting-screen {
  text-align: center;
  padding: 3rem 1rem;
}
.waiting-screen .big-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: block;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.08); } }

/* ─── Ranking table (admin) ─────────────────────────────────────────── */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.ranking-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.ranking-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.ranking-table tr:hover td { background: rgba(255,255,255,0.025); }
.rank-badge { font-weight: 800; color: var(--text-muted); }
.rank-badge.gold   { color: #FFD700; }
.rank-badge.silver { color: #B0B0C0; }
.rank-badge.bronze { color: #CD8B40; }
.group-name { font-weight: 700; }
.col-cash  { color: var(--accent2); font-weight: 600; }
.col-score { font-weight: 800; font-size: 1rem; }
.gameover-row td { opacity: 0.4; }
.vote-chip {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
}
.no-vote { color: var(--text-muted); font-size: 0.8rem; }

/* ─── Vote progress (admin) ─────────────────────────────────────────── */
.vote-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.vote-bar-wrap { flex: 1; background: var(--surface2); border-radius: 999px; height: 8px; }
.vote-bar { height: 8px; border-radius: 999px; background: var(--accent2); transition: width 0.5s; }
.vote-count { font-weight: 700; color: var(--accent2); font-size: 0.88rem; white-space: nowrap; }

/* ─── Final ranking ─────────────────────────────────────────────────── */
.final-ranking { padding: 0.5rem 0; }
.final-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface2);
  border-radius: 12px;
  margin-bottom: 0.5rem;
}
.final-rank { font-size: 1.5rem; font-weight: 800; min-width: 2rem; text-align: center; }
.final-name { font-weight: 700; font-size: 0.95rem; flex: 1; }
.final-score { font-weight: 800; color: var(--accent2); font-size: 1.05rem; }

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.1rem; }
}
