/* =============================================
   TechTrivia — style.css
   Aesthetic: Bold editorial dark mode
   Fonts: Bebas Neue (display) + Space Mono (code) + DM Sans (body)
   ============================================= */

/* ---------- RESET & VARIABLES ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #1a1a1a;
  --border: #2a2a2a;
  --accent: #caff00; /* Electric lime — the hero color */
  --accent-dim: rgba(202, 255, 0, 0.12);
  --red: #ff4545;
  --red-dim: rgba(255, 69, 69, 0.12);
  --green: #00e87b;
  --green-dim: rgba(0, 232, 123, 0.12);
  --text: #f0ede8;
  --text-muted: #666;
  --text-dim: #444;

  --font-display: "Bebas Neue", sans-serif;
  --font-mono: "Space Mono", monospace;
  --font-body: "DM Sans", sans-serif;

  --radius: 10px;
  --radius-lg: 18px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- SCREENS ---------- */
.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none !important;
}

/* ============================================
   START SCREEN
   ============================================ */
#start-screen {
  position: relative;
  overflow: hidden;
}

/* Animated grid background */
.start-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(202, 255, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(202, 255, 0, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridShift 20s linear infinite;
}
@keyframes gridShift {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 48px 48px;
  }
}

.start-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
  max-width: 520px;
  animation: fadeUp 0.6s var(--ease) both;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.game-title {
  font-family: var(--font-display);
  font-size: clamp(80px, 18vw, 140px);
  line-height: 0.9;
  letter-spacing: 2px;
  color: var(--text);
  margin-bottom: 20px;
}

.game-title span {
  color: var(--accent);
  -webkit-text-stroke: 2px var(--accent);
}

.game-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

.start-meta {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.meta-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 100px;
}

.btn-start {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 2px;
  padding: 14px 48px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.2s;
  box-shadow: 0 0 0 0 rgba(202, 255, 0, 0);
}

.btn-start:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(202, 255, 0, 0.3);
}

.btn-start:active {
  transform: translateY(0);
}

.start-note {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ============================================
   QUIZ SCREEN
   ============================================ */
#quiz-screen {
  flex-direction: column;
  justify-content: flex-start;
  padding: 0;
}

.quiz-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.quiz-logo {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.quiz-logo b {
  color: var(--accent);
}

.quiz-meta {
  display: flex;
  gap: 20px;
  align-items: center;
}

.timer-wrap,
.score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.timer-label,
.score-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.timer-val {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--accent);
  letter-spacing: 1px;
  transition: color 0.3s;
  min-width: 36px;
  text-align: center;
}

.timer-val.urgent {
  color: var(--red);
  animation: timerPulse 0.5s ease infinite alternate;
}
@keyframes timerPulse {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.5;
  }
}

.score-val {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text);
  letter-spacing: 1px;
  min-width: 36px;
  text-align: center;
}

/* Quiz body */
.quiz-body {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeUp 0.4s var(--ease) both;
}

/* Progress */
.progress-wrap {
  background: var(--surface-2);
  border-radius: 100px;
  height: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  width: 10%;
  transition: width 0.5s var(--ease);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: -12px;
}

/* Question card */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  animation: cardIn 0.35s var(--ease) both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.question-category {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.question-text {
  font-family: var(--font-body);
  font-size: clamp(17px, 2.5vw, 20px);
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

/* Options grid */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.option-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.15s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: optionIn 0.3s var(--ease) both;
}

.option-btn:nth-child(1) {
  animation-delay: 0.05s;
}
.option-btn:nth-child(2) {
  animation-delay: 0.1s;
}
.option-btn:nth-child(3) {
  animation-delay: 0.15s;
}
.option-btn:nth-child(4) {
  animation-delay: 0.2s;
}

@keyframes optionIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.option-letter {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--surface-2);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background 0.2s,
    color 0.2s;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
}

.option-btn:hover:not(:disabled) .option-letter {
  background: var(--accent);
  color: #000;
}

/* Correct answer */
.option-btn.correct {
  border-color: var(--green);
  background: var(--green-dim);
}
.option-btn.correct .option-letter {
  background: var(--green);
  color: #000;
}

/* Wrong answer */
.option-btn.wrong {
  border-color: var(--red);
  background: var(--red-dim);
}
.option-btn.wrong .option-letter {
  background: var(--red);
  color: #fff;
}

/* Dimmed (other options after answering) */
.option-btn.dimmed {
  opacity: 0.35;
  pointer-events: none;
}

.option-btn:disabled {
  cursor: not-allowed;
}

/* Feedback bar */
.feedback-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  animation: feedbackIn 0.25s var(--ease);
}

@keyframes feedbackIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.feedback-bar.correct {
  background: var(--green-dim);
  border: 1px solid var(--green);
  color: var(--green);
}
.feedback-bar.wrong {
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
}

.feedback-icon {
  font-size: 20px;
}

/* Next button */
.btn-next {
  background: var(--accent);
  color: #000;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 2px;
  padding: 14px 36px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  align-self: flex-end;
  transition:
    transform 0.15s,
    box-shadow 0.2s;
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(202, 255, 0, 0.25);
}

/* ============================================
   RESULTS SCREEN
   ============================================ */
#results-screen {
  align-items: flex-start;
  padding: 0;
}

.results-content {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  animation: fadeUp 0.5s var(--ease) both;
}

.results-rank {
  font-size: 56px;
  text-align: center;
  margin-bottom: 12px;
  animation: rankBounce 0.6s var(--ease) 0.2s both;
}

@keyframes rankBounce {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  70% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.results-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 64px);
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text);
}

.results-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 36px;
}

/* Score card */
.results-score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin-bottom: 32px;
}

.results-big-score {
  font-family: var(--font-display);
  font-size: 72px;
  color: var(--accent);
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 24px;
}

.results-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-val {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--text);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Review section */
.review-section {
  margin-bottom: 36px;
}

.review-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.review-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
  animation: fadeUp 0.3s var(--ease) both;
}

.review-item.correct {
  border-left: 3px solid var(--green);
}
.review-item.wrong {
  border-left: 3px solid var(--red);
}

.review-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.review-q {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 3px;
}

.review-answer {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.review-answer .correct-ans {
  color: var(--green);
}
.review-answer .wrong-ans {
  color: var(--red);
  text-decoration: line-through;
}

/* Restart button */
.btn-restart {
  display: block;
  width: 100%;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 3px;
  padding: 16px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.15s;
}

.btn-restart:hover {
  background: var(--accent);
  color: #000;
  transform: translateY(-2px);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 540px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
  .results-stats {
    gap: 24px;
  }
  .cta-box {
    padding: 40px 24px;
  }
  .btn-next {
    align-self: stretch;
    text-align: center;
  }
}
