:root {
  --bg: #0d0f14;
  --panel: #161a23;
  --panel-2: #1e2430;
  --line: #2a3140;
  --text: #e8ebf1;
  --muted: #8a93a6;
  --green: #2fd178;
  --red: #ff4d5e;
  --amber: #ffb547;
  --blue: #5aa9ff;
  --purple: #b48cff;
  --radius: 12px;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
body { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; border: 1px solid var(--line); background: var(--panel-2); border-radius: var(--radius); padding: 10px 14px; cursor: pointer; }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: default; }
button.primary { background: var(--blue); border-color: var(--blue); color: #001; font-weight: 700; }
input, select { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.green { color: var(--green); }
.red { color: var(--red); }
.amber { color: var(--amber); }
.hidden { display: none !important; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
h1.logo { font-size: 44px; letter-spacing: 2px; margin: 0; font-weight: 900; }
h1.logo span { color: var(--red); }

/* Toasts */
#toasts { position: fixed; left: 0; right: 0; top: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 50; padding: 0 12px; }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; max-width: 520px; width: 100%; font-size: 15px; animation: toastIn .2s ease-out; box-shadow: 0 6px 20px #0008; }
.toast.error { border-color: var(--red); }
.toast.warn { border-color: var(--amber); }
.toast.ok { border-color: var(--green); }
.toast.spy { border-color: var(--purple); }
.toast.role { border-color: var(--purple); background: #241a38; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* Big overlay effects */
#fx { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 40; }
.fx-banner { background: #000c; border: 2px solid var(--amber); padding: 18px 26px; border-radius: 16px; font-size: clamp(20px, 4vw, 40px); font-weight: 800; text-align: center; animation: pop .25s ease-out; max-width: 90vw; }
.fx-bell { font-size: clamp(80px, 20vw, 220px); animation: ring .15s ease-in-out 8 alternate; filter: drop-shadow(0 0 30px var(--amber)); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
@keyframes ring { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }
.flash { animation: flash .6s ease-out; }
@keyframes flash { from { background: #ffb54755; } }

.pulse { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* How to play */
dialog#how { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
dialog#how::backdrop { background: #000a; }
.how-body { padding: 20px; display: flex; flex-direction: column; }
.how-body h2 { margin: 0 0 8px; }
.how-body h3 { margin: 14px 0 2px; font-size: 15px; }
.how-body p { margin: 0; line-height: 1.45; color: var(--muted); }
.how-body button { margin-top: 18px; }

/* Ballpark: outfield green and chalk. */
body.site-ballpark {
  --bg: #0f2a1d; --panel: #16382a; --panel-2: #1e4635; --line: #2f5a47; --text: #f4f1e4; --muted: #a7bcae;
  --blue: #f2c94c; --red: #f2c94c; --green: #7ee2a8;
}
