:root { color-scheme: dark; background: #080808; color: #dedede; font-family: ui-monospace, 'Consolas', monospace; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
main { position: fixed; inset: 0; }
.render-filters { position: absolute; pointer-events: none; }
#powder { width: 100%; height: 100%; display: block; image-rendering: pixelated; filter: url(#scene-detail); cursor: crosshair; touch-action: none; outline: none; }
#powder:focus-visible:not([data-pointer-focus]) { outline: 1px solid #686868; outline-offset: -6px; }
#interaction-hint { position: absolute; top: 22%; left: 50%; transform: translate(-50%, -50%); margin: 0; width: max-content; max-width: 92vw; text-align: center; text-wrap: balance; color: #7c858b; font-size: clamp(13px, 1.2vw, 16px); line-height: 1.6; letter-spacing: .08em; opacity: .64; pointer-events: none; user-select: none; transition: opacity .45s ease; }
#art-credit { position: absolute; bottom: 23px; left: 24px; margin: 0; color: #7c858b; font-size: clamp(13px, 1.1vw, 15px); line-height: 1.7; letter-spacing: .035em; opacity: .64; pointer-events: none; user-select: none; transition: opacity .45s ease; }
#interaction-hint[data-dismissed], #art-credit[data-dismissed] { opacity: 0; }
#space-credit { position: fixed; bottom: 4px; right: 21px; z-index: 2; margin: 0; color: #8b959c; font: 10px/1.25 ui-monospace, Consolas, monospace; letter-spacing: 0; text-align: right; white-space: nowrap; opacity: .32; pointer-events: none; user-select: none; }
@media (max-width: 600px) { #space-credit { bottom: 2px; right: 15px; font-size: clamp(8px, calc((100vw - 30px) / 32), 10px); } }
@media (prefers-reduced-motion: reduce) { #interaction-hint, #art-credit { transition: none; } }
.controls { position: fixed; bottom: 20px; right: 21px; display: flex; gap: 4px; z-index: 2; }
button { width: 40px; height: 40px; display: grid; place-items: center; padding: 11px; color: #7b7b7b; background: transparent; border: 0; border-radius: 2px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:hover:not(:disabled) { color: #eee; }
button:disabled { opacity: .28; cursor: default; }
button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
button:focus-visible { outline: 1px solid #aaa; outline-offset: 3px; }
.controls button[aria-pressed] { border: 1px solid transparent; }
.controls button[aria-pressed="true"]:not(:disabled) { color: #89aab4; background: #20313a; border-color: #89aab4; }
.controls button[aria-pressed="false"] { background: transparent; color: #7b7b7b; }
#dark-matter[data-active="false"] { color: #7b7b7b; background: transparent; border-color: transparent; }
#dark-matter[data-active="true"]:not(:disabled) { color: #89aab4; background: #20313a; border-color: #89aab4; }
@media (max-width: 700px) { .controls { flex-wrap: wrap; justify-content: flex-end; max-width: calc(100vw - 30px); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; padding: 0; margin: -1px; border: 0; }
.fallback { position: fixed; top: 50%; width: 100%; text-align: center; color: #999; font-size: 16px; }
@media (max-width: 600px) { .controls { bottom: 16px; right: 15px; } #art-credit { left: 20px; bottom: 73px; } }

#planet-tooltip { position: fixed; z-index: 3; padding: 10px 12px; border: 1px solid #454545; border-radius: 4px; background: rgba(12, 14, 18, .94); color: #dedede; font: 13px/1.6 ui-monospace, Consolas, monospace; width: max-content; max-width: min(480px, calc(100vw - 12px)); max-height: calc(100dvh - 12px); overflow: auto; }
#planet-tooltip-content { white-space: pre-line; overflow-wrap: anywhere; padding-right: 58px; }
#planet-tooltip-content::first-line { color: #fff; font-weight: 600; }
#planet-tooltip-pin, #planet-tooltip-zoom { position: absolute; top: 5px; right: 5px; width: 27px; height: 27px; padding: 5px; }
#planet-tooltip-zoom { right: 36px; }
#planet-tooltip-pin[aria-pressed="true"], #planet-tooltip-zoom[aria-pressed="true"] { color: #a9d2df; background: #20313a; }
#planet-tooltip[data-pinned="true"] { border-color: #89aab4; }
#planet-tooltip[data-zoomed="true"] { max-height: 36dvh; }
#simulation-speed-control { position: fixed; bottom: 22px; left: 24px; z-index: 2; display: flex; align-items: center; gap: 9px; color: #8c969e; font: 13px/1.7 ui-monospace, Consolas, monospace; }
#simulation-speed { color: #c2cbd2; background: #11151a; border: 1px solid #39434a; border-radius: 2px; padding: 4px 6px; font: inherit; cursor: pointer; }
#simulation-speed:focus-visible { outline: 1px solid #aaa; outline-offset: 3px; }
#dark-matter-guide { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
#dark-matter-diagram { width: 100%; height: 100%; display: block; }
.dark-matter-explanation { position: absolute; left: 24px; bottom: 90px; width: 330px; max-width: calc(100vw - 48px); padding: 15px 17px; border-left: 1px solid #8bbbc9; background: rgba(8, 12, 17, .88); color: #bbc9cf; font: 12px/1.65 ui-monospace, Consolas, monospace; }
.dark-matter-explanation strong { display: block; color: #e0e9ed; font-weight: 500; margin-bottom: 6px; }
.dark-matter-explanation p { margin: 0 0 7px; }
#dark-matter-strength { color: #8bbbc9; font-size: 11px; }
@media (max-width: 600px) { .dark-matter-explanation { left: 20px; bottom: 86px; padding: 11px 13px; font-size: 11px; max-width: calc(100vw - 40px); } }

/* Persistent optional native-resolution control. */
#scene-footer { position: absolute; bottom: 68px; left: 24px; z-index: 2; max-width: calc(100vw - 48px); color: #7c858b; font-size: clamp(13px, 1.1vw, 15px); line-height: 1.7; letter-spacing: .035em; }
#scene-footer #art-credit { position: static; margin: 0 0 12px; font: inherit; letter-spacing: inherit; }
#high-resolution { position: fixed; top: 23px; left: 24px; z-index: 2; display: block; width: auto; max-width: calc(100vw - 48px); height: auto; padding: 0; border: 0; border-radius: 0; color: #7c858b; font: clamp(13px, 1.1vw, 15px)/1.7 ui-monospace, Consolas, monospace; letter-spacing: .035em; text-align: left; opacity: .64; }
#high-resolution:hover, #high-resolution:focus-visible { color: #dedede; opacity: 1; }
#high-resolution[aria-pressed="true"] { color: #c2cbd2; opacity: .9; text-decoration: underline; text-decoration-color: #657179; text-underline-offset: 4px; }
@media (max-width: 700px) { #scene-footer { left: 20px; bottom: 76px; max-width: calc(100vw - 40px); } #high-resolution { top: 20px; left: 20px; max-width: calc(100vw - 40px); } }
@media (max-width: 700px) { #simulation-speed-control { left: 20px; bottom: 20px; } .controls { max-width: calc(100vw - 155px); } }

/* The prayer SVG inherits the same sizing, stroke and state colours as its neighbours. */
.controls #god-director { padding: 10px; }
.controls #system-zoom { padding: 9px; }
.controls #system-zoom svg { width: 20px; height: 20px; }

/* The Earth milestone closing message sits above the live focal scene. */
#earth-message { position:fixed; top:clamp(76px,10vh,120px); left:50%; transform:translateX(-50%); z-index:4; width:min(960px,calc(100vw - 40px)); text-align:center; pointer-events:none; color:#eef1ed; text-shadow:0 2px 24px #000,0 1px 5px #000; }
#earth-message p { margin:0 0 15px; color:#b7c3ca; font:clamp(12px,1.25vw,17px)/1.6 ui-monospace,Consolas,monospace; text-wrap:balance; }
#earth-message strong { display:block; font:600 clamp(36px,7.3vw,94px)/1.06 'Newsreader',Georgia,serif; letter-spacing:-.035em; text-wrap:balance; }
#earth-message:not([hidden]) { animation:earth-message-reveal 1.1s ease both; }
@keyframes earth-message-reveal { from { opacity:0; } to { opacity:1; } }
@media (max-width:600px) { #earth-message { top:max(78px,env(safe-area-inset-top)); } #earth-message p { margin-bottom:12px; } }
@media (prefers-reduced-motion:reduce) { #earth-message:not([hidden]) { animation:none; } }
#earth-continue { position:fixed; left:50%; bottom:82px; transform:translateX(-50%); z-index:4; width:auto; height:auto; padding:9px 15px; color:#c4cfd2; background:rgba(12,17,21,.85); border:1px solid #52636a; font:12px/1.5 ui-monospace,Consolas,monospace; letter-spacing:.02em; }
#earth-continue[hidden] { display:none; }
#earth-continue:hover { color:#fff; border-color:#89aab4; }
@media (max-width:600px) { #earth-continue { bottom:126px; max-width:calc(100vw - 40px); } }
