:root {
  --bg: #1a0a3d;
  --bg2: #5b1fb0;
  --bg3: #ff2fb0;
  --card: #ffffff;
  --ink: #1a1a2e;
  --muted: #6b6b8a;
  --purple: #7b2ff7;
  --purple-deep: #5b1fb0;
  --pink: #ff5fd8;
  --pink-deep: #d6169c;
  --red: #ff3b57;
  --red-deep: #d81a3a;
  --blue: #2196f3;
  --blue-deep: #0d6fd1;
  --yellow: #ffc93c;
  --yellow-deep: #f5a300;
  --green: #35c465;
  --green-deep: #1fa04c;
  --brown: #b06a3a;
  --brown-deep: #8a4f28;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(0,0,0,.25);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
  font-family: 'Baloo 2', 'Segoe UI Rounded', 'Segoe UI', 'Nunito', system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 5%, rgba(255,95,216,.35), transparent 40%),
    radial-gradient(circle at 90% 15%, rgba(33,150,243,.30), transparent 45%),
    radial-gradient(circle at 30% 90%, rgba(255,201,60,.20), transparent 40%),
    radial-gradient(circle at 20% 0%, var(--bg2), var(--bg) 65%);
  background-attachment: fixed;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wrap {
  width: 100%;
  max-width: 1100px;
  padding: 24px;
  margin: 0 auto;
}

h1, h2, h3 { margin: 0 0 12px; }

