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

:root {
  --bg-dark: #0d1117;
  --bg-card: #161b22;
  --accent: #238636;
  --accent-hover: #2ea043;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --arena-green: #1a472a;
  --goal-left: #2563eb;
  --goal-right: #dc2626;
  --border: #30363d;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior-y: none;
}

html {
  height: 100dvh;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* ── Menü ── */

#menu-screen {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(35, 134, 54, 0.15) 0%, transparent 60%),
    var(--bg-dark);
}

.menu-container {
  text-align: center;
  padding: 2rem;
}

.menu-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #fff 0%, #fbbf24 45%, #58a6ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 240px;
}

.menu-btn {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.menu-btn:hover {
  background: #21262d;
  border-color: #484f58;
}

.menu-btn:active {
  transform: scale(0.98);
}

.menu-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-size: 1.15rem;
  padding: 1rem 1.5rem;
}

.menu-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ── Modal pencere ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.modal h2 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.modal p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  text-align: left;
  white-space: pre-line;
}

/* ── Oyun ── */

#game-screen {
  background: var(--bg-dark);
  align-items: stretch;
  position: relative;
  min-height: 0;
  height: 100dvh;
}

.game-top {
  width: 100%;
  padding: max(0.5rem, env(safe-area-inset-top)) 1rem 0.35rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.back-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.15s, border-color 0.15s;
}

.back-btn:hover {
  color: var(--text);
  border-color: #484f58;
}

.music-btn {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.music-btn:hover {
  border-color: #484f58;
  background: #21262d;
}

.music-btn:active {
  transform: scale(0.95);
}

.music-btn.is-muted {
  opacity: 0.65;
  border-color: #484f58;
}

.game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 3vh, 1.5rem);
  min-height: 0;
  width: 100%;
  padding: 0 clamp(0.75rem, 4vw, 1.5rem) clamp(0.75rem, 3vh, 1.25rem);
}

/* Arenanın üstündeki HUD */
.game-hud {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: clamp(0.5rem, 2vh, 0.85rem) clamp(1rem, 5vw, 2rem);
  min-width: min(100%, 420px);
  width: 100%;
  max-width: 480px;
  background: rgba(22, 27, 34, 0.65);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.hud-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 5vw, 2rem);
  width: 100%;
}

.hud-team {
  flex: 1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.hud-flag-circle {
  width: clamp(56px, 14vw, 72px);
  height: clamp(56px, 14vw, 72px);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.hud-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(2.4rem, 10vw, 3.2rem);
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
  justify-content: center;
}

.hud-score-sep {
  color: var(--text-muted);
  font-weight: 600;
  opacity: 0.7;
}

.hud-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding-top: 0.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  width: 100%;
}

#half-label {
  font-size: clamp(0.7rem, 2.5vw, 0.8rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

#game-timer {
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.hud-team-name {
  font-size: clamp(0.65rem, 2.8vw, 0.8rem);
  color: var(--text-muted);
  max-width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.game-area {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  max-width: min(100vw - 24px, 100%);
  min-height: 0;
  min-width: 0;
  position: relative;
}

#game-canvas {
  display: block;
  border-radius: 50%;
  box-shadow:
    0 0 0 4px var(--border),
    0 0 60px rgba(35, 134, 54, 0.2);
}

/* Gol — flaş */
.goal-flash {
  animation: goalFlash 0.6s ease-out;
}

@keyframes goalFlash {
  0% { filter: brightness(2); }
  100% { filter: brightness(1); }
}

/* ── Turnuva seçimi ── */

#setup-screen {
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(35, 134, 54, 0.12) 0%, transparent 55%),
    var(--bg-dark);
}

.setup-container {
  width: 100%;
  max-width: 640px;
  padding: 1.25rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.setup-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.setup-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.stage-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
}

.stage-btn:hover {
  border-color: #484f58;
  background: #21262d;
}

.stage-btn.active {
  border-color: var(--accent);
  background: rgba(35, 134, 54, 0.12);
}

.stage-btn-label {
  font-weight: 700;
  font-size: 1rem;
}

