:root {
  color-scheme: dark;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: #0c0d19;
  color: #f5f2ff;
  --aqua: #6fffe0;
  --muted: #b7b8d6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at top, #272344, transparent 56%);
  overscroll-behavior: none;
}
main { width: min(100%, 420px, max(300px, (100dvh - 165px) * .667)); }
header, .hud, footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
header { margin-bottom: 8px; }
h1 { font-size: clamp(19px, 5.3vw, 31px); margin: 3px 0; letter-spacing: -.075em; }
h1 span, small { color: var(--aqua); }
small { font-size: 9px; letter-spacing: .14em; }
button, input {
  font: inherit;
  border-radius: 7px;
  border: 1px solid #514f75;
  background: #23233e;
  color: inherit;
  min-height: 42px;
  padding: 6px 10px;
}
button { cursor: pointer; font-weight: 700; touch-action: manipulation; }
button:disabled { opacity: .38; cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; }
#sound { font-size: 10px; white-space: nowrap; }
.hud {
  padding: 4px 8px 4px 12px;
  background: #191a30;
  border: 1px solid #393856;
  border-radius: 9px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: .07em;
  margin-bottom: 7px;
}
.hud strong { display: block; color: #fff; margin-top: 2px; font-size: 15px; letter-spacing: 0; }
#pause { min-width: 44px; }
.cabinet { position: relative; border: 1px solid #484665; border-radius: 10px; overflow: hidden; background: #111225; }
canvas { display: block; width: 100%; aspect-ratio: 2 / 3; touch-action: none; user-select: none; }
.overlay {
  position: absolute; inset: 0; display: flex; align-items: safe center; justify-content: center;
  padding: 12px; background: #101124ca; overflow: auto;
}
.overlay[hidden] { display: none; }
.panel {
  width: min(100%, 290px); padding: 16px; border: 1px solid #555179; border-radius: 10px;
  background: #191a31; box-shadow: 0 8px 24px #07071188; text-align: center;
}
.panel h2 { margin: 0 0 8px; font-size: 22px; color: var(--aqua); }
.panel p { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0 0 10px; }
.actions, form { display: grid; gap: 6px; }
.primary { color: #102021; background: var(--aqua); border-color: var(--aqua); }
input { width: 100%; font-size: 16px; }
label { font-size: 12px; }
table { width: 100%; text-align: left; font-size: 11px; border-collapse: collapse; margin: 0 0 8px; table-layout: fixed; }
th, td { padding: 3px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom: 1px solid #353551; }
th:first-child { width: 12%; }
th:nth-child(2) { width: 40%; }
footer { margin-top: 8px; color: var(--muted); font-size: 9px; min-height: 12px; }
#offline { color: var(--aqua); text-align: right; }
body { background: radial-gradient(ellipse at top, #30244d, transparent 56%), #080b19; }
.hud, .panel { background: linear-gradient(160deg, #282b49, #14182c); }
.cabinet { border-color: #64759d; box-shadow: 0 12px 24px #040509aa, 0 0 18px #758fe427; }
.primary { background: linear-gradient(165deg, #c4fff2, #6fffe0 50%, #54cdd3); }
