/* The launcher page (tabs before the game) and the game view around the picture. */
:root {
  --bg: #0d0e10; --panel: #16181c; --panel2: #1d2026; --line: #2b2f37;
  --fg: #ebe8e1; --muted: #9b988f; --accent: #f2b134; --accent-ink: #1a1404; --bad: #e5675b; --good: #7fc47a;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
[hidden] { display: none !important; }

/* ---- launcher ---- */
#launcher { min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: 0 16px 40px;
  background: radial-gradient(1200px 500px at 50% -10%, #23262d 0%, transparent 70%), var(--bg); }
.top { width: min(920px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 8px; }
.brand { display: flex; flex-direction: column; }
.brand h1 { margin: 0; font: 900 clamp(26px, 5vw, 44px)/1 "Arial Black", Impact, system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.brand h1 b { color: var(--accent); }
.brand span { margin-top: 8px; color: var(--muted); font-size: 14px; letter-spacing: .04em; }
.road { width: min(920px, 100%); height: 6px; margin: 10px 0 18px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 34px, transparent 34px 58px); opacity: .85; }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }

nav.tabs { width: min(920px, 100%); display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
nav.tabs button { appearance: none; background: none; border: 0; color: var(--muted); font: 600 14px system-ui, sans-serif;
  padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
nav.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
nav.tabs button:hover { color: var(--fg); }

.panel { width: min(920px, 100%); padding: 22px 0 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.card h2 { margin: 0 0 8px; font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* the play card */
.play { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
@media (max-width: 640px) { .play { grid-template-columns: 1fr; } }
#go { appearance: none; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink);
  font: 900 22px/1 "Arial Black", Impact, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase;
  padding: 20px 46px; cursor: pointer; box-shadow: 0 6px 0 #a87412; transition: transform .06s, box-shadow .06s; }
#go:hover { filter: brightness(1.06); }
#go:active { transform: translateY(4px); box-shadow: 0 2px 0 #a87412; }
#go:disabled { filter: grayscale(.6) brightness(.8); cursor: default; }
#go small { display: block; margin-top: 6px; font: 600 11px system-ui, sans-serif; letter-spacing: .04em; text-transform: none; opacity: .75; }
.checks { margin: 10px 0 0; padding: 0; list-style: none; font-size: 14px; }
.checks li { margin: 3px 0; }
.checks li::before { content: "● "; color: var(--muted); }
.checks li.ok::before { color: var(--good); }
.checks li.bad::before { color: var(--bad); }

/* tables and controls */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
kbd { display: inline-block; min-width: 22px; padding: 1px 7px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 6px;
  background: var(--panel2); font: 600 12px ui-monospace, monospace; text-align: center; }
.btn { appearance: none; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2);
  color: var(--fg); font: 600 14px system-ui, sans-serif; cursor: pointer; }
.btn:hover { border-color: #444a55; }
.btn.danger { color: var(--bad); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label.opt { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
select { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--fg); padding: 0 8px; }
ul.list { margin: 6px 0 0; padding-left: 18px; }
.changes li { margin-bottom: 6px; }
.changes b { color: var(--accent); font-weight: 600; }

/* ---- the game view ---- */
#view { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; }
#view canvas { --ar: 1.33333; width: min(100vw, calc(100vh * var(--ar))); aspect-ratio: var(--ar); background: #000; image-rendering: pixelated; outline: none; display: block; }
#hud { position: absolute; top: 6px; right: 6px; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,.6); color: #ddd;
  font: 12px ui-monospace, monospace; pointer-events: none; }
#dl { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(420px, 80vw); padding: 10px 14px 12px;
  background: rgba(13,14,16,.86); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; transition: opacity .6s; }
#dl .bar { height: 6px; margin-top: 8px; border-radius: 3px; background: #2a2d33; overflow: hidden; }
#dl .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
#dl.fade { opacity: 0; pointer-events: none; }
#fs { position: absolute; top: 8px; left: 8px; opacity: 0; transition: opacity .3s; }
#view:hover #fs, #fs:focus-visible { opacity: .85; }
#dev { position: fixed; left: 0; right: 0; bottom: 0; height: 160px; background: rgba(0,0,0,.85); border-top: 1px solid var(--line); z-index: 5; }
#dev #st { display: block; padding: 4px 8px; font: 12px ui-monospace, monospace; color: var(--fg); }
#log { height: 130px; overflow: auto; font: 12px ui-monospace, monospace; color: var(--muted); white-space: pre-wrap; padding: 0 8px; }

/* the crash / hang screen over the picture */
#crash { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.72); z-index: 4; }
#crash .card { width: min(520px, 100%); margin: 0; }
#crash textarea, .lastrep textarea { width: 100%; height: 140px; margin: 0 0 10px; background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; font: 11px ui-monospace, monospace; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lastrep { border-color: var(--bad); }
.support { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.support h2 { margin-bottom: 4px; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
