:root {
  color-scheme: dark;
  --ink: #eff8fa;
  --muted: #9fb4bb;
  --faint: #718992;
  --surface: rgba(12, 27, 40, 0.92);
  --surface-solid: #0c1b28;
  --surface-2: #112737;
  --line: rgba(164, 212, 218, 0.16);
  --line-strong: rgba(164, 212, 218, 0.3);
  --cyan: #71f1e7;
  --cyan-soft: rgba(113, 241, 231, 0.12);
  --lime: #c8ff72;
  --amber: #ffc66d;
  --red: #ff8f87;
  --navy: #07131f;
  --radius-lg: 26px;
  --radius-md: 16px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--navy); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 20% 0%, #113141 0, transparent 36rem),
    var(--navy);
  background-size: 48px 48px, 48px 48px, auto, auto;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

button, a { font: inherit; }
button { color: inherit; }

button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 4px;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(110px);
  opacity: .11;
  pointer-events: none;
}

.ambient-one { width: 24rem; height: 24rem; background: var(--cyan); top: 12%; left: -12rem; }
.ambient-two { width: 28rem; height: 28rem; background: #3478ba; right: -15rem; bottom: 2%; }

.topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border: 1px solid rgba(113, 241, 231, .5);
  border-radius: 50%;
  box-shadow: inset 0 0 16px rgba(113, 241, 231, .1), 0 0 20px rgba(113, 241, 231, .08);
}

.brand-mark span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 13px var(--cyan);
}

.brand strong, .brand small { display: block; line-height: 1.3; }
.brand strong { font-size: .95rem; letter-spacing: .005em; }
.brand small { color: var(--faint); font-size: .7rem; letter-spacing: .15em; margin-top: 4px; }

.restart-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 30, 43, .7);
  cursor: pointer;
  font-size: .84rem;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.restart-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.restart-button:hover { border-color: var(--cyan); background: var(--cyan-soft); transform: translateY(-1px); }

.progress-wrap {
  width: min(780px, calc(100% - 40px));
  margin: 28px auto 14px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.progress-track { height: 3px; margin-top: 10px; overflow: hidden; background: rgba(255,255,255,.08); border-radius: 999px; }
.progress-track span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--lime)); border-radius: inherit; transition: width .6s cubic-bezier(.2,.8,.2,1); }

.status-bar {
  width: min(780px, calc(100% - 40px));
  min-height: 74px;
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  background: rgba(7, 19, 31, .76);
  backdrop-filter: blur(16px);
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .2);
  position: relative;
  z-index: 8;
}

.status-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 20px;
  border-right: 1px solid var(--line);
}

.status-item:last-child { border-right: 0; }
.status-icon { flex: 0 0 auto; width: 27px; height: 27px; position: relative; }
.score-icon { border: 1px solid var(--cyan); border-radius: 50%; }
.score-icon::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--cyan); border-radius: 50%; opacity: .5; }
.score-icon::after { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); top: 11px; left: 11px; box-shadow: 0 0 8px var(--cyan); }
.sample-icon { border: 1px solid var(--amber); border-radius: 4px 4px 8px 8px; transform: scale(.65); }
.sample-icon::before { content: ""; position: absolute; width: 19px; height: 6px; left: 3px; top: -7px; border: 2px solid var(--amber); border-bottom: 0; border-radius: 5px 5px 0 0; }
.sample-icon::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 4px; height: 8px; background: rgba(255,198,109,.35); border-radius: 0 0 5px 5px; }
.evidence-icon { border: 1px solid var(--lime); border-radius: 3px; transform: rotate(-4deg) scale(.75); }
.evidence-icon::before, .evidence-icon::after { content: ""; position: absolute; left: 5px; height: 1px; background: var(--lime); opacity: .7; }
.evidence-icon::before { width: 15px; top: 8px; box-shadow: 0 6px 0 var(--lime), 0 12px 0 var(--lime); }

