/* TechIQ daily quiz. All rules are scoped to body.techiq-page so nothing
   leaks into the rest of the site. Markup: dist/techiq/index.html,
   behaviour: /static/js/techiq.js */

/* body top padding comes from the shared layout now that the quiz uses the site header */
.techiq-page .container { max-width: 640px; margin: 0 auto; padding: 0 20px; }

/* Header: back link + wordmark */
.techiq-page > header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7,11,24,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.techiq-page .header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.techiq-page .back-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  color: #22d3ee; text-decoration: none;
  font: 700 15px 'Space Grotesk', sans-serif;
}
.techiq-page .back-link svg { width: 20px; height: 20px; }
.techiq-page .logo { margin: 0; font: 800 22px 'Space Grotesk', sans-serif; letter-spacing: -.02em; color: #f4f6fb; }
.techiq-page .logo span { color: #22d3ee; }
.techiq-page main { padding: 24px 0 48px; }

/* How to play */
.how-to-play { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; margin-bottom: 20px; overflow: hidden; }
.how-to-play-toggle {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between;
  background: none; border: 0; padding: 12px 16px; cursor: pointer;
  color: #22d3ee; font: 600 14px 'Space Grotesk', sans-serif;
}
.how-to-play-toggle svg { width: 18px; height: 18px; transition: transform .2s; }
.how-to-play-toggle.open svg { transform: rotate(180deg); }
.how-to-play-content { display: none; padding: 0 16px 14px; color: #93a0bd; font-size: 14px; line-height: 1.5; }
.how-to-play-content.open { display: block; }
.how-to-play-content ul { margin: 0; padding-left: 18px; }
.how-to-play-content li { margin: 6px 0; }

/* Streak / best / played */
.stats-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.stat { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 12px; text-align: center; }
.stat-value { font: 800 24px 'Space Grotesk', sans-serif; color: #f4f6fb; }
.stat-label { margin-top: 2px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #93a0bd; }

/* Loading */
.loading { text-align: center; color: #93a0bd; padding: 40px 0; }
.loading-spinner {
  width: 32px; height: 32px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid rgba(34,211,238,.2); border-top-color: #22d3ee;
  animation: tiq-spin .8s linear infinite;
}
@keyframes tiq-spin { to { transform: rotate(360deg); } }

/* Progress + timer */
.progress-wrap { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.progress-dots { display: flex; gap: 6px; }
.progress-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.12); }
.progress-dot.active { background: #22d3ee; box-shadow: 0 0 0 3px rgba(34,211,238,.2); }
.progress-dot.correct { background: #34d399; }
.progress-dot.wrong { background: #f87171; }
.progress-dot.timeout { background: #fbbf24; }
.progress-label { font-size: 13px; color: #93a0bd; }
.timer-bar { height: 6px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.timer-fill { height: 100%; width: 100%; background: #22d3ee; border-radius: 99px; transition: width 1s linear, background .3s; }
.timer-fill.warning { background: #fbbf24; }
.timer-fill.danger { background: #f87171; }

/* Question card */
.question-card { background: #0d1326; border: 1px solid #1e2a4a; border-radius: 16px; padding: 22px 20px; }
.question-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.category-badge { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #22d3ee; font-weight: 700; }
.difficulty-dots { display: flex; gap: 4px; }
.diff-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.12); }
.diff-dot.filled { background: #fbbf24; }
.question-text { font: 600 19px/1.4 'Space Grotesk', sans-serif; color: #f4f6fb; margin-bottom: 18px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option-btn {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 44px; text-align: left;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: 12px;
  padding: 12px 14px; color: #e8ecf6; font: 15px/1.4 'Outfit', sans-serif; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.option-btn:hover { border-color: rgba(34,211,238,.5); }
.option-btn:disabled { cursor: default; }
.option-letter {
  flex: 0 0 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(34,211,238,.12); color: #22d3ee; font: 700 13px 'Space Grotesk', sans-serif;
}
.option-btn.correct { border-color: #34d399; background: rgba(52,211,153,.12); }
.option-btn.correct .option-letter { background: #34d399; color: #070b18; }
.option-btn.wrong { border-color: #f87171; background: rgba(248,113,113,.12); }
.option-btn.wrong .option-letter { background: #f87171; color: #070b18; }
.option-btn.reveal { border-color: #34d399; }
.next-btn {
  display: none; margin-top: 16px; min-height: 44px;
  background: #22d3ee; color: #070b18; border: 0; border-radius: 10px; padding: 12px 22px;
  font: 700 15px 'Space Grotesk', sans-serif; cursor: pointer;
}
.next-btn.visible { display: inline-block; }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Results and "already played": hidden until the script shows them */
.results, .already-played { display: none; }
.results.visible, .already-played.visible { display: block; }
.results-card { background: #0d1326; border: 1px solid #1e2a4a; border-radius: 16px; padding: 28px 20px; text-align: center; }
.score-ring { position: relative; width: 140px; height: 140px; margin: 0 auto 16px; }
.score-ring svg { width: 140px; height: 140px; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 10; }
.score-ring .bg { stroke: rgba(255,255,255,.08); }
.score-ring .fg { stroke: #22d3ee; stroke-linecap: round; stroke-dasharray: 408.4; stroke-dashoffset: 408.4; transition: stroke-dashoffset 1s ease; }
.score-number { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 36px 'Space Grotesk', sans-serif; color: #f4f6fb; }
.score-number span { font-size: 16px; color: #93a0bd; margin-left: 2px; }
.rating-title { font: 800 24px 'Space Grotesk', sans-serif; margin-bottom: 4px; }
.rating-subtitle { color: #93a0bd; font-size: 14px; margin-bottom: 18px; }
.results-stats { display: flex; justify-content: center; gap: 28px; margin-bottom: 20px; }
.results-stat-value { font: 800 22px 'Space Grotesk', sans-serif; color: #f4f6fb; }
.results-stat-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #93a0bd; }
.share-btn, .play-again-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  background: #22d3ee; color: #070b18; border: 0; border-radius: 10px; padding: 12px 20px;
  font: 700 15px 'Space Grotesk', sans-serif; cursor: pointer;
}
.share-btn svg { width: 18px; height: 18px; }
.play-again-btn { margin-top: 10px; background: transparent; color: #22d3ee; border: 1px solid rgba(34,211,238,.4); }
.countdown-value { font: 800 32px 'Space Grotesk', sans-serif; color: #22d3ee; letter-spacing: .04em; }
.share-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: #22d3ee; color: #070b18; padding: 10px 18px; border-radius: 99px; font-weight: 700;
  transition: opacity .2s, transform .2s;
}
.share-toast.visible { opacity: 1; transform: translateX(-50%); }
