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

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1a1a2e;
  --panel: #16213e;
  --border: #0f3460;
  --accent: #e94560;
  --green: #4caf50;
  --blue: #3498db;
  --gold: #ffd700;
  --text: #e0e0e0;
  --muted: #888;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

body.transparent {
  background: transparent !important;
}

#scoreboard {
  width: 100%;
  max-width: 500px;
}

.view { display: block; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.transparent .panel {
  background: rgba(22, 33, 62, 0.9);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-header h2 {
  font-size: 1.1em;
  font-weight: 700;
  color: #fff;
}

.badge {
  font-size: 0.7em;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.voting {
  background: var(--green);
  color: #fff;
  animation: pulse 1.5s ease-in-out infinite;
}

.badge.closed { background: #ff9800; color: #fff; }

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

/* Vote bars */
.vote-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.vote-label {
  font-size: 0.85em;
  font-weight: 700;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.vote-bar-track {
  flex: 1;
  height: 32px;
  background: rgba(15, 52, 96, 0.6);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.vote-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 0.8em;
  font-weight: 600;
  min-width: 0;
}

.vote-bar-fill.v1 { background: var(--accent); }
.vote-bar-fill.v2 { background: var(--green); }
.vote-bar-fill.v3 { background: var(--blue); }

.vote-bar-fill.correct {
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
  border: 2px solid var(--gold);
}

.vote-bar-fill.wrong { opacity: 0.4; }

.vote-count {
  font-size: 0.8em;
  width: 40px;
  text-align: right;
  flex-shrink: 0;
  color: var(--muted);
}

.vote-total {
  text-align: center;
  font-size: 0.8em;
  color: var(--muted);
  margin-top: 4px;
}

/* Reveal */
.reveal-answer {
  text-align: center;
  margin-top: 12px;
  font-size: 1em;
  font-weight: 700;
  color: var(--gold);
}

/* Leaderboard */
.tab-bar { display: flex; gap: 4px; }

.tab {
  padding: 4px 12px;
  border: none;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
  cursor: pointer;
  background: var(--border);
  color: var(--muted);
  font-family: inherit;
}
.tab.active { background: var(--accent); color: #fff; }

.lb-table {
  width: 100%;
  border-collapse: collapse;
}

.lb-table th {
  font-size: 0.7em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
}

.lb-table td {
  padding: 8px 4px;
  font-size: 0.85em;
}

.lb-table tr:nth-child(even) { background: rgba(15, 52, 96, 0.2); }

.lb-rank {
  font-weight: 900;
  color: var(--muted);
  width: 28px;
}

.lb-rank.gold { color: var(--gold); }
.lb-rank.silver { color: #c0c0c0; }
.lb-rank.bronze { color: #cd7f32; }

.lb-name {
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-points {
  text-align: right;
  font-weight: 700;
  color: var(--accent);
}

.lb-correct {
  text-align: right;
  color: var(--muted);
  font-size: 0.8em;
}

.lb-clickable {
  cursor: pointer;
  transition: color 0.2s;
}

.lb-clickable:hover {
  color: var(--accent);
  text-decoration: underline;
}

.player-summary {
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85em;
  color: var(--muted);
}

.player-detail-table .seg-col {
  text-align: center;
  width: 28px;
  padding: 8px 2px;
  font-size: 0.8em;
}

.player-detail-table thead .seg-col {
  font-size: 0.7em;
}

.seg-correct {
  color: var(--green);
  font-weight: 700;
}

.seg-wrong {
  color: var(--accent);
  font-weight: 700;
  opacity: 0.6;
}

.seg-unknown {
  color: var(--muted);
  opacity: 0.4;
}

.player-link {
  font-size: 0.7em;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  vertical-align: middle;
}

.player-link:hover {
  opacity: 1;
}

.pts-tag {
  display: inline-block;
  font-size: 0.65em;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.pts-tag.bonus {
  background: var(--gold);
  color: #1a1a2e;
}

.pts-tag.raid {
  background: var(--blue);
  color: #fff;
}

/* Bonus banner */
.bonus-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  animation: bannerIn 0.5s ease-out;
}

.bonus-inner {
  background: linear-gradient(135deg, var(--gold), #ff8c00);
  color: #1a1a2e;
  padding: 20px 40px;
  border-radius: 12px;
  font-size: 1.4em;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
}

.bonus-star { font-size: 1.2em; margin: 0 8px; }

@keyframes bannerIn {
  from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Logo header */
.logo-header {
  text-align: center;
  margin-bottom: 16px;
}

.logo-img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.transparent .logo-header {
  display: none;
}

/* Logo card (idle) */
.logo-card {
  text-align: center;
  padding: 20px;
}

.logo-card p {
  color: var(--muted);
  font-size: 0.9em;
}
