.q-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 95%;
  transform: translate(-50%, -50%);
  background-image: url("../img/quiz-bg.png");
  background-size: cover;
  background-position: center;
}

body {
  font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

.quiz-player-card {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 220px);
}

.quiz-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}

.quiz-stage {
  width: min(420px, 100%);
  aspect-ratio: 9 / 16;
  border-radius: 24px;
  background:
    radial-gradient(900px 700px at 20% 0%, rgba(159, 232, 112, .26), transparent 55%),
    radial-gradient(900px 700px at 90% 10%, rgba(96, 165, 250, .18), transparent 55%),
    radial-gradient(1100px 900px at 50% 120%, rgba(34, 197, 94, .14), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #f5f7ff 100%);
  box-shadow:
    0 30px 70px rgba(2, 6, 23, .18),
    0 14px 24px rgba(2, 6, 23, .10),
    inset 0 1px 0 rgba(255,255,255,.80);
  border: 1px solid rgba(2, 6, 23, .08);
  overflow: hidden;
  transform: translateZ(0);
}

.quiz-stage-inner {
  height: 100%;
  padding: 14px;
  position: relative;
  background:
    linear-gradient(135deg, rgba(255,255,255,.85), rgba(255,255,255,0)),
    linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0));
}

.quiz-card {
  height: 100%;
  border-radius: 20px;
  padding: 16px;
  color: rgba(2, 6, 23, .92);
  border: 1px solid rgba(2, 6, 23, .08);
  box-shadow:
    0 18px 40px rgba(2, 6, 23, .16),
    inset 0 1px 0 rgba(255,255,255,.70);
  backdrop-filter: blur(3px);
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 12px;
}

.quiz-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 20px;
  background: radial-gradient(900px 520px at 30% 0%, rgba(255,255,255,.75), transparent 60%);
  opacity: .55;
}

.quiz-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.quiz-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-timer {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  color: rgba(2, 6, 23, .92);
  width: 52px;
  height: 52px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
    background: radial-gradient(80px 40px at 30% 30%, #FFC107, #FF9800);
    border: 1px solid rgba(2, 6, 23, .10);
    box-shadow: 0 18px 30px rgba(2, 6, 23, .12), inset 0 1px 0 rgba(255, 255, 255, .85);
}

.quiz-timer.is-danger {
  color: rgba(127, 29, 29, .98);
  background: radial-gradient(80px 40px at 30% 30%, rgba(255,255,255,.95), rgba(254, 226, 226, .95));
  border-color: rgba(239,68,68,.40);
  box-shadow:
    0 18px 30px rgba(239,68,68,.12),
    0 0 0 4px rgba(239,68,68,.08),
    inset 0 1px 0 rgba(255,255,255,.85);
  animation: dangerPulse 700ms ease-in-out infinite alternate;
}

@keyframes dangerPulse {
  from { transform: translateY(0); filter: saturate(1); }
  to { transform: translateY(-1px); filter: saturate(1.15); }
}

.quiz-timertrack {
  height: 8px;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(2, 6, 23, .06);
  border: 1px solid rgba(2, 6, 23, .08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

.quiz-timertrack-bottom {
  margin-top: 2px;
}

.quiz-timerbar {
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, #9fe870, #22c55e);
  box-shadow: 0 10px 22px rgba(159,232,112,.12);
}

.quiz-timerbar.is-danger {
  background: linear-gradient(135deg, #ef4444, #fb7185);
  box-shadow: 0 10px 22px rgba(239,68,68,.16);
}

.quiz-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.quiz-logo {
  height: 30px;
  width: auto;
  display: block;
}

.quiz-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 11px;
  color: rgba(2, 6, 23, .90);
  background: linear-gradient(135deg, rgba(159,232,112,1), rgba(34,197,94,1));
  box-shadow: 0 10px 25px rgba(159,232,112,.15);
}

.quiz-prompt {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.2px;
  color: rgba(2, 6, 23, .92);
  text-shadow: none;
  padding: 35px 14px;
  border-radius: 18px;
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.78));
  border: 1px solid rgba(2, 6, 23, .08);
  box-shadow:
    0 18px 30px rgba(2, 6, 23, .12),
    inset 0 1px 0 rgba(255,255,255,.85);
}

.quiz-qprog {
  position: absolute;
  top: -10px;
  left: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .4px;
  color: rgb(255 255 255 / 92%);
  background: linear-gradient(135deg, rgb(0 0 0), rgb(155 156 155));
  box-shadow: 0 14px 22px rgba(2, 6, 23, .12), 0 0 0 4px rgba(159, 232, 112, .10), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.quiz-qtext {
  display: block;
}

.quiz-options {
  display: grid;
  gap: 10px;
  align-content: start;
}

.quiz-options .q-opt {
  border-radius: 16px !important;
  border: 1px solid rgba(2, 6, 23, .10) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.86)) !important;
  color: rgba(2, 6, 23, .92) !important;
  box-shadow:
    0 18px 30px rgba(2, 6, 23, .12),
    inset 0 1px 0 rgba(255,255,255,.85);
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease, background 160ms ease;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  transform-style: preserve-3d;
}

