:root {
  color-scheme: dark;
  --bg: #171713;
  --water: #172623;
  --panel: #25231d;
  --panel-strong: #302b22;
  --line: #585040;
  --text: #fff4dc;
  --muted: #c7bda4;
  --aqua: #50d6bd;
  --amber: #f3c55f;
  --coral: #ef705a;
  --violet: #8e80e6;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    linear-gradient(150deg, #171713 0%, #202018 42%, #162421 100%),
    var(--bg);
  color: var(--text);
  font-family: 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(280px, 1.05fr) minmax(430px, 1.35fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.briefing,
.meters {
  border: 1px solid rgba(243, 197, 95, 0.2);
  border-radius: 8px;
  background: rgba(37, 35, 29, 0.93);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.briefing {
  padding: 16px 18px;
}

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

h1 {
  margin: 0;
  color: #fff9ed;
  font-size: 1.34rem;
  line-height: 1.18;
}

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

.meters {
  display: grid;
  grid-template-columns: repeat(5, minmax(78px, 1fr)) auto auto;
  gap: 8px;
  padding: 10px;
}

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

.meters span {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid rgba(199, 189, 164, 0.17);
  background: rgba(23, 23, 19, 0.58);
}

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

.meters small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  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.14);
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 850;
  cursor: pointer;
}

.meters button:hover,
.meters button:focus-visible {
  outline: 2px solid rgba(80, 214, 189, 0.72);
  outline-offset: 2px;
}

#bellButton {
  background: #19483f;
  color: #eafff9;
}

#bellButton:disabled {
  cursor: not-allowed;
  color: rgba(234, 255, 249, 0.44);
  background: rgba(25, 72, 63, 0.42);
}

.arena-panel {
  overflow: hidden;
  border: 1px solid rgba(243, 197, 95, 0.22);
  border-radius: 8px;
  background: var(--water);
  box-shadow: 0 26px 78px rgba(0, 0, 0, 0.34);
}

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

.controls-note {
  margin: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(199, 189, 164, 0.15);
  background: rgba(23, 23, 19, 0.9);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

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

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

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

@media (max-width: 560px) {
  .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));
  }
}
