:root {
  --ink: #f4f0ff;
  --shadow: 0 2px 0 rgba(0,0,0,0.55);
  --font: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: #1d2b53;
  font-family: var(--font);
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

/* The real cursor is hidden throughout: the drawn computer mouse is the cursor. */
#game {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: none;
}

.hud {
  position: fixed;
  pointer-events: none;
  text-shadow: var(--shadow);
  letter-spacing: 0.08em;
}

.hud--top {
  top: max(1rem, env(safe-area-inset-top));
  left: 0;
  right: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

.readout { font-size: clamp(0.75rem, 1.6vw, 1rem); opacity: 0.75; }

.readout--stage {
  /* Scales from its left edge: with the default centre origin the pop animation
     pushes a long stage name off the side of the screen. */
  transform-origin: left center;
  margin-top: 0.15rem;
  font-size: clamp(0.62rem, 1.15vw, 0.78rem);
  opacity: 0.5;
  letter-spacing: 0.22em;
}

.hud--right { text-align: right; }

.readout--dev {
  margin-top: 0.15rem;
  font-size: clamp(0.62rem, 1.15vw, 0.78rem);
  letter-spacing: 0.18em;
  color: #ffb02e;
  opacity: 0.85;
}

.stage--up { animation: stage-up 1.1s ease-out; }

@keyframes stage-up {
  0%   { opacity: 1; transform: scale(1.5); color: #ffd479; }
  100% { opacity: 0.5; transform: scale(1); }
}
.readout--big {
  font-size: clamp(1.6rem, 5vw, 3rem);
  opacity: 1;
  font-variant-numeric: tabular-nums;
}

.hud--hint {
  bottom: max(1.75rem, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  text-align: center;
  font-size: clamp(0.7rem, 1.5vw, 0.95rem);
  opacity: 0.7;
  text-transform: uppercase;
}

.panel {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(22rem, 84vw);
  height: fit-content;
  padding: 1.75rem 1.5rem;
  text-align: center;
  background: rgba(24, 18, 40, 0.86);
  border: 2px solid rgba(244, 240, 255, 0.16);
  border-radius: 0.75rem;
  backdrop-filter: blur(6px);
  pointer-events: none;
  animation: pop 220ms cubic-bezier(0.2, 1.3, 0.4, 1);
}

.panel__title {
  margin-bottom: 0.75rem;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel__note--dim { opacity: 0.45; margin-top: 0.5rem; }

.panel__label {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.55;
}

.panel__dist {
  margin: 0.35rem 0 0.6rem;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-variant-numeric: tabular-nums;
}

.panel__note { font-size: 0.8rem; opacity: 0.7; line-height: 1.5; }

@keyframes pop {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .stage--up { animation: none; }
}
