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

:root {
  color-scheme: dark;
  --ink: #eff1ec;
  --muted: #a7adb1;
  --subtle: #727a81;
  --base: #171b20;
  --panel: #20262b;
  --panel-raised: #292f34;
  --line: #394147;
  --acid: #d6f36a;
  --acid-ink: #1b2113;
  --orange: #ee8759;
  --mono: 'DM Mono', 'Cascadia Code', monospace;
  --sans: 'Manrope', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--base); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
.workbench { width: min(1280px, calc(100% - 72px)); margin: 0 auto; }
.play-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid var(--acid); border-radius: 3px; background: var(--acid); color: var(--acid-ink); font: 700 10px var(--mono); letter-spacing: .05em; text-transform: uppercase; cursor: pointer; transition: transform .18s, background-color .18s; }
.play-button:hover { transform: translateY(-2px); background: #e2ff7c; }
.play-dialog { width: min(1040px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; overflow: auto; border: 1px solid #59654b; border-radius: 5px; background: #171d20; color: var(--ink); box-shadow: 0 28px 100px #0009; }
.play-dialog::backdrop { background: #05090bcf; backdrop-filter: blur(5px); }
.play-room { display: grid; gap: 14px; padding: clamp(14px, 2.3vw, 25px); animation: play-enter .24s ease-out both; }
@keyframes play-enter { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.play-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 12px; border-bottom: 1px solid #394147; }
.play-head h2 { margin: 5px 0 3px; font-size: clamp(21px, 3vw, 32px); letter-spacing: -.045em; }
.play-head p { margin: 0; color: #a7adb1; font-size: 11px; line-height: 1.5; }
.play-kicker, .play-hud small, .play-controls-hint { color: #9da69f; font: 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.play-close { width: 38px; height: 38px; flex: none; border: 1px solid #465047; background: #20262b; color: #eff1ec; font-size: 24px; line-height: 1; cursor: pointer; }
.play-hud { display: grid; grid-template-columns: minmax(180px,1.3fr) repeat(3,minmax(95px,.7fr)); gap: 9px; }
.play-stat { min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; padding: 10px 12px; border: 1px solid #333c3f; background: #1c2326; }
.play-stat small { grid-column: 1/-1; }
.play-stat strong { font: 12px var(--mono); color: #eff1ec; }
.health-track, .boss-track { display: flex; gap: 3px; min-width: 60px; }
.health-track i { height: 7px; flex: 1; background: #41494a; }
.health-track i.is-full { background: var(--acid); box-shadow: 0 0 8px #d6f36a4a; }
.play-stage { position: relative; height: clamp(300px, 52vh, 520px); min-height: 280px; overflow: hidden; border: 1px solid #485650; background: #101719; }
.play-stage canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.boss-readout { position: absolute; top: 12px; left: 50%; width: min(330px, calc(100% - 24px)); transform: translateX(-50%); padding: 8px 11px; border: 1px solid #5e4944; background: #17191cdd; backdrop-filter: blur(5px); }
.boss-readout[hidden] { display: none; }
.boss-line { display: flex; justify-content: space-between; gap: 12px; color: #f0ded5; font: 9px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.boss-track { height: 5px; margin-top: 7px; background: #443532; }
.boss-track i { width: 100%; background: #e87959; transition: width .2s; }
.play-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 22px; text-align: center; background: #101719d9; backdrop-filter: blur(5px); }
.play-overlay[hidden] { display: none; }
.play-overlay h3 { margin: 0; font-size: clamp(22px,4vw,36px); letter-spacing: -.04em; }
.play-overlay p { max-width: 440px; margin: 0 0 5px; color: #b7c0b8; font-size: 13px; line-height: 1.55; }
.play-overlay button { min-height: 42px; padding: 0 16px; border: 1px solid var(--acid); background: var(--acid); color: var(--acid-ink); font: 700 10px var(--mono); text-transform: uppercase; cursor: pointer; }
.play-overlay .play-secondary { border-color: #56615e; background: #222a2b; color: var(--ink); }
.play-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.game-message { min-height: 24px; color: #c5cec5; font-size: 12px; line-height: 1.5; }
.game-message[data-tone="danger"] { color: #ff9a7c; }
.game-message[data-tone="good"] { color: var(--acid); }
.play-controls { display: flex; align-items: center; gap: 14px; }
.play-pad { display: grid; grid-template-columns: repeat(3, 38px); grid-template-rows: repeat(2, 34px); gap: 3px; }
.play-pad button, .game-attack { border: 1px solid #4b5652; background: #222a2b; color: #e8eee7; font: 13px var(--mono); cursor: pointer; touch-action: manipulation; }
.play-pad [data-game-move="up"] { grid-column: 2; grid-row: 1; }
.play-pad [data-game-move="left"] { grid-column: 1; grid-row: 2; }
.play-pad [data-game-move="down"] { grid-column: 2; grid-row: 2; }
.play-pad [data-game-move="right"] { grid-column: 3; grid-row: 2; }
.play-pad button:active, .game-attack:active { border-color: var(--acid); background: #394632; }
.game-attack { min-width: 80px; min-height: 71px; color: #ff9a7c; font: 700 9px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.play-controls-hint { max-width: 165px; line-height: 1.6; }
.play-dialog:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
@media(max-width:700px) {
  .play-dialog { width: calc(100% - 14px); max-height: calc(100dvh - 14px); border-radius: 4px; }
  .play-room { gap: 9px; padding: 11px; }
  .play-head { gap: 10px; padding-bottom: 8px; }
  .play-head p { max-width: 42ch; font-size: 10px; }
  .play-hud { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
  .play-stat { padding: 7px 9px; }
  .play-stat small { font-size: 8px; }
  .play-stage { height: clamp(255px, 36svh, 340px); min-height: 255px; }
  .play-footer { align-items: stretch; flex-direction: column; gap: 8px; }
  .game-message { min-height: 20px; font-size: 11px; }
  .play-controls { justify-content: space-between; gap: 10px; }
  .play-controls-hint { display: none; }
}
@media(max-width:360px) {
  .play-room { padding: 8px; }
  .play-head h2 { font-size: 20px; }
  .play-stat strong { font-size: 10px; }
  .play-stage { height: 250px; min-height: 250px; }
  .play-pad { grid-template-columns: repeat(3,34px); grid-template-rows: repeat(2,32px); }
  .game-attack { min-width: 70px; min-height: 67px; }
}
@media(prefers-reduced-motion:reduce) { .play-room { animation: none; } }

.topbar { min-height: 76px; border-bottom: 1px solid #343b41; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 800; letter-spacing: .12em; }
.brand-light { color: var(--acid); }
.brand-mark { width: 25px; height: 25px; border: 1px solid #58634a; border-radius: 50%; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; padding: 5px; gap: 2px; transform: rotate(45deg); }
.brand-mark i { border-radius: 50%; background: var(--acid); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { opacity: .38; }
.machine-status, .top-link, .micro-label, .eyebrow, .control-index, .field-label .label-note, .range-captions, .favorites-heading, .page-footer, .map-meta, .map-legend, .map-key, .world-stats small { font-family: var(--mono); }
.machine-status { display: flex; align-items: center; gap: 9px; color: #9fa7aa; font-size: 10px; letter-spacing: .08em; }
.status-lamp, .live-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--acid); box-shadow: 0 0 10px #d6f36a72; }
.status-divider { height: 13px; width: 1px; margin: 0 5px; background: #485057; }
.machine-status #levelNumber { color: var(--acid); }
.top-link { color: var(--muted); text-decoration: none; font-size: 11px; border-bottom: 1px solid #475058; padding: 8px 0; }
.top-link span { color: var(--acid); margin-left: 7px; }

.intro { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: center; min-height: 286px; padding: 28px 7.3% 28px 2.8%; position: relative; overflow: hidden; }
.intro-copy { position: relative; z-index: 1; }
.eyebrow { color: var(--acid); font-size: 9px; letter-spacing: .14em; margin: 0 0 21px; display: flex; align-items: center; gap: 10px; }
.eyebrow-line { display: inline-block; width: 27px; height: 1px; background: var(--acid); }
h1 { margin: 0; font-size: clamp(46px, 6vw, 76px); line-height: .97; letter-spacing: -.075em; font-weight: 700; }
h1 span { color: var(--acid); }
.intro-text { max-width: 445px; color: #a5adb1; font-size: 13px; line-height: 1.75; margin: 18px 0 0; }
.intro-art { width: 250px; height: 230px; justify-self: center; position: relative; transform: rotate(-12deg); }
.orbit { position: absolute; border: 1px solid #59634c; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(34deg); }
.orbit-one { width: 214px; height: 105px; }
.orbit-two { width: 218px; height: 166px; transform: translate(-50%, -50%) rotate(-36deg); border-color: #414d4b; }
.seed-core { position: absolute; width: 79px; height: 79px; border-radius: 50% 50% 45% 50%; background: var(--acid); color: #26301c; display: grid; place-items: center; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(45deg); box-shadow: 0 0 42px #d6f36a27; }
.seed-core span { transform: rotate(-45deg); font-weight: 800; font-size: 19px; letter-spacing: -.08em; }
.seed-core i { position: absolute; width: 5px; height: 5px; border: 1px solid #526139; border-radius: 50%; }
.seed-core i:nth-of-type(1) { top: -15px; left: 35px; }.seed-core i:nth-of-type(2) { right: -15px; top: 35px; }.seed-core i:nth-of-type(3) { bottom: -15px; left: 35px; }.seed-core i:nth-of-type(4) { left: -15px; top: 35px; }
.orbit-label { color: #7f897c; position: absolute; font: 9px/1.5 var(--mono); letter-spacing: .08em; transform: rotate(12deg); }
.orbit-label-top { right: -4px; top: 25px; }.orbit-label-bottom { bottom: 28px; left: 0; }

.machine { display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(330px, .82fr); border: 1px solid #384047; background: var(--panel); min-height: 600px; }
.map-side { min-width: 0; padding: 26px 28px 22px; }
.section-heading, .control-head { display: flex; align-items: center; justify-content: space-between; }
.micro-label { font-size: 9px; color: #879199; letter-spacing: .1em; margin: 0 0 7px; }
.section-heading h2, .control-head h2 { font-size: 18px; margin: 0; letter-spacing: -.045em; font-weight: 700; }
.map-actions { display: flex; gap: 8px; }
.icon-button { width: 34px; height: 34px; border: 1px solid #414a50; background: transparent; display: grid; place-items: center; cursor: pointer; color: #aeb6b7; transition: .16s ease; }
.icon-button:hover, .icon-button.is-saved { border-color: var(--acid); color: var(--acid); }
.star-icon { font-size: 21px; line-height: 1; }
.icon-button svg, .share-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.map-frame { margin-top: 17px; background: #15191d; border: 1px solid #3a4247; }
.map-meta { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px; color: #9ba4a7; font-size: 9px; letter-spacing: .04em; }
.map-meta > span:first-child { display: flex; align-items: center; gap: 8px; color: var(--acid); }
.live-dot { width: 5px; height: 5px; }
.canvas-wrap { width: 100%; overflow: auto; padding: 2px 12px; }
#levelMap { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; }
.map-zoom { min-height: 32px; padding: 0 14px 6px; display: flex; align-items: center; gap: 10px; color: #7c878d; font: 8px var(--mono); }
.map-zoom label { white-space: nowrap; }.map-zoom input { min-width: 0; flex: 1; appearance: none; height: 12px; background: transparent; cursor: pointer; }
.map-zoom input::-webkit-slider-runnable-track { height: 2px; background: #4a5459; }.map-zoom input::-moz-range-track { height: 2px; background: #4a5459; }
.map-zoom input::-webkit-slider-thumb { appearance: none; width: 9px; height: 9px; margin-top: -3px; border-radius: 50%; background: var(--acid); }.map-zoom input::-moz-range-thumb { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--acid); }
.map-zoom output { width: 32px; color: var(--acid); text-align: right; }
.map-legend { border-top: 1px solid #31383d; padding: 11px 14px 12px; display: flex; flex-wrap: wrap; gap: 15px; color: #9ca5a8; text-transform: uppercase; font-size: 8px; letter-spacing: .03em; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 8px; height: 8px; display: inline-block; }
.swatch-floor { background: #4d5c53; }.swatch-wall { background: #242c31; border: 1px solid #67736e; }.swatch-hazard { background: var(--orange); }.swatch-start { background: var(--acid); }.swatch-exit { background: #72c9ec; }
.map-footer { display: flex; justify-content: space-between; align-items: center; padding: 21px 1px 0; }
.world-stats { display: flex; gap: clamp(21px, 4vw, 48px); }
.world-stats > span { display: flex; align-items: baseline; gap: 9px; }
.world-stats b { font-size: 20px; line-height: 1; letter-spacing: -.06em; font-weight: 600; }
.world-stats small { color: #879198; font-size: 8px; letter-spacing: .06em; }
.map-key { color: #858f94; font-size: 9px; display: flex; align-items: center; gap: 7px; }
kbd { font: 9px var(--mono); color: #b5bdbe; border: 1px solid #4c565c; border-bottom-width: 2px; padding: 3px 5px; }
.json-icon { font: 9px var(--mono); letter-spacing: -1px; }
.algorithm-trace { margin-top: 22px; padding: 16px; border: 1px solid #3b454a; background: #1b2125; }
.trace-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.trace-heading h3 { font-size: 13px; margin: 0; font-weight: 600; letter-spacing: -.025em; }
.trace-actions { display: flex; gap: 6px; }
.trace-actions button { min-height: 29px; padding: 0 9px; color: #bcc4bf; border: 1px solid #454f54; background: #22292d; cursor: pointer; font: 9px var(--mono); }
.trace-actions button:hover { color: var(--acid); border-color: #768456; }
.trace-actions button span { color: var(--acid); font-size: 15px; vertical-align: -1px; }
.trace-progress { height: 2px; margin-top: 15px; background: #384147; }
.trace-progress span { display: block; height: 100%; width: 0; background: var(--acid); transition: width .25s ease; }
.trace-current { display: grid; grid-template-columns: minmax(105px, .8fr) 2fr; gap: 16px; align-items: start; padding: 11px 0 10px; border-bottom: 1px solid #313a3f; }
.trace-current > span { color: var(--acid); font: 9px var(--mono); padding-top: 2px; }
.trace-current p { margin: 0; color: #b0b9b7; font-size: 10px; line-height: 1.6; }
.algorithm-code { list-style: none; margin: 9px 0 0; padding: 0; display: grid; gap: 2px; }
.algorithm-code li { padding: 4px 7px; color: #79848a; border-left: 2px solid transparent; font: 9px/1.45 var(--mono); }
.algorithm-code li::before { content: attr(data-number); display: inline-block; min-width: 24px; color: #586267; }
.algorithm-code li.is-active { color: #e3e9dd; border-left-color: var(--acid); background: #343c30; }
.algorithm-code li.is-active::before { color: var(--acid); }

.control-side { border-left: 1px solid #394147; background: #252b30; padding: 26px 25px 21px; }
.control-index { color: #778187; font-size: 9px; align-self: flex-start; padding-top: 4px; }
.control-head { margin-bottom: 25px; }
.field-label { display: block; color: #e5e9e5; font-size: 11px; font-weight: 600; margin-bottom: 9px; }
.field-label .label-note { font-size: 8px; color: #7e898f; font-weight: 400; margin-left: 5px; }
.seed-control { display: flex; border: 1px solid #49535a; background: #1b2024; transition: border-color .16s; }
.seed-control:focus-within { border-color: #95a85c; }
.seed-control input { min-width: 0; flex: 1; height: 42px; color: var(--acid); background: transparent; border: 0; padding: 0 12px; font: 14px var(--mono); letter-spacing: .05em; }
.dice-button { width: 43px; background: transparent; border: 0; border-left: 1px solid #414b51; color: #a9b0a9; cursor: pointer; font-size: 20px; transition: color .15s, transform .2s; }
.dice-button:hover { color: var(--acid); transform: rotate(40deg); }
.field-help { margin: 8px 0 21px; color: #899398; font-size: 9px; line-height: 1.6; }
.field-group { padding: 17px 0 15px; border-top: 1px solid #3c454b; }
select { width: 100%; height: 38px; appearance: none; padding: 0 32px 0 11px; color: #e2e6e0; border: 1px solid #485259; border-radius: 0; background-color: #20262b; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%23a5aeaa' stroke-width='1.4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; font-size: 10px; cursor: pointer; }
select:focus { border-color: #97a75f; }
select option { background: #20262b; color: #e2e6e0; }
.slider-label { display: flex; align-items: center; justify-content: space-between; }
.slider-label .field-label { margin: 0 0 10px; }
.slider-label output { color: var(--acid); font: 12px var(--mono); }
.range { appearance: none; display: block; width: 100%; height: 14px; margin: 0; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, var(--acid) var(--range-progress, 40%), #485156 var(--range-progress, 40%)); }
.range::-moz-range-track { height: 3px; background: #485156; }.range::-moz-range-progress { height: 3px; background: var(--acid); }
.range::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; margin-top: -5px; border: 2px solid var(--acid-ink); border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 1px var(--acid); }
.range::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid var(--acid-ink); border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 1px var(--acid); }
.range-captions { display: flex; justify-content: space-between; margin-top: 5px; color: #727e83; font-size: 7px; letter-spacing: .04em; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.field-row .field-group { border-top: 0; }
.size-note { margin: 6px 0 0; color: #78858a; font: 8px/1.4 var(--mono); }
.generate-button { width: 100%; min-height: 47px; margin-top: 18px; padding: 0 12px; display: flex; align-items: center; gap: 10px; border: 0; background: var(--acid); color: var(--acid-ink); cursor: pointer; font-size: 10px; font-weight: 800; letter-spacing: .045em; transition: background .15s, transform .15s; }
.generate-button:hover { background: #e2ff83; transform: translateY(-1px); }
.generate-glyph { font-size: 18px; line-height: 1; }
.generate-button kbd { margin-left: auto; color: #58633b; border-color: #a7bd55; font-size: 8px; }
.share-button { width: 100%; min-height: 40px; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #465057; background: transparent; color: #c2c9c6; cursor: pointer; font-size: 9px; transition: border-color .15s, color .15s; }
.share-button:hover { border-color: var(--acid); color: var(--acid); }
.share-button svg { width: 15px; height: 15px; }
.favorites { margin-top: 22px; padding-top: 13px; border-top: 1px solid #3d464b; }
.favorites-heading { display: flex; justify-content: space-between; align-items: center; color: #899399; font-size: 8px; letter-spacing: .06em; }
.favorites-heading h3 { margin: 0; font: inherit; }
.favorites-list { margin-top: 8px; }
.empty-favorites { margin: 0; color: #788287; font-size: 9px; line-height: 1.6; }
.favorite-row { display: flex; align-items: center; border-bottom: 1px solid #343c41; }
.favorite-item { min-width: 0; flex: 1; padding: 8px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #cbd0cc; background: none; border: 0; cursor: pointer; text-align: left; font: 9px var(--mono); }
.favorite-item:hover { color: var(--acid); }.favorite-item small { color: #758086; font-size: 8px; }
.favorite-remove { color: #7d878b; border: 0; background: transparent; cursor: pointer; font-size: 14px; padding: 0 3px; }
.favorite-remove:hover { color: var(--orange); }
.page-footer { min-height: 53px; display: flex; justify-content: space-between; align-items: center; gap: 18px; color: #747e83; font-size: 8px; letter-spacing: .045em; }
.toast { position: fixed; z-index: 5; left: 50%; bottom: 24px; padding: 10px 15px; border: 1px solid #58654a; background: #222923; color: var(--acid); font: 10px var(--mono); opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .workbench { width: min(100% - 36px, 720px); }
  .intro { grid-template-columns: 1fr 190px; padding-right: 4%; min-height: 250px; }
  .intro-art { transform: scale(.8) rotate(-12deg); margin-left: -20px; }
  .machine { grid-template-columns: 1fr; }
  .control-side { border-left: 0; border-top: 1px solid #394147; }
  .control-side { display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; }
  .control-head, .field-row, .favorites { grid-column: 1 / -1; }
  .control-head { margin-bottom: 5px; }
  .field-help { margin-bottom: 0; }
  .control-side > .field-group:nth-of-type(1) { border-top: 0; }
  .generate-button, .share-button { grid-column: 1 / -1; }
  .favorites { margin-top: 12px; }
}
@media (max-width: 560px) {
  .workbench { width: calc(100% - 24px); }
  .topbar { min-height: 60px; gap: 10px; }.brand { font-size: 12px; gap: 8px; }.brand-mark { width: 22px; height: 22px; }
  .machine-status { font-size: 8px; gap: 6px; }.machine-status .status-divider, .machine-status #levelNumber { display: none; }
  .top-link { font-size: 9px; }
  .intro { display: block; padding: 34px 12px 28px; min-height: auto; }
  h1 { font-size: clamp(47px, 15vw, 68px); }
  .intro-text { max-width: 360px; font-size: 12px; margin-top: 14px; }
  .intro-art { position: absolute; width: 170px; height: 165px; right: -3px; bottom: -32px; opacity: .48; transform: scale(.75) rotate(-12deg); }
  .orbit-one { width: 200px; }.orbit-two { width: 190px; }
  .map-actions { gap: 5px; }
  .map-side { padding: 20px 13px 18px; }
  .section-heading h2, .control-head h2 { font-size: 16px; }
  .canvas-wrap { padding: 1px 5px; }
  .algorithm-trace { padding: 13px 10px; }
  .trace-current { grid-template-columns: 1fr; gap: 5px; }
  .algorithm-code li { font-size: 8px; }
  .map-legend { gap: 10px; font-size: 7px; padding: 10px 8px; }
  .map-footer { align-items: flex-start; gap: 11px; }.world-stats { gap: 12px; flex-wrap: wrap; }.world-stats > span { display: flex; flex-direction: column; gap: 5px; }.world-stats b { font-size: 18px; }.world-stats small { font-size: 7px; }.map-key { font-size: 8px; white-space: nowrap; }
  .control-side { display: block; padding: 20px 15px; }
  .control-head { margin-bottom: 22px; }
  .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .field-help { margin-bottom: 18px; }
  .page-footer { padding: 13px 2px; align-items: flex-start; flex-direction: column; gap: 7px; line-height: 1.5; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }

@media (max-width: 360px) {
  .machine { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .map-side, .control-side { min-width: 0; }
  .section-heading, .control-head { min-width: 0; flex-wrap: wrap; gap: 10px; }
  .map-actions { max-width: 100%; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
}
