:root {
  color-scheme: light dark;
  --bg: #f6f8fc;
  --bg-deep: #e9eef7;
  --page-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(246, 248, 252, 0.82)),
    linear-gradient(135deg, #f8fafc 0%, #edf2fb 48%, #eef7f6 100%);
  --panel-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 244, 251, 0.94));
  --certificate-bg:
    linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent 50%),
    radial-gradient(circle at 88% 12%, rgba(8, 145, 178, 0.12), transparent 35%),
    #ffffff;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --surface-soft: rgba(30, 41, 59, 0.055);
  --line: rgba(15, 23, 42, 0.12);
  --line-strong: rgba(15, 23, 42, 0.22);
  --text: #111827;
  --muted: #64748b;
  --muted-strong: #334155;
  --violet: #6d5bd0;
  --violet-strong: #5b4bd1;
  --cyan: #087d95;
  --green: #087f5b;
  --red: #c24155;
  --yellow: #946200;
  --shadow: 0 24px 60px rgba(30, 41, 59, 0.16);
  --primary-text: #ffffff;
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --max-width: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080a18;
    --bg-deep: #050710;
    --page-bg:
      radial-gradient(circle at 18% 8%, rgba(124, 92, 255, 0.12), transparent 31rem),
      radial-gradient(circle at 88% 82%, rgba(105, 231, 255, 0.08), transparent 30rem),
      linear-gradient(145deg, var(--bg) 0%, #0b0e22 52%, #070914 100%);
    --panel-bg: linear-gradient(145deg, rgba(18, 23, 52, 0.88), rgba(10, 13, 31, 0.9));
    --certificate-bg:
      linear-gradient(135deg, rgba(169, 140, 255, 0.14), transparent 50%),
      radial-gradient(circle at 88% 12%, rgba(105, 231, 255, 0.16), transparent 35%),
      #0d1128;
    --surface: rgba(18, 23, 52, 0.82);
    --surface-strong: #121734;
    --surface-soft: rgba(255, 255, 255, 0.055);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.22);
    --text: #f7f8ff;
    --muted: #aeb7d7;
    --muted-strong: #d7dcf0;
    --violet: #a98cff;
    --violet-strong: #7c5cff;
    --cyan: #69e7ff;
    --green: #71f3b0;
    --red: #ff8f9e;
    --yellow: #ffd37a;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
    --primary-text: #080a18;
  }
}

:root[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-deep: #e9eef7;
  --page-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(246, 248, 252, 0.82)),
    linear-gradient(135deg, #f8fafc 0%, #edf2fb 48%, #eef7f6 100%);
  --panel-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 244, 251, 0.94));
  --certificate-bg:
    linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent 50%),
    radial-gradient(circle at 88% 12%, rgba(8, 145, 178, 0.12), transparent 35%),
    #ffffff;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --surface-soft: rgba(30, 41, 59, 0.055);
  --line: rgba(15, 23, 42, 0.12);
  --line-strong: rgba(15, 23, 42, 0.22);
  --text: #111827;
  --muted: #64748b;
  --muted-strong: #334155;
  --violet: #6d5bd0;
  --violet-strong: #5b4bd1;
  --cyan: #087d95;
  --green: #087f5b;
  --red: #c24155;
  --yellow: #946200;
  --shadow: 0 24px 60px rgba(30, 41, 59, 0.16);
  --primary-text: #ffffff;
}

