:root {
  --bg: #0b0f12;
  --panel: #12181d;
  --ink: #e7eef4;
  --muted: #8b9aaa;
  --line: #24303a;
  --mint: #6dffb0;
  --mint-dim: #1f8a58;
  --ember: #ff5a36;
  --gold: #f4c14a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 50% -10%, #1a2730 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Trebuchet MS, sans-serif;
}

body {
  display: grid;
  place-items: center;
  padding: 20px 12px 28px;
}

.app {
  width: min(720px, 100%);
  display: grid;
  gap: 16px;
}

.hud {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  background: color-mix(in srgb, var(--panel) 88%, black);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

h1 {
  margin: 0;
  letter-spacing: 0.28em;
  font-size: 1.05rem;
  color: var(--mint);
}

.stats {
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 22px;
}

.stats div {
  margin: 0;
}

.stats dt {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stats dd {
  margin: 2px 0 0;
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 700;
}

.hud-actions {
  display: flex;
  gap: 8px;
}

button {
  appearance: none;
  border: 1px solid var(--line);
  background: #1b242c;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--mint-dim);
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

#primaryBtn {
  background: var(--mint);
  color: #072114;
  border-color: transparent;
  padding: 10px 22px;
  min-width: 140px;
}

.stage {
  position: relative;
  justify-self: center;
  width: min(576px, 100%);
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #31404c;
  box-shadow: var(--shadow);
  background: #081015;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 10, 13, 0.62);
  backdrop-filter: blur(4px);
}

.overlay.hidden {
  display: none;
}

.card {
  width: min(360px, calc(100% - 32px));
  text-align: center;
  background: #121920;
  border: 1px solid #33424e;
  border-radius: 16px;
  padding: 22px 20px 18px;
}

.kicker {
  margin: 0 0 6px;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.card p {
  margin: 0 0 16px;
  color: var(--muted);
}

.hint {
  margin-top: 14px !important;
  font-size: 0.78rem;
}

.credit {
  margin: 10px 0 0 !important;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.byline {
  justify-self: center;
  margin: 0 !important;
  opacity: 0.85;
}

.legend {
  margin: 0;
  justify-self: center;
  max-width: 36rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.pad {
  display: none;
  justify-self: center;
  width: min(280px, 100%);
  gap: 8px;
}

.pad button {
  width: 100%;
  height: 52px;
  font-size: 1.1rem;
}

.pad-mid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

@media (max-width: 720px) {
  .hud {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .pad {
    display: grid;
  }
}
