:root {
  --night: #060e21;
  --night-2: #0a1730;
  --ink: #eaf2ff;
  --muted: #8fa4c5;
  --soft: #b9cae3;
  --line: rgba(153, 187, 236, .18);
  --cyan: #66e5ff;
  --blue: #5f8cff;
  --gold: #ffd47b;
  --coral: #ff9f87;
  --mint: #98efcf;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--night);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; background: var(--night); }
body { overflow-x: hidden; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.is-hidden { display: none !important; }

#space-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; background: radial-gradient(circle at 15% 14%, #152c58 0, transparent 38%), radial-gradient(circle at 86% 76%, #172950 0, transparent 34%), #060e21; }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(ellipse at center, transparent 42%, rgba(2, 7, 18, .56) 100%); }
.app-shell { position: relative; z-index: 2; width: 100%; min-height: 100vh; }
.screen { min-height: 100vh; width: 100%; padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }

.eyebrow { margin: 0 0 8px; color: #77cce7; font-size: 10px; font-weight: 700; letter-spacing: 2.8px; }
h1, h2, p { margin-top: 0; }
h1, h2 { letter-spacing: 0; }

/* Story */
.story-screen { display: grid; place-items: center; text-align: center; padding-top: 40px; }
.story-copy { width: min(720px, 100%); animation: rise-in .8s ease both; }
.story-copy h1 { margin: 0; font-size: clamp(45px, 8vw, 76px); line-height: 1; font-weight: 300; text-shadow: 0 0 28px rgba(102, 229, 255, .34); }
.story-subtitle { margin: 18px 0 22px; color: var(--soft); font-size: clamp(14px, 2.3vw, 18px); }
.story-scene { position: relative; width: min(520px, 84vw); aspect-ratio: 1.72; margin: 0 auto 25px; overflow: hidden; border: 1px solid rgba(136, 205, 255, .24); border-radius: 4px; background: radial-gradient(circle at center, rgba(59, 127, 203, .24), rgba(4, 14, 37, .46) 60%, rgba(3, 10, 24, .86)); box-shadow: inset 0 0 70px rgba(44, 111, 205, .16), var(--shadow); }
.story-scene::before, .story-scene::after { content: ""; position: absolute; inset: 14% -12%; border: 1px solid rgba(117, 214, 255, .18); border-radius: 50%; transform: rotate(-18deg); animation: scene-orbit 10s linear infinite; }
.story-scene::after { inset: 25% -9%; transform: rotate(30deg); animation-duration: 15s; opacity: .55; }
.story-orbit { position: absolute; top: 50%; left: 50%; border: 1px solid rgba(104, 207, 255, .44); border-radius: 50%; transform: translate(-50%, -50%) rotate(-14deg); }
.orbit-one { width: 42%; height: 82%; animation: orbit-one-spin 7s linear infinite; }
.orbit-two { width: 67%; height: 47%; transform: translate(-50%, -50%) rotate(34deg); animation: orbit-two-spin 11s linear infinite reverse; opacity: .64; }
.story-core { position: absolute; top: 50%; left: 50%; width: 45px; height: 45px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 36% 30%, #fff, #86ecff 24%, #4d83ff 61%, rgba(28, 58, 137, .15) 73%); box-shadow: 0 0 15px #8ef3ff, 0 0 50px rgba(85, 134, 255, .76); animation: breathing 2.6s ease-in-out infinite; }
.story-core span { position: absolute; inset: -10px; border: 1px solid rgba(154, 236, 255, .57); border-radius: 50%; animation: core-ring 2.6s ease-out infinite; }
.story-star { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); animation: twinkle 2s ease-in-out infinite; }
.star-a { top: 25%; left: 23%; animation-delay: .3s; }.star-b { bottom: 25%; right: 19%; animation-delay: 1s; }.star-c { top: 21%; right: 29%; animation-delay: 1.4s; }
.story-line { min-height: 26px; margin: 0 auto 22px; color: var(--ink); font-size: clamp(14px, 2.2vw, 18px); transition: opacity .3s ease; }
.story-controls { display: flex; align-items: center; justify-content: center; gap: 18px; }
.story-progress { width: min(280px, 50vw); height: 3px; overflow: hidden; border-radius: 99px; background: rgba(150, 190, 235, .18); }
.story-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--gold)); transition: width .2s linear; }
.text-button, .ghost-button, .link-button { padding: 6px 0; background: transparent; color: var(--soft); font-size: 13px; }
.text-button:hover, .ghost-button:hover, .link-button:hover { color: #fff; }

/* Map */
.map-screen, .game-screen { width: min(1160px, 100%); margin: 0 auto; }
.map-header, .game-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 25px; }
.map-header h2, .game-header h2 { margin: 0; font-size: clamp(25px, 4vw, 35px); font-weight: 350; }
.map-actions, .game-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { display: inline-grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(12, 28, 55, .62); color: var(--soft); transition: .2s ease; }
.icon-button:hover { border-color: rgba(123, 220, 255, .55); color: #fff; transform: translateY(-1px); }
.icon-button .icon { font-size: 17px; transform: rotate(-24deg); }
.ghost-button { padding: 9px 12px; border: 1px solid var(--line); border-radius: 3px; background: rgba(12, 28, 55, .38); }
.map-intro { display: flex; align-items: center; gap: 15px; max-width: 820px; margin: 0 auto 30px; padding: 17px 20px; border-left: 2px solid rgba(102, 229, 255, .65); border-bottom: 1px solid var(--line); background: rgba(10, 24, 49, .45); }
.map-intro-mark { display: grid; width: 42px; height: 42px; flex: none; place-items: center; border: 1px solid rgba(255, 212, 123, .6); color: var(--gold); border-radius: 50%; font-size: 22px; box-shadow: 0 0 17px rgba(255, 212, 123, .15); }
.map-intro strong { font-size: 16px; font-weight: 500; }.map-intro p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }.map-stats { margin-left: auto; text-align: right; color: var(--soft); white-space: nowrap; }.map-stats span { color: var(--gold); font-size: 23px; font-weight: 500; }.map-stats small { display: block; color: var(--muted); font-size: 11px; }
.chapter-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 22px; }
.chapter-tab { position: relative; padding: 11px 7px; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; text-align: left; transition: .2s ease; }.chapter-tab::before { content: ""; position: absolute; left: 0; bottom: -1px; width: 0; height: 2px; background: var(--cyan); transition: width .2s ease; }.chapter-tab:hover, .chapter-tab.is-active { color: var(--ink); }.chapter-tab.is-active::before { width: 100%; }
.level-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; max-width: 920px; margin: 0 auto; }
.level-card { position: relative; min-height: 112px; overflow: hidden; padding: 15px; border: 1px solid rgba(132, 171, 224, .17); border-radius: 4px; background: linear-gradient(135deg, rgba(14, 35, 69, .88), rgba(10, 21, 46, .74)); text-align: left; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }.level-card:not(.is-locked):hover { transform: translateY(-3px); border-color: rgba(102, 229, 255, .58); box-shadow: 0 10px 28px rgba(45, 127, 208, .17); }.level-card.is-locked { opacity: .42; cursor: not-allowed; }.level-card.is-complete { border-color: rgba(152, 239, 207, .45); }.level-card.is-current { border-color: rgba(255, 212, 123, .62); box-shadow: inset 0 0 0 1px rgba(255, 212, 123, .11); }.level-card.is-current::after { content: "CURRENT"; position: absolute; right: 9px; top: 9px; color: var(--gold); font-size: 8px; letter-spacing: 1px; }
.level-number { color: var(--soft); font-size: 12px; letter-spacing: 1px; }.level-card.is-complete .level-number { color: var(--mint); }.level-lock { float: right; color: var(--muted); font-size: 15px; }.level-stars { display: flex; gap: 2px; margin-top: 17px; color: var(--gold); font-size: 17px; letter-spacing: 2px; }.level-card:not(.is-complete) .level-stars { color: rgba(191, 207, 233, .24); }.level-chapter { position: absolute; bottom: 13px; left: 15px; color: var(--muted); font-size: 10px; }.map-footer-note { margin-top: 20px; color: var(--muted); font-size: 11px; text-align: center; }.legend-dot { display: inline-block; width: 7px; height: 7px; margin: 0 5px 0 12px; border-radius: 50%; }.legend-complete { background: var(--mint); box-shadow: 0 0 8px var(--mint); }.legend-current { background: var(--gold); box-shadow: 0 0 8px var(--gold); }.legend-locked { background: #69809d; }
.developer-dock { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 4; display: flex; align-items: flex-end; gap: 7px; }
.developer-option { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px dashed rgba(143, 164, 197, .34); border-radius: 3px; background: rgba(6, 14, 33, .82); color: rgba(185, 202, 227, .68); font-size: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); transition: .2s ease; }.developer-option:hover { border-color: rgba(102, 229, 255, .66); color: var(--cyan); background: rgba(10, 28, 55, .96); }.developer-option span:first-child { color: var(--cyan); font-family: Consolas, monospace; font-size: 13px; }.story-developer { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 4; }

