:root {
  color-scheme: light;
  --navy-950: #ffffff;
  --navy-900: #071829;
  --navy-800: #003c33;
  --ink: #212121;
  --muted: #616161;
  --gold: #ff7759;
  --line: #d9d9dd;
  --panel: #ffffff;
  --stone: #eeece7;
  --pale-green: #edfce9;
  --pale-blue: #f1f5ff;
  --primary: #17171c;
  --focus: #4c6ee6;
  --radius: 22px;
  --shadow: none;
  --font-display: CohereText, "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  --font-ui: "Unica77 Cohere Web", Inter, Arial, ui-sans-serif, system-ui, sans-serif;
  --font-mono: CohereMono, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--navy-950); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-ui);
  background: var(--navy-950);
}
body::before {
  content: none;
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button:disabled { cursor: not-allowed; }
.skip-link { position: fixed; z-index: 100; left: 1rem; top: -5rem; padding: .8rem 1rem; color: #061327; background: #fff; border-radius: 10px; }
.skip-link:focus { top: 1rem; }
.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; }
.icon { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.star-total .icon, .node-stars + .icon { fill: currentColor; }

.topbar {
  position: relative;
  z-index: 20;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem clamp(1rem, 3vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(3, 11, 24, 0.88);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: .8rem; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.brand-mark { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; color: var(--gold); border: 1px solid rgba(244, 185, 66, .5); border-radius: 50%; font-size: 1.55rem; }
.brand strong { display: block; font: 700 clamp(1.25rem, 2vw, 1.75rem)/1 var(--font-display); }
.brand small { display: block; margin-top: .3rem; color: var(--muted); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: .65rem; }
.star-total { display: flex; align-items: center; gap: .35rem; min-height: 44px; padding: .55rem .9rem; color: var(--gold); }
.star-total strong { font-size: 1.05rem; }
.star-total span { color: var(--muted); }
.icon-button { min-height: 44px; display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.icon-button:hover { border-color: rgba(244,185,66,.65); background: rgba(244,185,66,.08); transform: translateY(-1px); }
.icon-button b { color: var(--gold); font-size: .68rem; text-transform: uppercase; }

.welcome-shell, .showcase-shell { width: min(1320px, 100%); min-height: calc(100vh - 76px); margin: auto; padding: clamp(1.25rem, 4vw, 4rem); }
.welcome-hero { min-height: min(650px, calc(100vh - 110px)); display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: clamp(2rem, 6vw, 6rem); }
.welcome-copy h1, .showcase-intro h1 { max-width: 780px; margin: 0 0 1rem; font-size: clamp(3.3rem, 5.8vw, 6.2rem); line-height: .91; letter-spacing: -.05em; }
.welcome-copy > p, .showcase-intro > div > p { max-width: 670px; margin: 0; color: var(--muted); font-size: clamp(1.05rem, 1.8vw, 1.3rem); line-height: 1.65; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 2rem 0; }
.welcome-proof { display: flex; gap: clamp(1rem, 4vw, 3rem); margin: 0; padding: 0; list-style: none; }
.welcome-proof li { display: grid; gap: .2rem; }
.welcome-proof strong { color: var(--gold); font: 700 2rem var(--font-display); }
.welcome-proof span { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
.welcome-realms { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; transform: rotate(1.5deg); }
.welcome-realms article { position: relative; min-height: 220px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--realm) 48%, transparent); border-radius: 24px; background: color-mix(in srgb, var(--realm) 10%, var(--panel)); box-shadow: var(--shadow); }
.welcome-realms article:nth-child(even) { transform: translateY(1.4rem); }
.welcome-realms .realm-art { height: 180px; margin: 0; }
.welcome-realms strong { position: absolute; left: 1rem; bottom: .9rem; color: var(--realm); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.showcase-shell { width: min(1180px, 100%); }
.showcase-intro { min-height: 650px; display: grid; grid-template-columns: 1fr .72fr; align-items: center; gap: clamp(2rem, 7vw, 7rem); }
.showcase-intro h1 { font-size: clamp(3rem, 6vw, 5.7rem); }
.showcase-intro .primary-button { margin-top: 1.8rem; }
.showcase-route { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.showcase-route li { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-left: 3px solid var(--realm); background: color-mix(in srgb, var(--realm) 8%, transparent); }
.showcase-route li > span { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--realm); border-radius: 50%; color: var(--realm); font-weight: 900; }
.showcase-route strong, .showcase-route small { display: block; }
.showcase-route small { margin-top: .25rem; color: var(--muted); }
.showcase-banner { display: flex; align-items: center; justify-content: center; gap: 1rem; min-height: 46px; padding: .55rem 1rem; color: #181006; background: var(--gold); }
.showcase-banner span { font-size: .8rem; }
.showcase-banner button { min-height: 44px; padding: .35rem .65rem; border: 1px solid rgba(0,0,0,.38); border-radius: 8px; color: #181006; background: transparent; cursor: pointer; font-weight: 800; }

.map-shell { width: min(1480px, 100%); margin: auto; padding: clamp(1.2rem, 3vw, 2.75rem); }
.map-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
h1, h2 { font-family: var(--font-display); }
.map-heading h1 { margin: 0 0 .3rem; font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -.025em; }
.map-heading p { margin: 0; color: var(--muted); font-size: 1rem; }
.map-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; }
.mobile-reset { display: none; }
.journey-progress { width: min(280px, 34vw); color: var(--muted); font-size: .8rem; text-align: right; }
.journey-progress > div { height: 6px; margin-top: .55rem; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.1); }
.journey-progress i { display: block; height: 100%; border-radius: inherit; background: var(--gold); transition: width .5s ease; }
.mastery-dashboard { display: grid; grid-template-columns: minmax(210px, .5fr) 1.5fr; gap: 1.25rem; margin-bottom: 1.25rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(5,18,38,.72); }
.mastery-overall { display: grid; grid-template-columns: 1fr auto; gap: .35rem .8rem; padding-right: 1.25rem; border-right: 1px solid var(--line); }
.mastery-overall > span, .mastery-overall small { color: var(--muted); font-size: .75rem; }
.mastery-overall > strong { color: var(--gold); }
.mastery-overall > div, .realm-mastery div > div { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.1); }
.mastery-overall i, .realm-mastery i { display: block; height: 100%; border-radius: inherit; background: var(--gold); transition: width .5s ease; }
.realm-mastery { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem 1.25rem; }
.realm-mastery > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .25rem .75rem; }
.realm-mastery span, .realm-mastery strong { font-size: .72rem; }
.realm-mastery strong { color: var(--realm); }
.realm-mastery i { background: var(--realm); }

.realm-map { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.realm-map::before { content: ""; position: absolute; z-index: -1; left: 8%; right: 8%; top: 72%; height: 18px; border-block: 2px solid #ae7f3d; background: #d9b56f; transform: rotate(-1deg); box-shadow: 0 8px 14px rgba(0,0,0,.3); }
.realm {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--realm) 42%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--realm) 9%, rgba(5,18,38,.94));
  box-shadow: var(--shadow);
  transition: transform .25s ease, border-color .25s ease;
}
.realm.is-unlocked:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--realm) 75%, white); }
.realm.is-locked { filter: saturate(.3); }
.realm.is-locked::after { content: ""; position: absolute; inset: 0; background: rgba(2,8,18,.48); pointer-events: none; }
.realm-title { position: relative; z-index: 3; padding: 1.25rem 1.35rem 0; }
.realm-title > span, .briefing-copy > span, .challenge-heading > span, .feedback-panel > span { color: var(--realm); font-weight: 800; font-size: .74rem; letter-spacing: .13em; text-transform: uppercase; }
.realm-title h2 { margin: .25rem 0 .35rem; font-size: clamp(1.3rem, 2vw, 1.8rem); }
.realm-title p { min-height: 2.5em; margin: 0; color: var(--muted); font-size: .83rem; line-height: 1.5; }
.realm-art { display: block; width: 100%; height: 190px; margin-top: .25rem; overflow: visible; }
.realm-art .ground { fill: color-mix(in srgb, var(--realm) 18%, #06162c); }
.realm-art .silhouette { fill: color-mix(in srgb, var(--realm) 35%, #06162c); stroke: color-mix(in srgb, var(--realm) 80%, white); stroke-width: 1.5; }
.realm-art .detail { fill: none; stroke: color-mix(in srgb, var(--realm) 65%, white); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.realm-art .accent-line { fill: none; stroke: var(--realm); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.realm-art .accent-fill { fill: var(--realm); }
.realm-art .dashed { stroke-dasharray: 6 7; }
.realm-art .dice { fill: color-mix(in srgb, var(--realm) 18%, #07182f); }
.realm-art .grid-lines { opacity: .35; stroke-width: 1; }
.level-path { position: absolute; z-index: 4; left: 1rem; right: 1rem; bottom: 2.65rem; display: flex; align-items: flex-start; justify-content: space-between; }
.level-path::before { content: ""; position: absolute; z-index: -1; left: 8%; right: 8%; top: 22px; border-top: 3px dashed color-mix(in srgb, var(--realm) 55%, #d9b56f); }
.level-node { position: relative; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 3px solid color-mix(in srgb, var(--realm) 65%, white); border-radius: 50%; color: #fff; background: #08172d; font-weight: 900; cursor: pointer; box-shadow: 0 5px 14px rgba(0,0,0,.4); transition: transform .18s, background .18s; }
.level-node:nth-child(even) { margin-top: 18px; }
.level-node:hover:not(:disabled), .level-node.is-selected { transform: scale(1.12); background: var(--realm); }
.level-node:disabled { opacity: .52; border-color: #66738a; }
.level-node .icon { width: 1rem; }
.level-node.is-complete { background: color-mix(in srgb, var(--realm) 65%, #08172d); }
.node-stars { position: absolute; top: 43px; left: 50%; transform: translateX(-50%); color: var(--gold); font-size: .55rem; white-space: nowrap; letter-spacing: -.08em; }
.realm-count { position: absolute; bottom: .7rem; left: 1.25rem; color: var(--muted); font-size: .72rem; }
.realm-lock { position: absolute; z-index: 5; inset: auto 1rem 1rem; display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; color: var(--muted); background: rgba(2,8,18,.9); font-size: .72rem; }

.mission-dock { display: grid; grid-template-columns: auto 1.2fr .9fr auto; align-items: center; gap: 1.25rem; margin-top: 1.25rem; padding: 1rem 1.15rem; border: 1px solid color-mix(in srgb, var(--realm) 58%, transparent); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.mission-symbol { display: grid; place-items: center; width: 58px; height: 58px; color: var(--realm); border: 1px solid color-mix(in srgb, var(--realm) 55%, transparent); border-radius: 15px; background: color-mix(in srgb, var(--realm) 12%, transparent); }
.mission-symbol .icon { width: 1.7rem; height: 1.7rem; }
.mission-dock span { color: var(--realm); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.mission-dock h2 { margin: .18rem 0 0; font-size: 1.45rem; }
.mission-dock > p { margin: 0; color: var(--ink); font: italic 1.35rem/1.2 var(--font-display); text-align: center; }

.primary-button, .secondary-button, .back-button { min-height: 48px; border-radius: 13px; cursor: pointer; font-weight: 800; transition: transform .18s, filter .18s, border-color .18s; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; padding: .75rem 1.15rem; border: 1px solid color-mix(in srgb, var(--realm, var(--gold)) 70%, white); color: #fff; background: color-mix(in srgb, var(--realm, #7653d5) 78%, #13233d); box-shadow: 0 8px 24px color-mix(in srgb, var(--realm, #7653d5) 25%, transparent); }
.primary-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.12); }
.primary-button:disabled { opacity: .45; }
.secondary-button { padding: .75rem 1.15rem; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.secondary-button:hover { border-color: var(--realm); }
.back-button { padding: .45rem .7rem; border: 0; color: var(--muted); background: transparent; }
.back-button:hover { color: #fff; }

.stage-shell, .play-shell, .feedback-shell { width: min(1180px, 100%); min-height: calc(100vh - 76px); margin: auto; padding: clamp(1rem, 3vw, 2.5rem); }
.briefing-panel { min-height: 650px; display: grid; grid-template-columns: .85fr 1.15fr; align-items: center; gap: clamp(2rem, 6vw, 6rem); }
.briefing-copy h1 { margin: .45rem 0 .7rem; font-size: clamp(3rem, 7vw, 6.3rem); line-height: .92; letter-spacing: -.045em; }
.briefing-copy p { max-width: 42rem; margin: 0 0 1.75rem; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem); line-height: 1.65; }
.challenge-scene { position: relative; overflow: hidden; min-height: 410px; display: grid; place-items: center; align-content: center; border: 1px solid color-mix(in srgb, var(--realm) 45%, transparent); border-radius: 30px; background: color-mix(in srgb, var(--realm) 9%, rgba(4,15,31,.94)); box-shadow: var(--shadow); }
.challenge-scene::before { content: ""; position: absolute; width: 260px; height: 260px; border: 1px solid color-mix(in srgb, var(--realm) 30%, transparent); border-radius: 50%; box-shadow: 0 0 0 35px color-mix(in srgb, var(--realm) 4%, transparent), 0 0 0 70px color-mix(in srgb, var(--realm) 3%, transparent); }
.challenge-scene .realm-art { position: relative; z-index: 1; width: min(480px, 96%); height: auto; }
.scene-formula { position: relative; z-index: 2; margin-top: -1.4rem; padding: .8rem 1.1rem; border: 1px solid color-mix(in srgb, var(--realm) 55%, transparent); border-radius: 12px; color: #fff; background: rgba(3,11,24,.88); font: 700 clamp(1.2rem, 3vw, 2rem)/1.2 var(--font-display); }

.play-status { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.play-status > span { color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.level-dots { justify-self: end; display: flex; gap: .4rem; }
.level-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.18); }
.level-dots .current { outline: 2px solid var(--realm); outline-offset: 3px; background: #fff; }
.level-dots .done { background: var(--realm); }
.play-layout { min-height: 640px; display: grid; grid-template-columns: minmax(0, .95fr) minmax(430px, 1.05fr); align-items: stretch; gap: 1.25rem; }
.play-layout .challenge-scene { min-height: 100%; }
.challenge-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(1.3rem, 3vw, 2.5rem); border: 1px solid var(--line); border-radius: 28px; background: var(--panel); box-shadow: var(--shadow); }
.challenge-heading h1 { margin: .35rem 0 .75rem; font-size: clamp(2.4rem, 4vw, 4.2rem); line-height: 1; }
.challenge-heading p { margin: 0 0 1.6rem; color: var(--ink); font-size: clamp(1rem, 1.7vw, 1.18rem); line-height: 1.6; }
.answer-form label { display: block; margin-bottom: .5rem; color: var(--muted); font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.answer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; }
.answer-row input { width: 100%; min-height: 56px; padding: .6rem 1rem; border: 1px solid color-mix(in srgb, var(--realm) 45%, var(--line)); border-radius: 13px; color: #fff; background: rgba(255,255,255,.06); font-size: 1.4rem; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.choice-button { min-height: 60px; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: rgba(255,255,255,.035); text-align: left; cursor: pointer; font-size: .92rem; font-weight: 700; transition: background .18s, border-color .18s, transform .18s; }
.choice-button:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--realm) 60%, white); }
.choice-button.is-selected { border-color: var(--realm); background: color-mix(in srgb, var(--realm) 20%, transparent); box-shadow: inset 0 0 0 1px var(--realm); }
.choice-submit { grid-column: 1 / -1; margin-top: .35rem; }
.attempt-note { margin: 1rem 0 0; color: var(--muted); font-size: .78rem; }

.coordinate-challenge { display: grid; grid-template-columns: minmax(210px, 300px) 1fr; align-items: center; gap: .8rem 1.25rem; }
.coordinate-grid { grid-row: span 3; width: 100%; border: 1px solid var(--line); border-radius: 18px; background: rgba(1,10,21,.8); }
.minor-grid line { stroke: rgba(255,255,255,.09); stroke-width: 1; }
.axis { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 2; }
.axis-arrow { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 2; }
.grid-labels { fill: var(--muted); font: 12px var(--font-ui); }
.player-shadow { fill: rgba(0,0,0,.35); }
.player-marker { fill: var(--realm); stroke: #fff; stroke-width: 1.5; transition: transform .18s ease; }
.coordinate-readout { color: var(--muted); text-align: center; }
.coordinate-readout strong { display: block; margin-top: .25rem; color: #fff; font: 700 1.35rem var(--font-display); }
.direction-pad { display: grid; grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(2, 46px); justify-content: center; gap: .35rem; }
.direction-pad button { border: 1px solid var(--line); border-radius: 10px; color: #fff; background: rgba(255,255,255,.05); cursor: pointer; font-size: 1.15rem; }
.direction-pad button:hover { border-color: var(--realm); background: color-mix(in srgb, var(--realm) 16%, transparent); }
.direction-pad button:nth-child(1) { grid-column: 2; }
.direction-pad button:nth-child(2) { grid-column: 1; grid-row: 2; }
.direction-pad button:nth-child(3) { grid-column: 2; grid-row: 2; }
.direction-pad button:nth-child(4) { grid-column: 3; grid-row: 2; }

.feedback-shell { position: relative; display: grid; place-items: center; overflow: hidden; }
.feedback-panel { position: relative; z-index: 2; width: min(680px, 100%); padding: clamp(2rem, 5vw, 4rem); border: 1px solid color-mix(in srgb, var(--realm) 45%, var(--line)); border-radius: 30px; background: var(--panel); box-shadow: var(--shadow); text-align: center; }
.feedback-symbol { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 1.2rem; border: 2px solid var(--realm); border-radius: 50%; color: var(--realm); background: color-mix(in srgb, var(--realm) 12%, transparent); font: 700 2.25rem var(--font-display); }
.feedback-panel h1 { margin: .45rem 0 .8rem; font-size: clamp(2.3rem, 5vw, 4.7rem); line-height: .98; }
.feedback-panel > p { max-width: 38rem; margin: 0 auto 1.4rem; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.feedback-formula { margin: 1.25rem 0; padding: 1rem; border-block: 1px solid var(--line); color: #fff; font: 700 1.55rem var(--font-display); }
.earned-stars { margin: 1rem 0; color: var(--gold); font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: .08em; }
.skill-takeaway { display: inline-flex; align-items: center; gap: .65rem; margin: 0 auto 1rem; padding: .7rem .9rem; border: 1px solid color-mix(in srgb, var(--realm) 45%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--realm) 9%, transparent); }
.skill-takeaway span { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.skill-takeaway strong { color: var(--realm); }
.feedback-panel > .unlock-note { margin-bottom: 1.2rem; color: var(--ink); font-size: .85rem; font-weight: 700; }
.complete-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .75rem; }
.spark-field { position: absolute; inset: 0; pointer-events: none; }
.spark-field i { position: absolute; left: calc((var(--i) * 37) % 100 * 1%); top: calc((var(--i) * 61) % 100 * 1%); color: var(--gold); opacity: .65; animation: twinkle 1.8s calc(var(--i) * -.12s) infinite alternate ease-in-out; }
.certificate { display: none; }

/* Cohere-inspired editorial layer. Realm colors remain functional wayfinding accents. */
.topbar {
  min-height: 72px;
  padding-block: .75rem;
  border-color: var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
}
.brand-mark {
  color: var(--primary);
  border-color: var(--primary);
  border-radius: 8px;
}
.brand strong { font-weight: 500; letter-spacing: -.03em; }
.brand small,
.realm-title > span,
.briefing-copy > span,
.challenge-heading > span,
.feedback-panel > span,
.mission-dock span,
.answer-form label,
.play-status > span,
.skill-takeaway span {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: .08em;
}
.star-total { color: var(--gold); }
.icon-button {
  border-radius: 999px;
  background: transparent;
  font-size: .875rem;
  font-weight: 500;
}
.icon-button:hover { border-color: var(--primary); background: var(--stone); transform: none; }
.icon-button b { color: var(--primary); }

h1, h2 { font-weight: 400; letter-spacing: -.035em; }
main h1:focus { outline: none; }
.welcome-copy h1, .showcase-intro h1 {
  font-size: clamp(3.5rem, 7vw, 6rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.04em;
}
.welcome-copy > p, .showcase-intro > div > p { color: var(--muted); line-height: 1.45; }
.welcome-proof { padding-top: 1.5rem; border-top: 1px solid var(--line); }
.welcome-proof strong { color: var(--ink); font-weight: 400; }
.welcome-proof span { color: var(--muted); font-family: var(--font-mono); }
.welcome-realms { transform: none; gap: 1rem; }
.welcome-realms article {
  border-color: var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--realm) 8%, white);
  box-shadow: none;
}
.welcome-realms article:nth-child(even) { transform: none; }
.welcome-realms strong { padding: .35rem .65rem; border-radius: 999px; color: white; background: var(--realm); letter-spacing: .06em; }

.showcase-route { border-top: 1px solid var(--line); }
.showcase-route li { padding: 1.2rem 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.showcase-route li > span { border-radius: 8px; }
.showcase-banner { color: white; background: var(--primary); }
.showcase-banner button { border-color: rgba(255,255,255,.5); border-radius: 999px; color: white; }

.map-heading { padding: 1rem 0 .5rem; }
.map-heading h1 { font-size: clamp(2.8rem, 6vw, 5.4rem); font-weight: 400; line-height: 1; }
.mastery-dashboard {
  padding: 1.4rem;
  border-radius: 8px;
  background: var(--pale-green);
}
.mastery-overall > strong { color: var(--navy-800); font-size: 1.4rem; font-weight: 500; }
.mastery-overall > div, .realm-mastery div > div { background: rgba(0,60,51,.12); }
.mastery-overall i { background: #003c33; }
.realm-map { gap: 1rem; }
.realm-map::before { display: none; }
.realm {
  min-height: 410px;
  border-color: var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: none;
}
.realm.is-unlocked:hover { transform: translateY(-2px); border-color: var(--realm); }
.realm.is-locked { background: var(--stone); }
.realm.is-locked::after { background: rgba(238,236,231,.55); }
.realm-title { padding-top: 1.5rem; }
.realm-title h2 { font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 400; }
.realm-art .ground { fill: color-mix(in srgb, var(--realm) 12%, white); }
.realm-art .silhouette { fill: color-mix(in srgb, var(--realm) 18%, white); stroke: var(--realm); }
.realm-art .detail { stroke: color-mix(in srgb, var(--realm) 75%, #212121); }
.realm-art .dice { fill: color-mix(in srgb, var(--realm) 12%, white); }
.level-node { border-width: 2px; color: var(--ink); background: white; box-shadow: none; }
.level-node:hover:not(:disabled), .level-node.is-selected, .level-node.is-complete { color: white; background: var(--realm); }
.level-node:disabled { border-color: #93939f; color: #75758a; }
.realm-lock { border-color: var(--line); color: var(--ink); background: rgba(255,255,255,.96); }
.mission-dock {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--stone);
  box-shadow: none;
}
.mission-symbol { border-radius: 8px; background: white; }
.mission-dock > p { font-style: normal; font-weight: 400; }

.primary-button, .secondary-button, .back-button { border-radius: 999px; font-size: .875rem; font-weight: 500; }
.primary-button {
  padding: .75rem 1.5rem;
  border-color: var(--primary);
  color: white;
  background: var(--primary);
  box-shadow: none;
}
.primary-button:hover:not(:disabled) { transform: none; filter: none; background: #000; }
.secondary-button { padding-inline: 1.25rem; border-color: var(--primary); background: transparent; }
.secondary-button:hover { color: white; border-color: var(--primary); background: var(--primary); }
.back-button { padding-inline: .9rem; }
.back-button:hover { color: var(--ink); background: var(--stone); }

.briefing-panel { min-height: 620px; }
.briefing-copy h1 { font-weight: 400; line-height: 1; }
.briefing-copy p { color: var(--muted); line-height: 1.45; }
.challenge-scene {
  border: 0;
  border-radius: 22px;
  background: var(--navy-800);
  box-shadow: none;
}
.challenge-scene::before { border-color: rgba(255,255,255,.16); box-shadow: 0 0 0 35px rgba(255,255,255,.035), 0 0 0 70px rgba(255,255,255,.025); }
.challenge-scene .realm-art .ground { fill: color-mix(in srgb, var(--realm) 25%, #003c33); }
.challenge-scene .realm-art .silhouette { fill: color-mix(in srgb, var(--realm) 35%, #003c33); stroke: white; }
.challenge-scene .realm-art .detail { stroke: rgba(255,255,255,.75); }
.scene-formula { border-color: rgba(255,255,255,.28); border-radius: 8px; background: #17171c; font-weight: 400; }
.level-dots i { background: #d9d9dd; }
.level-dots .current { background: var(--primary); }
.challenge-panel {
  border-color: var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: none;
}
.challenge-heading h1 { font-weight: 400; }
.answer-row input {
  border-color: var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: white;
}
.answer-row input:focus-visible { border-color: #9b60aa; }
.choice-button { border-radius: 8px; background: white; font-weight: 500; }
.choice-button:hover { transform: none; border-color: var(--realm); }
.choice-button.is-selected { background: color-mix(in srgb, var(--realm) 10%, white); box-shadow: inset 4px 0 0 var(--realm); }
.coordinate-grid { border-radius: 8px; background: var(--pale-blue); }
.minor-grid line { stroke: rgba(33,33,33,.1); }
.axis, .axis-arrow { stroke: rgba(33,33,33,.65); }
.coordinate-readout strong { color: var(--ink); font-weight: 500; }
.direction-pad button { border-radius: 8px; color: var(--ink); background: white; }

.feedback-panel {
  border-color: var(--line);
  border-radius: 22px;
  background: white;
  box-shadow: none;
}
.feedback-symbol { border-radius: 8px; font-weight: 400; }
.feedback-panel h1 { font-weight: 400; }
.feedback-formula { color: var(--ink); }
.skill-takeaway { border-radius: 8px; background: color-mix(in srgb, var(--realm) 8%, white); }
.spark-field i { color: var(--gold); }

@keyframes twinkle { from { opacity: .2; transform: scale(.7) rotate(0); } to { opacity: 1; transform: scale(1.25) rotate(24deg); } }
@keyframes nudge { 0%,100% { transform: translateX(0); } 30% { transform: translateX(-7px); } 60% { transform: translateX(7px); } }
.is-wrong { animation: nudge .35s ease; }

@media (max-width: 1100px) {
  .welcome-hero { grid-template-columns: 1fr 1fr; }
  .realm-map { grid-template-columns: 1fr 1fr; }
  .realm-map::before { display: none; }
  .mission-dock { grid-template-columns: auto 1fr auto; }
  .mission-dock > p { display: none; }
  .play-layout { grid-template-columns: .82fr 1.18fr; }
  .coordinate-challenge { grid-template-columns: 1fr; }
  .coordinate-grid { grid-row: auto; max-width: 280px; margin: auto; }
}

@media (max-width: 780px) {
  .welcome-hero, .showcase-intro { grid-template-columns: 1fr; min-height: 0; padding: 2rem 0; }
  .welcome-realms { order: -1; max-width: 560px; }
  .welcome-realms article { min-height: 170px; }
  .welcome-realms .realm-art { height: 145px; }
  .showcase-banner { justify-content: space-between; }
  .showcase-banner span { display: none; }
  .mastery-dashboard { grid-template-columns: 1fr; }
  .mastery-overall { padding: 0 0 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .icon-button span, .icon-button b { display: none; }
  .icon-button { width: 44px; justify-content: center; padding: .5rem; }
  .reset-button { display: none; }
  .mobile-reset { display: inline-flex; }
  .map-heading { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .journey-progress { width: 100%; text-align: left; }
  .realm-map { grid-template-columns: 1fr; }
  .realm { min-height: 390px; }
  .mission-dock { grid-template-columns: auto 1fr; gap: .8rem; }
  .mission-dock .primary-button { grid-column: 1 / -1; }
  .briefing-panel, .play-layout { grid-template-columns: 1fr; min-height: 0; }
  .briefing-panel { padding: 2rem 0; }
  .briefing-copy { order: 2; }
  .briefing-copy h1 { font-size: clamp(2.8rem, 14vw, 5rem); }
  .challenge-scene { min-height: 280px; }
  .play-layout .challenge-scene { min-height: 300px; }
  .play-status { grid-template-columns: 1fr auto; }
  .play-status > span { display: none; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-submit { grid-column: auto; }
}

@media (max-width: 480px) {
  .welcome-shell, .showcase-shell { padding: 1rem; }
  .topbar { align-items: center; gap: .35rem; }
  .topbar-actions { flex-wrap: nowrap; gap: .3rem; }
  .icon-button { width: 44px; min-height: 44px; }
  .star-total span { display: none; }
  .welcome-copy h1 { font-size: 3rem; }
  .welcome-realms { gap: .5rem; }
  .welcome-realms article { min-height: 135px; border-radius: 16px; }
  .welcome-realms .realm-art { height: 115px; }
  .welcome-proof { justify-content: space-between; }
  .welcome-proof strong { font-size: 1.5rem; }
  .welcome-proof span { font-size: .75rem; }
  .realm-mastery { grid-template-columns: 1fr; }
  .topbar { padding: .7rem .85rem; }
  .brand-mark { width: 2.35rem; height: 2.35rem; }
  .brand strong { font-size: 1.2rem; }
  .brand small { display: none; }
  .star-total { padding-inline: .3rem; }
  .map-shell, .stage-shell, .play-shell, .feedback-shell { padding: 1rem; }
  .realm-title p { min-height: 0; }
  .realm-art { height: 175px; }
  .mission-symbol { display: none; }
  .mission-dock { grid-template-columns: 1fr; }
  .answer-row { grid-template-columns: 1fr; }
  .challenge-panel { padding: 1.2rem; border-radius: 20px; }
  .challenge-heading h1 { font-size: 2.5rem; }
  .feedback-panel { padding: 2rem 1.2rem; }
}

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

@media print {
  body { color: #17233a; background: #fff; }
  body::before, .topbar, .feedback-panel, .spark-field { display: none !important; }
  .feedback-shell { min-height: 100vh; padding: 2cm; }
  .certificate { display: grid; place-items: center; align-content: center; min-height: 17cm; width: 100%; padding: 2cm; border: 8px double #9a6b20; text-align: center; }
  .certificate span { color: #9a6b20; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
  .certificate h2 { margin: 1cm 0 .5cm; font-size: 3rem; }
  .certificate p { max-width: 15cm; font-size: 1.2rem; line-height: 1.7; }
  .certificate strong { margin-top: 1cm; color: #9a6b20; font-size: 2rem; }
}
