:root {
  --bg-deep: #0f153a;
  --bg-mid: #16215a;
  --bg-glow: #1b2f7a;
  --sky-text: #6fc5ff;
  --crimson: #ef152d;
  --crimson-dark: #a8081c;
  --ink-dark: #141824;
  --silver-top: #ffffff;
  --silver-mid: #dedede;
  --silver-bot: #bebebe;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 52% 45%, var(--bg-glow) 0%, var(--bg-mid) 45%, var(--bg-deep) 100%);
  color: #ffffff;
  overflow-x: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 3vw, 32px) clamp(14px, 3vw, 24px) 56px;
  overflow-x: hidden;
}

/* Ambient neural glow */
.stage::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 22% 48%, rgba(56, 189, 248, 0.14) 0%, transparent 42%),
    radial-gradient(circle at 86% 24%, rgba(251, 146, 60, 0.08) 0%, transparent 32%);
  pointer-events: none;
  z-index: 0;
}

.neuron-right {
  position: fixed;
  top: 0;
  right: 0;
  height: 82vh;
  max-height: 680px;
  width: auto;
  pointer-events: none;
  z-index: 1;
  opacity: 0.92;
  user-select: none;
}

.card-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(250px, 390px) minmax(0, 1fr);
  align-items: center;
  gap: 28px;
}

.mascot-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-bottom: 18px;
}

.mascot-pane::after {
  content: '';
  width: 78%;
  max-width: 290px;
  height: 20px;
  margin-top: 6px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(2, 6, 23, 0.72) 0%, rgba(2, 6, 23, 0.35) 48%, transparent 75%);
  filter: blur(4px);
  pointer-events: none;
}

.mascot-img {
  width: 100%;
  max-width: 380px;
  height: auto;
  display: block;
  user-select: none;
  animation: floatSlow 5s ease-in-out infinite;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-7px); }
}

.content-pane {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 12px;
}

.screen {
  width: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  animation: fadeSlideIn 260ms ease-out;
}

.screen.active {
  display: flex;
}

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

/* Screen 1: Landing */
.landing-kicker {
  margin: 0;
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 700;
  color: var(--sky-text);
  line-height: 1.1;
}

.landing-title {
  margin: 4px 0 18px;
  font-size: clamp(2.6rem, 5vw, 4.1rem);
  font-weight: 900;
  line-height: 0.96;
  color: var(--crimson);
  text-shadow: 0 4px 18px rgba(239, 21, 45, 0.35);
  letter-spacing: -0.01em;
}

.landing-copy {
  margin: 0 0 14px;
  font-size: clamp(1rem, 1.55vw, 1.24rem);
  font-weight: 500;
  line-height: 1.4;
  color: #f1f5f9;
  max-width: 560px;
}

.landing-subcopy {
  margin: 0 0 28px;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 500;
  line-height: 1.4;
  color: #e2e8f0;
  max-width: 520px;
}

.btn-start {
  appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: clamp(15px, 2.4vw, 20px) clamp(22px, 4.5vw, 44px);
  width: min(100%, 360px);
  min-width: 0;
  cursor: pointer;
  color: #ffffff;
  font-family: inherit;
  font-size: clamp(0.95rem, 1.7vw, 1.3rem);
  font-weight: 800;
  letter-spacing: clamp(0.1em, 0.35vw, 0.2em);
  text-transform: uppercase;
  background: linear-gradient(180deg, #ff3a4f 0%, #e60c24 52%, #b5071b 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.45),
    inset 0 -4px 8px rgba(90, 0, 12, 0.5),
    0 12px 28px rgba(230, 12, 36, 0.45);
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.btn-start:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.55),
    inset 0 -4px 8px rgba(90, 0, 12, 0.5),
    0 16px 34px rgba(230, 12, 36, 0.6);
}

.btn-start:active {
  transform: translateY(1px);
}

