:root {
  color-scheme: dark;
  --ink: #dddddd;
  --muted: #6b6b6b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #030303;
  color: var(--ink);
  font-family: "Courier New", ui-monospace, monospace;
}

body {
  display: grid;
  place-items: center;
  padding: 22px;
}

.shell { width: min(820px, 94vw, 88vh); }

.hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 7px 2px 10px;
  font-size: 14px;
  letter-spacing: .16em;
  color: #bcbcbc;
  text-transform: uppercase;
}

.hud > :last-child { text-align: right; }

#message {
  color: #e7e1bd;
  text-align: center;
  min-width: 180px;
}

.arena {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: none;
  background: #000;
  border: 1px solid #202020;
  box-shadow: 0 0 0 1px #080808, 0 18px 70px rgba(0,0,0,.72);
  overflow: hidden;
  outline: none;
  cursor: crosshair;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hint {
  position: absolute;
  left: 12px;
  bottom: 9px;
  font-size: 10px;
  letter-spacing: .12em;
  color: #2e2e2e;
  user-select: none;
  pointer-events: none;
}

.footer {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 12px;
  color: #686868;
  font-size: 11px;
  letter-spacing: .08em;
}

.footer label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.footer input { width: 92px; }

.meter {
  min-width: 90px;
  color: #747474;
}

button {
  border: 1px solid #303030;
  color: #a8a8a8;
  background: #080808;
  padding: 6px 10px;
  font: inherit;
  letter-spacing: .08em;
  cursor: pointer;
}

button:hover { border-color: #565656; color: #ddd; }

@media (max-width: 700px) {
  body { padding: 8px; }
  .hud { font-size: 11px; gap: 8px; letter-spacing: .08em; }
  .arena { aspect-ratio: 1 / 1; }
  .footer { gap: 9px; }
}


.gameover-overlay {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: #000;
  z-index: 10;
  text-align: center;
  user-select: none;
}
.gameover-overlay.show { display: grid; }

.gameover-inner {
  transform: translateY(-2vh);
  font-family: "Courier New", monospace;
  text-transform: uppercase;
}

.gameover-title {
  font-size: clamp(36px, 8vw, 92px);
  line-height: .9;
  letter-spacing: .07em;
  color: #e9e4cf;
  text-shadow:
    3px 0 0 #5a1d1d,
    -3px 0 0 #1d4d53,
    0 4px 0 #111;
  image-rendering: pixelated;
}

.gameover-sub {
  margin-top: 28px;
  color: #7f7f72;
  font-size: clamp(12px, 2vw, 20px);
  letter-spacing: .17em;
}

.gameover-score {
  margin-top: 12px;
  color: #b5ad85;
  font-size: clamp(11px, 1.7vw, 17px);
  letter-spacing: .12em;
}

.gameover-hint {
  margin-top: 34px;
  color: #474747;
  font-size: clamp(10px, 1.5vw, 14px);
  letter-spacing: .12em;
  animation: blinkgo 1.1s steps(1,end) infinite;
}

@keyframes blinkgo {
  0%, 54% { opacity: 1; }
  55%, 100% { opacity: .18; }
}


.high-score {
  margin-top: 8px;
  text-align: center;
  color: #66685f;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.score-popup {
  position: absolute;
  pointer-events: none;
  font-family: "Courier New", monospace;
}
