/* ============================================================
   Seb's Revision — Game-Show Energy Theme
   ============================================================ */

:root {
  --ink: #1a1235;
  --ink-soft: #4a3f6b;
  --paper: #fff8f0;
  --paper-warm: #fff1de;
  --pink: #ff3b81;
  --pink-hot: #ff1f6a;
  --violet: #7c3aed;
  --indigo: #4f46e5;
  --amber: #ffb020;
  --amber-hot: #ff8a00;
  --emerald: #16a374;
  --emerald-soft: #d6f5e6;
  --rose-soft: #ffe1ec;
  --sky: #38bdf8;
  --shadow: 4px 4px 0 0 var(--ink);
  --shadow-lg: 6px 6px 0 0 var(--ink);
  --shadow-sm: 2px 2px 0 0 var(--ink);
}

html, body {
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
}

body {
  background:
    radial-gradient(1100px 500px at -10% -10%, rgba(255,59,129,.18), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(124,58,237,.18), transparent 55%),
    radial-gradient(700px 600px at 50% 110%, rgba(255,176,32,.16), transparent 60%),
    var(--paper);
  min-height: 100vh;
  background-attachment: fixed;
}

.font-display {
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------- Top bar (streak + XP) ---------- */
.topbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 16px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.chip-streak { background: linear-gradient(135deg, #ffb020, #ff5577); color: #fff; }
.chip-xp     { background: linear-gradient(135deg, #7c3aed, #38bdf8); color: #fff; }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}
.card-soft {
  background: var(--paper-warm);
  border: 3px solid var(--ink);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  border-radius: 28px;
  border: 3px solid var(--ink);
  background: linear-gradient(135deg, #ff3b81 0%, #7c3aed 55%, #4f46e5 100%);
  color: #fff;
  padding: 22px 20px 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.25), transparent 35%),
    radial-gradient(circle at 90% 80%, rgba(255,176,32,.3), transparent 40%);
  pointer-events: none;
}
.hero h1 {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 1.05;
  margin: 0;
}
.hero p { margin: 6px 0 0; opacity: .95; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 3px solid var(--ink);
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 19px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .06s ease, box-shadow .06s ease, filter .12s ease;
  text-align: center;
}
.btn:active:not(:disabled) { transform: translate(3px,3px); box-shadow: 1px 1px 0 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: var(--shadow-sm); }

.btn-primary {
  background: linear-gradient(135deg, #ff3b81 0%, #ff1f6a 60%, #c026d3 100%);
  color: #fff;
}
.btn-go {
  background: linear-gradient(135deg, #ffb020 0%, #ff5577 100%);
  color: #fff;
  font-size: 22px;
  min-height: 64px;
}
.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a374);
  color: #fff;
}
.btn-ghost {
  background: #fff;
  font-size: 15px;
  min-height: 44px;
  padding: 10px 14px;
}

/* ---------- Inputs ---------- */
.input, .textarea {
  width: 100%;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 14px 16px;
  font-family: "Nunito", sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  outline: none;
}
.textarea { line-height: 1.4; resize: vertical; }
.input:focus, .textarea:focus { border-color: var(--pink); box-shadow: 4px 4px 0 0 var(--pink); }

/* ---------- Checkbox tiles ---------- */
.tile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 18px;
  transition: transform .08s ease, background .15s ease;
}
.tile:has(input:checked) {
  background: linear-gradient(135deg, #fff, #ffe1ec);
  border-color: var(--pink);
  box-shadow: 4px 4px 0 0 var(--pink);
}
.tile input {
  appearance: none;
  width: 26px;
  height: 26px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.tile input:checked {
  background: var(--pink);
  border-color: var(--ink);
}
.tile input:checked::after {
  content: "✓";
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
}

/* ---------- Plan list ---------- */
.plan-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 18px;
}
.plan-item .num {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7c3aed, #ff3b81);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  border: 2px solid var(--ink);
  flex-shrink: 0;
}
.plan-item .emoji { font-size: 24px; }

/* ---------- Progress bar ---------- */
.progress-shell {
  width: 100%;
  height: 18px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffb020 0%, #ff3b81 60%, #7c3aed 100%);
  width: 0%;
  transition: width .35s cubic-bezier(.4,1.6,.6,1);
}

/* ---------- Question pill ---------- */
.q-pill {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: "Fredoka", sans-serif;
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ---------- Feedback boxes ---------- */
.fb {
  border-radius: 18px;
  border: 3px solid var(--ink);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.fb-good { background: linear-gradient(135deg, #d6f5e6, #b9f0d4); }
.fb-nudge { background: linear-gradient(135deg, #fff1de, #ffd8a8); }
.fb-info { background: #f4f0ff; }

/* ---------- Confidence buttons ---------- */
.conf-btn {
  flex: 1;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px;
  padding: 18px 8px;
  font-size: 38px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .08s ease, background .15s ease;
}
.conf-btn:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 0 var(--ink); }
.conf-btn:hover { background: var(--paper-warm); }
.conf-btn .lbl {
  display: block;
  font-family: "Fredoka", sans-serif;
  font-size: 13px;
  margin-top: 4px;
  color: var(--ink-soft);
}

/* ---------- CORRECT badge ---------- */
.correct-badge {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 50;
}
.correct-badge .b {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 64px;
  color: #fff;
  background: linear-gradient(135deg, #16a374, #22c55e);
  padding: 18px 32px;
  border-radius: 28px;
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 0 var(--ink);
  transform: scale(0) rotate(-12deg);
  animation: pop 900ms cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes pop {
  0%   { transform: scale(0) rotate(-25deg); opacity: 0; }
  25%  { transform: scale(1.15) rotate(6deg); opacity: 1; }
  55%  { transform: scale(1) rotate(-3deg); opacity: 1; }
  85%  { transform: scale(1) rotate(0deg); opacity: 1; }
  100% { transform: scale(.85) rotate(0deg); opacity: 0; }
}

/* ---------- Confetti ---------- */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 49;
}
.confetti span {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 12px;
  height: 16px;
  border-radius: 3px;
  opacity: 0;
  animation: burst 900ms ease-out forwards;
}
@keyframes burst {
  0%   { transform: translate(-50%,-50%) rotate(0deg) scale(.5); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) rotate(var(--rot)) scale(1); opacity: 0; }
}

/* ---------- Floating XP ---------- */
.xp-float {
  position: fixed;
  top: 70px;
  right: 16px;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #ff3b81);
  border: 3px solid var(--ink);
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 60;
  animation: xpFloat 1200ms ease-out forwards;
}
@keyframes xpFloat {
  0%   { transform: translateY(20px) scale(.6); opacity: 0; }
  20%  { transform: translateY(0) scale(1.1); opacity: 1; }
  60%  { transform: translateY(-10px) scale(1); opacity: 1; }
  100% { transform: translateY(-60px) scale(.9); opacity: 0; }
}

/* ---------- Section heading ---------- */
.h-display {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 1.1;
  color: var(--ink);
}
.h-sub {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink-soft);
}

/* ---------- Parent view (calmer) ---------- */
.parent-body {
  background:
    radial-gradient(900px 400px at 100% 0%, rgba(124,58,237,.10), transparent 60%),
    radial-gradient(800px 500px at 0% 100%, rgba(255,59,129,.08), transparent 60%),
    #f7f5fb;
}
.parent-card {
  background: #fff;
  border: 1px solid #e7e1f5;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(26,18,53,.04), 0 8px 24px rgba(26,18,53,.06);
}
.parent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #7c3aed, #ff3b81);
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-family: "Fredoka", sans-serif;
  font-size: 13px;
}
.parent-bar {
  height: 6px;
  border-radius: 999px;
  background: #ece6f8;
  overflow: hidden;
}
.parent-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #ff3b81);
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.shake { animation: shake .4s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .correct-badge .b, .confetti span, .xp-float { animation-duration: 1ms; }
}

/* ---------- Prep card ---------- */
.pill {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: "Fredoka", sans-serif;
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.pill-amber { background: linear-gradient(90deg, #ff9f1c, #ff3b81); }
.card-title {
  font-family: "Fredoka", sans-serif;
  font-size: 28px;
  line-height: 1.15;
  margin: 10px 0 4px;
}
.card-lead { color: #4a4a55; font-size: 15px; margin-bottom: 14px; }
.section-label {
  font-family: "Fredoka", sans-serif;
  font-size: 16px;
  margin: 14px 0 6px;
  letter-spacing: .01em;
}
.prep-list {
  list-style: none;
  padding: 0;
  margin: 0 0 4px;
}
.prep-list li {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.35;
}
.prep-list li::before {
  content: "✓ ";
  color: #7c3aed;
  font-weight: bold;
}
.btn-block { width: 100%; margin-top: 16px; }