.brand-footer {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

.brand-footer img {
  width: 100%;
  max-width: 440px;
  height: auto;
  display: block;
}

/* Screens 2 & 3: Questions */
.question-instruction {
  margin: 0 0 20px;
  font-size: clamp(1.25rem, 2.3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--sky-text);
  max-width: 600px;
}

.question-header-box {
  width: 100%;
  max-width: 590px;
  display: flex;
  align-items: stretch;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #fafafa 0%, #dcdcdc 50%, #c6c6c6 100%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  margin-bottom: 22px;
  text-align: left;
  color: var(--ink-dark);
}

.q-num-badge {
  flex: 0 0 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.35rem;
  font-weight: 900;
  color: #111827;
  background: linear-gradient(180deg, #e5e7eb 0%, #cbd5e1 100%);
  border-right: 2px solid rgba(15, 23, 42, 0.14);
}

.q-prompt-text {
  padding: 12px 18px;
  font-size: clamp(1rem, 1.45vw, 1.18rem);
  font-weight: 800;
  line-height: 1.3;
  display: flex;
  align-items: center;
  color: #111827;
}

.options-list {
  width: 100%;
  max-width: 590px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  transition: transform 150ms ease;
}

.option-row.missing .option-pill {
  box-shadow: 0 0 0 2.5px #f43f5e, 0 8px 18px rgba(244, 63, 94, 0.35);
}

.option-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px 12px 14px;
  min-height: 54px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--silver-top) 0%, var(--silver-mid) 52%, var(--silver-bot) 100%);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.9),
    0 6px 14px rgba(0, 0, 0, 0.32);
  text-align: left;
  color: var(--ink-dark);
}

.option-icon {
  flex: 0 0 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.option-icon svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.option-label {
  font-size: clamp(1.02rem, 1.45vw, 1.2rem);
  font-weight: 800;
  color: #111827;
}

.yn-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.yn-btn {
  appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.65);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
  background: linear-gradient(180deg, #f3f4f6 0%, #d1d5db 55%, #b8bec7 100%);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.35);
  transition: transform 120ms ease, box-shadow 120ms ease, background 150ms ease, color 150ms ease;
}

.yn-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.45);
}

