:root {
  color-scheme: dark;
  --bg: #050611;
  --surface: #101227;
  --surface-2: #171a34;
  --line: #343758;
  --text: #f8f7ff;
  --muted: #b8bdd5;
  --dim: #858ba7;
  --cyan: #54efff;
  --pink: #ff4ccd;
  --gold: #ffe34f;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  min-width: 320px; margin: 0; color: var(--text);
  background:
    radial-gradient(ellipse at 70% 8%, #3a174f8a 0, transparent 38%),
    radial-gradient(ellipse at 8% 30%, #0e407766 0, transparent 36%),
    radial-gradient(ellipse at 78% 58%, #42196366 0, transparent 40%),
    #050611;
}
button, input { font: inherit; }
button { cursor: pointer; }
.mode-picker { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 20px 0 16px; max-width: 720px; }
.mode-card { min-height: 94px; display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 16px; border: 2px solid #61708f; border-radius: 18px; background: #131c36; color: #f2f7ff; text-decoration: none; box-shadow: 0 8px 25px #0005; }
.mode-card strong { font-size: clamp(21px, 4vw, 27px); line-height: 1; }
.mode-card span { font-size: 13px; line-height: 1.35; color: #d6e0f5; }
.mode-card.current { border-color: #72edfa; background: #17324a; }
.mode-card:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.arcade-level-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; max-height: min(56vh, 520px); overflow: auto; padding: 4px; }
.arcade-level-grid button { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; padding: 10px 14px; font-size: 14px; }
.arcade-level-grid button span { white-space: nowrap; color: #91f3fc; font-size: 12px; }
@media (max-width: 680px) { .mode-picker { grid-template-columns: 1fr; gap: 10px; } .mode-card { min-height: 72px; padding: 13px 16px; } .mode-card strong { font-size: 23px; } .arcade-level-grid { grid-template-columns: 1fr; } }
button:focus-visible, summary:focus-visible, canvas:focus-visible, input:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 3px;
}
.spectrum-text {
  color: transparent;
  background: linear-gradient(90deg, #5ef5ff, #c47aff 38%, #ff5fc4 66%, #ffe262);
  background-clip: text;
  -webkit-background-clip: text;
}
.topbar {
  width: min(1160px, calc(100% - 36px)); min-height: 68px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-bottom: 1px solid #c9ceff20;
}
.brand { display: inline-flex; gap: 11px; align-items: center; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .02em; }
.brand-mark {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: conic-gradient(#ff445b,#ffbe3f,#eaff46,#47ffd1,#4c9dff,#db4aff,#ff445b);
  box-shadow: 0 0 18px #bd5cff55;
}
.brand-mark span { width: 16px; height: 16px; border-radius: 50%; background: #03040c; border: 1px solid #ffffff9c; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.build-label, .intro-tags span {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid #c9ceff30;
  color: var(--muted); border-radius: 999px; padding: 7px 10px; font-size: 9px;
  font-weight: 850; letter-spacing: .09em;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #89ff9a; box-shadow: 0 0 9px #89ff9a; }
main { width: min(1160px, calc(100% - 36px)); margin: 0 auto; }
.intro {
  min-height: 318px; padding: 42px 0 23px; position: relative; overflow: hidden;
}
.eyebrow { margin: 0 0 8px; font-size: 10px; line-height: 1.35; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: #77eeff; }
.intro h1 { position: relative; z-index: 1; max-width: 620px; margin: 3px 0 7px; font-size: clamp(42px, 8vw, 72px); line-height: .98; letter-spacing: -.06em; text-shadow: 0 0 33px #ea47ff30; }
.lede { position: relative; z-index: 1; max-width: 510px; margin: 11px 0 16px; color: #e0dcf1; font-size: clamp(16px, 2.6vw, 22px); line-height: 1.4; }
.intro-tags { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 7px; }
.intro-tags span { font-size: 9px; padding: 6px 9px; letter-spacing: .04em; background: #090b18a8; }
.hero-orbit { position: absolute; width: 360px; height: 290px; right: 6%; top: 12px; display: grid; place-items: center; opacity: .92; pointer-events: none; }
.orbit-line { position: absolute; width: 310px; height: 146px; border: 1px solid #b77cff55; border-radius: 50%; transform: rotate(-24deg); }
.orbit-two { width: 350px; height: 220px; transform: rotate(31deg); border-color: #55efff45; }
.hero-void {
  width: 100px; height: 100px; z-index: 1; border-radius: 50%; padding: 8px;
  display: grid; place-items: center; background: conic-gradient(#ff4a76,#ffda51,#6dff85,#4cffff,#6f9fff,#e650ff,#ff4a76);
  box-shadow: 0 0 25px #ff4cda88, 0 0 65px #43e9ff52;
}
.hero-void i { width: 100%; height: 100%; border-radius: 50%; display: block; background: radial-gradient(circle at 38% 30%,#171426,#02030a 68%); border: 1px solid #ffffffbb; }
.hero-star { position: absolute; z-index: 2; width: 11px; height: 11px; border-radius: 50%; background: #58f4ff; box-shadow: 0 0 17px 5px #58f4ff88; }
.star-a { left: 12%; top: 30%; }
.star-b { right: 11%; top: 26%; background: #ff5ccf; box-shadow: 0 0 17px 5px #ff5ccf88; }
.star-c { left: 27%; bottom: 16%; width: 8px; height: 8px; background: #ffe34f; box-shadow: 0 0 17px 5px #ffe34f88; }
.intro-story { position: relative; z-index: 1; display: flex; gap: 10px; align-items: flex-start; max-width: 610px; margin-top: 18px; }
.intro-story p { margin: 0; max-width: 580px; color: #bfc5dd; font-size: 12px; line-height: 1.55; }
.story-spark { color: var(--gold); text-shadow: 0 0 13px var(--gold); }

.game-card, .info-card {
  border: 1px solid #626caa76; border-radius: var(--radius);
  background: linear-gradient(155deg, #16182fef, #0c0e1feb 74%);
  box-shadow: 0 22px 70px #0008, inset 0 1px #ffffff10;
}
.game-card { position: relative; padding: 17px; touch-action: none; }
.game-card:fullscreen, .game-card.is-immersive {
  position: fixed; inset: 0; z-index: 10000; width: 100vw; height: 100vh; height: 100dvh;
  max-height: 100dvh; margin: 0; padding: calc(8px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
  display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto; gap: 0;
  overflow: hidden; border: 0; border-radius: 0; background: radial-gradient(ellipse at 50% 42%, #14132d, #050611 78%);
  box-shadow: none;
}
.game-card:fullscreen::before, .game-card.is-immersive::before { top: 0; left: 8%; right: 8%; }
.game-card:fullscreen .game-heading, .game-card.is-immersive .game-heading { min-width: 0; margin-bottom: 5px; }
.game-card:fullscreen .game-heading-copy, .game-card.is-immersive .game-heading-copy { min-width: 0; }
.game-card:fullscreen .game-heading h2, .game-card.is-immersive .game-heading h2 { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-card:fullscreen .chapter-subtitle, .game-card.is-immersive .chapter-subtitle { max-width: 42ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-card:fullscreen .game-actions, .game-card.is-immersive .game-actions { gap: 5px; }
.game-card:fullscreen .fullscreen-button, .game-card.is-immersive .fullscreen-button { border-color: #6beeff; color: #8cf5ff; background: #132239; }
.game-card:fullscreen .campaign-progress, .game-card.is-immersive .campaign-progress { margin: 5px 0 7px; }
.game-card:fullscreen .objective-strip, .game-card.is-immersive .objective-strip { gap: 5px; }
.game-card:fullscreen .objective, .game-card.is-immersive .objective { min-height: 39px; }
.game-card:fullscreen .mission-line, .game-card.is-immersive .mission-line { min-height: 25px; padding: 2px 2px 5px; }
.game-card:fullscreen .board-wrap, .game-card.is-immersive .board-wrap { width: 100%; max-width: none; height: 100%; min-height: 0; display: grid; place-items: center; border-radius: 12px; }
.game-card:fullscreen canvas, .game-card.is-immersive canvas { width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 240px); aspect-ratio: 360 / 500; }
.game-card:fullscreen .run-footer, .game-card.is-immersive .run-footer { min-height: 31px; }
.game-card:fullscreen .game-footnote, .game-card.is-immersive .game-footnote { min-height: 22px; }
body.immersive-fallback { overflow: hidden; }
.game-card::before {
  content: ""; height: 2px; position: absolute; top: -1px; left: 8%; right: 8%;
  background: linear-gradient(90deg, transparent, #4cecff, #c14cff, #ff56b8, #ffe451, transparent);
  filter: drop-shadow(0 0 7px #ce58ff);
}
.game-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.game-heading .eyebrow { margin-bottom: 4px; }
.game-heading h2 { margin: 0; font-size: clamp(15px, 3vw, 19px); letter-spacing: -.025em; }
.chapter-subtitle { margin: 4px 0 0; color: #aeb6d2; font-size: 10px; }
.game-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.quiet-button, .secondary-button, .primary-button, .map-chip, .text-button {
  border-radius: 12px; min-height: 38px; padding: 0 12px; color: var(--text);
  border: 1px solid #65709c76; background: #202443; font-size: 11px; font-weight: 800;
}
.quiet-button { min-height: 34px; padding: 0 9px; color: #d3d8eb; font-size: 10px; }
.quiet-button[aria-pressed="true"] { border-color: #63f1ff; color: #6cf2ff; }
.campaign-progress { margin: 12px 0 10px; }
.progress-caption { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; color: var(--dim); font-size: 9px; font-variant-numeric: tabular-nums; }
.progress-caption span:last-child { color: #c5c3dc; font-weight: 750; }
.progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: #262a46; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#48f1ff,#9174ff,#ff55c6,#ffe45a); box-shadow: 0 0 11px #b85fff; transition: width .25s ease; }
.objective-strip { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 7px; }
.objective { min-width: 0; min-height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #454966; background: #090b18; border-radius: 12px; }
.objective > span:last-child { min-width: 0; display: grid; gap: 2px; }
.objective small { color: #9299b6; font-size: 8px; font-weight: 850; letter-spacing: .08em; white-space: nowrap; }
.objective strong { color: var(--text); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.energy-objective strong { color: #74f4ff; }
.size-objective strong { color: #f2b9ff; }
.echo-objective strong { color: #ffe66b; }
.objective-shape { flex: 0 0 auto; display: inline-block; width: 11px; height: 11px; }
.spectrum-shape { border-radius: 50%; background: conic-gradient(#ff435b,#ffbf3e,#eaff46,#43fbd5,#4c9bff,#da4aff,#ff435b); box-shadow: 0 0 11px #91eaff8a; }
.void-shape { border-radius: 50%; background: #02030a; border: 2px solid #e879ff; box-shadow: 0 0 9px #cf60ff; }
.echo-shape { transform: rotate(45deg); background: #ffe34f; box-shadow: 0 0 8px #ffe34f99; }
.map-chip { min-height: 42px; padding: 0 10px; border-color: #59eafa7a; color: #7cf4ff; background: #142234; white-space: nowrap; font-size: 10px; }
.mission-line { min-height: 30px; display: flex; align-items: center; gap: 7px; padding: 4px 2px 8px; color: #b8bdd5; font-size: 10px; }
.arcade-survey-progress { flex: 0 0 auto; color: #c9b5ff; font-size: 8px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.arcade-survey-result { color: #cfc0ff; }
.mission-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #ffdc59; box-shadow: 0 0 9px #ffdc59; }
.board-wrap {
  width: min(100%, 590px); margin: 0 auto; position: relative; overflow: hidden;
  border: 1px solid #6e71ae; border-radius: 18px; background: #070817;
  box-shadow: 0 0 0 1px #e94aff1c, 0 12px 42px #02030c99;
}
canvas { width: 100%; height: auto; aspect-ratio: 360 / 500; display: block; touch-action: none; }
.overlay {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 13px;
  background: #050612bb; transition: opacity .16s ease;
}
.overlay.hidden { opacity: 0; pointer-events: none; }
.overlay-card {
  width: min(100%, 356px); max-height: 100%; overflow: auto; padding: 20px 18px 16px;
  border-radius: 19px; text-align: center; border: 1px solid #7773bf;
  background: linear-gradient(145deg,#1c2140f5,#101225f7 72%);
  box-shadow: 0 12px 48px #000b, 0 0 25px #b94aff20;
  scrollbar-color: #7864c4 #101225; scrollbar-width: thin;
}
.overlay-card .eyebrow { margin-bottom: 7px; color: #7cf0ff; }
.overlay-card h3 { margin: 0 0 9px; font-size: clamp(19px, 5vw, 25px); line-height: 1.08; letter-spacing: -.035em; }
.modal-story, .story-reveal { margin: 0 auto 12px; max-width: 34ch; color: #d0d2e9; font-size: 12px; line-height: 1.5; }
.mission-card { display: flex; align-items: center; gap: 10px; padding: 10px; margin: 11px 0; text-align: left; border: 1px solid #7f61c677; background: #0b1125; border-radius: 12px; }
.mission-icon { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff2a2; background: radial-gradient(circle,#c847ff88,#422d6d); box-shadow: 0 0 17px #b14eff55; }
.mission-card strong, .mission-card small { display: block; }
.mission-card strong { font-size: 11px; color: #fff; }
.mission-card small { margin-top: 3px; color: #aeb7d2; font-size: 9px; line-height: 1.4; }
.modal-note { margin: 9px 0 12px; color: #929bb8; font-size: 9px; }
.modal-actions { display: grid; gap: 7px; }
.primary-button, .secondary-button { width: 100%; }
.primary-button {
  min-height: 43px; border-color: transparent; color: #110d21;
  background: linear-gradient(100deg,#66f4ff,#c89bff 48%,#ff70c8);
  box-shadow: 0 5px 22px #a555ff44; font-size: 12px;
}
.primary-button:hover { filter: brightness(1.08); }
.secondary-button { min-height: 40px; background: #202542; color: #e8e8fa; }
.text-button { min-height: 33px; border: 0; background: transparent; color: #8df4ff; padding: 5px 7px; }
.completion-burst { margin: 12px auto 15px; padding: 11px; border: 1px solid #5d5f9c77; border-radius: 14px; background: #10152b; }
.star-score { display: block; color: #ffe65d; font-size: 24px; letter-spacing: .1em; text-shadow: 0 0 15px #ffb52b99; }
.completion-burst small { display: block; margin-top: 4px; color: #b7bed5; font-size: 9px; }
.story-reveal { color: #fff0b3; font-size: 13px; }
@keyframes victory-card-arrive { 0% { opacity: 0; transform: translateY(18px) scale(.88); filter: brightness(1.7); } 68% { opacity: 1; transform: translateY(-3px) scale(1.025); filter: brightness(1.2); } 100% { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1); } }
@keyframes victory-burst-arrive { 0% { opacity: 0; transform: scale(.72); box-shadow: 0 0 0 #59f6ff00; } 55% { opacity: 1; transform: scale(1.04); box-shadow: 0 0 30px #59f6ff55, 0 0 48px #ff4dcc33; } 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 18px #59f6ff22, 0 0 30px #ff4dcc18; } }
@keyframes victory-stars-arrive { 0% { opacity: 0; transform: scale(.2) rotate(-18deg); } 70% { opacity: 1; transform: scale(1.25) rotate(5deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
.overlay.level-win .overlay-card { animation: victory-card-arrive .52s cubic-bezier(.16,1,.3,1) both; }
.overlay.level-win .completion-burst { background: linear-gradient(120deg,#14304a,#242044 55%,#391b45); animation: victory-burst-arrive .72s .12s cubic-bezier(.16,1,.3,1) both; }
.overlay.level-win .star-score { animation: victory-stars-arrive .62s .18s cubic-bezier(.16,1,.3,1) both; }
.map-overlay { padding: 7px; }
.map-overlay .overlay-card { width: 100%; max-width: 540px; height: 100%; padding: 13px; text-align: left; }
.map-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.map-heading h3 { margin-bottom: 2px; }
.map-summary { margin: 0 0 9px; color: var(--muted); font-size: 9px; }
.map-close { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; border: 1px solid #6e76a0; color: #fff; background: #232644; font-size: 19px; }
.world-map-list { display: grid; gap: 8px; }
.world-map-card { padding: 9px; border: 1px solid hsl(var(--world-hue) 84% 68% / 40%); border-radius: 13px; background: linear-gradient(130deg,hsl(var(--world-hue) 80% 44% / 13%),#0a0d1d 60%); }
.locked-world { opacity: .56; }
.world-map-title { display: grid; grid-template-columns: 27px 1fr auto; align-items: center; gap: 7px; }
.world-orb { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 32% 28%,#fff,hsl(var(--world-hue) 100% 70%) 26%,hsl(var(--world-hue) 88% 34%) 70%,#08091a 74%); box-shadow: 0 0 12px hsl(var(--world-hue) 100% 65% / 70%); }
.world-map-title strong, .world-map-title small { display: block; }
.world-map-title strong { color: #f2f3ff; font-size: 10px; }
.world-map-title small { margin-top: 2px; color: #a8b0ca; font-size: 8px; }
.world-map-title>b { color: hsl(var(--world-hue) 100% 77%); font-size: 9px; }
.world-map-story { margin: 7px 0; color: #9da7c1; font-size: 8px; }
.level-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.level-node { min-height: 39px; padding: 3px 1px; display: grid; align-content: center; gap: 2px; border: 1px solid #515678; border-radius: 8px; color: #eff4ff; background: #1a2038; }
.level-node span { font-size: 10px; font-weight: 850; }
.level-node small { color: #abb4d0; font-size: 6px; line-height: 1; font-weight: 800; }
.level-node:disabled { cursor: default; opacity: .48; background: #0b0e1b; }
.complete-node { border-color: #5cf3cb; background: #153436; }
.complete-node small { color: #ffe762; }
.active-node { border-color: #ff68d6; box-shadow: inset 0 0 10px #ff68d622; }
.map-footnote { margin: 9px 1px 1px; color: #abb4ce; font-size: 8px; line-height: 1.4; }
.run-footer { min-height: 39px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.run-footer p { margin: 0; color: #b4bbd2; font-size: 10px; line-height: 1.35; }
.game-footnote { min-height: 27px; display: flex; align-items: center; gap: 7px; border-top: 1px solid #30334f; color: #818aa9; font-size: 8px; }
.footnote-orb { width: 8px; height: 8px; border-radius: 50%; background: conic-gradient(#ff435b,#ffe34f,#51f4ff,#dc4aff,#ff435b); }
.local-note { margin-left: auto; color: #707994; }

.campaign-section { padding: 52px 0 22px; }
.section-heading { max-width: 650px; }
.section-heading h2 { margin: 0 0 7px; font-size: clamp(25px, 5vw, 36px); letter-spacing: -.045em; }
.section-heading>p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.chapter-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 20px; }
.chapter-card {
  position: relative; overflow: hidden; min-height: 104px; padding: 12px;
  border: 1px solid hsl(var(--chapter-hue) 88% 71% / 38%); border-radius: 15px;
  background: radial-gradient(ellipse at 95% 10%,hsl(var(--chapter-hue) 95% 56% / 22%),transparent 57%),#0c0f21;
}
.chapter-card>span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; background: hsl(var(--chapter-hue) 84% 55% / 46%); font-size: 8px; font-weight: 850; }
.chapter-card h3 { margin: 7px 0 3px; font-size: 12px; }
.chapter-card p { margin: 0; color: #aeb5cf; font-size: 9px; line-height: 1.35; }
.below-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; margin: 15px 0; }
.info-card { padding: 18px; }
.info-card h2 { margin: 0 0 13px; font-size: 18px; letter-spacing: -.025em; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; }
.steps li>span { color: #ff75d1; font-size: 10px; font-weight: 900; padding-top: 2px; }
.steps strong { display: block; font-size: 11px; }
.steps p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.keyboard-note { margin: 13px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--dim); font-size: 9px; line-height: 1.45; }
.playtest-card>p:not(.eyebrow) { color: var(--muted); font-size: 11px; line-height: 1.5; }
.wide-button { min-height: 39px; }
.copy-status { min-height: 15px; margin: 8px 0 0 !important; color: #87f4ff !important; font-size: 9px !important; }
.settings { margin: 14px 0 24px; border: 1px solid #333754; border-radius: 15px; background: #0c0f20; }
.settings summary { padding: 13px 15px; color: #d5d9ed; font-size: 11px; font-weight: 750; cursor: pointer; }
.settings-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 0 13px 10px; }
.settings label { min-height: 47px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border-radius: 10px; background: #171b31; cursor: pointer; }
.settings label strong, .settings label small { display: block; }
.settings label strong { font-size: 10px; }
.settings label small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.25; }
.settings input { width: 17px; height: 17px; flex: 0 0 auto; accent-color: #75f0ff; }
.clear-button { margin: 0 13px 11px; font-size: 9px; }
.footer { width: min(1160px, calc(100% - 36px)); margin: 0 auto; padding: 0 0 22px; display: flex; justify-content: space-between; gap: 12px; color: #707894; font-size: 8px; }
.footer a { color: #79eefa; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
body.high-contrast { --muted: #e0e4f5; --dim: #b5bdd6; }
body.high-contrast .game-card, body.high-contrast .info-card, body.high-contrast .settings, body.high-contrast .board-wrap { border-color: #e0dcff; }
body.high-contrast .objective, body.high-contrast .timer-chip { border-color: #d5dcff; }

@media (min-width: 900px) {
  main { display: grid; grid-template-columns: minmax(280px,.84fr) minmax(470px,1.16fr); column-gap: 25px; align-items: start; }
  .intro { grid-column: 1; grid-row: 1; min-height: 375px; padding-top: 46px; }
  .hero-orbit { width: 300px; height: 240px; right: -60px; top: 85px; opacity: .56; }
  .hero-orbit .orbit-line { transform: scale(.78) rotate(-24deg); }
  .hero-orbit .orbit-two { transform: scale(.78) rotate(31deg); }
  .intro-story { max-width: 410px; }
  .game-card { grid-column: 2; grid-row: 1 / span 3; margin-top: 26px; }
  .campaign-section, .below-grid, .settings { grid-column: 1 / -1; }
  .chapter-cards { grid-template-columns: repeat(6,1fr); }
}
@media (max-width: 680px) {
  .topbar, main, .footer { width: calc(100% - 22px); }
  .topbar { min-height: 58px; }
  .brand { font-size: 12px; }
  .build-label { font-size: 7px; padding: 6px 8px; }
  .map-top-button { font-size: 9px; min-height: 32px; padding: 0 8px; }
  .intro { min-height: 275px; padding: 28px 0 19px; }
  .intro h1 { font-size: clamp(42px, 12vw, 60px); }
  .lede { max-width: 80%; font-size: 15px; }
  .hero-orbit { width: 220px; height: 205px; right: -47px; top: 35px; opacity: .45; }
  .hero-void { width: 75px; height: 75px; padding: 6px; }
  .orbit-line { width: 220px; height: 115px; }
  .orbit-two { width: 260px; height: 175px; }
  .intro-story { max-width: 89%; margin-top: 15px; }
  .intro-story p { font-size: 10px; }
  .game-card { padding: 10px; border-radius: 18px; }
  .game-heading { align-items: flex-start; }
  .game-heading h2 { font-size: 14px; }
  .chapter-subtitle { max-width: 225px; font-size: 8px; }
  .game-actions { gap: 4px; }
  .quiet-button { font-size: 8px; padding: 0 7px; min-height: 31px; }
  .objective-strip { grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
  .objective { min-height: 41px; gap: 5px; padding: 0 6px; }
  .objective small { font-size: 6px; }
  .objective strong { font-size: 9px; }
  .objective-shape { width: 9px; height: 9px; }
  .map-chip { grid-column: 1 / -1; min-height: 32px; }
  .mission-line { min-height: 25px; padding-bottom: 5px; font-size: 9px; }
  .board-wrap { border-radius: 14px; }
  .campaign-section { padding-top: 35px; }
  .chapter-cards { grid-template-columns: repeat(2,1fr); gap: 6px; margin-top: 13px; }
  .chapter-card { min-height: 91px; padding: 9px; }
  .chapter-card h3 { font-size: 10px; }
  .chapter-card p { font-size: 8px; }
  .below-grid { grid-template-columns: 1fr; gap: 8px; }
  .info-card { padding: 15px; }
  .settings-row { grid-template-columns: 1fr; }
  .footer { flex-direction: column; gap: 6px; }
  .run-footer p { font-size: 9px; }
  .local-note { display: none; }
}
@media (max-width: 370px) {
  .top-actions { gap: 4px; }
  .build-label { letter-spacing: .03em; }
  .game-actions .quiet-button { padding: 0 5px; }
}
@media (max-width: 420px) {
  .game-card:fullscreen, .game-card.is-immersive { padding-left: calc(7px + env(safe-area-inset-left)); padding-right: calc(7px + env(safe-area-inset-right)); }
  .game-card:fullscreen .game-actions, .game-card.is-immersive .game-actions { gap: 3px; }
  .game-card:fullscreen .quiet-button, .game-card.is-immersive .quiet-button { padding: 0 6px; font-size: 8px; }
  .game-card:fullscreen .game-heading h2, .game-card.is-immersive .game-heading h2 { font-size: 12px; }
  .game-card:fullscreen .chapter-subtitle, .game-card.is-immersive .chapter-subtitle { max-width: 26ch; font-size: 8px; }
}
@media (max-height: 520px) {
  .game-card:fullscreen, .game-card.is-immersive { padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .game-card:fullscreen .chapter-subtitle, .game-card.is-immersive .chapter-subtitle,
  .game-card:fullscreen .campaign-progress, .game-card.is-immersive .campaign-progress,
  .game-card:fullscreen .mission-line, .game-card.is-immersive .mission-line,
  .game-card:fullscreen .game-footnote, .game-card.is-immersive .game-footnote { display: none; }
  .game-card:fullscreen .objective, .game-card.is-immersive .objective { min-height: 33px; }
  .game-card:fullscreen .objective-strip, .game-card.is-immersive .objective-strip { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
  .game-card:fullscreen .map-chip, .game-card.is-immersive .map-chip { min-height: 33px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* Living nebula treatment: restrained so the board remains readable. */
body { position: relative; isolation: isolate; }
body::before {
  content: ""; position: fixed; inset: -18%; z-index: -1; pointer-events: none;
  opacity: .28; mix-blend-mode: screen;
  background:
    radial-gradient(ellipse at 16% 24%, #24dfff17 0 3%, transparent 31%),
    radial-gradient(ellipse at 78% 36%, #b84cff19 0 4%, transparent 34%),
    radial-gradient(ellipse at 58% 82%, #ff4cae12 0 3%, transparent 32%),
    radial-gradient(circle at 23% 68%, #ffffff70 0 1px, transparent 1.5px),
    radial-gradient(circle at 73% 17%, #8df7ff88 0 1px, transparent 1.5px),
    radial-gradient(circle at 91% 74%, #ffb7ef77 0 1px, transparent 1.5px);
  background-size: 120% 120%, 130% 130%, 145% 145%, 190px 230px, 260px 310px, 330px 270px;
  animation: nebula-drift 58s ease-in-out infinite alternate;
}
.intro { isolation: isolate; }
.intro::before {
  content: ""; position: absolute; width: 390px; height: 230px; right: 4%; top: 24px;
  background: radial-gradient(ellipse, #55dfff12, #bd55ff0a 42%, transparent 72%);
  filter: blur(5px); animation: nebula-breathe 9s ease-in-out infinite alternate;
  pointer-events: none;
}
.hero-orbit { animation: hero-float 10s ease-in-out infinite; }
.orbit-one { animation: orbit-turn 44s linear infinite; }
.orbit-two { animation: orbit-turn-reverse 58s linear infinite; }
.hero-void { animation: prism-turn 32s linear infinite; }
.hero-void i { animation: void-glow 5s ease-in-out infinite alternate; }
.hero-star { animation: star-beat 3.8s ease-in-out infinite alternate; }
.star-b { animation-delay: -1.2s; }
.star-c { animation-delay: -2.3s; }
.game-card::before { background-size: 220% 100%; animation: spectrum-scan 8s linear infinite; }
.objective { transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease; }
.echo-objective:not([hidden]) {
  border-color: #8beeff75;
  background: linear-gradient(120deg, #111b2c, #14102a 70%, #171126);
  box-shadow: inset 0 0 18px #684bff12, 0 0 15px #4be8ff0c;
  animation: objective-breathe 4.6s ease-in-out infinite alternate;
}
.mission-dot { animation: star-beat 2.4s ease-in-out infinite alternate; }
@keyframes nebula-drift { from { transform: translate3d(-1.3%, -1%, 0) rotate(-2deg); } to { transform: translate3d(1.2%, 1.4%, 0) rotate(2deg); } }
@keyframes nebula-breathe { from { opacity: .42; transform: scale(.94); } to { opacity: .9; transform: scale(1.08); } }
@keyframes hero-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes orbit-turn { to { transform: rotate(336deg); } }
@keyframes orbit-turn-reverse { to { transform: rotate(-329deg); } }
@keyframes prism-turn { to { filter: hue-rotate(360deg); } }
@keyframes void-glow { from { box-shadow: inset 0 0 7px #b55cff18; } to { box-shadow: inset 0 0 22px #55dffff0; } }
@keyframes star-beat { from { opacity: .5; filter: brightness(.8); } to { opacity: 1; filter: brightness(1.5); } }
@keyframes spectrum-scan { from { background-position: 0 0; } to { background-position: 220% 0; } }
@keyframes objective-breathe { from { box-shadow: inset 0 0 12px #684bff0a, 0 0 8px #4be8ff08; } to { box-shadow: inset 0 0 22px #684bff20, 0 0 17px #4be8ff18; } }
.objective > span:last-child { min-width: 0; }
.objective small { display: block; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) {
  body::before, .intro::before, .hero-orbit, .orbit-one, .orbit-two, .hero-void,
  .hero-void i, .hero-star, .game-card::before, .echo-objective:not([hidden]), .mission-dot {
    animation: none !important;
  }
}
\n\n#echoObjective .chain-shape {
  width: 13px; height: 13px; border: 1px solid #fff8; border-radius: 50%;
  background: conic-gradient(#6ff1ff 0 35%, #bb70ff 35% 67%, #ffdb56 67% 100%);
  box-shadow: 0 0 10px #71e8ff70;
}
#echoObjective .hunt-shape {
  width: 11px; height: 11px; transform: rotate(45deg); border: 1px solid #fff;
  border-radius: 2px; background: linear-gradient(135deg, #fff4a6, #ff9d46 65%, #ce4cff);
  box-shadow: 0 0 9px #ffc44788;
}
#echoObjective .relay-shape {
  width: 13px; height: 13px; border: 1px dashed #77f5ff; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 1px, #51dffb55 2px, transparent 6px);
  box-shadow: 0 0 9px #49eeff80;
}
#echoObjective[data-kind="sequence"] strong { color: #a9f5ff; }
#echoObjective[data-kind="collect"] strong { color: #ffd68d; }
#echoObjective[data-kind="route"] strong,
#echoObjective[data-kind="echoRoute"] strong { color: #a9ffde; }
#echoObjective[data-kind="echo"] strong { color: #ffe66b; }
.mission-line #missionLabel { min-width: 0; }
@media (max-width: 560px) {
  .intro::before { right: -42%; opacity: .5; }
  .hero-orbit { right: -20%; opacity: .48; }
  .objective small { letter-spacing: .04em; }
}


/* Compact controls stay beside the puzzle prompt; the expanded guide stays in the heading. */
.mission-line { min-width: 0; justify-content: flex-start; }
#missionLabel { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mission-hint { margin-left: auto; flex: 0 0 auto; color: #7f8ba9; font-size: 8px; font-weight: 850; letter-spacing: .09em; white-space: nowrap; }
.guide-menu { position: relative; order: 4; flex: 0 0 auto; z-index: 12; }
.guide-menu summary { list-style: none; display: grid; place-items: center; cursor: pointer; user-select: none; }
.guide-menu summary::-webkit-details-marker { display: none; }
.guide-panel { position: absolute; top: calc(100% + 8px); right: 0; width: min(250px, calc(100vw - 36px)); padding: 10px 12px; border: 1px solid #6874a2a8; border-radius: 13px; background: #0a0d1ff2; box-shadow: 0 12px 34px #000b; backdrop-filter: blur(14px); }
.guide-panel p { margin: 0; padding: 6px 0; color: #c4cbe0; font-size: 10px; line-height: 1.45; }
.guide-panel p + p { border-top: 1px solid #59628438; }
.guide-panel strong { display: inline-block; min-width: 48px; color: #74ebff; font-size: 8px; letter-spacing: .08em; }
@media (max-width: 430px) {
  .mission-hint { font-size: 7px; letter-spacing: .04em; }
  .game-actions { gap: 4px; }
}
@media (max-width: 370px) {
  .game-actions .quiet-button { padding-left: 4px; padding-right: 4px; }
  .mission-hint { font-size: 6px; }
}

/* v20: brief acknowledgements; no continuous interface bouncing. */
.progress-track > span, .progress-track > i, #campaignProgressFill { transition: width 280ms ease-out; }
.quiet-button, .primary-button, .secondary-button, .level-node { transition: transform 120ms ease-out, border-color 160ms ease-out, background-color 160ms ease-out; }
.quiet-button:active, .primary-button:active, .secondary-button:active, .level-node:active { transform: translateY(1px) scale(.98); }
.micro-confirm { animation: micro-confirm 360ms ease-out; }
@keyframes micro-confirm { 0% { transform: scale(1); } 35% { transform: scale(1.045); color: #c6fff5; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .micro-confirm { animation: none; } .quiet-button:active,.primary-button:active,.secondary-button:active,.level-node:active { transform: none; } }
body.reduce-motion .micro-confirm { animation: none; }

.saved-progress { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:16px; margin:14px 0; border:1px solid #414563; border-radius:15px; background:#0c0f20; grid-column:1 / -1; }
.saved-progress h2 { margin:0 0 6px; font-size:15px; }
.saved-progress p { margin:0; max-width:680px; color:#aeb6cf; font-size:12px; line-height:1.5; }
.saved-progress .clear-button { flex-shrink:0; min-height:44px; margin:0; padding:10px 14px; border:1px solid #886175; border-radius:10px; color:#ffd0df; }

/* v32: objective copy wraps independently of gameplay canvas geometry. */
#missionLabel { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; line-height:1.4; }
.mission-line { flex-wrap:wrap; align-items:flex-start; }
.mission-line .mission-dot { margin-top:4px; }
.objective small, .objective strong { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
.objective-strip { grid-template-columns:repeat(3,minmax(0,1fr)) auto; }
@media(max-width:600px){.objective-strip{grid-template-columns:repeat(3,minmax(0,1fr));}.objective-strip .map-chip{grid-column:1 / -1;justify-self:end;}}
