*{box-sizing:border-box}html{min-height:100%;background:#0b1720}body{margin:0;color:#fff0d0;background:radial-gradient(ellipse at top,#213c46 0%,#0b1720 75%);font-family:ui-monospace,Menlo,Consolas,monospace;overscroll-behavior:none}button{font:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible{outline:3px solid #8ee6c4;outline-offset:4px}[hidden]{display:none!important}
.shell{width:min(100%,420px);margin:auto;padding:max(12px,env(safe-area-inset-top)) 16px max(12px,env(safe-area-inset-bottom));min-height:100svh;display:flex;flex-direction:column;gap:12px}.top{display:flex;justify-content:space-between;align-items:center;gap:12px}.brand strong{display:block;font-size:28px;letter-spacing:1px}.brand-star{color:#ffad73;font-size:17px;margin-left:6px}.brand>span{display:block;font-size:9px;letter-spacing:2px;color:#9db4b6;margin-top:3px}.hud{display:flex;gap:21px;text-align:right}.hud small{display:block;font-size:9px;letter-spacing:1px;color:#9db4b6}.hud strong{display:block;font-size:25px;font-variant-numeric:tabular-nums}.hud>div:first-child strong{color:#8ee6c4}
.mode{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:9px;color:#a5bbbc}.mode>div{display:flex;gap:4px}.mode button{border:1px solid #405e66;border-radius:5px;background:transparent;color:#b3c5c2;padding:9px 7px;font-size:9px;min-height:34px}.mode button.selected{color:#101f2c;background:#e9d9b0;border-color:#e9d9b0}.play-area{position:relative;width:100%;border:1px solid #607c80;border-radius:8px;overflow:hidden;background:#101f2c;line-height:0;box-shadow:0 12px 35px #0005}.play-area canvas{display:block;width:100%;height:auto;aspect-ratio:360/510;image-rendering:pixelated;touch-action:none}
.overlay{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;gap:16px;background:linear-gradient(#101f2c44,#101f2c08 60%,#101f2c77);padding:60px 18px 16px;text-align:center;line-height:1.4}.intro-mark{font-size:8px;letter-spacing:2px;color:#c3b58f}.overlay h1{margin:0;font-size:clamp(20px,6vw,28px);letter-spacing:-1px;color:#fff0d0}.overlay p{margin:0;font-size:11px;color:#bbcfca;max-width:270px}.intro-controls{display:flex;gap:20px;font-size:9px;color:#8fa9ad}.intro-controls>span{display:flex;flex-direction:column;gap:4px}.intro-controls b{font-size:13px;color:#8ee6c4}.intro-controls span:first-child b{color:#ffad73}.action{padding:13px 32px;min-height:48px;border:0;border-radius:5px;color:#172638;background:#ffc38e;font-weight:900;font-size:16px;box-shadow:0 4px 0 #aa6647}.action:active{transform:translateY(3px);box-shadow:0 1px 0 #aa6647}
.overlay[data-screen=result]{background:linear-gradient(#101f2ce8,#101f2cd9 65%,#101f2c50);padding-top:32px;gap:12px}.overlay[data-screen=result] .intro-mark,.overlay[data-screen=result] .intro-controls,.overlay[data-screen=pause] .intro-mark,.overlay[data-screen=pause] .intro-controls{display:none}.overlay[data-screen=result] h1{font-size:15px;letter-spacing:1px;color:#ffbe8a}.result-details{display:flex;flex-direction:column;align-items:center;gap:1px}.result-details>strong{font-size:78px;line-height:1.1;letter-spacing:-5px}.result-details>span{font-size:12px;letter-spacing:2px;color:#e4d8b9}.result-details i{color:#64888a}.result-details small{font-size:8px;color:#98b5b5;letter-spacing:1px;margin-top:9px}.overlay[data-screen=result] p{font-size:9px;color:#ffb797;max-width:260px}.share-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;width:100%;max-width:270px}.share-actions button{padding:10px 12px;min-height:40px;border-radius:4px;border:1px solid #64888a;background:#18323d;color:#e3e8d4;font-size:10px}.share-actions>span{width:100%;font-size:8px;color:#96afb0}
.hold{width:100%;display:grid;grid-template-columns:32px 1fr auto;align-items:center;gap:8px;border:1px solid #76968f;border-bottom:4px solid #355b5c;border-radius:7px;background:#1c363f;color:#8ee6c4;min-height:64px;padding:12px 16px;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;text-align:left}.control-icon{font-size:29px}.hold strong{font-size:19px}.hold>span:last-child{font-size:9px;letter-spacing:.4px}.hold.active{background:#ffc38e;color:#172638;border-color:#ffc38e;border-bottom-color:#aa6647}.below{display:flex;justify-content:space-between;align-items:center;color:#96b3b0;font-size:8px;gap:4px}.below button{padding:8px 0 8px 8px;min-height:32px;color:#bcd1c4;border:0;background:transparent;font-size:8px}footer{display:flex;flex-direction:column;gap:7px;align-items:center;text-align:center;font-size:9px;color:#93aaa9;margin-top:auto;padding:8px 0}footer span:last-child{font-size:8px;color:#607e83}
@media(max-height:760px){.shell{gap:8px;padding-top:8px;padding-bottom:8px;max-width:min(420px,calc((100svh - 205px)*.706 + 32px))}.brand strong{font-size:24px}.hold{min-height:54px;padding:8px 12px}footer{padding:0;font-size:8px;gap:4px}.overlay{padding-top:45px;gap:12px}.overlay[data-screen=result]{padding-top:22px;gap:9px}.result-details>strong{font-size:64px}}
@media(max-width:340px){.shell{padding-left:10px;padding-right:10px}.mode{font-size:8px}.hold{padding-left:10px;padding-right:10px;grid-template-columns:22px 1fr auto}.hold>span:last-child{font-size:8px}.overlay{padding-left:10px;padding-right:10px}.overlay[data-screen=result]{gap:9px;padding-top:24px}}
@media(prefers-reduced-motion:reduce){.action:active{transform:none}}
@media(max-height:500px){.shell{max-width:420px}}

/* Experimental, small A/B/C selector; not part of v0.3 release. */
.marker-compare{display:flex;justify-content:space-between;align-items:center;gap:4px;flex-wrap:wrap;color:#95b5b2;font-size:8px;letter-spacing:.3px}
.marker-compare>div{display:flex;gap:4px;flex:1;justify-content:flex-end}
.marker-compare button{min-height:32px;padding:7px 6px;border-radius:5px;border:1px solid #405e66;background:#162a34;color:#bed0ca;font-size:9px}
.marker-compare button.selected{background:#d2d2bc;color:#172638;border-color:#d2d2bc}
@media(max-width:375px){.marker-compare{gap:3px}.marker-compare button{font-size:8px;padding:7px 4px}}

/* v0.4-C companion experiment: Earth state and crew line on the result screen. */
.result-details>.result-journey{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 10px;margin-top:6px;font-size:9px;letter-spacing:1px;line-height:1.3}
.result-journey em{font-style:normal;color:#8fd0ff}
.result-journey i{display:inline-block;width:6px;height:6px;margin-right:5px;background:#a9d6ff;box-shadow:0 0 0 1px #172638,0 0 6px #4f9dff;vertical-align:1px}

/* v0.4-E clarity: settings stay outside the scene; transient achievements vanish. */
.prefs{display:flex;align-items:center;gap:12px;justify-content:flex-end}
.prefs button{padding:7px 3px;min-height:36px;font-size:10px;color:#d3e5dd}
.prefs button:first-child{min-width:44px;border:1px solid #405e66;border-radius:5px;padding:7px 8px}
.milestone-notice{position:absolute;top:40px;right:12px;max-width:65%;z-index:2;pointer-events:none;
  padding:5px 9px;border:1px solid #718c8a;border-radius:4px;background:#132b37dd;
  color:#ffe3ac;font-size:10px;font-weight:700;letter-spacing:.3px;line-height:1.3;text-align:right}
@media(max-width:340px){.prefs{gap:7px}.prefs button{font-size:9px}.milestone-notice{font-size:9px;top:39px;right:8px}}

.milestone-help{font-size:9px;color:#d6c7a1;text-align:center;line-height:1.35}
.overlay[data-screen=result] .milestone-help,.overlay[data-screen=pause] .milestone-help{display:none}

/* Link to the separate STORY page. */
.mode .story-link{display:inline-flex;align-items:center;border:1px solid #6a8f8a;border-radius:5px;color:#ffe3ac;padding:9px 7px;font-size:9px;min-height:34px;text-decoration:none}
.mode .story-link:focus-visible{outline:3px solid #8ee6c4;outline-offset:4px}