.status-copy { display: block; min-width: 0; line-height: 1.25; }
.status-copy small { display: block; color: var(--faint); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.status-copy strong { display: block; margin-top: 4px; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

details.evidence-status { padding: 0; }
details.evidence-status summary { list-style: none; width: 100%; display: flex; align-items: center; gap: 11px; padding: 13px 18px; cursor: pointer; }
details.evidence-status summary::-webkit-details-marker { display: none; }
details.evidence-status summary > svg { width: 17px; margin-left: auto; fill: none; stroke: var(--faint); stroke-width: 1.7; transition: transform .2s ease; }
details.evidence-status[open] summary > svg { transform: rotate(180deg); }
.evidence-popover { position: absolute; width: min(360px, calc(100vw - 40px)); right: 0; top: calc(100% + 9px); padding: 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: #102432; box-shadow: var(--shadow); }
.evidence-popover p { margin: 0; color: var(--muted); font-size: .88rem; }
.evidence-popover ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.evidence-popover li { display: flex; align-items: flex-start; gap: 9px; font-size: .88rem; }
.evidence-popover li::before { content: ""; width: 7px; height: 7px; margin-top: .5em; flex: 0 0 auto; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px rgba(200,255,114,.5); }

#app {
  width: min(780px, calc(100% - 40px));
  min-height: 560px;
  margin: 0 auto 30px;
  outline: none;
}

.scene { animation: sceneIn .46s cubic-bezier(.2,.8,.2,1) both; }
.scene.is-leaving { animation: sceneOut .16s ease both; }

@keyframes sceneIn { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sceneOut { to { opacity: 0; transform: translateY(-8px); } }

.scene-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(17, 39, 55, .96), rgba(10, 24, 36, .98));
  box-shadow: var(--shadow);
}

.scene-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(180deg, transparent, var(--cyan), transparent); opacity: .8; }
.scene-content { padding: clamp(26px, 5vw, 48px); }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; color: var(--cyan); font-size: .73rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 19px; height: 1px; background: currentColor; }
h1, h2 { margin: 0; line-height: 1.08; letter-spacing: -.035em; }
h1 { max-width: 660px; font-size: clamp(2.35rem, 7vw, 4.7rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.65rem); }
.lead { max-width: 65ch; margin: 24px 0 0; color: #c7d8dc; font-size: clamp(1.02rem, 2vw, 1.12rem); line-height: 1.78; }
.scene-rule { width: 100%; height: 1px; margin: 31px 0; background: linear-gradient(90deg, var(--line-strong), transparent); }

.start-card { min-height: 540px; display: grid; align-items: end; background: radial-gradient(circle at 82% 20%, rgba(113,241,231,.13), transparent 17rem), linear-gradient(145deg, #102a3b, #091822 70%); }
.start-card::after { content: ""; position: absolute; width: 240px; height: 240px; right: -70px; top: -70px; border: 1px solid rgba(113,241,231,.12); border-radius: 50%; box-shadow: 0 0 0 38px rgba(113,241,231,.025), 0 0 0 78px rgba(113,241,231,.018); }
.start-copy { position: relative; z-index: 1; }
.start-note { display: flex; gap: 18px; margin: 29px 0; padding: 17px 19px; max-width: 590px; border: 1px solid var(--line); border-radius: 14px; background: rgba(4, 14, 23, .3); }
.start-note span { color: var(--faint); font-size: .73rem; letter-spacing: .1em; text-transform: uppercase; }
.start-note strong { display: block; color: var(--ink); margin-top: 2px; font-size: .9rem; }

.primary-button, .decision-button, .continue-button {
  border: 0;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.primary-button, .continue-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 21px;
  border-radius: 12px;
  background: var(--cyan);
  color: #04201e;
  font-weight: 800;
  box-shadow: 0 12px 34px rgba(113, 241, 231, .14);
}

.primary-button:hover, .continue-button:hover:not(:disabled) { transform: translateY(-2px); background: #93fff5; box-shadow: 0 16px 38px rgba(113, 241, 231, .2); }
.primary-button svg, .continue-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.continue-button:disabled { cursor: not-allowed; background: #2a414c; color: #81959b; box-shadow: none; }

.decision-heading { margin: 0 0 18px; font-size: 1.03rem; letter-spacing: -.01em; }
.decision-list { display: grid; gap: 12px; }
.decision-button {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 36px 1fr 20px;
  align-items: center;
  gap: 15px;
  padding: 13px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 18, 28, .46);
  text-align: left;
}
.decision-button:hover { transform: translateX(4px); border-color: rgba(113,241,231,.55); background: rgba(113,241,231,.075); }
.choice-key { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--cyan); font-size: .8rem; font-weight: 800; }
.choice-label { font-weight: 680; line-height: 1.4; }
.decision-button svg { width: 18px; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.consequence-banner { margin: 27px 0 0; display: flex; align-items: center; gap: 11px; color: var(--amber); font-size: .78rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.consequence-banner::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px rgba(255,198,109,.65); }
.state-change { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.state-chip { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); color: var(--muted); font-size: .76rem; }
.state-chip.negative { border-color: rgba(255,143,135,.25); color: var(--red); }
.state-chip.positive { border-color: rgba(200,255,114,.24); color: var(--lime); }

.activity-panel { margin-top: 28px; padding: clamp(18px, 4vw, 27px); border: 1px solid var(--line); border-radius: 18px; background: rgba(3, 13, 22, .45); }
.activity-kicker { margin: 0 0 6px; color: var(--lime); font-size: .69rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.activity-panel h3 { margin: 0; font-size: clamp(1.05rem, 3vw, 1.3rem); line-height: 1.4; }
.activity-help { margin: 7px 0 17px; color: var(--faint); font-size: .85rem; }
.activity-feedback { min-height: 28px; margin: 13px 0 0; color: var(--muted); font-size: .88rem; }
.activity-feedback.correct { color: var(--lime); }
.activity-feedback.try-again { color: var(--amber); }

.microscopy-frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid var(--line-strong); border-radius: 14px; background: #02090e; }
.microscopy-frame::after { content: ""; position: absolute; z-index: 2; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 0, rgba(113,241,231,.035) 50%, transparent 100%); background-size: 100% 9px; }
.microscopy-frame svg { width: 100%; height: 100%; display: block; }
.media-label { position: absolute; z-index: 3; left: 12px; bottom: 10px; padding: 4px 8px; border: 1px solid rgba(255,255,255,.15); border-radius: 5px; background: rgba(1, 8, 12, .78); color: #9eb4ba; font-size: .66rem; letter-spacing: .09em; text-transform: uppercase; }
.hotspot { position: absolute; z-index: 4; width: 54px; height: 54px; margin: -27px 0 0 -27px; border: 2px solid rgba(255,255,255,.78); border-radius: 50%; background: rgba(255,255,255,.07); color: #fff; cursor: pointer; font-size: .72rem; font-weight: 850; box-shadow: 0 0 0 5px rgba(255,255,255,.06); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.hotspot:hover { transform: scale(1.1); border-color: var(--cyan); background: rgba(113,241,231,.16); }
.hotspot[data-hotspot="a"] { left: 23%; top: 38%; }
.hotspot[data-hotspot="b"] { left: 54%; top: 50%; }
.hotspot[data-hotspot="c"] { left: 81%; top: 34%; }
.hotspot.correct { border-color: var(--lime); background: rgba(200,255,114,.2); box-shadow: 0 0 0 6px rgba(200,255,114,.08), 0 0 23px rgba(200,255,114,.3); }
.hotspot.incorrect { border-color: var(--amber); background: rgba(255,198,109,.2); }
.hotspot:disabled { cursor: default; }
.hotspot:disabled:hover { transform: none; }

.match-board { margin-top: 18px; display: grid; grid-template-columns: minmax(0, .75fr) 34px minmax(0, 1.25fr); gap: 10px; align-items: stretch; }
.match-column { display: grid; grid-template-rows: repeat(3, 1fr); gap: 10px; }
.match-divider { display: grid; place-items: center; color: var(--faint); }
.match-divider svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.match-item, .match-target { min-height: 59px; border-radius: 11px; font: inherit; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.match-item { border: 1px solid rgba(113,241,231,.32); background: rgba(113,241,231,.07); color: var(--ink); font-weight: 800; }
.match-item:hover:not(:disabled), .match-item.selected { border-color: var(--cyan); background: rgba(113,241,231,.14); transform: translateY(-1px); }
.match-item.matched { color: var(--lime); border-color: rgba(200,255,114,.25); background: rgba(200,255,114,.06); cursor: default; }
.match-target { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border: 1px dashed var(--line-strong); background: rgba(255,255,255,.018); color: var(--muted); text-align: left; }
.match-target:hover, .match-target.drop-ready { border-color: var(--cyan); background: rgba(113,241,231,.06); }
.match-target.matched { border-style: solid; border-color: rgba(200,255,114,.3); background: rgba(200,255,114,.055); color: var(--ink); }
.filter-swatch { width: 9px; height: 30px; flex: 0 0 auto; border-radius: 999px; background: var(--swatch, var(--cyan)); box-shadow: 0 0 12px color-mix(in srgb, var(--swatch, var(--cyan)) 55%, transparent); }
.matched-name { display: block; color: var(--lime); font-size: .72rem; font-weight: 800; }
.shake { animation: shake .3s ease; }
@keyframes shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }

.action-row { margin-top: 24px; display: flex; justify-content: flex-end; }

.result-card { text-align: center; }
.result-card::before { width: 100%; height: 3px; inset: 0 0 auto; background: linear-gradient(90deg, transparent, var(--result-color, var(--cyan)), transparent); }
.result-symbol { display: grid; place-items: center; width: 74px; height: 74px; margin: 0 auto 21px; border: 1px solid color-mix(in srgb, var(--result-color, var(--cyan)) 42%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--result-color, var(--cyan)) 8%, transparent); color: var(--result-color, var(--cyan)); font-size: 1.6rem; box-shadow: 0 0 30px color-mix(in srgb, var(--result-color, var(--cyan)) 13%, transparent); }
.result-label { margin: 15px 0 8px; color: var(--result-color, var(--cyan)); font-weight: 800; font-size: 1.12rem; }
.result-explanation { max-width: 59ch; margin: 0 auto; color: #c7d8dc; }
.result-guidance { max-width: 59ch; margin: 13px auto 0; color: var(--muted); font-size: .93rem; }
.result-metrics { margin: 28px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; text-align: left; }
.result-metric { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(3,13,22,.36); }
.result-metric.wide { grid-column: 1 / -1; }
.result-metric small { display: block; color: var(--faint); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.result-metric strong { display: block; margin-top: 5px; font-size: 1.2rem; }
.result-evidence { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.result-evidence li { padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .77rem; }
.result-card .primary-button { margin: 0 auto; }

.footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 20px 0 28px; display: flex; justify-content: space-between; color: #4f6871; font-size: .64rem; font-weight: 700; letter-spacing: .15em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 620px) {
  .topbar { width: min(100% - 28px, 1180px); min-height: 78px; }
  .brand small { display: none; }
  .brand strong { max-width: 190px; font-size: .82rem; }
  .restart-button { width: 42px; padding: 0; justify-content: center; }
  .restart-button span, .restart-button { font-size: 0; }
  .restart-button svg { width: 18px; }
  .progress-wrap, .status-bar, #app { width: min(100% - 28px, 780px); }
  .progress-wrap { margin-top: 22px; }
  .status-bar { min-height: 67px; }
  .status-item, details.evidence-status summary { padding: 11px 9px; gap: 7px; }
  .status-icon { width: 22px; height: 22px; }
  .score-icon::before { inset: 5px; }
  .score-icon::after { top: 8px; left: 8px; }
  .sample-icon { transform: scale(.55); }
  .evidence-icon { transform: rotate(-4deg) scale(.64); }
  .status-copy small { font-size: .56rem; letter-spacing: .04em; }
  .status-copy strong { font-size: .87rem; }
  details.evidence-status summary > svg { display: none; }
  .scene-content { padding: 25px 21px; }
  .start-card { min-height: 510px; }
  .start-note { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .decision-button { grid-template-columns: 33px 1fr; }
  .decision-button > svg { display: none; }
  .match-board { grid-template-columns: 1fr; }
  .match-divider { height: 22px; transform: rotate(90deg); }
  .hotspot { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
  .result-metrics { grid-template-columns: 1fr 1fr; }
  .footer { width: min(100% - 28px, 1180px); }
}

@media (max-width: 390px) {
  .status-icon { display: none; }
  .status-item, details.evidence-status summary { justify-content: center; text-align: center; }
  .status-copy small { white-space: normal; line-height: 1.15; }
  .result-metrics { grid-template-columns: 1fr; }
  .result-metric.wide { grid-column: auto; }
}

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