:root {
  color-scheme: dark;
  --bg: #15130f;
  --floor: #221f18;
  --panel: #2b261b;
  --panel-strong: #3a2f20;
  --text: #f3eadc;
  --muted: #b9ad98;
  --line: #65523a;
  --copper: #e58b3c;
  --ember: #e75136;
  --cool: #55c8d2;
  --leaf: #8ad36a;
  --gold: #f1c45b;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(229, 139, 60, 0.16), transparent 28rem),
    linear-gradient(135deg, #15130f 0%, #241c14 52%, #171915 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
canvas {
  font: inherit;
}

.game-shell {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 24px;
}

.hud {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 1.5fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.briefing,
.meters {
  border: 1px solid rgba(241, 196, 91, 0.18);
  background: rgba(43, 38, 27, 0.9);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  border-radius: 8px;
}

.briefing {
  padding: 16px 18px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 34rem;
  color: #fff8e8;
  font-size: 1.38rem;
  line-height: 1.15;
}

.briefing p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.38;
}

.meters {
  display: grid;
  grid-template-columns: repeat(6, minmax(72px, 1fr)) auto auto;
  gap: 8px;
  align-items: stretch;
  padding: 10px;
}

.meters span,
.meters button {
  min-height: 58px;
  border-radius: 8px;
}

.meters span {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(185, 173, 152, 0.18);
  background: rgba(21, 19, 15, 0.58);
}

.meters b {
  color: #fff9ec;
  font-size: 1.05rem;
  line-height: 1;
  white-space: nowrap;
}

.meters small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.meters button {
  min-width: 82px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.meters button:hover,
.meters button:focus-visible {
  outline: 2px solid rgba(85, 200, 210, 0.7);
  outline-offset: 2px;
}

#pulseButton {
  background: #17444b;
  color: #e9fdff;
}

#pulseButton:disabled {
  cursor: not-allowed;
  color: rgba(233, 253, 255, 0.42);
  background: rgba(23, 68, 75, 0.38);
}

.arena-panel {
  overflow: hidden;
  border: 1px solid rgba(241, 196, 91, 0.2);
  border-radius: 8px;
  background: #11100d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 620;
  background: var(--floor);
  touch-action: none;
}

.controls-note {
  margin: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(185, 173, 152, 0.16);
  color: var(--muted);
  background: rgba(21, 19, 15, 0.9);
  font-size: 0.95rem;
  line-height: 1.35;
}

@media (max-width: 920px) {
  .hud {
    grid-template-columns: 1fr;
  }

  .meters {
    grid-template-columns: repeat(3, minmax(84px, 1fr));
  }

  .meters button {
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .game-shell {
    width: min(100% - 16px, 1120px);
    padding-top: 10px;
  }

  .briefing {
    padding: 14px;
  }

  h1 {
    font-size: 1.12rem;
  }

  .briefing p:last-child,
  .controls-note {
    font-size: 0.9rem;
  }

  .meters {
    grid-template-columns: repeat(2, minmax(118px, 1fr));
  }
}