/* Developer generator */
.generator-screen { width: min(1440px, 100%); margin: 0 auto; }
.generator-header { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 14px; padding: 4px 0 20px; border-bottom: 1px solid var(--line); }.generator-header h2 { margin: 0; font-size: 28px; font-weight: 350; }.generator-header .eyebrow { margin-bottom: 3px; }.generator-export { display: inline-flex; align-items: center; gap: 7px; }
.generator-workspace { display: grid; grid-template-columns: minmax(230px, 280px) minmax(410px, 1fr) minmax(270px, 320px); min-height: calc(100vh - 118px); }
.generator-controls, .generator-analysis { padding: 22px 20px; }.generator-controls { border-right: 1px solid var(--line); }.generator-analysis { border-left: 1px solid var(--line); }.generator-play { min-width: 0; padding: 22px clamp(18px, 3vw, 42px); }
.generator-section-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 17px; }.generator-section-heading > span { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid rgba(102, 229, 255, .32); color: var(--cyan); font-size: 9px; }.generator-section-heading h3 { margin: 0; color: var(--ink); font-size: 13px; font-weight: 550; }.generator-section-heading small { margin-left: 5px; color: var(--muted); font-size: 10px; font-weight: 400; }
.generator-field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px; margin-bottom: 14px; color: var(--soft); font-size: 11px; }.generator-field output { color: var(--gold); font-size: 10px; }.generator-field select, .generator-number { grid-column: 1 / -1; width: 100%; min-height: 35px; margin-top: 2px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 3px; outline: 0; background: rgba(10, 25, 51, .72); color: var(--ink); font: inherit; }.generator-field select:focus, .generator-number:focus, .generator-notes:focus { border-color: rgba(102, 229, 255, .56); }.generator-field-pair { grid-template-columns: 1fr 1fr; gap: 9px; }.generator-field-pair label { display: grid; gap: 5px; }.generator-field-pair select { grid-column: auto; margin: 0; }
.generator-field input[type="range"] { grid-column: 1 / -1; width: 100%; height: 3px; margin: 4px 0 1px; accent-color: var(--cyan); cursor: pointer; }.generator-command { width: 100%; margin-top: 4px; }.generator-command:disabled { opacity: .45; cursor: wait; }.generator-status { min-height: 31px; margin-top: 10px; color: var(--muted); font-size: 10px; line-height: 1.45; }.generator-status.is-error { color: var(--coral); }.generator-status.is-ready { color: var(--mint); }
.generator-composition { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; margin: -2px 0 15px; color: var(--muted); font-size: 9px; }.generator-composition strong { color: var(--mint); font-size: 10px; font-weight: 500; }.generator-composition-bar { grid-column: 1 / -1; display: flex; width: 100%; height: 6px; overflow: hidden; border: 1px solid rgba(153, 187, 236, .16); border-radius: 2px; background: rgba(8, 18, 38, .75); }.generator-composition-bar i { display: block; height: 100%; transition: width .12s linear; }.generator-composition-bar i:nth-child(1) { background: #35415a; }.generator-composition-bar i:nth-child(2) { background: #91dfff; }.generator-composition-bar i:nth-child(3) { background: #ffd47b; }.generator-composition-bar i:nth-child(4) { background: #7488f5; }
.generator-policy { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 9px 10px; border: 1px solid rgba(153, 187, 236, .13); background: rgba(9, 23, 47, .42); color: var(--muted); font-size: 10px; }.generator-policy strong { color: var(--mint); font-size: 10px; font-weight: 500; }
.generator-play-header { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 560px; margin: 0 auto 16px; border-bottom: 1px solid var(--line); }.generator-play-header div { display: grid; gap: 4px; padding: 8px 12px 11px; text-align: center; }.generator-play-header span { color: var(--muted); font-size: 9px; }.generator-play-header strong { color: var(--gold); font-size: 20px; font-weight: 450; }.generator-board-wrap { position: relative; display: grid; min-height: 300px; place-items: center; }.generator-board { width: min(58vh, 560px); }.generator-board:empty::before { content: "NO GENERATED BOARD"; align-self: center; justify-self: center; color: rgba(143, 164, 197, .42); font-size: 10px; letter-spacing: 2px; }.generator-play-state { position: absolute; left: 50%; bottom: 10px; z-index: 4; max-width: 88%; padding: 6px 10px; border: 1px solid transparent; background: rgba(6, 17, 38, .82); color: var(--muted); font-size: 10px; text-align: center; transform: translateX(-50%); pointer-events: none; }.generator-play-state.is-success { border-color: rgba(152, 239, 207, .35); color: var(--mint); }.generator-play-state.is-fail { border-color: rgba(255, 159, 135, .35); color: var(--coral); }.generator-play-actions { display: flex; justify-content: center; gap: 9px; margin-top: 16px; }.board-cell.is-solution { outline: 2px solid var(--gold); outline-offset: -3px; box-shadow: inset 0 0 14px rgba(255, 212, 123, .16); }
.generator-metrics { display: grid; gap: 0; margin: 0; }.generator-metrics div { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(153, 187, 236, .11); }.generator-metrics dt { color: var(--muted); font-size: 10px; }.generator-metrics dd { margin: 0; color: var(--ink); font-size: 12px; text-align: right; }.generator-metrics dd.is-warning { color: var(--coral); }.generator-metrics dd.is-good { color: var(--mint); }.generator-rating-heading { margin-top: 24px; }.generator-rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }.generator-rating button { height: 34px; border: 1px solid var(--line); border-radius: 2px; background: rgba(10, 25, 51, .64); color: var(--muted); font-size: 12px; }.generator-rating button:hover, .generator-rating button.is-active { border-color: rgba(255, 212, 123, .62); background: rgba(255, 212, 123, .1); color: var(--gold); }.generator-notes { width: 100%; margin-top: 9px; padding: 9px; resize: vertical; border: 1px solid var(--line); border-radius: 3px; outline: 0; background: rgba(8, 21, 44, .72); color: var(--ink); font: 11px/1.5 inherit; }.generator-notes::placeholder { color: rgba(143, 164, 197, .5); }.generator-record-actions { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-top: 8px; }.generator-record-actions .secondary-button { min-height: 38px; }.generator-history-heading { margin-top: 25px; margin-bottom: 10px; }
.generator-records { display: grid; gap: 7px; max-height: 260px; overflow: auto; padding-right: 3px; }.generator-record-empty { padding: 14px 0; color: rgba(143, 164, 197, .55); font-size: 10px; text-align: center; }.generator-record { display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; padding: 9px; border: 1px solid rgba(153, 187, 236, .13); border-radius: 3px; background: rgba(9, 23, 47, .5); }.generator-record strong { color: var(--soft); font-size: 10px; font-weight: 500; }.generator-record small { color: var(--muted); font-size: 9px; }.generator-record-rating { color: var(--gold); font-size: 11px; text-align: right; }.generator-record-buttons { display: flex; grid-column: 1 / -1; gap: 5px; margin-top: 3px; }.generator-record-buttons button { flex: 1; padding: 5px; border: 1px solid rgba(153, 187, 236, .14); border-radius: 2px; background: transparent; color: var(--muted); font-size: 9px; }.generator-record-buttons button:hover { color: var(--cyan); border-color: rgba(102, 229, 255, .38); }

