/* ============================================================
   FANZONE-TRIVIA.CSS — Trivia Challenge specific styles
   Visual Identity: "The Quiz Show" — amber accent, neon timer
   ============================================================ */

/* ─── MODE + CATEGORY SELECTORS ───────────────────────── */
.fz-trivia-setup {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-lg, 1.5rem) var(--space-md, 1rem);
}

.fz-setup-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted, #8a9bb8);
  margin-bottom: var(--space-sm, 0.75rem);
  font-weight: 600;
}

.fz-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm, 0.75rem);
  margin-bottom: var(--space-lg, 1.5rem);
}

@media (min-width: 640px) {
  .fz-mode-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.fz-mode-btn {
  background: var(--ink-2, #121a30);
  border: 2px solid var(--ink-line, #2a3a5c);
  border-radius: 12px;
  padding: var(--space-md, 1rem) var(--space-sm, 0.75rem);
  color: var(--ink-text, #eef1fb);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  touch-action: manipulation;
}

.fz-mode-btn:hover {
  border-color: var(--page-accent, #f2b705);
  background: var(--ink-3, #1a2540);
}

.fz-mode-btn.selected {
  border-color: var(--page-accent, #f2b705);
  background: var(--page-accent-soft, rgba(242, 183, 5, 0.15));
  color: var(--page-accent, #f2b705);
}

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

.fz-mode-btn-name {
  font-weight: 700;
  font-size: 15px;
}

.fz-mode-btn-desc {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 400;
}

/* Category pills */
.fz-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs, 0.5rem);
  margin-bottom: var(--space-lg, 1.5rem);
}

@media (max-width: 640px) {
  .fz-category-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .fz-category-pills::-webkit-scrollbar {
    display: none;
  }
  .fz-category-pill {
    flex: 0 0 auto;
    min-width: 120px;
    scroll-snap-align: start;
  }
}

.fz-category-pill {
  background: var(--ink-2, #121a30);
  border: 1px solid var(--ink-line, #2a3a5c);
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-text, #eef1fb);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  touch-action: manipulation;
}

.fz-category-pill:hover {
  border-color: var(--page-accent, #f2b705);
}

.fz-category-pill.selected {
  border-color: var(--page-accent, #f2b705);
  background: var(--page-accent-soft, rgba(242, 183, 5, 0.15));
  color: var(--page-accent, #f2b705);
}

.fz-start-btn {
  width: 100%;
  min-height: 52px;
  background: var(--page-accent, #f2b705);
  color: var(--ink, #0a0f1e);
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  touch-action: manipulation;
}

.fz-start-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 16px rgba(242, 183, 5, 0.3);
}

.fz-start-btn:active {
  transform: scale(0.97);
}

.fz-start-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

/* ─── QUESTION AREA ────────────────────────────────────── */
.fz-trivia-game {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--space-md, 1rem) var(--space-xl, 2rem);
  display: none;
}

.fz-trivia-game.active {
  display: block;
}

/* Timer bar */
.fz-timer-bar-container {
  position: sticky;
  top: 109px; /* below subnav */
  z-index: 50;
  background: var(--ink, #0a0f1e);
  padding: 8px 0 4px;
  margin: 0 calc(-1 * var(--space-md, 1rem));
  padding-left: var(--space-md, 1rem);
  padding-right: var(--space-md, 1rem);
}

.fz-timer-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--ink-3, #1a2540);
  overflow: hidden;
}

.fz-timer-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    var(--page-accent, #f2b705),
    var(--page-accent, #f2b705)
  );
  transition: width 1s linear;
  width: 100%;
}

.fz-timer-fill.warning {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
  animation: timerPulse 0.5s ease-in-out infinite;
}

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

/* Streak indicator */
.fz-streak-indicator {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: var(--space-sm, 0.75rem);
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  color: var(--ink-muted, #8a9bb8);
}

.fz-streak-flame {
  font-size: 16px;
  transition:
    font-size 0.3s ease,
    text-shadow 0.3s ease;
}

.fz-streak-flame[data-streak="0"] {
  font-size: 14px;
  opacity: 0.4;
}
.fz-streak-flame[data-streak="1"] {
  font-size: 16px;
}
.fz-streak-flame[data-streak="2"] {
  font-size: 18px;
}
.fz-streak-flame[data-streak="3"] {
  font-size: 20px;
  text-shadow: 0 0 6px rgba(242, 183, 5, 0.5);
}
.fz-streak-flame[data-streak="4"] {
  font-size: 22px;
  text-shadow: 0 0 8px rgba(242, 183, 5, 0.6);
}
.fz-streak-flame[data-streak="5"],
.fz-streak-flame[data-streak="6"],
.fz-streak-flame[data-streak="7"],
.fz-streak-flame[data-streak="8"],
.fz-streak-flame[data-streak="9"] {
  font-size: 24px;
  text-shadow: 0 0 10px rgba(242, 183, 5, 0.7);
}
.fz-streak-flame[data-streak="10"] {
  font-size: 28px;
  text-shadow: 0 0 14px rgba(242, 183, 5, 0.8);
}

/* Question card */
.fz-question-card {
  background: var(--ink-2, #121a30);
  border: 1px solid var(--ink-line, #2a3a5c);
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-lg, 1.5rem);
  margin-bottom: var(--space-md, 1rem);
}

.fz-question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md, 1rem);
}

.fz-question-category {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--page-accent, #f2b705);
  font-weight: 600;
}

.fz-difficulty-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 9999px;
  font-family: var(--font-mono, monospace);
}

.fz-difficulty-badge.easy {
  background: rgba(43, 207, 156, 0.15);
  color: #2bcf9c;
  border: 1px solid rgba(43, 207, 156, 0.3);
}
.fz-difficulty-badge.medium {
  background: rgba(242, 183, 5, 0.15);
  color: #f2b705;
  border: 1px solid rgba(242, 183, 5, 0.3);
}
.fz-difficulty-badge.hard {
  background: rgba(230, 126, 34, 0.15);
  color: #e67e22;
  border: 1px solid rgba(230, 126, 34, 0.3);
}
.fz-difficulty-badge.expert {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.fz-question-text {
  font-family: var(--font-body, sans-serif);
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 600;
  color: var(--ink-text, #eef1fb);
  line-height: 1.5;
  margin-bottom: var(--space-lg, 1.5rem);
  text-align: center;
}

/* Option buttons */
.fz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, 0.75rem);
}

.fz-option-btn {
  background: var(--ink-3, #1a2540);
  border: 2px solid var(--ink-line, #2a3a5c);
  border-radius: 12px;
  padding: var(--space-md, 1rem) var(--space-lg, 1.5rem);
  color: var(--ink-text, #eef1fb);
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: var(--space-sm, 0.75rem);
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
}

.fz-option-btn:hover:not(.locked) {
  border-color: var(--page-accent, #f2b705);
  background: rgba(242, 183, 5, 0.08);
}

.fz-option-btn:active:not(.locked) {
  transform: scale(0.98);
}

.fz-option-btn.selected {
  border-color: var(--page-accent, #f2b705);
  background: var(--page-accent-soft, rgba(242, 183, 5, 0.15));
}

.fz-option-btn.correct {
  border-color: #2bcf9c;
  background: rgba(43, 207, 156, 0.15);
  animation: correctFlash 0.5s ease-out;
}

.fz-option-btn.wrong {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.15);
  animation: wrongShake 0.4s ease-out;
}

.fz-option-btn.locked {
  cursor: default;
  opacity: 0.4;
}

.fz-option-btn.locked:not(.correct):not(.wrong) {
  opacity: 0.3;
}

.fz-option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink-line, #2a3a5c);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  flex-shrink: 0;
  color: var(--ink-text, #eef1fb);
}

.fz-option-btn.correct .fz-option-letter {
  background: #2bcf9c;
  color: var(--ink, #0a0f1e);
}

.fz-option-btn.wrong .fz-option-letter {
  background: #e74c3c;
  color: var(--ink, #0a0f1e);
}

@keyframes correctFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(43, 207, 156, 0.4);
  }
  50% {
    box-shadow: 0 0 20px 4px rgba(43, 207, 156, 0.3);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(43, 207, 156, 0);
  }
}

@keyframes wrongShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}

/* Explanation */
.fz-explanation {
  margin-top: var(--space-md, 1rem);
  padding: var(--space-md, 1rem);
  background: var(--ink-3, #1a2540);
  border-radius: 12px;
  border-left: 3px solid var(--page-accent, #f2b705);
  font-size: 14px;
  color: var(--ink-text, #eef1fb);
  opacity: 0.85;
  line-height: 1.5;
  display: none;
}

.fz-explanation.show {
  display: block;
  animation: fadeInUp 0.3s ease;
}

.fz-explanation-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--page-accent, #f2b705);
  font-weight: 700;
  margin-bottom: 4px;
}

/* ─── RESULTS SCREEN ───────────────────────────────────── */
.fz-trivia-results {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-xl, 2rem) var(--space-md, 1rem);
  text-align: center;
  display: none;
}

.fz-trivia-results.active {
  display: block;
  animation: fadeInUp 0.5s ease;
}

.fz-results-score {
  font-family: var(--font-mono, monospace);
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 800;
  color: var(--page-accent, #f2b705);
  line-height: 1;
  margin-bottom: 4px;
  text-shadow: 0 2px 12px rgba(242, 183, 5, 0.3);
}

.fz-results-score-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted, #8a9bb8);
  margin-bottom: var(--space-lg, 1.5rem);
}

.fz-results-breakdown {
  background: var(--ink-2, #121a30);
  border: 1px solid var(--ink-line, #2a3a5c);
  border-radius: 12px;
  padding: var(--space-lg, 1.5rem);
  margin-bottom: var(--space-lg, 1.5rem);
  text-align: left;
}

.fz-results-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--ink-line, #2a3a5c);
}

.fz-results-row:last-child {
  border-bottom: none;
  padding-top: var(--space-sm, 0.75rem);
}

.fz-results-row:last-child .fz-results-row-value {
  font-weight: 800;
  color: var(--page-accent, #f2b705);
  font-size: 18px;
}

.fz-results-row-label {
  font-size: 14px;
  color: var(--ink-muted, #8a9bb8);
}

.fz-results-row-value {
  font-family: var(--font-mono, monospace);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-text, #eef1fb);
}

.fz-results-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, 0.75rem);
}

.fz-results-actions .fz-btn {
  width: 100%;
}

/* ─── SIDEBAR (desktop) ────────────────────────────────── */
.fz-trivia-sidebar {
  display: none;
}

@media (min-width: 960px) {
  .fz-trivia-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-lg, 1.5rem);
    max-width: 960px;
    margin: 0 auto;
  }

  .fz-trivia-sidebar {
    display: block;
  }
}

.fz-sidebar-card {
  background: var(--ink-2, #121a30);
  border: 1px solid var(--ink-line, #2a3a5c);
  border-radius: 12px;
  padding: var(--space-md, 1rem);
  margin-bottom: var(--space-md, 1rem);
}

.fz-sidebar-card-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted, #8a9bb8);
  font-weight: 600;
  margin-bottom: var(--space-sm, 0.75rem);
}

.fz-sidebar-card-value {
  font-family: var(--font-mono, monospace);
  font-size: 24px;
  font-weight: 800;
  color: var(--page-accent, #f2b705);
}

.fz-sidebar-tip {
  font-size: 13px;
  color: var(--ink-text, #eef1fb);
  opacity: 0.8;
  line-height: 1.5;
}

/* ─── PROGRESS DOTS ────────────────────────────────────── */
.fz-progress-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: var(--space-md, 1rem);
}

.fz-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-line, #2a3a5c);
  transition: background 0.3s;
}

.fz-progress-dot.current {
  background: var(--page-accent, #f2b705);
  box-shadow: 0 0 6px rgba(242, 183, 5, 0.4);
}

.fz-progress-dot.correct {
  background: #2bcf9c;
}

.fz-progress-dot.wrong {
  background: #e74c3c;
}

/* ─── DAILY LOCK ──────────────────────────────────────── */
.fz-daily-locked {
  text-align: center;
  padding: var(--space-xl, 2rem);
  color: var(--ink-muted, #8a9bb8);
}

.fz-daily-locked-icon {
  font-size: 48px;
  margin-bottom: var(--space-md, 1rem);
}

.fz-daily-locked-text {
  font-size: 16px;
  margin-bottom: var(--space-md, 1rem);
}

/* ─── REDUCED MOTION ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .fz-timer-fill.warning,
  .fz-option-btn.correct,
  .fz-option-btn.wrong,
  .fz-trivia-results.active {
    animation: none !important;
  }

  .fz-timer-fill {
    transition: none;
  }
}

/* ─── NEXT QUESTION BUTTON (in question card) ─────────── */
#fz-next-question {
  width: 100%;
  margin-top: var(--space-md, 1rem);
  min-height: 52px;
  font-size: 16px;
  font-weight: 700;
  background: var(--page-accent, #f2b705);
  color: var(--ink, #0a0f1e);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  touch-action: manipulation;
  animation: fadeInUp 0.3s ease;
}

#fz-next-question:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 16px rgba(242, 183, 5, 0.3);
}

#fz-next-question:active {
  transform: scale(0.97);
}

/* Keep question card compact — no extra spacing after answering */
.fz-question-card {
  transition: padding 0.3s ease;
}

/* Make sure explanation + next button are visible together */
.fz-explanation.show + #fz-next-question {
  margin-top: var(--space-md, 1rem);
}

/* Streak indicator: keep it visible above all sticky chrome.
   The old override shifted the timer bar down 57px (position:relative;
   top:57px), painting it over the progress dots and streak indicator. */
.fz-streak-indicator {
  position: relative;
  z-index: 40;
  background: var(--ink, #0a0f1e);
}