:root[data-theme="dark"] {
  --bg: #080a18;
  --bg-deep: #050710;
  --page-bg:
    radial-gradient(circle at 18% 8%, rgba(124, 92, 255, 0.12), transparent 31rem),
    radial-gradient(circle at 88% 82%, rgba(105, 231, 255, 0.08), transparent 30rem),
    linear-gradient(145deg, var(--bg) 0%, #0b0e22 52%, #070914 100%);
  --panel-bg: linear-gradient(145deg, rgba(18, 23, 52, 0.88), rgba(10, 13, 31, 0.9));
  --certificate-bg:
    linear-gradient(135deg, rgba(169, 140, 255, 0.14), transparent 50%),
    radial-gradient(circle at 88% 12%, rgba(105, 231, 255, 0.16), transparent 35%),
    #0d1128;
  --surface: rgba(18, 23, 52, 0.82);
  --surface-strong: #121734;
  --surface-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f7f8ff;
  --muted: #aeb7d7;
  --muted-strong: #d7dcf0;
  --violet: #a98cff;
  --violet-strong: #7c5cff;
  --cyan: #69e7ff;
  --green: #71f3b0;
  --red: #ff8f9e;
  --yellow: #ffd37a;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --primary-text: #080a18;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-deep);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  transform: translateY(-160%);
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient,
.grid-overlay {
  position: fixed;
  pointer-events: none;
}

.ambient {
  display: none;
  z-index: -3;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.65;
}

.ambient-one {
  width: 280px;
  height: 280px;
  top: -120px;
  right: 18%;
  background: radial-gradient(circle, rgba(169, 140, 255, 0.36), transparent 68%);
}

.ambient-two {
  width: 320px;
  height: 320px;
  bottom: -170px;
  left: 8%;
  background: radial-gradient(circle, rgba(105, 231, 255, 0.2), transparent 70%);
}

.grid-overlay {
  inset: 0;
  z-index: -4;
  opacity: 0.22;
  background-image:
    linear-gradient(var(--surface-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--surface-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

.site-header,
.site-footer,
.app-shell {
  width: min(calc(100% - 40px), var(--max-width));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(169, 140, 255, 0.65);
  border-radius: 50%;
  box-shadow: inset 0 0 18px rgba(169, 140, 255, 0.18), 0 0 18px rgba(105, 231, 255, 0.12);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  width: 42px;
  height: 14px;
  border: 1px solid rgba(105, 231, 255, 0.58);
  border-radius: 50%;
  content: "";
}

.brand-mark::before {
  transform: rotate(35deg);
}

.brand-mark::after {
  transform: rotate(-35deg);
}

.brand-core {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 13px var(--cyan);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
  backdrop-filter: blur(12px);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.theme-toggle-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--cyan);
  font-size: 0.94rem;
  line-height: 1;
}

.time-badge,
.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted-strong);
  backdrop-filter: blur(12px);
}

.time-badge {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
}

.app-shell {
  min-height: calc(100vh - 112px);
  display: grid;
  align-items: center;
  padding: 14px 0 18px;
}

.screen {
  width: 100%;
  animation: screen-in 480ms ease both;
}

#welcome-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: clamp(22px, 4vw, 52px);
  align-items: center;
}

.hero-card,
.question-card,
.result-layout {
  border: 1px solid var(--line);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero-card {
  padding: clamp(24px, 3.6vw, 42px);
  border-radius: var(--radius-xl);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 14px;
  font-size: clamp(2.45rem, 5.6vw, 4.85rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h1 span {
  color: transparent;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-copy {
  max-width: 700px;
  margin-bottom: 20px;
  color: var(--muted-strong);
  font-size: clamp(1rem, 1.8vw, 1.16rem);
}

.module-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 22px;
}

.module-strip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 720;
}

.module-strip b {
  color: var(--violet);
  font-size: 0.68rem;
}

.start-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.start-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 18px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 820;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button-primary {
  background: linear-gradient(100deg, var(--violet-strong), #9277ff 55%, #72d9ff);
  color: var(--primary-text);
  box-shadow: 0 13px 30px rgba(124, 92, 255, 0.25);
}

.button-secondary {
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
}

.button-ghost {
  background: transparent;
  color: var(--muted-strong);
}

.concept-orbit {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1;
  margin-inline: auto;
}

.qubit-sphere {
  position: absolute;
  inset: 25%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.26), transparent 19%),
    radial-gradient(circle at 65% 70%, rgba(105, 231, 255, 0.18), transparent 38%),
    linear-gradient(145deg, rgba(169, 140, 255, 0.82), rgba(25, 35, 87, 0.92));
  box-shadow: inset -24px -24px 50px rgba(5, 7, 16, 0.48), 0 0 80px rgba(124, 92, 255, 0.22);
}

.qubit-sphere::before,
.qubit-sphere::after {
  position: absolute;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  content: "";
}

.qubit-sphere::before {
  inset: 47% -16%;
}

.qubit-sphere::after {
  inset: -16% 47%;
}

.qubit-sphere span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-style: italic;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.orbit {
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(105, 231, 255, 0.28);
  border-radius: 50%;
}

.orbit::after {
  position: absolute;
  inset: 49% -7%;
  border-top: 1px dashed rgba(169, 140, 255, 0.36);
  content: "";
}

.orbit-a {
  transform: rotate(26deg) scaleY(0.47);
}

.orbit-b {
  transform: rotate(-52deg) scaleY(0.55);
}

.orbit span {
  position: absolute;
  top: 45%;
  right: -3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan);
}

.orbit-label {
  position: absolute;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
}

.label-a { top: 7%; left: 15%; }
.label-b { right: 4%; bottom: 24%; }
.label-c { bottom: 5%; left: 26%; }

#quiz-screen {
  max-width: 920px;
  margin-inline: auto;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.quiz-header .eyebrow {
  margin-bottom: 4px;
}

.question-counter {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.score-chip {
  min-width: 90px;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
}

.score-chip strong {
  color: var(--green);
  font-size: 1.02rem;
}

.progress-track {
  height: 5px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  box-shadow: 0 0 15px rgba(105, 231, 255, 0.45);
  transition: width 380ms ease;
}

.question-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.question-number {
  display: flex;
  justify-content: center;
  padding-top: 30px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(169, 140, 255, 0.1), transparent);
  color: var(--line-strong);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0;
}

.question-content {
  padding: clamp(22px, 3vw, 34px);
}

.topic-tag {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 5px 9px;
  border: 1px solid rgba(169, 140, 255, 0.28);
  border-radius: 7px;
  background: rgba(169, 140, 255, 0.08);
  color: var(--violet);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.question-content h2 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(1.34rem, 2.4vw, 1.82rem);
  line-height: 1.22;
  letter-spacing: 0;
}

.answer-options {
  display: grid;
  gap: 9px;
}

.answer-option {
  display: grid;
  grid-template-columns: 34px 1fr 24px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--muted-strong);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.answer-option:hover:not(:disabled) {
  transform: translateX(3px);
  border-color: rgba(169, 140, 255, 0.58);
  background: rgba(169, 140, 255, 0.09);
}

.answer-option:disabled {
  cursor: default;
}

.answer-key {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.answer-text {
  line-height: 1.42;
}

.answer-state {
  color: transparent;
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
}

.answer-option.is-correct {
  border-color: rgba(113, 243, 176, 0.68);
  background: rgba(113, 243, 176, 0.09);
  color: var(--text);
}

.answer-option.is-correct .answer-key {
  border-color: rgba(113, 243, 176, 0.58);
  color: var(--green);
}

.answer-option.is-correct .answer-state {
  color: var(--green);
}

.answer-option.is-incorrect {
  border-color: rgba(255, 143, 158, 0.52);
  background: rgba(255, 143, 158, 0.07);
}

.answer-option.is-incorrect .answer-state {
  color: var(--red);
}

.answer-option.is-dimmed {
  opacity: 0.56;
}

.feedback-panel {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(113, 243, 176, 0.24);
  border-radius: var(--radius-md);
  background: rgba(113, 243, 176, 0.055);
  animation: feedback-in 340ms ease both;
}

.feedback-panel.is-incorrect {
  border-color: rgba(255, 211, 122, 0.28);
  background: rgba(255, 211, 122, 0.05);
}

.feedback-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: rgba(113, 243, 176, 0.13);
  color: var(--green);
  font-weight: 900;
}

.feedback-panel.is-incorrect .feedback-icon {
  background: rgba(255, 211, 122, 0.12);
  color: var(--yellow);
}

.feedback-title {
  margin-bottom: 4px;
  color: var(--text);
  font-weight: 850;
}

.correct-answer {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 760;
}

.feedback-explanation {
  margin-bottom: 12px;
  color: var(--muted-strong);
  font-size: 0.9rem;
}

.takeaway {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.takeaway span {
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(169, 140, 255, 0.12);
  color: var(--violet);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.takeaway p {
  margin: 0;
  color: var(--text);
  font-weight: 680;
}

.quiz-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  margin-top: 12px;
}

.quiz-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.button-next {
  min-width: 174px;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: clamp(22px, 4vw, 44px);
  padding: clamp(24px, 3.6vw, 42px);
  border-radius: var(--radius-xl);
}

.result-summary h2 {
  max-width: 620px;
  margin-bottom: 16px;
  font-size: clamp(1.9rem, 3.8vw, 3.3rem);
  line-height: 1;
  letter-spacing: 0;
}

.result-message {
  max-width: 620px;
  color: var(--muted-strong);
}

.score-display {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 18px 0;
}

.score-ring {
  display: grid;
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  place-content: center;
  border: 1px solid rgba(105, 231, 255, 0.32);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(105, 231, 255, 0.08), transparent 64%),
    conic-gradient(from 180deg, rgba(169, 140, 255, 0.72), rgba(105, 231, 255, 0.52), rgba(169, 140, 255, 0.72));
  box-shadow: inset 0 0 0 8px var(--surface-strong), 0 0 35px rgba(105, 231, 255, 0.12);
  text-align: center;
}

.score-ring strong {
  display: block;
  font-size: 2rem;
  line-height: 0.95;
}

.score-ring span {
  color: var(--muted-strong);
  font-size: 0.8rem;
}

.score-label {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 850;
}

.score-display > div:last-child p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.name-form {
  max-width: 570px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.name-form label {
  display: block;
  margin-bottom: 10px;
  font-weight: 820;
}

.name-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.name-row input {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--text);
}

.name-row input::placeholder {
  color: var(--muted);
}

.name-form > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.result-card-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.named-score-card {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(169, 140, 255, 0.28);
  border-radius: 24px;
  background: var(--certificate-bg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.named-score-card::before,
.named-score-card::after {
  position: absolute;
  border: 1px solid rgba(105, 231, 255, 0.13);
  border-radius: 50%;
  content: "";
}

.named-score-card::before {
  width: 280px;
  height: 280px;
  right: -155px;
  bottom: -145px;
}

.named-score-card::after {
  width: 210px;
  height: 210px;
  right: -120px;
  bottom: -110px;
}

.certificate-kicker {
  margin-bottom: 22px;
  color: var(--cyan);
  font-size: 0.69rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.certificate-symbol {
  position: absolute;
  top: 24px;
  right: 28px;
  color: var(--line-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
  font-style: italic;
}

.certificate-label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.named-score-card h3 {
  min-height: 2.2em;
  margin-bottom: 24px;
  overflow-wrap: anywhere;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.certificate-score {
  display: grid;
  gap: 3px;
  margin-bottom: 28px;
}

.certificate-score strong {
  font-size: 1.7rem;
}

.certificate-score span {
  color: var(--violet);
  font-size: 0.82rem;
  font-weight: 760;
}

.certificate-date {
  position: absolute;
  bottom: 22px;
  left: 28px;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.result-actions .button {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 10px 13px;
  font-size: 0.82rem;
}

.site-footer {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  padding: 11px 15px;
  border: 1px solid rgba(113, 243, 176, 0.35);
  border-radius: 11px;
  background: var(--surface-strong);
  color: var(--green);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 780;
  animation: feedback-in 240ms ease both;
}

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

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

@media (max-width: 900px) {
  body {
    overflow-y: auto;
  }

  .site-header,
  .site-footer,
  .app-shell {
    width: min(calc(100% - 32px), var(--max-width));
  }

  .app-shell {
    min-height: calc(100vh - 128px);
    padding: 18px 0 28px;
  }

  #welcome-screen,
  .result-layout {
    grid-template-columns: 1fr;
  }

  .concept-orbit {
    width: min(62vw, 300px);
    order: -1;
  }

  .hero-card {
    padding-top: 30px;
  }

  .result-card-wrap {
    max-width: 540px;
  }
}

@media (max-width: 650px) {
  .site-header,
  .site-footer,
  .app-shell {
    width: min(calc(100% - 24px), var(--max-width));
  }

  .site-header {
    min-height: 64px;
  }

  .brand span:last-child {
    display: none;
  }

  .app-shell {
    align-items: start;
    padding-top: 10px;
  }

  .hero-card,
  .result-layout {
    border-radius: 22px;
  }

  .hero-card {
    padding: 28px 22px;
  }

  h1 {
    font-size: clamp(2.28rem, 12vw, 3.5rem);
  }

  .concept-orbit {
    width: min(64vw, 250px);
  }

  .question-card {
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .question-number {
    display: none;
  }

  .question-content {
    padding: 22px 18px;
  }

  .answer-option {
    grid-template-columns: 32px 1fr 20px;
  }

  .feedback-panel {
    grid-template-columns: 1fr;
  }

  .feedback-icon {
    width: 30px;
    height: 30px;
  }

  .quiz-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .quiz-actions p {
    order: 2;
    text-align: center;
  }

  .button-next {
    width: 100%;
  }

  .result-layout {
    padding: 27px 20px;
  }

  .score-display {
    align-items: flex-start;
    gap: 14px;
  }

  .score-ring {
    width: 94px;
    height: 94px;
  }

  .name-row {
    grid-template-columns: 1fr;
  }

  .named-score-card {
    min-height: 320px;
    padding: 28px;
  }

  .certificate-date {
    left: 28px;
  }

  .site-footer {
    flex-wrap: wrap;
    padding: 10px 0 16px;
  }
}

@media (min-width: 901px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body {
    line-height: 1.42;
  }

  .site-header {
    min-height: 56px;
  }

  .site-footer {
    min-height: 36px;
  }

  .site-header,
  .site-footer,
  .app-shell {
    width: min(calc(100% - 32px), var(--max-width));
  }

  .app-shell {
    min-height: 0;
    height: calc(100dvh - 92px);
    padding: 6px 0 10px;
  }

  .screen {
    max-height: 100%;
  }

  .button {
    min-height: 42px;
    padding: 10px 16px;
  }

  .quiz-header {
    margin-bottom: 6px;
  }

  .progress-track {
    margin-bottom: 8px;
  }

  .question-content {
    padding: 18px 24px;
  }

  .topic-tag {
    margin-bottom: 8px;
  }

  .question-content h2 {
    margin-bottom: 12px;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
  }

  .answer-options {
    gap: 7px;
  }

  .answer-option {
    min-height: 42px;
    padding: 7px 10px;
    font-size: 0.92rem;
  }

  .feedback-panel {
    grid-template-columns: 32px 1fr;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
  }

  .feedback-icon {
    width: 30px;
    height: 30px;
  }

  .feedback-explanation {
    margin-bottom: 9px;
    font-size: 0.84rem;
  }

  .takeaway {
    gap: 8px;
    padding-top: 8px;
    font-size: 0.86rem;
  }

  .quiz-actions {
    min-height: 40px;
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    min-height: auto;
    background: white;
    color: #111;
  }

  .site-header,
  .site-footer,
  .result-summary,
  .result-actions,
  .ambient,
  .grid-overlay,
  #welcome-screen,
  #quiz-screen {
    display: none !important;
  }

  .app-shell,
  #result-screen,
  .result-layout,
  .result-card-wrap {
    display: block !important;
    width: 100%;
    min-height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: white;
    box-shadow: none;
  }

  .named-score-card {
    width: 165mm;
    min-height: 105mm;
    margin: 25mm auto 0;
    border: 2px solid #27213d;
    background: white;
    color: #111;
    box-shadow: none;
  }

  .certificate-kicker,
  .certificate-score span {
    color: #483d8b;
  }

  .certificate-label,
  .certificate-date {
    color: #555;
  }
}
