/* Page reset. The claude.ai host injected these two rules; a standalone file needs its own.
   [hidden] must beat the display values on .layer and .hud, or every overlay shows at once. */
body { margin: 0; }
[hidden] { display: none !important; }

/* Layout: one full-height canvas. At rest only a centered Start button shows; in-game readouts sit in the floor band beside the turret. Single light cream look, chosen by the user. */
:root {
  --cream: #F7F3EA;
  --floor: #F1ECE1;
  --card: #FFFDF9;
  --ink: #1D1D1F;
  --ink-2: #6E6E73;
  --ink-3: #A1A1A6;
  --hair: #E3DCCD;
  --press: #EDE7DA;
  --dust: #C9BDA6;
  --blue: #0071E3;
  --blue-deep: #0058B0;
  --blue-tint: #E3EEFB;
  --orange: #FF9500;
  --red: #FF3B30;
  --ring: rgba(0, 113, 227, 0.35);
  --scrim: rgba(247, 243, 234, 0.82);
  --shadow-ink: rgba(70, 52, 20, 0.16);
  --shadow-btn: 0 1px 2px rgba(29, 29, 31, 0.10), 0 10px 28px rgba(29, 29, 31, 0.14);
  --shadow-btn-hover: 0 2px 4px rgba(29, 29, 31, 0.12), 0 16px 36px rgba(29, 29, 31, 0.18);
  --shadow-card: 0 1px 2px rgba(70, 52, 20, 0.05), 0 18px 48px rgba(70, 52, 20, 0.12);
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
.stage { position: relative; height: 100%; overflow: hidden; user-select: none; -webkit-user-select: none; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#typer { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; }

button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }

/* Start */
.layer { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; }
.start { display: flex; flex-direction: column; align-items: center; gap: 22px; transform: translateY(-28px); }
.btn-primary {
  appearance: none; border: 0; cursor: pointer;
  font: 600 19px/1 var(--font-display); letter-spacing: -0.01em;
  color: var(--card); background: var(--ink);
  height: 58px; padding: 0 56px; border-radius: 999px;
  box-shadow: var(--shadow-btn);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease, background-color .2s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-btn-hover); }
.btn-primary:active { transform: scale(.97); box-shadow: var(--shadow-btn); }
.opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.opt {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 14px/1 var(--font-text); color: var(--ink-2);
  padding: 9px 12px; border-radius: 10px;
  transition: background-color .15s ease, color .15s ease;
}
.opt:hover { background: var(--press); color: var(--ink); }
.opt svg { width: 8px; height: 12px; color: var(--ink-3); flex: none; }
.best { margin: -14px 0 0; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* In-game readouts */
.hud {
  position: absolute; left: 0; right: 0; bottom: 0; height: 64px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 20px; pointer-events: none;
}
.hud-side { display: flex; gap: 22px; }
.m { display: flex; flex-direction: column; gap: 3px; min-width: 44px; }
.hud-r .m { align-items: flex-end; }
.m .v { font: 600 17px/1.1 var(--font-round); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--ink); }
.m .k { font: 500 11px/1.2 var(--font-text); color: var(--ink-3); }

/* Pause and results */
.scrim { background: var(--scrim); }
.card {
  width: min(360px, 100%);
  background: var(--card); border-radius: 22px; box-shadow: var(--shadow-card);
  padding: 30px 24px 18px; display: flex; flex-direction: column; gap: 22px; text-align: center;
}
.card h2 { margin: 0; font: 600 26px/1.15 var(--font-display); letter-spacing: -0.02em; text-wrap: balance; }
.card p { margin: 6px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.card .opt { align-self: center; }
.card kbd {
  font: 500 12px/1 var(--font-text); color: var(--ink);
  background: var(--cream); border: 1px solid var(--hair); border-radius: 6px; padding: 3px 7px;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--cream); border-radius: 14px; padding: 16px 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.tile .v { font: 600 30px/1 var(--font-round); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile .k { font: 500 12px/1.2 var(--font-text); color: var(--ink-2); }
.badge { align-self: center; margin: -8px 0 0; font: 600 12px/1 var(--font-text); color: var(--blue); background: var(--blue-tint); padding: 7px 12px; border-radius: 999px; }
.note { margin: -8px 0 0; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-direction: column; gap: 4px; }
.btn-primary.wide { width: 100%; height: 50px; padding: 0 20px; font-size: 17px; }
.btn-text {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: 500 15px/1 var(--font-text); color: var(--blue);
  padding: 12px; border-radius: 10px; transition: color .15s ease;
}
.btn-text:hover { color: var(--blue-deep); }

@media (max-width: 420px) { .hud { padding: 0 16px; } .hud-side { gap: 16px; } }
@media (prefers-reduced-motion: reduce) { .btn-primary, .opt, .btn-text { transition: none; } }