/* Game */
.game-screen { display: flex; flex-direction: column; max-width: 760px; }.game-header { padding-bottom: 14px; }.back-button { margin-right: 12px; }.level-heading { flex: 1; }.level-heading .eyebrow { margin-bottom: 3px; }.level-heading h2 { font-size: 24px; }.game-actions { justify-content: flex-end; }.game-hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 18px; }.hud-item { display: flex; align-items: baseline; gap: 7px; color: var(--soft); }.hud-item strong { color: var(--ink); font-size: 25px; font-weight: 400; }.hud-item:last-child { justify-content: flex-end; }.hud-label { color: var(--muted); font-size: 11px; }.hud-suffix { color: var(--muted); font-size: 10px; }.chain-display { min-width: 106px; padding: 7px 15px 9px; border: 1px solid rgba(102, 229, 255, .22); border-radius: 3px; background: rgba(15, 39, 72, .48); text-align: center; transition: .25s ease; }.chain-display.is-hot { border-color: rgba(255, 212, 123, .7); box-shadow: 0 0 25px rgba(255, 184, 80, .22); transform: scale(1.04); }.chain-label { display: block; color: var(--cyan); font-size: 9px; letter-spacing: 2px; }.chain-display strong { color: var(--gold); font-size: 24px; font-weight: 500; }
.board-wrap { position: relative; display: grid; place-items: center; flex: 1; min-height: 300px; }.board { display: grid; width: min(74vh, 680px); max-width: 100%; aspect-ratio: 1; gap: clamp(4px, .8vw, 8px); padding: clamp(10px, 2vw, 17px); border: 1px solid rgba(121, 194, 255, .18); border-radius: 7px; background: radial-gradient(circle at 50% 45%, rgba(26, 75, 130, .45), rgba(7, 19, 43, .83) 65%); box-shadow: inset 0 0 42px rgba(75, 149, 238, .17), 0 22px 60px rgba(2, 8, 22, .46); }.board-cell { position: relative; min-width: 0; min-height: 0; border: 0; border-radius: 4px; background: transparent; touch-action: manipulation; }.board-cell::before { content: ""; position: absolute; left: 50%; top: 50%; width: 32%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); transition: .3s ease; }.board-cell.level-1::before { background: #9fdcff; box-shadow: 0 0 8px rgba(133, 220, 255, .82), 0 0 20px rgba(102, 190, 255, .42); }.board-cell.level-2::before { width: 53%; background: radial-gradient(circle at 34% 27%, #fff7d5 0 12%, #ffd47b 22%, #60d8f7 57%, #4f76db 77%); box-shadow: 0 0 10px rgba(255, 213, 133, .78), 0 0 28px rgba(96, 186, 255, .48); }.board-cell.level-3::before { width: 65%; background: radial-gradient(circle at 35% 25%, #fff 0 10%, #ffeeb0 16%, #7ae8ff 42%, #627ef4 66%, #4051bb 83%); box-shadow: 0 0 14px #b2f6ff, 0 0 33px rgba(98, 134, 255, .8), 0 0 50px rgba(255, 212, 123, .28); }.board-cell.level-3::after { content: ""; position: absolute; left: 50%; top: 50%; width: 86%; height: 33%; border: 1px solid rgba(148, 235, 255, .57); border-radius: 50%; transform: translate(-50%, -50%) rotate(-26deg); animation: star-ring 3.2s linear infinite; }.board-cell.is-sleeping { filter: saturate(.66); opacity: .56; }.board-cell.is-lit { opacity: 1; filter: saturate(1.12); }.board-cell.is-lit::before { animation: lit-pulse .8s ease-out; }.board-cell.is-lit.level-1::before { box-shadow: 0 0 12px #bcf2ff, 0 0 25px rgba(102, 229, 255, .7); }.board-cell.is-lit.level-2::before { box-shadow: 0 0 15px #ffe9aa, 0 0 34px rgba(102, 223, 255, .83); }.board-cell.is-lit.level-3::before { box-shadow: 0 0 21px #fff4c7, 0 0 48px rgba(102, 223, 255, .96); }.board-cell.is-obstacle { border: 1px solid rgba(77, 92, 122, .19); background: repeating-linear-gradient(135deg, rgba(25, 36, 59, .7), rgba(25, 36, 59, .7) 3px, rgba(15, 23, 41, .88) 3px, rgba(15, 23, 41, .88) 7px); opacity: .6; }.board-cell.is-obstacle::before { width: 28%; background: #1d2d4b; box-shadow: 0 0 10px rgba(33, 63, 104, .42); }.board-cell.is-obstacle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 64%; height: 1px; background: rgba(138, 153, 185, .18); transform: translate(-50%, -50%) rotate(-35deg); }.board-cell.is-hint { outline: 2px solid var(--gold); outline-offset: -2px; animation: hint-breathe 1.1s ease-in-out infinite; }.board-cell.is-direction::after { content: "·"; position: absolute; left: 50%; top: -2px; color: var(--gold); font-size: 18px; transform: translateX(-50%); }
.resonance-meter { position: absolute; left: 50%; bottom: 3%; z-index: 3; display: flex; gap: 2px; opacity: 0; transform: translateX(-50%); }.resonance-meter.is-visible { opacity: 1; }.resonance-meter i { display: block; width: 4px; height: 4px; border: 1px solid rgba(177, 211, 241, .62); border-radius: 50%; background: rgba(8, 21, 45, .8); }.resonance-meter i.is-filled { border-color: var(--gold); background: var(--gold); }.board-cell.is-lit .resonance-meter { opacity: 0; }
.board-cell.is-sleeping { opacity: 1; filter: none; animation: none; }.board-cell.is-sleeping::before { animation: none !important; box-shadow: none !important; }.board-cell.is-sleeping.level-1::before { background: #415168; }.board-cell.is-sleeping.level-2::before { background: radial-gradient(circle, #5b6470 0 24%, #3d4b5d 58%, #2b3749 100%); }.board-cell.is-sleeping.level-3::before { background: radial-gradient(circle, #67686b 0 18%, #465064 48%, #2b3548 82%); }.board-cell.is-sleeping.level-3::after { border-color: rgba(105, 119, 142, .36); opacity: .48; animation: none !important; }.board-cell.is-sleeping .resonance-meter i.is-filled { box-shadow: none; }.board-cell.is-lit { animation: lit-breathe 2.8s ease-in-out .8s infinite; }.board-cell.is-lit.level-3::after { animation: star-ring 3.2s linear infinite; }.board-cell.is-hint { animation: none; }
.board-message { position: absolute; left: 50%; bottom: -4px; transform: translate(-50%, 100%); min-height: 22px; color: var(--soft); font-size: 12px; opacity: 0; transition: opacity .3s ease; white-space: nowrap; }.board-message.is-visible { opacity: 1; }
.game-toolbar { display: flex; justify-content: center; gap: 10px; padding: 18px 0 5px; }.tool-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 82px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 3px; background: rgba(10, 26, 51, .64); color: var(--soft); font-size: 12px; transition: .2s ease; }.tool-button:hover { border-color: rgba(102, 229, 255, .48); color: #fff; transform: translateY(-1px); }.tool-icon { color: var(--cyan); font-size: 16px; line-height: 1; }.tutorial-callout { z-index: 5; display: flex; align-items: center; align-self: center; gap: 7px; max-width: min(320px, 88vw); margin-top: 12px; padding: 10px 13px; border: 1px solid rgba(102, 229, 255, .42); background: rgba(7, 22, 46, .93); color: var(--soft); font-size: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); animation: callout-in .45s ease both; }.callout-arrow { color: var(--gold); font-size: 19px; }

/* Modal and feedback */
.fx-ripple { position: fixed; z-index: 18; width: var(--ripple-size); height: var(--ripple-size); pointer-events: none; border: 1px solid var(--ripple-color); border-radius: 50%; transform: translate(-50%, -50%) scale(.25); box-shadow: 0 0 18px var(--ripple-color); animation: fx-ripple .68s ease-out both; }
.fx-particle { position: fixed; z-index: 18; width: 4px; height: 4px; pointer-events: none; border-radius: 50%; background: var(--particle-color); box-shadow: 0 0 9px var(--particle-color); transform: translate(-50%, -50%); animation: fx-particle .78s cubic-bezier(.1, .75, .3, 1) both; }
.fx-flash { position: fixed; inset: 0; z-index: 17; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(170, 244, 255, .28), transparent 64%); animation: fx-flash .78s ease-out both; }
.modal-layer { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(2, 8, 20, .64); backdrop-filter: blur(9px); }.result-modal { position: relative; width: min(420px, 100%); padding: 34px 30px 29px; border: 1px solid rgba(145, 210, 255, .26); border-radius: 5px; background: linear-gradient(145deg, rgba(15, 38, 74, .96), rgba(8, 19, 43, .98)); box-shadow: var(--shadow); text-align: center; animation: modal-in .42s cubic-bezier(.18, .8, .27, 1.2) both; }.result-modal h2 { margin: 0 0 9px; font-size: 29px; font-weight: 350; }.result-copy { margin-bottom: 18px; color: var(--soft); font-size: 13px; }.result-burst { position: absolute; inset: -20px 12px auto; pointer-events: none; color: var(--gold); }.result-burst span { position: absolute; text-shadow: 0 0 13px currentColor; animation: burst-twinkle 1.7s ease-in-out infinite; }.result-burst span:nth-child(1) { left: 6%; top: 21px; font-size: 17px; }.result-burst span:nth-child(2) { right: 10%; top: 9px; color: var(--cyan); font-size: 13px; animation-delay: .5s; }.result-burst span:nth-child(3) { right: 20%; top: 65px; color: var(--mint); font-size: 12px; animation-delay: .9s; }.result-burst span:nth-child(4) { left: 18%; top: 63px; color: var(--coral); animation-delay: .25s; }.rating { display: flex; justify-content: center; gap: 9px; margin: 0 auto 19px; color: rgba(213, 230, 255, .22); font-size: 34px; line-height: 1; }.rating span.is-on { color: var(--gold); text-shadow: 0 0 16px rgba(255, 212, 123, .72); }.result-stats { display: flex; justify-content: center; gap: 48px; margin: 0 auto 26px; }.result-stats div { display: grid; gap: 4px; }.result-stats strong { color: var(--ink); font-size: 24px; font-weight: 400; }.result-stats span { color: var(--muted); font-size: 11px; }.result-actions { display: grid; gap: 9px; }.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 43px; border-radius: 3px; font-size: 13px; }.primary-button { background: linear-gradient(100deg, #6ce9f2, #6991f7); color: #06142e; font-weight: 600; box-shadow: 0 8px 24px rgba(92, 201, 236, .22); }.secondary-button { border: 1px solid rgba(134, 194, 237, .28); background: rgba(18, 41, 74, .55); color: var(--soft); }.link-button { margin: 2px auto 0; }.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; max-width: min(350px, 90vw); padding: 10px 15px; border: 1px solid rgba(131, 201, 236, .3); border-radius: 3px; background: rgba(8, 23, 47, .93); color: var(--soft); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .25s ease; }.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes rise-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scene-orbit { to { transform: rotate(342deg); } }
@keyframes orbit-one-spin { to { transform: translate(-50%, -50%) rotate(346deg); } }
@keyframes orbit-two-spin { to { transform: translate(-50%, -50%) rotate(394deg); } }
@keyframes breathing { 0%, 100% { transform: translate(-50%, -50%) scale(.92); } 50% { transform: translate(-50%, -50%) scale(1.1); } }
@keyframes core-ring { 0% { opacity: .72; transform: scale(.78); } 100% { opacity: 0; transform: scale(1.45); } }
@keyframes twinkle { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.35); } }
@keyframes star-ring { to { transform: translate(-50%, -50%) rotate(334deg); } }
@keyframes lit-pulse { 0% { transform: translate(-50%, -50%) scale(.45); opacity: .4; } 48% { transform: translate(-50%, -50%) scale(1.42); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); } }
@keyframes lit-breathe { 0%, 100% { opacity: .9; } 50% { opacity: 1; } }
@keyframes hint-breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 212, 123, .08); } 50% { box-shadow: 0 0 0 6px rgba(255, 212, 123, .16); } }
@keyframes callout-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes burst-twinkle { 0%, 100% { opacity: .38; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }
@keyframes fx-ripple { 0% { opacity: .85; transform: translate(-50%, -50%) scale(.25); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } }
@keyframes fx-particle { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--particle-angle)) translateX(0); } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--particle-angle)) translateX(var(--particle-distance)); } }
@keyframes fx-flash { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }

