@import url("https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700;800&family=Inter:wght@400;500&family=JetBrains+Mono:wght@600&display=swap");

:root {
  --bg: #12162B; --fg: #E4E6F0; --muted: #8C92B3; --line: #2C3254; --card: #191E38;
  --spine: #F5B53F; --dead: #FF7A7A; --right: #5ED8B0; --right-bg: #173A3A;
  --link: #F5B53F; --focus: #F5B53F; --cta: #F5B53F; --cta-fg: #12162B;
  --ui: "Onest", system-ui, sans-serif; --story: "Onest", system-ui, sans-serif;
  --s1: #F5B53F; --s2: #8FA8FF; --s3: #B9BED6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 1.05rem/1.6 var(--story); -webkit-text-size-adjust: 100%; }
h1 { font: 800 2rem/1.12 var(--ui); letter-spacing: -0.02em; margin: 1.4rem 0 1rem; text-wrap: balance; }
main { max-width: 40rem; margin: 0 auto; padding: 0.75rem 16px 5rem; }
a { color: var(--link); text-underline-offset: 0.18em; }
code { font: 0.88em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 0.1em 0.35em; border-radius: 5px; background: var(--card); border: 1px solid var(--line); overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bar { display: flex; justify-content: space-between; align-items: center; min-height: 2.5rem; font: 500 0.9rem/1 var(--ui); }
.bar a { text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
button:disabled { cursor: default; }
.lang { font: 600 0.8rem/1 var(--ui); padding: 0.45rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; }

.step, .outro { position: relative; padding: 1.75rem 0 0.25rem 2.4rem; }
.step::before, .outro::before { content: ""; position: absolute; left: 0.7rem; top: 0; bottom: 0; width: 2px; background: var(--spine); }
.step h2, .outro h2 { position: relative; margin: 0 0 0.6rem; font: 600 0.8rem/1.3 "JetBrains Mono", monospace; color: var(--spine); }
.step h2::before, .outro h2::before {
  content: ""; position: absolute; left: -2.08rem; top: 50%; translate: 0 -50%;
  width: 0.9rem; height: 0.9rem; border-radius: 50%; background: var(--bg); border: 2px solid var(--spine);
}
.step:last-of-type h2::before { background: var(--spine); }
.outro h2::before { background: var(--right); border-color: var(--right); width: 1.1rem; height: 1.1rem; left: -2.18rem; border-radius: 3px; }
.outro::before { bottom: auto; height: 1.9rem; }

.option {
  position: relative; display: block; width: 100%; text-align: left; margin: 0.55rem 0;
  padding: 0.75rem 0.95rem; font: 400 1rem/1.4 var(--ui);
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--card);
  transition: border-color 0.15s;
}
.option:not(:disabled):hover { border-color: var(--fg); }
.option.wrong { color: var(--muted); border-style: dashed; border-color: var(--dead); background: transparent; }
.option.wrong::before {
  content: "✕"; position: absolute; left: -1.95rem; top: 50%; translate: 0 -50%;
  width: 1.4rem; text-align: center; font: 700 0.8rem/1 var(--ui); color: var(--dead); background: var(--bg);
}
.option.right { border-color: var(--right); background: var(--right-bg); font-weight: 600; }
.option.right::before {
  content: ""; position: absolute; left: -2.02rem; top: 50%; translate: 0 -50%;
  width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--right);
}
.result { margin: 0.1rem 0 1rem 0.95rem; padding-left: 0.9rem; font-size: 0.97rem; }
.result p { margin: 0.35rem 0; }
.result.wrong { border-left: 2px dashed var(--dead); color: var(--muted); }
.result.right { border-left: 2px solid var(--right); }

.next {
  position: sticky; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 1; display: block; width: fit-content;
  margin: 0.5rem 0 1rem; padding: 0.8rem 1.3rem; border-radius: 10px; font: 600 1rem/1.2 var(--ui);
  background: var(--cta); color: var(--cta-fg); box-shadow: 0 0 0 6px var(--bg), 0 6px 20px rgb(0 0 0 / 0.5);
}
.score { font: 600 1rem/1.4 var(--ui); }
.episodes { list-style: none; padding: 0; font-family: var(--ui); }
.episodes li { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.chart-link { text-decoration-style: dotted; text-decoration-thickness: 1.5px; }
.chart-link::after { content: "\00a0↗"; font-size: 0.8em; }
.chart-source { font: 400 0.9rem/1.4 var(--ui); color: var(--muted); }

.intro {
  position: relative; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--spine);
  border-radius: 10px; padding: 0.4rem 1rem 0.4rem 2.2rem; margin-bottom: 0.5rem;
}
.intro::before {
  content: ""; position: absolute; left: 0.85rem; top: 1.15rem; width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--spine); animation: page 0.9s ease-in-out 3;
}
@keyframes page { 50% { opacity: 0.15; } }

.panel {
  --bg: #111217; --card: #181b1f; --fg: #ccccdc; --muted: #8e8e9c; --line: #2a2d33; --spine: #FF9830;
  --s1: #73BF69; --s2: #FADE2A; --s3: #5794F2; --threshold: #F2495C; --ui: "Inter", system-ui, sans-serif;
  margin: 0.75rem 0 1rem; padding: 0 0.5rem 0.5rem; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 4px; font: 400 0.8rem/1.3 var(--ui);
}
.dash-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0; color: var(--muted); }
.crumbs { flex: 1; min-width: 5.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumbs b { color: var(--fg); font-weight: 500; }
.picker, .refresh { padding: 0.25rem 0.5rem; border: 1px solid var(--line); border-radius: 2px; background: var(--card); white-space: nowrap; }
.panel-card { background: var(--card); border: 1px solid var(--line); border-radius: 2px; padding: 0.4rem 0.3rem 0.2rem; }
.panel figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0 0.3rem; font-weight: 500; }
.panel .chart-link { color: var(--fg); }
.panel .illustrative { padding: 0 0.4rem; border: 1px dashed var(--s2); border-radius: 2px; color: var(--s2); font-size: 0.7rem; cursor: help; }
.panel .plot { margin: 0.4rem 0 0; min-height: 220px; }
.legend { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.legend th { color: var(--s3); font-weight: 500; }
.legend th, .legend td { padding: 0.15rem 0.4rem; text-align: right; }
.legend td:first-child { text-align: left; }
.legend i { display: inline-block; width: 14px; height: 4px; margin-right: 0.4rem; border-radius: 1px; vertical-align: middle; }
.tooltip { position: absolute; z-index: 2; pointer-events: none; padding: 0.4rem 0.55rem; background: #22252b; border: 1px solid var(--line); border-radius: 2px; box-shadow: 0 4px 12px rgb(0 0 0 / 0.5); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tooltip b { display: block; margin-bottom: 0.2rem; color: var(--muted); font-weight: 500; }
.tooltip i { display: inline-block; width: 10px; height: 3px; margin-right: 0.4rem; vertical-align: middle; }
.tooltip span { float: right; margin-left: 1rem; font-weight: 500; }
.hint-btn { margin: 0.3rem 0 0.2rem; padding: 0.45rem 0.9rem; border: 1.5px dashed var(--line); border-radius: 10px; font: 500 0.9rem/1.2 var(--ui); color: var(--muted); }
.hint-btn:hover { color: var(--fg); border-color: var(--fg); }
.hint { margin: 0.4rem 0; padding: 0.1rem 0 0.1rem 0.9rem; border-left: 2px solid var(--spine); font-size: 0.97rem; }
.hint p { margin: 0.35rem 0; }
.result .option { margin: 0.4rem 0; font-size: 0.95rem; }
.result .option::before { content: none; }
