/* Shared design tokens and chrome used by the landing page and every game.
   The site is dark-themed only, by design: there is no light palette. */
:root {
  /* Dark "toy arcade" palette: shared by the landing page and every game. */
  --bg: #10121a;
  --surface: #191c26;
  --surface-2: #232735;
  --text: #eef0f7;
  --muted: #9ba1b6;
  --border: #2b3040;
  --dot: #262a39;
  --pink: #ff6fae;
  --cyan: #2ec4e6;
  --lime: #9bd531;
  --orange: #f39237;
  --yellow: #ffd23f;
  --accent: var(--pink);
  --accent-contrast: #10121a;
  --shadow: 0 2px 4px rgb(0 0 0 / 30%), 0 16px 40px rgb(0 0 0 / 35%);
  --radius: 22px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Titan One", "Arial Rounded MT Bold", var(--font);
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.5px, transparent 1.6px);
  background-size: 28px 28px;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- Monetization ---------- */

.ad-slot {
  margin: 40px auto;
  max-width: 970px;
  text-align: center;
}
.ad-slot[hidden] { display: none; }

.ad-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.ad-placeholder {
  display: grid;
  place-items: center;
  min-height: 90px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
}

.support-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.support-link:hover { border-color: var(--accent); color: var(--accent); }

.legal-link {
  color: var(--muted);
  font-size: 13px;
}
.legal-link:hover { color: var(--accent); }

/* ---------- Game page chrome ---------- */

.game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.game-bar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.back-link:hover { color: var(--accent); }

.game-bar .spacer { min-width: 80px; display: flex; justify-content: flex-end; }

.game-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 16px;
}

.game-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 16px 32px;
}

/* ---------- Game kit (optional) ----------
   Opt-in building blocks for game pages: panels, buttons, stats, key hints and
   a start/pause overlay. Everything is prefixed `kit-` so it never collides with
   a game's own class names. Use what helps, restyle or ignore the rest.
   See games/_template/STYLE_GUIDE.md. */

.kit-layout {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 24px;
  align-items: start;
}
@media (max-width: 820px) { .kit-layout { grid-template-columns: minmax(0, 1fr); } }

.kit-intro { margin: 0; color: var(--muted); max-width: 60ch; text-align: center; }

.kit-board {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  touch-action: manipulation;
}
.kit-board canvas { display: block; width: 100%; height: auto; }

.kit-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.kit-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  min-width: 0;
}
.kit-panel h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.kit-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.kit-stat { display: flex; flex-direction: column; gap: 2px; }
.kit-stat small {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.kit-stat strong {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kit-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.kit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: 600 0.9rem var(--font);
  text-decoration: none;
  cursor: pointer;
}
.kit-btn:hover:not(:disabled) { border-color: var(--muted); }
.kit-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.kit-btn.is-danger { color: var(--accent); }

/* The big yellow arcade button, same look as "Start" on the landing page. */
.kit-btn.is-primary {
  padding: 12px 26px;
  border: 0;
  background: radial-gradient(circle at 35% 25%, #fff3b0, var(--yellow) 45%, #e0a800);
  color: #3a2a00;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  box-shadow: 0 5px 0 #a87a00, 0 12px 24px rgb(255 210 63 / 22%);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.kit-btn.is-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #a87a00, 0 4px 10px rgb(255 210 63 / 18%); }

.kit-keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; align-items: center; }
.kit-keys dt { display: flex; gap: 4px; }
.kit-keys dd { margin: 0; color: var(--muted); }
.kit-keys kbd, kbd.kit-kbd {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1;
  padding: 3px 7px 2px;
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

.kit-fine { margin: 8px 0 0; font-size: 0.82rem; color: var(--muted); }

/* Start / pause / game-over screen laid over the board (inside the play area:
   game UI only, never ads or outbound links). */
.kit-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: rgb(16 18 26 / 82%);
  backdrop-filter: blur(3px);
}
.kit-overlay[hidden] { display: none; }
.kit-overlay h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
}
.kit-overlay p { margin: 0; color: var(--muted); max-width: 36ch; }
@media (max-width: 520px) {
  .kit-overlay { gap: 8px; padding: 12px; overflow: auto; }
  .kit-overlay p { font-size: 0.9rem; line-height: 1.35; }
  .kit-overlay .kit-btn.is-primary { padding: 8px 22px; }
  .kit-overlay .kit-fine { display: none; } /* keyboard hints; touch players don't need them */
}

@media (prefers-reduced-motion: reduce) {
  .kit-btn.is-primary { transition: none; }
}
