/* The hosted page, "Saber Run": a live note tunnel behind everything (stage.js), white-hot type
   with saber-coloured halos, frosted cards. Dark only, by owner ruling (2026-10-16). */
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 700; font-display: swap; src: url("./vendor-stage/fonts/barlow-condensed-700-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 800; font-display: swap; src: url("./vendor-stage/fonts/barlow-condensed-800-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("./vendor-stage/fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("./vendor-stage/fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("./vendor-stage/fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("./vendor-stage/fonts/barlow-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("./vendor-stage/fonts/jetbrains-mono.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --void: #070B14;
  --ink: #F4F9FF;
  --soft: #A9B7C9;
  --left: #FF2D45;
  --right: #1AA8FF;
  --on-right: #021220;
  --ok: #4BE3A0;
  --error: #FF8A8A;
  --warn: #FFC861;
  --panel: rgba(9, 17, 28, 0.66);
  --card: rgba(9, 17, 28, 0.84);
  --field: rgba(4, 9, 16, 0.6);
  --edge: rgba(160, 200, 255, 0.16);
  --edge-strong: rgba(160, 200, 255, 0.3);
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;
  --space: 0.5rem;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  font: 100%/1.6 var(--body);
  background: var(--void);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--void); font-size: 1.0625rem; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
a { color: var(--right); }

/* ------------------------------------------------------------------ stage */
.stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0;
  background: radial-gradient(ellipse at 70% 45%, #12304a 0%, var(--void) 70%); }
.veil { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 1; transition: opacity 600ms;
  background: radial-gradient(ellipse at 50% 40%, rgba(7, 11, 20, 0.35), rgba(7, 11, 20, 0.82)); }
body[data-phase="signed-out"] .veil, body[data-phase="signing-in"] .veil { opacity: 0; }
.hud { position: fixed; z-index: 1; right: -0.08em; bottom: 3.5rem; pointer-events: none; white-space: nowrap; display: none;
  font: italic 800 clamp(90px, 16vw, 240px)/0.8 var(--display); color: transparent; -webkit-text-stroke: 1px rgba(160, 200, 255, 0.18); }
body[data-phase="signed-out"] .hud, body[data-phase="signing-in"] .hud { display: block; }
.site-header, main, .site-footer { position: relative; z-index: 2; }
.motion { position: fixed; z-index: 3; right: var(--gutter-r); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  font: 600 0.8125rem/1 var(--body); color: var(--ink); background: rgba(8, 12, 20, 0.72); border: 1px solid var(--edge);
  border-radius: 999px; padding: 0.6rem 0.9rem; min-height: 2.25rem; cursor: pointer; backdrop-filter: blur(8px); }

/* ------------------------------------------------------------------ base */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: 4; left: var(--gutter); top: -4rem; padding: var(--space) calc(2 * var(--space));
  background: var(--card); color: var(--ink); border: 1px solid var(--edge); border-radius: 10px; }
.skip-link:focus { top: var(--space); }
[hidden] { display: none !important; }
.hint { color: var(--soft); font-size: 0.875rem; margin: 0; }

.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space) calc(2 * var(--space));
  padding-block: 1.1rem; padding-left: var(--gutter); padding-right: var(--gutter-r); max-width: calc(1180px + 2 * 16px); width: 100%; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; color: var(--ink); text-decoration: none; }
.brand-name { font: italic 800 1.7rem/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase; text-shadow: 0 0 18px rgba(26, 168, 255, 0.45); }
.account { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.plan-badge { font: 0.8125rem/1.2 var(--mono); padding: 0.4rem 0.75rem; border-radius: 999px; border: 1px solid var(--edge); color: var(--soft); background: rgba(9, 17, 28, 0.5); }

main { flex: 1; width: 100%; max-width: calc(1180px + 2 * 16px); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-r); padding-block: 0 5rem; }
main:focus { outline: none; }
#app-view, #unavailable-view, #loading-view { max-width: 47.5rem; margin: 1.5rem auto 0; }
.site-footer { padding-block: 1.5rem calc(4.5rem + env(safe-area-inset-bottom, 0px)); padding-left: var(--gutter); padding-right: var(--gutter-r);
  color: var(--soft); font-size: 0.875rem; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 0.5rem; margin-bottom: 0.5rem; }
.footer-links a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.footer-links a:hover, .legal a:hover, .signin-agreement a:hover { color: var(--ink); }
.signin-action { flex: 1 1 16rem; max-width: 24rem; }
.signin-agreement { margin-top: 0.5rem; }
.hero-actions > .button-secondary { align-self: flex-start; }

/* ------------------------------------------------------------------ legal pages */
.legal { max-width: 75ch; min-width: 0; padding-top: 1.5rem; overflow-wrap: anywhere; }
.legal h1 { font: italic 800 clamp(2rem, 6vw, 3rem)/1.1 var(--display); }
.legal h2 { margin-top: 2rem; font-size: 1.5rem; line-height: 1.3; }
.legal h3 { margin-top: 1.5rem; font-size: 1.25rem; }
.legal p, .legal ul, .legal ol { margin-block: 1rem; }
.legal ul, .legal ol { padding-left: 1.5rem; }
.legal li > p { margin-block: 0.5rem; }
.legal blockquote { margin: 1rem 0; padding: 0.5rem 1rem; border-left: 3px solid var(--warn); background: var(--panel); }
.legal code { font: 0.875em var(--mono); }
.legal-table { max-width: 100%; overflow-x: auto; margin-block: 1rem; }
.legal table { width: 100%; border-collapse: collapse; }
.legal th, .legal td { min-width: 8rem; padding: 0.75rem; border: 1px solid var(--edge-strong); text-align: left; vertical-align: top; }
.legal th { background: var(--panel); }

/* ------------------------------------------------------------------ buttons */
.button-primary, .button-secondary, .button-quiet, .button-danger {
  font: 700 1.0625rem/1.2 var(--body); min-height: 3.25rem; padding: 0.8rem 1.6rem; border-radius: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; text-decoration: none; border: 1px solid transparent; }
.button-primary { color: var(--on-right); background: var(--right); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset, 0 10px 40px rgba(26, 168, 255, 0.4); }
.button-primary:hover { filter: brightness(1.08); }
.button-secondary { color: var(--right); background: rgba(7, 11, 20, 0.72); border-color: var(--right); backdrop-filter: blur(6px); }
.button-quiet { font-weight: 600; font-size: 0.9375rem; min-height: 2.75rem; padding: 0.5rem 1.1rem; color: var(--ink); background: rgba(9, 17, 28, 0.5); border-color: var(--edge); border-radius: 999px; }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: wait; }
.button-go { width: 100%; min-height: 3.75rem; font: italic 800 1.35rem/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

/* ------------------------------------------------------------------ landing */
.hero { min-height: clamp(520px, 78svh, 860px); display: flex; flex-direction: column; justify-content: flex-end; padding-block: 1.5rem 3.5rem; max-width: 46rem; }
.eyebrow { margin: 0 0 1rem; font: 0.8125rem/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--soft); display: flex; align-items: center; gap: 0.75rem; }
.eyebrow-mark { width: 30px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--left) 50%, var(--right) 50%); flex: none; }
.landing h1 { margin: 0; font: italic 800 clamp(64px, 12.5vw, 184px)/0.82 var(--display); text-transform: uppercase; letter-spacing: -0.005em; color: #FFF6F7; text-wrap: balance; }
.landing h1 span { display: block; }
.glow-left { text-shadow: 0 0 6px rgba(255, 45, 69, 0.9), 0 0 28px rgba(255, 45, 69, 0.7), 0 0 70px rgba(255, 45, 69, 0.45); }
.glow-right { color: #F2FAFF; text-shadow: 0 0 6px rgba(26, 168, 255, 0.9), 0 0 28px rgba(26, 168, 255, 0.7), 0 0 70px rgba(26, 168, 255, 0.45); }
.intro { margin: 1.75rem 0 0; max-width: 34rem; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); color: #D7E1EE; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 1.75rem 0 1rem; }
.hero .hint { max-width: 34rem; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9); }
/* Empty until Cloudflare renders into it; never display:none, so the widget can always mount. */
.turnstile:not(:empty) { margin: 1rem 0; }

.band { padding-block: 3.5rem; }
.band h2 { margin: 0 0 1.5rem; font: italic 800 clamp(42px, 5.5vw, 76px)/0.9 var(--display); text-transform: uppercase; }
.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 22px; backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); }
.how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.1rem; }
.how li { padding: 1.75rem; min-width: 0; }
.kicker { font: 0.8125rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--soft); }
.how h3 { margin: 0.5rem 0 0.4rem; font: italic 800 2rem/1 var(--display); text-transform: uppercase; }
.how p { margin: 0; color: var(--soft); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.1rem; margin-bottom: 1rem; }
.plan-card { padding: 1.6rem; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.plan-card .tier { font: 0.8125rem/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--soft); }
.plan-card .maps { font: italic 800 4.5rem/0.95 var(--display); font-variant-numeric: tabular-nums; }
.plan-card .unit { color: var(--soft); }
.plan-card ul { margin: 0.75rem 0 0; padding: 0 0 0 1.1rem; color: #CFD9E6; }
.plan-card a { margin-top: auto; padding-top: 1rem; font-weight: 700; }

/* ------------------------------------------------------------------ signed in */
.plan { padding: 0; margin: 0 0 1.1rem; overflow: hidden; }
.plan-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); margin: 0; }
.plan-facts div { padding: 1rem 1.25rem; min-width: 0; border-right: 1px solid var(--edge); }
.plan-facts div:last-child { border-right: 0; }
.plan-facts dt { font: 0.75rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); }
.plan-facts dd { margin: 0.15rem 0 0; font: italic 800 1.45rem/1.15 var(--display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#plan-left:not([data-remaining="0"]) { color: var(--right); text-shadow: 0 0 18px rgba(26, 168, 255, 0.55); }

.status { min-height: 1.5rem; font-weight: 600; margin: 0 0 1.1rem; display: flex; align-items: center; gap: 0.6rem; color: #D7E1EE; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--right); box-shadow: 0 0 12px var(--right); flex: none; }
.status:empty { display: none; }
.status:focus { outline: none; }
.status[data-state="success"] { color: #C9F6E2; }
.status[data-state="success"]::before { background: var(--ok); box-shadow: 0 0 12px var(--ok); }
.status[data-state="error"] { color: var(--error); padding: 0.8rem 1rem; border-radius: 14px; border: 1px solid rgba(255, 138, 138, 0.4); background: rgba(40, 8, 12, 0.7); }
.status[data-state="error"]::before { content: "Problem:"; width: auto; height: auto; border-radius: 0; background: none; box-shadow: none; font-weight: 700; }
#signin-status { margin-top: 0.5rem; }

.card { background: var(--card); border: 1px solid var(--edge); border-radius: 22px; padding: clamp(1.25rem, 4vw, 2.1rem);
  margin: 0 0 1.1rem; backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); }
.card h2 { margin: 0 0 1.4rem; font: italic 800 2.75rem/0.95 var(--display); text-transform: uppercase; }
h3 { font-size: 1rem; margin: 0 0 var(--space); }

.field { display: grid; align-content: start; gap: 0.4rem; margin-bottom: 1.4rem; min-width: 0; }
.field > label, legend { font-weight: 650; }
input, select { font: inherit; color: var(--ink); }
.field input:not([type="checkbox"]):not([type="color"]):not([type="file"]), select {
  width: 100%; min-width: 0; min-height: 3.1rem; padding: 0.6rem 0.9rem; border-radius: 12px; border: 1px solid var(--edge-strong); background: var(--field); }
input[type="color"] { width: 5.5rem; min-height: 3.1rem; padding: 0.25rem; border-radius: 12px; border: 1px solid var(--edge-strong); background: var(--field); }
.unit { color: var(--soft); font-weight: 400; }
[aria-invalid="true"] { border-color: var(--error) !important; outline: 2px solid var(--error); outline-offset: 1px; }

.drop { position: relative; display: grid; justify-items: center; gap: 0.4rem; padding: 1.9rem 1.25rem; text-align: center; color: var(--right);
  border-radius: 16px; border: 1.5px dashed rgba(160, 200, 255, 0.35); background: rgba(4, 9, 16, 0.55); }
.drop:hover, .drop:focus-within { border-color: var(--right); box-shadow: 0 0 0 4px rgba(26, 168, 255, 0.15); }
.drop-call { color: var(--ink); font-weight: 700; }
.drop-link { color: var(--right); text-decoration: underline; text-underline-offset: 4px; }
.drop-name { color: var(--soft); font-size: 0.875rem; overflow-wrap: anywhere; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; min-width: 0; }
legend { padding: 0; margin-bottom: 0.6rem; }
legend .hint { font-weight: 400; }
.choice-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.choice { --diff: var(--soft); position: relative; display: inline-flex; align-items: center; gap: 0.6rem; min-height: 3rem; padding: 0 1.1rem 0 0.9rem;
  border-radius: 12px; border: 1px solid var(--edge-strong); background: rgba(4, 9, 16, 0.5); color: var(--diff); }
.choice:has(input[value="Easy"]) { --diff: #4BE3A0; }
.choice:has(input[value="Normal"]) { --diff: #63B8FF; }
.choice:has(input[value="Hard"]) { --diff: #FFA24A; }
.choice:has(input[value="Expert"]) { --diff: #FF5C6C; }
.choice:has(input:checked) { border-color: var(--diff); background: rgba(255, 255, 255, 0.06); }
.choice input, .field-check input { width: 1.3rem; height: 1.3rem; margin: 0; accent-color: var(--diff, var(--right)); }
.choice label { font: italic 800 1.3rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; cursor: pointer; }
.choice label::after { content: ""; position: absolute; inset: 0; }

.field-check { grid-template-columns: auto 1fr; align-items: center; column-gap: 0.75rem; }
.field-check label { min-height: 2.75rem; display: flex; align-items: center; }
.field-check .hint { grid-column: 2; }
.settings .group { border: 1px solid var(--edge); border-radius: 16px; padding: 1.1rem 1.25rem 0.4rem; margin: 0 0 1.1rem; background: rgba(4, 9, 16, 0.4); }
.settings .group > legend { padding: 0 0.5rem; font: italic 800 1.4rem/1 var(--display); text-transform: uppercase; }
.settings .group-feel, .settings .group-look, .settings .group-elements { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); column-gap: 1.4rem; }
.settings .group > legend { grid-column: 1 / -1; }
.settings .overrides { border: 1px solid var(--edge); border-radius: 16px; padding: 0 1.25rem; margin: 0 0 1.1rem; background: rgba(4, 9, 16, 0.4); }
.overrides summary { cursor: pointer; font-weight: 650; min-height: 3.25rem; display: flex; align-items: center; }
.override-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0 1.4rem; padding-top: 0.5rem; }

.fixed-settings { border: 1px solid var(--edge); border-radius: 16px; padding: 1.1rem 1.25rem; margin-bottom: 1.4rem; background: rgba(4, 9, 16, 0.45); }
.fixed-settings h3 { display: flex; align-items: center; gap: 0.5rem; font-size: 1.0625rem; }
.fixed-settings h3::before { content: ""; width: 0.9rem; height: 0.9rem; border-radius: 3px; border: 2px solid var(--soft); border-top-width: 5px; flex: none; }
.upgrade-note { margin: 0 0 1rem; color: var(--soft); }
.upgrade-note a { color: var(--right); font-weight: 700; }
.defaults { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 0.75rem 1.4rem; margin: 0; }
.defaults div { min-width: 0; }
.defaults dt { font: 0.75rem/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); }
.defaults dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.swatch-row { display: inline-flex; align-items: center; gap: 0.5rem; }
.swatch { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 4px; border: 1px solid var(--edge-strong); }

.steps { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.9rem; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.25rem 1fr; align-items: center; gap: 0.9rem; color: var(--soft); }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  border: 2px solid var(--edge-strong); font: 600 0.8125rem/1 var(--mono); font-variant-numeric: tabular-nums; }
.steps li[data-status="done"] { color: var(--ink); }
.steps li[data-status="done"]::before { content: "✓"; border-color: var(--ok); color: var(--ok); }
.steps li[data-status="current"] { color: var(--ink); font-weight: 700; }
.steps li[data-status="current"]::before { border-color: var(--right); background: var(--right); color: var(--on-right); box-shadow: 0 0 18px var(--right); }
.steps li[data-status="stopped"] { color: var(--error); font-weight: 700; }
.steps li[data-status="stopped"]::before { content: "!"; border-color: var(--error); color: var(--error); }
@media (prefers-reduced-motion: no-preference) {
  .steps li[data-status="current"]::before { animation: pulse 1.6s ease-in-out infinite; }
}
@keyframes pulse { 50% { opacity: 0.55; } }

.self-check { color: #CFF7E5; font-weight: 600; display: flex; gap: 0.6rem; margin: 0 0 0.5rem; }
.self-check:empty { display: none; }
.self-check[data-self-check="passed"]::before { content: "✓"; color: var(--ok); font-weight: 800; }
.warning { margin: 1.4rem 0 0; padding: 0.9rem 1.1rem; border-radius: 14px; border: 1px solid rgba(255, 200, 97, 0.35); background: rgba(40, 30, 8, 0.6); color: #F6E6C2; }

#unavailable-view h1 { font: italic 800 clamp(2.5rem, 6vw, 4rem)/0.95 var(--display); text-transform: uppercase; }

@media (max-width: 40rem) {
  .plan-facts div { border-right: 0; border-bottom: 1px solid var(--edge); }
  .plan-facts div:last-child { border-bottom: 0; }
  .hud { display: none !important; }
  .hero { min-height: 0; justify-content: flex-start; padding-block: 2rem 2.5rem; }
  .intro { padding: 0.75rem 0.9rem; margin-inline: -0.9rem; border-radius: 14px; background: rgba(7, 11, 20, 0.6);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
}
@media (prefers-reduced-transparency: reduce) {
  .panel, .card { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(9, 17, 28, 0.96); }
}

.account-delete { font: inherit; color: var(--soft); background: transparent; border: 0; padding: 0.5rem 0;
  min-height: 2.75rem; margin-top: 1rem; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
.account-delete:hover { color: var(--ink); }
.card-danger { border-color: var(--error); margin-top: 1rem; overflow-wrap: anywhere; }
.card-danger h2 { font-size: clamp(1.75rem, 6vw, 2.75rem); }
.card-danger .actions > button { max-width: 100%; }
.button-danger { color: var(--void); background: var(--error); }
.button-danger:hover { filter: brightness(1.08); }
