/* =========================
   THEME VARIABLES – PASTEL COTTON-CANDY (LIGHT ONLY)
   ========================= */
:root {
  /* Base surfaces & text */
  --bg: #ffddf0;          /* lightest pink background */
  --bg-2: #ebbef3;        /* secondary lavender-pink */
  --card: rgba(255, 255, 255, 0.97);
  --card-border: rgba(0, 0, 0, 0.05);
  --text: #3d2a3f;        /* soft deep plum */
  --muted: #7a6b7e;       /* muted plum-gray */

  /* Brand & states (pastel) */
  --brand: #fc98cf;       /* pastel pink */
  --brand-2: #bdadfd;     /* pastel lavender */
  --success: #81faad;     /* pastel mint */
  --danger: #fa94a0;      /* pastel rose */
  --warn: #ffd240;        /* pastel yellow */

  --radius: 16px;
  --shadow: 0 12px 36px rgba(0, 0, 0, .06);
}

/* =========================
   BASE LAYOUT
   ========================= */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  padding: 24px;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 20% -10%, var(--bg-2), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, #acd0f0, transparent 60%), /* soft baby blue hint */
    linear-gradient(180deg, var(--bg), var(--bg));
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Animated background blobs */
body::before,
body::after {
  content: "";
  position: fixed;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .5;
  z-index: -1;
  animation: blob 24s ease-in-out infinite alternate;
}
body::before {
  top: -12vmax; left: -10vmax;
  background: radial-gradient(circle at 30% 30%, #f7ade2, transparent 60%); /* pink */
}
body::after {
  bottom: -14vmax; right: -14vmax;
  background: radial-gradient(circle at 70% 60%, #c7deff, transparent 60%); /* light blue */
  animation-delay: 6s;
}
@keyframes blob {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(2vmax,-1vmax) scale(1.04); }
  100% { transform: translate(-1vmax,2vmax) scale(0.98); }
}

/* Container cards */
#welcome-screen,
#multiple-choice {
  max-width: 900px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  animation: float-in 420ms ease both;
  transition: transform .2s ease, box-shadow .25s ease;
}
#multiple-choice{
    margin-top: 40px;
}
#welcome-screen:hover,
#multiple-choice:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(255, 163, 214, 0.2); /* pastel pink lift */
}

@keyframes float-in {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Headings */
h1 { margin: 0 0 8px; font-weight: 700; letter-spacing: .2px; color: #f187fd; }
h2, h3 { margin: 10px 0 6px; font-weight: 600; color: var(--muted); }

ol { margin: 8px 0 0 22px; }
#welcome-screen li { font-size: 1.05rem; margin-bottom: 10px; }

/* =========================
   BUTTONS (pink→lavender gradient + soft pastel glow)
   ========================= */
button {
  appearance: none;
  border: 1px solid transparent;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  color: #2d1e2f;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow:
    0 10px 22px rgba(192, 108, 154, 0.25), /* pink */
    0 2px 6px rgba(173, 134, 194, 0.15);    /* lavender */
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease, opacity .2s ease;
}
button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(249, 168, 212, .30),
    0 0 0 6px rgba(196, 181, 253, .18); /* soft pastel glow ring */
}
button:active { transform: translateY(0) scale(.99); }
button:disabled { opacity: .4; cursor: not-allowed; }

.start-button { margin-top: 16px; }
.start-button button { font-size: 1rem; }

/* Restart uses pastel mint success gradient */
#restart-btn {
  background: linear-gradient(135deg, #86efac, #bbf7d0);
  box-shadow:
    0 10px 22px rgba(82, 150, 107, 0.28),
    0 2px 6px rgba(187, 247, 208, .18);
}
#restart-btn:hover {
  box-shadow:
    0 14px 28px rgba(134, 239, 172, .34),
    0 0 0 6px rgba(119, 171, 138, 0.22);
}

/* Next & post controls */
.controls, .post-controls {
  max-width: 900px;
  margin: 12px auto 0;
  display: flex; gap: 12px; justify-content: flex-end;
}

