/* MakeProps charter (makeprops.com): Outfit, four blues, white grounds. The identity always sits on white. */
:root {
  --navy: #0C3351;
  --royal: #164194;
  --blue: #4B85E6;
  --sky: #30A7FF;
  --mist: #EEF1FF;
  --line: #D9E0F5;
  --ink-soft: rgba(12, 51, 81, .72);
  --ink-faint: rgba(12, 51, 81, .52);
  --ok: #1E9E6A;
  --danger: #D23F3F;
  --warn: #C98400;
  --logo-ink: #1D1D1B;
  --grad: linear-gradient(90deg, #30A7FF 0%, #2B96ED 21%, #216CC1 62%, #164194 100%);
  --bleed: 4000px;
  --font-sans: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-hand: 'Caveat', 'Bradley Hand', 'Segoe Print', cursive;
  --font-mono: 'Courier Prime', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #FFFFFF;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-sans);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

input { -webkit-user-select: text; user-select: text; }
button { font-family: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
[hidden] { display: none !important; }

.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }

#viewport { position: fixed; inset: 0; overflow: hidden; background: #FFFFFF; }
/* The stage centres the content; decorations and backgrounds run past it to the screen edges. */
#stage { position: absolute; left: 0; top: 0; width: 1180px; height: 820px; transform-origin: 0 0; overflow: visible; }
.page { position: absolute; inset: 0; }

.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Top bar */
.topbar { position: absolute; left: 0; top: 0; right: 0; height: 76px; display: flex; align-items: center; gap: 22px; padding: 0 36px; z-index: 30; }
.topbar::before { content: ''; position: absolute; z-index: -1; left: calc(-1 * var(--bleed)); right: calc(-1 * var(--bleed)); top: calc(-1 * var(--bleed)); bottom: 0; background: #FFFFFF; border-bottom: 1px solid var(--line); }
.topbar-logo { width: 170px; height: 33px; color: var(--logo-ink); flex: none; }
.topbar-sep { width: 1px; height: 28px; background: var(--line); flex: none; }
.topbar-title { font-size: 13.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--royal); white-space: nowrap; }
.topbar-stats { margin-left: auto; display: flex; gap: 34px; align-items: center; }
.topbar-who { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 15px; color: var(--ink-soft); }
.topbar-who b { color: var(--navy); }
.topbar-who .link-button { margin-left: 18px; }
.topbar-quit { margin-left: 8px; border: 1.5px solid var(--line); background: #FFFFFF; color: var(--royal); font-size: 14px; font-weight: 600; height: 40px; padding: 0 18px; border-radius: 20px; }
.topbar .link-button:last-child { margin-left: auto; }
.topbar-who .link-button:last-child { margin-left: 18px; }

.stat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; min-width: 56px; }
.stat b { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); }
.stat small { margin-top: 6px; font-size: 11px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-soft); }
.stat-accent b { color: var(--blue); }
.stat-alert b { color: var(--danger); }

/* Shared type and buttons */
.kicker { margin: 0; font-size: 13.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--royal); }
.bar { display: block; width: 76px; height: 6px; margin-top: 12px; background: var(--grad); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.button-main { height: 52px; padding: 0 28px; border: 0; border-radius: 6px; background: var(--royal); color: #FFFFFF; font-size: 16px; font-weight: 700; }
.button-ghost { height: 52px; padding: 0 24px; border: 1.5px solid var(--line); border-radius: 6px; background: #FFFFFF; color: var(--royal); font-size: 16px; font-weight: 600; }
.button-skew { height: 58px; padding: 0 44px; border: 0; background: var(--blue); color: #FFFFFF; font-size: 17px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
.button-main:active, .button-ghost:active, .button-skew:active { transform: translateY(1px); filter: brightness(.95); }
.link-button { border: 0; background: none; padding: 6px 0; color: var(--royal); font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.link-danger { color: var(--danger); }

/* Overlays */
.modal-veil, .end-veil { position: absolute; inset: calc(-1 * var(--bleed)); z-index: 60; display: grid; place-items: center; background: rgba(255, 255, 255, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-card, .end-card { width: 460px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 30px 70px rgba(12, 51, 81, .18); padding: 34px 36px 30px; }
.modal-card h2, .end-card h2 { margin: 6px 0 0; font-size: 26px; line-height: 1.2; }
.modal-card p { margin: 10px 0 0; color: var(--ink-soft); font-size: 16px; }
.modal-actions { margin-top: 26px; display: flex; gap: 12px; justify-content: flex-end; }
.idle-veil { z-index: 90; }
.idle-count { color: var(--royal); font-variant-numeric: tabular-nums; }
.end-card { width: 560px; text-align: center; animation: rise .35s ease-out; }
.end-card h2 { font-size: 24px; font-weight: 600; }
.end-points { margin: 18px 0 24px; }
.end-points b { font-size: 64px; font-weight: 800; color: var(--royal); font-variant-numeric: tabular-nums; }
.end-points span { font-size: 18px; color: var(--ink-soft); }

.countdown { position: absolute; top: 76px; left: calc(-1 * var(--bleed)); right: calc(-1 * var(--bleed)); bottom: calc(-1 * var(--bleed)); padding-bottom: var(--bleed); z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(255, 255, 255, .78); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.countdown-figure { font-size: 120px; font-weight: 800; color: var(--royal); line-height: 1; min-height: 120px; }
.countdown-pop { animation: pop .5s ease-out; }
.countdown-hint { max-width: 620px; margin: 0; text-align: center; font-size: 22px; font-weight: 500; color: var(--navy); }

.game-layer { position: absolute; inset: 0; touch-action: none; }
.game-toast { position: absolute; left: 50%; top: 92px; z-index: 40; max-width: 760px; transform: translateX(-50%); padding: 11px 22px; border-radius: 30px; background: var(--navy); color: #FFFFFF; font-size: 16px; font-weight: 600; text-align: center; box-shadow: 0 10px 26px rgba(12, 51, 81, .25); pointer-events: none; }
.game-toast-in { animation: toast-in .3s ease-out; }
.points-pop { position: absolute; z-index: 45; transform: translate(-50%, -50%); font-size: 22px; font-weight: 800; color: var(--royal); background: #FFFFFF; border-radius: 20px; padding: 2px 12px; box-shadow: 0 6px 16px rgba(22, 65, 148, .25); pointer-events: none; animation: float-up .9s ease-out forwards; }
.points-pop-bad { color: var(--danger); }
.stamp { position: absolute; left: 50%; top: 46%; z-index: 44; transform: translate(-50%, -50%) rotate(-4deg); padding: 16px 30px; border: 4px solid var(--ok); border-radius: 10px; background: rgba(255, 255, 255, .94); color: var(--ok); font-size: 30px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; pointer-events: none; }
.stamp-in { animation: stamp .45s cubic-bezier(.2, 1.4, .4, 1); }

.sync { position: fixed; right: 6px; bottom: 6px; width: 8px; height: 8px; border-radius: 50%; background: #9BD9B8; z-index: 100; pointer-events: none; }
.sync-wait { background: #F2B705; }
.sync-off { background: #E07A7A; }

.rotate-hint { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  .rotate-hint { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #FFFFFF; color: var(--navy); font-size: 22px; }
  .rotate-hint b { font-size: 34px; }
}

@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes float-up { from { opacity: 1; transform: translate(-50%, -50%); } to { opacity: 0; transform: translate(-50%, -110%); } }
@keyframes stamp { from { transform: translate(-50%, -50%) rotate(-4deg) scale(1.6); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-4deg) scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