.stage-btn-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.setup-info {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.team-grid-wrap {
  max-height: min(50vh, 420px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 0.45rem;
}

.team-card.disabled,
.team-card.locked {
  opacity: 0.35;
  cursor: not-allowed;
}

.team-card.in-bracket {
  border-color: #58a6ff;
  background: rgba(88, 166, 255, 0.08);
}

.team-card.my-team {
  border-color: var(--accent);
  background: rgba(35, 134, 54, 0.15);
  box-shadow: 0 0 0 2px rgba(35, 134, 54, 0.35);
}

.team-card-badge {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.4rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.team-card:hover {
  border-color: #484f58;
}

.team-card.selected {
  border-color: var(--accent);
  background: rgba(35, 134, 54, 0.1);
}

.team-card-flag {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.team-card-name {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
}

.pick-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pick-hint.hidden {
  display: none;
}

.setup-start {
  margin-top: 0.25rem;
}

.setup-start:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Oyun: aşama ── */

.game-stage {
  flex: 1;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bracket-bar.hidden {
  display: none;
}

/* Elendikten sonra seyirci modu */
.spectator-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.35rem 1rem;
  background: rgba(220, 38, 38, 0.12);
  border-bottom: 1px solid rgba(220, 38, 38, 0.25);
  flex-shrink: 0;
  width: 100%;
}

.spectator-bar.hidden {
  display: none;
}

.spectator-text {
  font-size: 0.85rem;
  color: #fca5a5;
  font-weight: 600;
}

/* Turnuva ağacı — tek satır, arena yüksekliğini yemez */
.bracket-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  padding: 0.25rem 1rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.bracket-chip {
  box-sizing: border-box;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: opacity 0.3s, border-color 0.2s, background 0.2s;
  overflow: hidden;
}

.bracket-chip-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  height: 100%;
  padding: 0.15rem;
}

.bracket-chip img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.bracket-chip-name {
  font-size: 0.45rem;
  color: var(--text-muted);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  line-height: 1;
  display: none;
}

.bracket-chip.playing {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.12);
}

.bracket-chip.player-team img {
  border-color: var(--accent);
}

.bracket-chip.eliminated {
  opacity: 0.25;
  filter: grayscale(1);
}

.bracket-chip.eliminated .bracket-chip-name {
  text-decoration: line-through;
}

.bracket-chip.champion {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.15);
}

.bracket-chip.champion img {
  border-color: #ffd700;
}

/* Devre arası */
.halftime-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 4;
  pointer-events: none;
}

.halftime-overlay.hidden {
  display: none;
}

.halftime-title {
  font-size: 1.6rem;
  font-weight: 800;
}

.halftime-sub {
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Final galibiyeti */
#game-screen.final-mode .game-top,
#game-screen.final-mode .bracket-bar,
#game-screen.final-mode .game-hud,
#game-screen.final-mode .game-area {
  visibility: hidden;
  pointer-events: none;
}

.final-win-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  z-index: 50;
}

.final-win-screen.hidden {
  display: none;
}

#final-confetti-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.final-win-label {
  position: relative;
  z-index: 1;
  font-size: clamp(3rem, 12vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #ffd700;
  text-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.final-win-flag {
  position: relative;
  z-index: 1;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #ffd700;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.45);
  margin-top: 1.25rem;
  animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.final-win-name {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
}

/* Galibiyet + konfeti */
#confetti-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.victory-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 3;
  pointer-events: none;
  animation: fadeIn 0.3s ease;
}

.victory-overlay.hidden {
  display: none;
}

.victory-flag {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffd700;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.victory-name {
  margin-top: 1rem;
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  padding: 0 1rem;
}

.victory-sub {
  margin-top: 0.35rem;
  font-size: 1rem;
  color: var(--text-muted);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ── Mobil sürüm ── */

@media (max-width: 640px) {
  #game-screen {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .game-top {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .game-stage {
    font-size: 0.75rem;
    text-align: right;
  }

  .back-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
  }

  .game-body {
    justify-content: center;
    gap: clamp(1rem, 4vh, 1.75rem);
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .game-hud {
    max-width: 100%;
    padding: 0.85rem 1rem 0.75rem;
    border-radius: 18px;
  }

  .hud-row {
    gap: 0.75rem;
  }

  .hud-flag-circle {
    width: clamp(64px, 18vw, 80px);
    height: clamp(64px, 18vw, 80px);
  }

  .hud-score {
    font-size: clamp(2.6rem, 12vw, 3.4rem);
  }

  #game-timer {
    font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  }

  .game-area {
    flex: 1 1 0;
    width: 100%;
    min-height: min(52vw, 52vh);
  }
}

/* ── Quiz ── */

.menu-btn-quiz {
  background: linear-gradient(135deg, #1f3a5f 0%, #2563eb 100%);
  border-color: #3b82f6;
  color: #fff;
}

.menu-btn-quiz:hover {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  border-color: #60a5fa;
}

#quiz-screen {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(37, 99, 235, 0.12) 0%, transparent 55%),
    var(--bg-dark);
  overflow-y: auto;
}

.quiz-wrap {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem max(2rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100%;
}

.quiz-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quiz-heading {
  font-size: 1.25rem;
  font-weight: 700;
  flex: 1;
  text-align: center;
}

.quiz-panel.hidden {
  display: none;
}

.quiz-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: quizFadeIn 0.35s ease;
}

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

.quiz-intro-hero {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.quiz-intro-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.quiz-intro-hero h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.quiz-intro-hero p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.quiz-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.quiz-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  text-align: center;
}

.quiz-stat-val {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: #58a6ff;
}

.quiz-stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: block;
}