@media (max-width: 720px) {
  .screen { padding-left: 15px; padding-right: 15px; }
  .map-header { padding-bottom: 20px; }.map-intro { padding: 14px; gap: 11px; }.map-intro p { font-size: 11px; }.map-intro-mark { width: 36px; height: 36px; font-size: 18px; }.map-stats span { font-size: 19px; }.map-stats small { font-size: 10px; }
  .chapter-tabs { grid-template-columns: repeat(2, 1fr); gap: 3px 8px; }.chapter-tab { font-size: 11px; padding: 9px 5px; }
  .level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }.level-card { min-height: 94px; padding: 11px; }.level-card.is-current::after { display: none; }.level-stars { margin-top: 10px; font-size: 15px; }.level-chapter { left: 11px; bottom: 9px; font-size: 9px; }
  .developer-dock { right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); }.developer-dock .developer-option { padding: 8px; }.developer-dock .developer-option span:last-child { display: none; }.developer-dock #map-generator span:last-child { display: inline; }.story-developer { right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); }
  .game-header { padding-bottom: 11px; }.level-heading h2 { font-size: 21px; }.game-hud { margin-bottom: 11px; }.hud-label { font-size: 10px; }.hud-item strong { font-size: 22px; }.chain-display { min-width: 91px; padding-left: 8px; padding-right: 8px; }.chain-display strong { font-size: 21px; }.board { width: min(86vw, 66vh); gap: 3px; padding: 10px; }.game-toolbar { padding-top: 20px; }.tool-button { min-width: 75px; padding: 9px 9px; }.tool-button span:last-child { font-size: 11px; }.board-message { bottom: 0; }
}
@media (max-width: 1080px) {
  .generator-workspace { grid-template-columns: 240px minmax(390px, 1fr); }.generator-analysis { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; border-top: 1px solid var(--line); border-left: 0; }.generator-analysis .generator-section-heading, .generator-analysis .generator-metrics { grid-column: 1; }.generator-analysis .generator-rating-heading, .generator-analysis .generator-rating, .generator-analysis .generator-notes, .generator-analysis .generator-record-actions { grid-column: 2; }.generator-analysis .generator-rating-heading { grid-row: 1; margin-top: 0; }.generator-history-heading, .generator-records { grid-column: 1 / -1; }.generator-records { grid-template-columns: repeat(2, 1fr); max-height: none; }
}
@media (max-width: 720px) {
  .generator-screen { padding-left: 12px; padding-right: 12px; }.generator-header { grid-template-columns: 38px 1fr auto; padding-bottom: 14px; }.generator-header h2 { font-size: 23px; }.generator-export { width: 38px; height: 38px; justify-content: center; padding: 0; font-size: 0; }.generator-export span { font-size: 16px; }.generator-workspace { display: block; min-height: 0; }.generator-controls, .generator-analysis, .generator-play { padding: 19px 4px; border: 0; border-bottom: 1px solid var(--line); }.generator-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }.generator-controls .generator-section-heading, .generator-controls .generator-command, .generator-controls .generator-status, .generator-controls .generator-composition { grid-column: 1 / -1; }.generator-field-pair { grid-column: 1 / -1; }.generator-play { padding-left: 0; padding-right: 0; }.generator-board { width: min(92vw, 62vh); }.generator-play-state { bottom: 5px; }.generator-analysis { display: block; }.generator-analysis .generator-rating-heading { margin-top: 24px; }.generator-records { display: grid; grid-template-columns: 1fr; }.generator-record-actions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 390px) { .map-intro { align-items: flex-start; }.map-stats { display: none; }.level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }.level-card { min-height: 88px; }.level-stars { font-size: 13px; }.game-hud { gap: 4px; }.hud-suffix { display: none; }.hud-item { gap: 4px; }.chain-display { min-width: 80px; }.board { width: min(91vw, 64vh); }.tool-button { min-width: 66px; gap: 4px; }.tool-icon { font-size: 14px; } }
