:root {
  color-scheme: dark;
  --amber: #e7c27a;
  --torch: #ff7a3c;
  --water: #7ec8e3;
  --panel: #1a120f;
  --border: #5a4034;
  --muted: #b5a394;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #120d0b;
  color: #f6efe4;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 122, 60, 0.18), transparent 46%),
    radial-gradient(ellipse at 12% 80%, rgba(80, 140, 170, 0.12), transparent 42%),
    #120d0b;
}
main { height: 100dvh; padding: 8px; display: grid; }
a { color: inherit; text-decoration: none; }
.label { margin: 0; font: 10px monospace; letter-spacing: 2px; color: var(--muted); }
h1 { margin: 0; font: italic 900 28px/0.95 "Segoe UI", sans-serif; color: var(--amber); }
h1 span { display: block; margin-top: 4px; font: 9px monospace; letter-spacing: 2px; color: var(--muted); }
.machine { min-height: 0; height: 100%; display: grid; grid-template-columns: 230px minmax(0, 1fr) 230px; gap: 8px; }
aside, dialog { background: rgba(22, 15, 12, 0.94); border: 1px solid var(--border); border-radius: 12px; }
aside { min-height: 0; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
button, .arcade-exit {
  font: 700 11px monospace; color: #f6efe4; background: #2a1c16; border: 1px solid #6b4c3a;
  border-radius: 7px; padding: 6px 8px; cursor: pointer; touch-action: none;
}
.arcade-exit { display: inline-flex; align-items: center; }
#score { font: 900 28px monospace; color: var(--amber); }
.hud-left b { font: 700 16px monospace; }
.hud-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.status-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.pill { font: 700 9px monospace; letter-spacing: 0.6px; color: #8d7b6c; border: 1px solid #4d382e; border-radius: 99px; padding: 3px 6px; }
.pill.lit, .pill.on { color: #2a160c; background: var(--amber); border-color: #ffe0a8; }
.pill.hot { color: #2a160c; background: var(--torch); border-color: #ffd0b4; }
#bridgeFlag { margin: 0; font: 800 13px monospace; color: var(--torch); }
#status { margin: 0; min-height: 32px; font: 600 12px/1.35 monospace; color: #f0e2d0; }
#start, #play { background: linear-gradient(135deg, #e7c27a, #ff7a3c); color: #2a160c; border: 0; font-weight: 900; }
#table { position: relative; min-height: 0; height: 100%; border-radius: 12px; overflow: hidden; border: 1px solid #6b4c3a; background: #1a100c; }
#table.siege { box-shadow: 0 0 28px rgba(255, 122, 60, 0.45); }
.gl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#overlay { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; background: rgba(12, 8, 7, 0.82); }
#overlay p { margin: 0 0 8px; font: 700 11px monospace; letter-spacing: 2px; color: var(--amber); }
#overlay h2 { margin: 0 0 10px; font: italic 900 46px/1 "Segoe UI", sans-serif; }
#overlay span { max-width: 420px; margin-bottom: 16px; color: #eadccb; font-size: 14px; line-height: 1.5; }
.instructions h2 { margin: 0; font: italic 900 22px/1.1 "Segoe UI", sans-serif; }
.instructions p { margin: 0; color: #e6d5c4; font-size: 12.5px; line-height: 1.45; }
.instructions strong { color: white; }
.keys { margin-top: auto; display: flex; flex-direction: column; gap: 4px; color: var(--muted); font: 11px monospace; }
kbd { border: 1px solid #6b4c3a; border-radius: 4px; padding: 1px 4px; color: #fff; }
.touch-bar { display: none; grid-template-columns: 1fr 1.3fr 0.8fr 1fr; gap: 6px; }
#launch { position: relative; overflow: hidden; }
#launchMeter { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: var(--amber); }
dialog { color: #f6efe4; max-width: 460px; padding: 18px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog p { color: #eadccb; line-height: 1.5; }
@media (pointer: coarse), (max-width: 980px) {
  main { grid-template-rows: minmax(0, 1fr) auto; padding: 6px; }
  .machine { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .instructions { display: none; }
  .hud-left { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; overflow: visible; }
  .brand, #status { grid-column: 1 / -1; }
  .hud-left > .label, #best, .rule, .status-pills, #start, #restart, #bridgeFlag { display: none; }
  h1 { font-size: 18px; }
  h1 span, .heading-actions #rules { display: none; }
  #score { font-size: 22px; }
  .touch-bar { display: grid; }
  .touch-bar button { min-height: 46px; }
}
