html,body{margin:0;height:100%;background:#000;color:#ddd;font:14px system-ui,sans-serif;overflow:hidden}
#stage{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;overflow:hidden}
/* Always the full window width; height follows the game's aspect ratio. */
#screen{display:block;flex:none;width:100vw;height:auto;aspect-ratio:4/3;image-rendering:auto;outline:none;cursor:default;background:#000}
#status{position:fixed;left:12px;bottom:10px;font-size:12px;color:#9aa;max-width:90vw;white-space:pre-wrap;pointer-events:none}
#dialog{position:fixed;inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);background:#1b2329;border:1px solid #556;border-radius:8px;padding:16px 20px;min-width:260px;max-width:80vw;text-align:center}
#dialog button{margin-top:8px;padding:8px 18px}

/* Loading screen shown while the client files download. */
:root{--gold:#d8b46a;--gold-dim:#8a6d36;--ink:#0b0a08}
#loading{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse at 50% 40%,#2a1f12 0%,#120d08 45%,#050403 100%);z-index:10;transition:opacity .8s ease,visibility .8s;padding:16px;box-sizing:border-box}
#loading.done{opacity:0;visibility:hidden}
.loading-glow{position:absolute;left:50%;top:42%;width:min(70vw,640px);aspect-ratio:1;transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(circle,rgba(216,180,106,.18),transparent 65%);animation:glow 4s ease-in-out infinite;pointer-events:none}
.loading-box{position:relative;width:min(520px,100%);text-align:center;color:#e9dcc0}
.loading-kicker{margin:0 0 6px;font:600 12px/1 system-ui,sans-serif;letter-spacing:.35em;text-transform:uppercase;color:var(--gold-dim)}
.loading-title{margin:0;font:700 clamp(30px,6vw,52px)/1.1 "Cinzel","Trajan Pro",Georgia,serif;letter-spacing:.06em;color:var(--gold);text-shadow:0 0 24px rgba(216,180,106,.35),0 2px 0 #000}
.loading-sigil{display:flex;gap:10px;justify-content:center;margin:22px 0}
.loading-sigil span{width:9px;height:9px;transform:rotate(45deg);background:var(--gold);box-shadow:0 0 10px var(--gold);animation:pulse 1.2s ease-in-out infinite}
.loading-sigil span:nth-child(2){animation-delay:.2s}.loading-sigil span:nth-child(3){animation-delay:.4s}
.loading-bar{height:10px;border:1px solid var(--gold-dim);border-radius:6px;background:rgba(0,0,0,.6);overflow:hidden;box-shadow:inset 0 1px 3px #000}
#loading-fill{height:100%;width:0;background:linear-gradient(90deg,#7a5a24,#e6c37a,#7a5a24);background-size:200% 100%;animation:shine 2s linear infinite;transition:width .25s ease}
#loading-step{margin:14px 0 2px;font:500 15px/1.4 system-ui,sans-serif}
#loading-detail{margin:0;font:12px/1.4 ui-monospace,Menlo,monospace;color:#9c8d70;font-variant-numeric:tabular-nums}
#loading-tip{margin:22px auto 0;max-width:440px;min-height:3em;font:italic 13px/1.5 Georgia,serif;color:#b9a684;transition:opacity .5s}
#fetching{position:fixed;right:12px;bottom:10px;display:flex;align-items:center;gap:8px;padding:6px 10px;border:1px solid var(--gold-dim);border-radius:6px;background:rgba(10,8,5,.8);color:#e9dcc0;font:12px system-ui,sans-serif;pointer-events:none;z-index:5}
#fetching .dot{width:8px;height:8px;border-radius:50%;background:var(--gold);animation:pulse 1s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:.25}50%{opacity:1}}
@keyframes shine{to{background-position:-200% 0}}
@keyframes glow{0%,100%{opacity:.6}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){.loading-glow,.loading-sigil span,#loading-fill,#fetching .dot{animation:none}}
