:root {
  --bg-top: #0f1226;
  --bg-bottom: #1a1040;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #eef0ff;
  --text-dim: #a7acd9;
  --accent: #7dd8ff;
  --accent-2: #b487ff;
  --correct: #4ade80;
  --incorrect: #fb7185;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 20% -10%, var(--bg-bottom), var(--bg-top) 60%);
}

header h1 {
  font-size: 1.75rem;
  margin: 0 0 1.5rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.02em;
}

[hidden] {
  display: none !important;
}

#setup-screen,
#quiz-screen,
#results-screen {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

label {
  color: var(--text-dim);
  font-size: 0.9rem;
}

select {
  font-size: 1rem;
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

select option {
  background: #1a1040;
  color: var(--text);
}

input[type='checkbox'] {
  accent-color: var(--accent);
}

#choices-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#choices-list button {
  text-align: left;
  padding: 0.75rem 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: normal;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

#choices-list button:not(:disabled):hover {
  border-color: var(--accent);
  background: rgba(125, 216, 255, 0.1);
  transform: translateY(-1px);
}

#choices-list button.correct {
  border-color: var(--correct);
  background: rgba(74, 222, 128, 0.15);
}

#choices-list button.incorrect {
  border-color: var(--incorrect);
  background: rgba(251, 113, 133, 0.15);
}

#choices-list button:disabled {
  cursor: default;
}

button {
  font-size: 1rem;
  padding: 0.7rem 1.3rem;
  border-radius: 16px;
  border: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0f1226;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

#timer-display,
#score-display,
#difficulty-badge {
  display: inline-block;
  width: fit-content;
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
}

#timer-display {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent);
}

#passage {
  color: var(--text-dim);
  line-height: 1.5;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
}

#explanation {
  line-height: 1.5;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(180, 135, 255, 0.1);
  border: 1px solid var(--panel-border);
}

.cat-mascot-wrap {
  position: fixed;
  top: 50%;
  user-select: none;
  pointer-events: none;
}

.cat-mascot-left {
  left: 1.5rem;
  transform: translateY(-50%) scaleX(-1);
}

.cat-mascot-right {
  right: 1.5rem;
  transform: translateY(-50%);
}

.cat-mascot {
  display: block;
  font-size: 24rem;
  line-height: 1;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
}

.cat-mascot.cheer {
  animation: cat-cheer 0.5s ease;
}

.cat-mascot.frown {
  animation: cat-frown 0.4s ease;
}

@keyframes cat-cheer {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.3) rotate(-8deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes cat-frown {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Phone layout: the desktop cats are sized to sit in unused space on either
   side of a centered card. On a narrow screen that space doesn't exist, so
   they'd cover the whole quiz - shrink them into small top-corner badges
   instead of hiding them entirely. */
@media (max-width: 700px) {
  body {
    padding: 1.5rem 1rem;
  }

  header h1 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  #setup-screen,
  #quiz-screen,
  #results-screen {
    padding: 1.25rem;
    border-radius: 18px;
    gap: 0.85rem;
  }

  .cat-mascot-wrap {
    top: 0.75rem;
    transform: none;
  }

  .cat-mascot-left {
    left: 0.75rem;
    transform: scaleX(-1);
  }

  .cat-mascot-right {
    right: 0.75rem;
    transform: none;
  }

  .cat-mascot {
    font-size: 3rem;
  }
}
