:root {
  --bg: #0d0f12;
  --fg: #d8dade;
  --muted: #8a9099;
  --accent: #d0402a;
  --panel: #171a1f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 14px/1.4 system-ui, sans-serif; }
body { display: flex; flex-direction: column; }
main { position: relative; flex: 1; min-height: 0; }
canvas { display: block; width: 100%; height: 100%; outline: none; background: #000; }
#status { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--bg); }
#status[hidden] { display: none; }
#progress { width: min(360px, 80vw); accent-color: var(--accent); }
#progress[hidden], #again[hidden] { display: none; }
#again { background: var(--panel); color: var(--fg); border: 1px solid #2a2f37; border-radius: 4px; padding: 6px 14px; cursor: pointer; }
#error { position: absolute; inset: 16px; display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow: auto; background: var(--panel); border-left: 4px solid var(--accent); }
#error[hidden], #report[hidden] { display: none; }
#error-text { margin: 0; white-space: pre-wrap; }
#report { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#report p { flex-basis: 100%; margin: 0; color: var(--muted); }
#report button { background: #20242b; color: var(--fg); border: 1px solid #2a2f37; border-radius: 4px; padding: 4px 10px; cursor: pointer; }
footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 6px 16px; color: var(--muted); }
footer a { color: var(--fg); }
footer button { background: var(--panel); color: var(--fg); border: 1px solid #2a2f37; border-radius: 4px; padding: 4px 10px; cursor: pointer; }
footer details { flex-basis: 100%; }
#console { max-height: 30vh; overflow: auto; margin: 4px 0 0; font: 12px/1.3 ui-monospace, monospace; color: var(--muted); }
dialog { background: var(--panel); color: var(--fg); border: 1px solid #2a2f37; border-radius: 6px; padding: 16px 20px; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog h2 { margin: 0 0 8px; font-size: 18px; }
dialog p { color: var(--muted); }
dialog button { background: #20242b; color: var(--fg); border: 1px solid #2a2f37; border-radius: 4px; padding: 4px 10px; cursor: pointer; }
.wad-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid #22262d; }
.wad-row small { color: var(--muted); }
.wads-add { display: block; margin: 12px 0; }
.wads-actions { display: flex; gap: 8px; justify-content: flex-end; }
