*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --ink: #0b0b0b;
  --paper: #e8e4da;
  --dim: rgba(232, 228, 218, 0.42);
  --line: rgba(232, 228, 218, 0.1);
  --signal: #ff4d1a;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

html,
body {
  height: 100%;
  background: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  width: 100%;
  height: 100svh;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* ─────────── HUD ─────────── */

.hud {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 2rem);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  pointer-events: none;
  z-index: 2;
}

.hud-top {
  top: 0;
}

.hud-bottom {
  bottom: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--paper);
}

.tag-dot {
  width: 6px;
  height: 6px;
  background: var(--signal);
  box-shadow: 0 0 10px var(--signal);
  animation: blink 1.2s steps(2, jump-none) infinite;
}

.readout {
  display: flex;
  gap: 1.5rem;
}

.readout div {
  display: flex;
  gap: 0.5rem;
}

.readout dd {
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.hint {
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hint.is-hidden {
  opacity: 0;
}

.counter {
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

@keyframes blink {
  50% {
    opacity: 0.2;
  }
}

@media (max-width: 640px) {
  .readout div:last-child {
    display: none;
  }

  .hud {
    font-size: 0.6rem;
  }
}