.yn-btn.selected-yes {
  color: #ffffff;
  border-color: #ffffff;
  background: linear-gradient(180deg, #ff3a4f 0%, #e60c24 55%, #b30519 100%);
  box-shadow:
    0 0 0 3px rgba(255, 58, 79, 0.45),
    0 8px 18px rgba(230, 12, 36, 0.55);
  transform: scale(1.05);
}

.yn-btn.selected-no {
  color: #ffffff;
  border-color: #93c5fd;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 55%, #1e3a8a 100%);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.45),
    0 8px 18px rgba(37, 99, 235, 0.5);
  transform: scale(1.05);
}

.validation-msg {
  min-height: 22px;
  margin-top: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fda4af;
}

.nav-actions {
  margin-top: 10px;
  width: 100%;
  max-width: 590px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.btn-secondary {
  appearance: none;
  border: 1.5px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.btn-secondary:hover {
  background: rgba(30, 41, 59, 0.75);
  border-color: #94a3b8;
}

.btn-primary {
  appearance: none;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 13px 34px;
  cursor: pointer;
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ff3a4f 0%, #e60c24 52%, #b5071b 100%);
  box-shadow: 0 8px 20px rgba(230, 12, 36, 0.45);
  transition: transform 140ms ease, filter 140ms ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Slide 4: Thank You */
.thankyou-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  border: 2.5px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 26px rgba(34, 197, 94, 0.45);
}

.thankyou-badge svg {
  width: 36px;
  height: 36px;
}

.thankyou-title {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  font-weight: 900;
  color: var(--sky-text);
  line-height: 1.05;
  text-shadow: 0 4px 18px rgba(111, 197, 255, 0.25);
}

.thankyou-copy {
  margin: 0 0 10px;
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  font-weight: 700;
  color: #ffffff;
  max-width: 520px;
  line-height: 1.4;
}

.thankyou-subcopy {
  margin: 0 0 28px;
  font-size: clamp(0.95rem, 1.4vw, 1.12rem);
  font-weight: 500;
  color: #cbd5e1;
  max-width: 480px;
  line-height: 1.4;
}

/* Screen 5: Final Score */
.result-heading {
  margin: 0 0 16px;
  font-size: clamp(1.35rem, 2.35vw, 1.95rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--sky-text);
}

.score-summary-banner {
  width: 100%;
  max-width: 650px;
  margin-bottom: 18px;
  padding: 14px 20px;
  border-radius: 14px;
  background: rgba(15, 23, 55, 0.78);
  border: 1.5px solid rgba(111, 197, 255, 0.45);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff3a4f 0%, #d40a21 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.35rem;
  box-shadow: 0 4px 14px rgba(230, 12, 36, 0.45);
}

.score-pill small {
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.9;
}

.score-meta {
  flex: 1;
  min-width: 0;
}

.score-meta-interp {
  font-size: 1.08rem;
  font-weight: 800;
  color: #ffffff;
}

.score-meta-action {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--sky-text);
  margin-top: 2px;
}

.score-table {
  width: 100%;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-table-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  text-align: left;
}

.score-cell {
  padding: 12px 14px;
  border-radius: 7px;
  background: linear-gradient(180deg, #ffffff 0%, #dcdcdc 55%, #c5c5c5 100%);
  color: #111827;
  font-size: clamp(0.88rem, 1.25vw, 1.02rem);
  font-weight: 800;
  line-height: 1.25;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.score-table-row.header .score-cell {
  font-size: clamp(0.92rem, 1.3vw, 1.06rem);
  font-weight: 900;
  background: linear-gradient(180deg, #f3f4f6 0%, #cfd5df 100%);
}

.score-table-row.active-band .score-cell {
  background: linear-gradient(180deg, #fff5f5 0%, #fecdd3 100%);
  box-shadow:
    0 0 0 2.5px #ff2e47,
    0 8px 20px rgba(255, 46, 71, 0.4);
  color: #7f0717;
}

.result-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Subtle Admin Link */
.admin-link {
  position: fixed;
  bottom: 12px;
  left: 16px;
  z-index: 10;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.65);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: color 150ms ease, border-color 150ms ease;
}

.admin-link:hover {
  color: #ffffff;
  border-color: rgba(111, 197, 255, 0.6);
}

@media (max-width: 1024px) {
  .card-shell {
    grid-template-columns: minmax(210px, 310px) minmax(0, 1fr);
    gap: 20px;
  }

  .neuron-right {
    opacity: 0.5;
    height: 62vh;
  }
}

@media (max-width: 860px) {
  .stage {
    justify-content: flex-start;
    padding: 20px 14px 28px;
  }

  .card-shell {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mascot-pane {
    padding-bottom: 10px;
  }

  .mascot-img {
    max-width: 190px;
  }

  .mascot-pane::after {
    max-width: 165px;
    height: 14px;
  }

  .content-pane {
    padding: 4px 2px;
  }

  .neuron-right {
    opacity: 0.24;
    height: 42vh;
  }

  .score-table-row {
    grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  .yn-btn {
    width: 46px;
    height: 46px;
    font-size: 0.9rem;
  }

  .admin-link {
    position: static;
    transform: none;
    margin-top: 22px;
    align-self: center;
    white-space: nowrap;
  }
}

@media (max-width: 540px) {
  .mascot-img {
    max-width: 155px;
  }

  .mascot-pane::after {
    max-width: 135px;
    height: 12px;
  }

  .question-instruction {
    margin-bottom: 14px;
    font-size: 1.12rem;
  }

  .question-header-box {
    margin-bottom: 16px;
  }

  .q-num-badge {
    flex: 0 0 50px;
    font-size: 1.75rem;
  }

  .q-prompt-text {
    padding: 10px 12px;
    font-size: 0.94rem;
  }

  .options-list {
    gap: 10px;
  }

  .option-row {
    gap: 10px;
  }

  .option-pill {
    padding: 9px 14px 9px 10px;
    min-height: 46px;
    gap: 10px;
  }

  .option-icon {
    flex: 0 0 26px;
    height: 26px;
  }

  .option-icon svg {
    width: 17px;
    height: 17px;
  }

  .option-label {
    font-size: 0.95rem;
  }

  .yn-group {
    gap: 8px;
  }

  .yn-btn {
    width: 42px;
    height: 42px;
    font-size: 0.84rem;
  }

  .nav-actions {
    gap: 10px;
  }

  .btn-secondary {
    padding: 11px 18px;
    font-size: 0.88rem;
  }

  .btn-primary {
    padding: 12px 22px;
    font-size: 0.9rem;
  }

  .score-summary-banner {
    padding: 12px 14px;
    gap: 10px;
  }

  .score-pill {
    font-size: 1.15rem;
    padding: 7px 14px;
  }

  .score-meta-interp {
    font-size: 0.98rem;
  }

  .score-meta-action {
    font-size: 0.85rem;
  }

  .score-table-row {
    grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  .score-cell {
    padding: 9px 8px;
    font-size: 0.78rem;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .score-table-row.header .score-cell {
    font-size: 0.82rem;
  }

  .thankyou-badge {
    width: 60px;
    height: 60px;
  }

  .thankyou-badge svg {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 375px) {
  .option-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .yn-group {
    justify-content: flex-end;
  }
}