/* =========================
   PROGRESS + SCORE + TIMER
   ========================= */
#live-score, #timer {
  font-weight: 700;
  margin: 6px 0 12px 0;
}
#live-score { color: var(--success); }

#timer {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--card-border);
  transition: background .3s ease, color .3s ease, box-shadow .3s ease;
}
#timer.low {
  color: #fff;
  background: rgba(244, 63, 94, 0.65);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0.45); }
  50% { box-shadow: 0 0 0 12px rgba(244,63,94,0); }
}

#progress { margin: 14px 0 18px; }
#progress-text { font-weight: 600; margin-bottom: 8px; color: var(--muted); }

.progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(0,0,0,0.05);
  border: 1px solid var(--card-border);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 400ms cubic-bezier(.2,.7,.2,1);
}
.progress-bar::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.35) 40%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 2.2s ease-in-out infinite;
  pointer-events: none;
  opacity: .55;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%);  }
}

/* =========================
   QUESTIONS & OPTIONS
   ========================= */
.questions { margin: 28px 0; opacity: 1; }
.questions.animate-in { animation: q-in 260ms ease both; }

@keyframes q-in {
  from { transform: translateY(6px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.questions p {
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

/* Options grid */
.multiple-answers ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  display: grid;
  gap: 10px;
}

/* Option item */
.multiple-answers li {
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.66);
  transition: transform .06s ease, background .2s ease, border-color .2s ease, box-shadow .25s ease;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  box-shadow: 0 6px 20px rgba(0,0,0,.04);
}
.multiple-answers li:hover {
  background: rgba(255,255,255,0.9);
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 10px 26px rgba(249,168,212,.16); /* pastel pink hover */
  transform: translateY(-1px);
}
.multiple-answers li:active { transform: translateY(0) scale(.995); }

/* Selected, Correct, Incorrect states (pinky accents) */
.multiple-answers li.selected {
  outline: 3px solid rgba(249, 168, 212, .32);  /* pink outline */
  background: rgba(249, 168, 212, .14);         /* pink tint */
  border-color: rgba(249, 168, 212, .45);
}
.multiple-answers li.correct {
  background: rgba(134, 239, 172, .14);
  border-color: rgba(134, 239, 172, .60);
  outline: 3px solid rgba(134, 239, 172, .35);
  animation: pop .28s ease-out;
}
@keyframes pop {
  0% { transform: scale(.98); }
  80% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
.multiple-answers li.incorrect {
  background: rgba(253, 164, 175, .14); /* soft rose */
  border-color: rgba(253, 164, 175, .60);
  outline: 3px solid rgba(253, 164, 175, .30);
  animation: wiggle .28s ease;
}
@keyframes wiggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* =========================
   RESULT
   ========================= */
#result {
  max-width: 900px;
  margin: 12px auto 0;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

/* =========================
   ACCESSIBILITY & REDUCED MOTION
   ========================= */
:focus-visible {
  outline: 3px solid rgba(249, 168, 212, .45); /* brand pink */
  outline-offset: 2px;
  border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =========================
   LAYOUT TWEAKS
   ========================= */
#welcome-screen { 
  display: flex; 
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  flex-direction: column;
  margin-top: 100px;
}

#welcome-screen h3 { margin-bottom: 6px; }

#next-btn { margin-top: 20px; }
#next-btn[disabled] { opacity: 0.35; }

/* =========================
   CONFETTI (created dynamically)
   ========================= */
.confetti {
  position: fixed;
  top: -10px;
  width: 10px; height: 14px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2)); /* pink → lavender */
  opacity: .95;
  border-radius: 2px;
  transform: rotate(0deg);
  animation: confetti-fall 3.2s linear forwards;
  pointer-events: none;
}
@keyframes confetti-fall {
  0% { transform: translate3d(0, -20px, 0) rotate(0deg); }
  100% { transform: translate3d(0, 110vh, 0) rotate(720deg); }
}


/* hide until needed */
.controls { display: none; }
.post-controls { display: none; }   /* already hidden inline, but keep for consistency */
#result { display: none; }