.brand {
  color: #fff;
  font-weight: 800;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  text-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.brand .dot { color: var(--yellow); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  border-top: 8px solid var(--purple);
}

/* ---- Big, bouncy, pop-out buttons ---- */
.btn {
  border: none;
  border-radius: 16px;
  padding: 14px 26px;
  font-size: 1.08rem;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: var(--purple);
  box-shadow: 0 6px 0 var(--purple-deep), 0 10px 18px rgba(0,0,0,.25);
  text-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .12s var(--pop), box-shadow .12s var(--pop), filter .15s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 8px 0 var(--purple-deep), 0 14px 22px rgba(0,0,0,.3); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--purple-deep), 0 4px 10px rgba(0,0,0,.25); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.btn.secondary { background: var(--blue); box-shadow: 0 6px 0 var(--blue-deep), 0 10px 18px rgba(0,0,0,.25); }
.btn.secondary:hover { box-shadow: 0 8px 0 var(--blue-deep), 0 14px 22px rgba(0,0,0,.3); }
.btn.secondary:active { box-shadow: 0 2px 0 var(--blue-deep), 0 4px 10px rgba(0,0,0,.25); }
.btn.danger { background: var(--red); box-shadow: 0 6px 0 var(--red-deep), 0 10px 18px rgba(0,0,0,.25); }
.btn.danger:hover { box-shadow: 0 8px 0 var(--red-deep), 0 14px 22px rgba(0,0,0,.3); }
.btn.danger:active { box-shadow: 0 2px 0 var(--red-deep), 0 4px 10px rgba(0,0,0,.25); }
.btn.success { background: var(--green); box-shadow: 0 6px 0 var(--green-deep), 0 10px 18px rgba(0,0,0,.25); }
.btn.success:hover { box-shadow: 0 8px 0 var(--green-deep), 0 14px 22px rgba(0,0,0,.3); }
.btn.success:active { box-shadow: 0 2px 0 var(--green-deep), 0 4px 10px rgba(0,0,0,.25); }
.btn.warn { background: var(--yellow); color: var(--ink); text-shadow: none; box-shadow: 0 6px 0 var(--yellow-deep), 0 10px 18px rgba(0,0,0,.2); }
.btn.warn:hover { box-shadow: 0 8px 0 var(--yellow-deep), 0 14px 22px rgba(0,0,0,.25); }
.btn.warn:active { box-shadow: 0 2px 0 var(--yellow-deep), 0 4px 10px rgba(0,0,0,.2); }
.btn.pink { background: var(--pink-deep); box-shadow: 0 6px 0 #a01178, 0 10px 18px rgba(0,0,0,.25); }
.btn.pink:hover { box-shadow: 0 8px 0 #a01178, 0 14px 22px rgba(0,0,0,.3); }
.btn.pink:active { box-shadow: 0 2px 0 #a01178, 0 4px 10px rgba(0,0,0,.25); }
.btn.big { padding: 20px 38px; font-size: 1.4rem; border-radius: 20px; }
.btn.block { width: 100%; }

input[type=text], input[type=tel], textarea {
  width: 100%;
  border: 3px solid #e2e2f0;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease;
}
input[type=text]:focus, input[type=tel]:focus, textarea:focus { border-color: var(--purple); }

label { font-weight: 800; font-size: .9rem; color: var(--muted); display: block; margin-bottom: 6px; }

.pill {
  display: inline-block;
  background: #efe9ff;
  color: var(--purple-deep);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: .82rem;
  font-weight: 800;
}

.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.grow { flex: 1; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.hidden { display: none !important; }

/* ---- Answer choice shapes (bright, poppy, chunky) ---- */
.choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: 100%;
}
@media (max-width: 640px) {
  .choices-grid { grid-template-columns: 1fr; }
}
.choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  border: none;
  border-radius: 18px;
  padding: 24px 20px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  text-shadow: 0 1px 4px rgba(0,0,0,.35);
  box-shadow: 0 8px 0 rgba(0,0,0,.22), 0 14px 20px rgba(0,0,0,.2);
  transition: transform .1s var(--pop), box-shadow .1s var(--pop);
  animation: bounceIn .35s var(--pop);
}
.choice-btn:hover { transform: translateY(-3px); box-shadow: 0 11px 0 rgba(0,0,0,.22), 0 18px 24px rgba(0,0,0,.25); }
.choice-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 rgba(0,0,0,.22); }
.choice-btn .shape { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.choice-0 { background: var(--red); }
.choice-1 { background: var(--blue); }
.choice-2 { background: var(--yellow); color: var(--ink); text-shadow: 0 1px 2px rgba(255,255,255,.4); }
.choice-3 { background: var(--green); }
.choice-4 { background: var(--purple); }
.choice-5 { background: var(--brown); }
.choice-btn.correct { outline: 6px solid #fff; }
.choice-btn.wrong { opacity: .45; }
.choice-btn.dim { opacity: .35; }

@keyframes bounceIn {
  0% { transform: scale(.7); opacity: 0; }
  70% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

/* Podium */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  margin-top: 40px;
}
.podium .step {
  width: 180px;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 10px;
  color: #fff;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0,0,0,.3);
  box-shadow: 0 -4px 0 rgba(255,255,255,.25) inset, 0 12px 24px rgba(0,0,0,.3);
}
.podium .step .medal { font-size: 2.4rem; }
.podium .step .name { font-size: 1.15rem; margin-top: 6px; }
.podium .step .score { opacity: .9; font-size: .95rem; }
.podium .first { height: 220px; background: linear-gradient(180deg, #ffe066, var(--yellow-deep)); order: 2; }
.podium .second { height: 170px; background: linear-gradient(180deg, #7ecbff, var(--blue-deep)); order: 1; }
.podium .third { height: 130px; background: linear-gradient(180deg, var(--brown), var(--brown-deep)); order: 3; }

.confetti-piece {
  position: fixed;
  top: -20px;
  width: 10px;
  height: 16px;
  opacity: .9;
  z-index: 999;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: 1; }
}

.countdown-num {
  font-size: 40vh;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 10px 40px rgba(0,0,0,.4);
  animation: pop .5s var(--pop);
}
@keyframes pop {
  0% { transform: scale(.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

.timer-bar-track {
  width: 100%;
  height: 16px;
  background: rgba(255,255,255,.25);
  border-radius: 999px;
  overflow: hidden;
}
.timer-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  border-radius: 999px;
  transition: width .1s linear;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 8px;
  box-shadow: 0 3px 8px rgba(0,0,0,.08);
  border-left: 6px solid var(--purple);
}
.leaderboard-row:nth-child(1) { border-left-color: var(--yellow-deep); }
.leaderboard-row:nth-child(2) { border-left-color: var(--blue); }
.leaderboard-row:nth-child(3) { border-left-color: var(--brown); }
.leaderboard-row .rank { font-weight: 900; color: var(--purple-deep); width: 28px; }
.leaderboard-row .name { flex: 1; font-weight: 700; }
.leaderboard-row .score { font-weight: 800; color: var(--muted); }

.qimg {
  max-width: 100%;
  max-height: 32vh;
  border-radius: 16px;
  box-shadow: var(--shadow);
  object-fit: contain;
  border: 6px solid #fff;
}
