:root {
  color-scheme: dark;
  --bg: #061013;
  --panel: #0d1d22;
  --panel-strong: #13292f;
  --ink: #edf8f3;
  --muted: #98b3b1;
  --line: rgba(193, 235, 224, 0.18);
  --accent: #49d4c8;
  --gold: #f6c85f;
  --fault: #ff6d73;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 14%, rgba(73, 212, 200, 0.12), transparent 26rem),
    linear-gradient(135deg, #071315 0%, #0b1719 44%, #071011 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  border: 1px solid rgba(246, 200, 95, 0.55);
  border-radius: 6px;
  background: #1a2b2f;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 44px;
  padding: 0 1rem;
}

button:hover,
button:focus-visible {
  background: #263b3f;
  outline: 2px solid rgba(73, 212, 200, 0.55);
  outline-offset: 2px;
}

.game-shell {
  width: min(1180px, calc(100vw - 24px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 0;
  display: grid;
  align-content: center;
  gap: 12px;
}

.hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 22, 25, 0.9);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

h1 {
  color: var(--ink);
  font-size: clamp(1.05rem, 1.8vw, 1.55rem);
  font-weight: 850;
  line-height: 1.2;
  margin: 0;
}

.meters {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(76px, auto);
  gap: 8px;
  align-items: stretch;
}

.meters span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 54px;
  padding: 0.35rem 0.55rem;
}

.meters b {
  color: var(--ink);
  display: block;
  font-size: 1.02rem;
  line-height: 1.05;
}

.meters small {
  color: var(--muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.canvas-frame {
  border: 1px solid rgba(193, 235, 224, 0.16);
  border-radius: 8px;
  background: #091618;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

canvas {
  aspect-ratio: 16 / 10;
  display: block;
  width: 100%;
  max-height: calc(100vh - 150px);
  min-height: 360px;
  touch-action: none;
}

@media (max-width: 760px) {
  .game-shell {
    width: min(100vw - 12px, 680px);
    padding: 6px 0;
    align-content: start;
  }

  .hud {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .meters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: row;
  }

  .meters button {
    grid-column: 1 / -1;
  }

  .meters span {
    min-width: 0;
    padding-inline: 0.2rem;
  }

  canvas {
    max-height: none;
    min-height: 300px;
  }
}