.quiz-options .q-opt:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  border-color: rgba(159,232,112,.35) !important;
}

.quiz-opt-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 36px;
  border-radius: 14px;
  color: rgba(255,255,255,.95);
  font-weight: 900;
  letter-spacing: .6px;
  box-shadow:
    0 14px 22px rgba(0,0,0,.26),
    inset 0 1px 0 rgba(255,255,255,.25);
  border: 1px solid rgba(255,255,255,.18);
}

.quiz-opt-text {
  color: rgba(2, 6, 23, .92);
  font-weight: 700;
  line-height: 1.25;
  text-shadow: none;
}

.quiz-options .q-opt.border-slate-900 {
  border-color: rgba(159,232,112,.55) !important;
  box-shadow:
    0 18px 34px rgba(0,0,0,.22),
    0 0 0 4px rgba(159,232,112,.10),
    inset 0 1px 0 rgba(255,255,255,.10);
}

.quiz-options .q-opt.border-green-500 {
  border-color: rgba(159,232,112,.75) !important;
  background: linear-gradient(135deg, #22c55e, #9fe870) !important;
  color: rgba(255,255,255,.98) !important;
  box-shadow:
    0 18px 34px rgba(34,197,94,.18),
    0 0 0 4px rgba(159,232,112,.16),
    inset 0 1px 0 rgba(255,255,255,.20);
}

.quiz-options .q-opt.border-green-500 .quiz-opt-text {
  color: rgba(255,255,255,.98);
}

.quiz-options .q-opt.is-correct {
  animation: correctZoomOut 520ms cubic-bezier(.2, .9, .2, 1) both;
  transform-origin: center;
}

@keyframes correctZoomOut {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(0) scale(.94); }
  100% { transform: translateY(0) scale(1); }
}

.quiz-options .q-opt:active {
  transform: translateY(0px);
}

.quiz-feedback {
  font-size: 12px;
  color: rgba(2, 6, 23, .58);
  min-height: 18px;
}

.quiz-end {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(800px 600px at 50% 25%, rgba(159,232,112,.22), transparent 55%),
    radial-gradient(700px 500px at 20% 0%, rgba(96,165,250,.18), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(245,247,255,.96));
  border-radius: 20px;
  text-align: center;
  border: 1px solid rgba(2, 6, 23, .06);
  backdrop-filter: blur(10px);

  opacity: 0;
  transform: translateY(14px) scale(.98);
  filter: blur(10px);
  pointer-events: none;
  transition:
    opacity 320ms ease,
    transform 520ms cubic-bezier(.2, .9, .2, 1),
    filter 320ms ease;
}

.quiz-end::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.85) 50%, transparent 65%);
  transform: translateX(-40%) rotate(8deg);
  opacity: 0;
  pointer-events: none;
}

.quiz-end.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.quiz-end.is-visible::after {
  opacity: .55;
  animation: endSweep 900ms ease-out 120ms both;
}

@keyframes endSweep {
  from { transform: translateX(-55%) rotate(8deg); opacity: 0; }
  30% { opacity: .55; }
  to { transform: translateX(55%) rotate(8deg); opacity: 0; }
}

.quiz-end-img {
  height: 60px;
  width: auto;
  filter: drop-shadow(0 18px 30px rgba(2, 6, 23, .10));
}

.quiz-end-tagline {
  margin-top: 6px;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.2px;
  color: rgba(2, 6, 23, .92);
}

.quiz-end-score {
  margin-top: 6px;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.2px;
  color: rgba(2, 6, 23, .90);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #CDDC39, rgba(255,255,255,.70));
  border: 1px solid rgba(2, 6, 23, .10);
  box-shadow:
    0 22px 40px rgba(2, 6, 23, .14),
    0 8px 14px rgba(2, 6, 23, .10),
    inset 0 1px 0 rgba(255,255,255,.90);
  position: relative;
}

.quiz-end-score::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 10%;
  right: 10%;
  height: 45%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,0));
  opacity: .9;
  pointer-events: none;
}

.quiz-end-score::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(159,232,112,.45), rgba(96,165,250,.35));
  filter: blur(10px);
  opacity: .35;
  z-index: -1;
  pointer-events: none;
}

.quiz-end-sub {
  font-size: 13px;
  color: rgba(2, 6, 23, .60);
}

.hidden {
  display: none !important;
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: rgba(255,255,255,.70);
  border-top: 1px solid rgba(255,255,255,.10);
  padding-top: 10px;
}

.quiz-accent-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9fe870;
  box-shadow: 0 0 0 4px rgba(159,232,112,.12);
  margin-right: 6px;
}

@media (max-width: 1024px) {
  .quiz-player-card {
    min-height: auto;
  }
}

.q-anim-enter {
  animation: qEnter 180ms ease-out both;
}

.q-anim-exit {
  animation: qExit 180ms ease-in both;
}

@keyframes qEnter {
  from { opacity: 0; transform: translateY(10px) scale(.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes qExit {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(.995); }
}

