:root {
  --bg-top: #08111f;
  --bg-bottom: #1b2d45;
  --panel: rgba(8, 14, 25, 0.82);
  --panel-border: #f9d679;
  --cyan: #77f6ff;
  --cream: #fff6d6;
  --text: #fff8df;
  --shadow: rgba(0, 0, 0, 0.34);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, rgba(119,246,255,.18), transparent 28%), linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--text);
  font-family: "Trebuchet MS", "Verdana", sans-serif;
}
body { min-height: 100vh; min-height: 100dvh; }
.app-shell { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.cabinet { width: min(100%, 580px); display: grid; gap: 12px; }
.hud, .controls-note {
  border: 4px solid rgba(249,214,121,.6);
  background: linear-gradient(180deg, rgba(14,24,40,.92), rgba(8,14,25,.9));
  box-shadow: 0 14px 40px var(--shadow);
}
.hud { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 20px; }
.brand h1, .panel h2, .score-pill strong { margin: 0; font-family: "Courier New", monospace; text-transform: uppercase; letter-spacing: .06em; }
.brand h1 { font-size: clamp(1.3rem, 4vw, 1.8rem); }
.brand-kicker, .label, .eyebrow, .controls-note { font-family: "Courier New", monospace; text-transform: uppercase; letter-spacing: .18em; }
.brand-kicker { display: block; color: var(--cyan); font-size: .62rem; margin-bottom: 6px; }
.scoreboard { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.score-pill {
  min-width: 86px; padding: 8px 10px; border-radius: 14px; border: 3px solid rgba(119,246,255,.34);
  background: rgba(255,255,255,.05); text-align: center; flex: 1 1 86px;
}
.power-pill { border-color: rgba(255,125,240,.34); }
.label { display: block; font-size: .56rem; color: #b8cde6; margin-bottom: 4px; }
.score-pill strong { font-size: .95rem; color: #ffe16d; }
.game-frame {
  position: relative; border-radius: 26px; overflow: hidden; border: 4px solid var(--panel-border);
  box-shadow: 0 18px 50px var(--shadow); touch-action: none; background: #0c1627;
}
canvas {
  display: block; width: 100%; height: auto; aspect-ratio: 9 / 14;
  image-rendering: pixelated; image-rendering: crisp-edges;
  background: linear-gradient(180deg, #0d1c30, #1d2f4a 54%, #483527);
}
.overlay {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 20px;
  background: rgba(5,9,17,.5); opacity: 0; pointer-events: none; transition: opacity 160ms ease;
}
.overlay.visible { opacity: 1; pointer-events: auto; }
.panel {
  width: min(100%, 360px); padding: 22px 20px 18px; border: 4px solid var(--panel-border);
  border-radius: 20px; background: var(--panel); text-align: center; box-shadow: 0 16px 40px rgba(0,0,0,.38);
}
.eyebrow { margin: 0 0 10px; font-size: .68rem; color: var(--cyan); }
.eyebrow.danger { color: #ff6d57; }
.panel h2 { font-size: clamp(1.4rem, 5vw, 2rem); line-height: 1.1; margin-bottom: 12px; }
.panel p { margin: 0 0 16px; color: #d9e8f4; line-height: 1.4; }
.toast-line { font-size: .9rem; color: #fff1b3; }
.action {
  width: 100%; border: 0; border-radius: 14px; padding: 14px 16px; background: linear-gradient(180deg, #ffe57f, #f1a935);
  color: #271100; font-family: "Courier New", monospace; font-size: 1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; cursor: pointer; box-shadow: inset 0 -4px 0 rgba(87,45,2,.28);
}
.action.secondary { background: linear-gradient(180deg, #9df7ff, #4fb8ff); color: #061522; }
.action:active { transform: translateY(1px); }
.button-stack { display: grid; gap: 10px; }
.controls-note {
  display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px;
  border-radius: 18px; font-size: .58rem; color: #c9d7e9;
}
@media (max-width: 520px) {
  .app-shell { padding: 10px; }
  .hud { padding: 12px; align-items: stretch; flex-direction: column; }
  .scoreboard { width: 100%; }
  .controls-note { flex-direction: column; align-items: center; }
}
