/* Quarterly Rollout: two-ink risograph look. System fonts only. */
:root {
  --ink: #22305b; --ink2: #3b4a7a; --paper: #f4ecdc; --cream: #fff8ea; --coral: #ef6a55; --mustard: #f2b544;
  --teal: #2b9a8f; --mint: #a9dccf; --nav: 52px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --round: ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #18213f radial-gradient(rgba(169, 220, 207, 0.08) 1px, transparent 1.5px) 0 0 / 14px 14px;
  color: var(--cream); font: 16px/1.5 var(--font); overscroll-behavior: none;
}
#app {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  height: calc(100vh - var(--nav)); height: calc(100dvh - var(--nav)); padding: 8px; overflow: hidden;
}
#stage {
  position: relative; aspect-ratio: 960 / 620;
  width: min(100%, calc((100vh - var(--nav) - 64px) * 960 / 620));
  width: min(100%, calc((100dvh - var(--nav) - 64px) * 960 / 620));
  box-shadow: 7px 7px 0 var(--coral); border: 3px solid var(--ink); background: var(--ink);
}
canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
#help { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; color: rgba(255, 248, 234, 0.75); font-size: 13px; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 5px; margin: 0 1px; border: 1px solid rgba(255, 248, 234, 0.4); border-radius: 4px; font: 12px/1.6 ui-monospace, Menlo, monospace; text-align: center; }

/* ---- overlay screens */
.screen {
  position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(24, 33, 63, 0.72); overflow: auto;
}
.screen[hidden] { display: none; }
.card {
  width: min(560px, 100%); max-height: 100%; overflow: auto; margin: auto;
  padding: 22px 24px; background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 14px; box-shadow: 8px 8px 0 var(--coral);
}
.card h1, .card h2 { font-family: var(--round); margin: 0 0 8px; line-height: 1.05; text-shadow: 2px 2px 0 var(--mint); }
.card h1 { font-size: clamp(38px, 8vw, 62px); font-weight: 900; letter-spacing: -1px; text-shadow: 3px 3px 0 var(--coral); }
.card h1 span { color: var(--teal); }
.card h2 { font-size: clamp(24px, 5vw, 34px); font-weight: 850; }
.kicker { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--coral); }
.tagline { margin: 0 0 10px; font-weight: 700; color: var(--ink2); }
.premise, blockquote p { font-size: 15.5px; }
blockquote { margin: 12px 0; padding: 10px 14px; background: var(--cream); border-left: 5px solid var(--mustard); border-radius: 6px; }
blockquote p { margin: 0 0 6px; }
cite { font-style: normal; font-weight: 700; font-size: 13px; color: var(--ink2); }
cite::before { content: "— "; }
.goal { font-weight: 650; }
.big { margin: 4px 0; font: 800 40px/1.1 ui-monospace, Menlo, monospace; }
.fine { margin: 14px 0 0; font-size: 12.5px; color: var(--ink2); }
.fine a { color: var(--ink); }
.ending p { margin: 0 0 8px; }

.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.buttons.stack { flex-direction: column; align-items: stretch; }
.toggles { margin-top: 10px; }
button { font: inherit; }
.card button {
  min-height: 44px; padding: 8px 16px; border: 2.5px solid var(--ink); border-radius: 10px; background: var(--cream); color: var(--ink);
  font-weight: 750; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); transition: transform 0.08s, box-shadow 0.08s;
}
.card button.primary { background: var(--mustard); }
.card button.toggle { background: var(--mint); font-weight: 650; }
.card button.quiet { background: transparent; box-shadow: none; }
.card button:hover:not([disabled]) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.card button:active:not([disabled]) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.card button:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.card button[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.card button[hidden] { display: none; }
.floor-list { display: grid; gap: 8px; }
.floor-list .floor { display: flex; justify-content: space-between; gap: 12px; text-align: left; }
.floor .best { font-weight: 600; color: var(--ink2); white-space: nowrap; }

/* ---- touch controls */
.touch-only { display: none; }
body.touch .touch-only { display: block; }
body.touch #help { display: none; }
body.touch.in-menu #touch { display: none; }
#t-pause {
  position: absolute; top: 6px; right: 6px; z-index: 5; width: 40px; height: 34px; border: 2px solid var(--cream); border-radius: 8px;
  background: rgba(34, 48, 91, 0.55); color: var(--cream); font-size: 13px;
}
#touch { position: fixed; inset: auto 0 0 0; height: 0; z-index: 6; }
#stick, #t-spin { position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); touch-action: none; user-select: none; -webkit-user-select: none; }
#stick {
  left: max(18px, env(safe-area-inset-left)); width: 132px; height: 132px; border-radius: 50%;
  background: rgba(255, 248, 234, 0.12); border: 2px solid rgba(255, 248, 234, 0.45);
}
#knob {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: rgba(242, 181, 68, 0.85); border: 2px solid var(--ink); pointer-events: none;
}
#t-spin {
  right: max(18px, env(safe-area-inset-right)); width: 96px; height: 96px; border-radius: 50%;
  background: rgba(239, 106, 85, 0.85); border: 3px solid var(--cream); color: var(--cream); font: 800 18px var(--round);
}
#t-spin:active { background: var(--coral); transform: scale(0.96); }
@media (orientation: portrait) {
  body.touch #app { justify-content: flex-start; padding-top: 12px; }
}
@media (max-width: 520px) {
  .card { padding: 16px; }
  .premise, blockquote p { font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .card button { transition: none; }
}