.quiz-rules-list {
  list-style: none;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.quiz-rules-list strong {
  color: #93c5fd;
}

.quiz-start-btn {
  width: 100%;
}

.quiz-hud {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.quiz-hud-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  text-align: center;
}

.quiz-score-box {
  border-color: rgba(35, 134, 54, 0.4);
  background: rgba(35, 134, 54, 0.1);
}

.quiz-hud-label,
.quiz-streak-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quiz-hud-value {
  font-size: 1.4rem;
  font-weight: 800;
}

.quiz-streak-badge.hot {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  animation: streakPulse 0.6s ease;
}

@keyframes streakPulse {
  50% { transform: scale(1.04); }
}

.quiz-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #58a6ff);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.quiz-progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  display: block;
}

.quiz-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
}

.quiz-question-num {
  font-size: 0.75rem;
  color: #58a6ff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.quiz-question-text {
  font-size: clamp(1.05rem, 3.5vw, 1.2rem);
  font-weight: 600;
  line-height: 1.45;
  margin-top: 0.5rem;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.quiz-options.locked {
  pointer-events: none;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.quiz-option:hover:not(:disabled) {
  border-color: #58a6ff;
  background: rgba(88, 166, 255, 0.08);
}

.quiz-option:active:not(:disabled) {
  transform: scale(0.98);
}

.quiz-option-letter {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.quiz-option.is-correct {
  border-color: var(--accent);
  background: rgba(35, 134, 54, 0.2);
}

.quiz-option.is-correct .quiz-option-letter {
  background: var(--accent);
  color: #fff;
}

.quiz-option.is-wrong {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.15);
}

.quiz-option.is-wrong .quiz-option-letter {
  background: #dc2626;
  color: #fff;
}

.quiz-feedback {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  animation: quizFadeIn 0.25s ease;
}

.quiz-feedback.hidden {
  display: none;
}

.quiz-feedback.correct {
  background: rgba(35, 134, 54, 0.2);
  border: 1px solid var(--accent);
  color: #86efac;
}

.quiz-feedback.wrong {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid #dc2626;
  color: #fca5a5;
}

.quiz-fb-icon {
  font-size: 1.2rem;
  font-weight: 700;
}

.quiz-result-hero {
  text-align: center;
  padding: 1rem 0;
}

.quiz-ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 1rem;
}

.quiz-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.quiz-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.quiz-ring-fill {
  fill: none;
  stroke: #58a6ff;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.quiz-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.quiz-ring-center span {
  font-size: 1.75rem;
  font-weight: 800;
}

.quiz-ring-center small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.quiz-new-record {
  color: #fbbf24;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.quiz-new-record.hidden {
  display: none;
}

.quiz-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.quiz-result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.quiz-result-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  text-align: center;
}

.quiz-result-val {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
}

.quiz-result-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.quiz-result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

@media (max-width: 480px) {
  .quiz-options {
    grid-template-columns: 1fr;
  }

  .quiz-heading {
    font-size: 1.1rem;
    margin-right: 0;
  }

  .quiz-header {
    flex-wrap: wrap;
  }
}
