/* Egg Heist — shared visual language for the site and the game.
   Palette matches contrib/art/make_social.py and html/src/render.js; change one,
   change all three. */

:root {
  --sky-1:#7CCBEC; --sky-2:#C9EEFB;
  --grass-1:#8CC63F; --grass-2:#6BA632; --grass-3:#4E8226;
  --dirt-1:#C89463; --dirt-2:#A06E42;
  --barn-1:#D24B3A; --barn-2:#A3342A;
  --wood-1:#B5794A; --wood-2:#8A5730;
  --gold-1:#FFF0A8; --gold-2:#FFC22E; --gold-3:#E09B12;
  --cream:#FFF6E0; --cream-2:#F2E3C2; --ink:#3B2A1E; --ink-soft:#7A5A3E;
  --p1:#FF7043; --p2:#42A5F5; --p3:#9CCC65; --p4:#AB7DF6;

  /* Display face is the game's voice: chunky, uppercase, titles and the timer.
     Body copy stays on the system stack — the CC0 display faces have no real
     lowercase, and paragraphs set in them are genuinely hard to read. */
  --font-display: "EggHeist Display", Impact, "Arial Black", system-ui, sans-serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 18px;
  --border: 5px;
  --shadow: 0 10px 0 rgba(59,42,30,.24), 0 18px 34px rgba(59,42,30,.24);
}

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

html {
  /* Reserve the scrollbar's width at all times: without this, a page that grows
     past the viewport shifts its content sideways as the bar appears. */
  scrollbar-gutter: stable;
  overflow-y: scroll;
  scroll-behavior: smooth;
}

/* The play surface is fixed and must never scroll. */
html:has(#stage) { overflow: hidden; scrollbar-gutter: auto; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--sky-1);
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; margin: 0 0 .4em; }

h1 {
  font-size: clamp(38px, 9vw, 86px);
  text-transform: uppercase;
  letter-spacing: -.02em;
  color: var(--gold-2);
  text-shadow:
    3px 3px 0 var(--gold-3), -3px 0 0 var(--ink), 3px 0 0 var(--ink),
    0 -3px 0 var(--ink), 0 3px 0 var(--ink), 0 8px 0 rgba(59,42,30,.22);
}

a { color: var(--barn-2); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--barn-1);
  outline-offset: 3px;
}

/* --- panels --------------------------------------------------------------- */
.panel {
  background: var(--cream);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

.kicker {
  display: inline-block;
  background: var(--barn-1); color: #fff;
  font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  font-size: 12px; padding: 6px 14px; border-radius: 999px;
  border: 3px solid var(--ink);
}

/* --- buttons -------------------------------------------------------------- */
.btn {
  --btn-bg: var(--gold-2);
  --btn-shadow: var(--gold-3);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 19px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
  background: var(--btn-bg);
  border: 4px solid var(--ink);
  border-radius: 14px;
  padding: 13px 24px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--btn-shadow);
  transition: transform .07s ease, box-shadow .07s ease, filter .12s ease;
  user-select: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--btn-shadow); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.btn--big { font-size: 26px; padding: 18px 34px; border-radius: 18px; }
.btn--green { --btn-bg: var(--grass-1); --btn-shadow: var(--grass-3); }
.btn--red   { --btn-bg: var(--barn-1); --btn-shadow: var(--barn-2); color: #fff; }
.btn--ghost { --btn-bg: var(--cream); --btn-shadow: var(--cream-2); }
.btn--small {
  /* The display face is a blocky poster font: fine at 20px+, mush at 13px.
     Small controls use the UI stack so their labels stay legible. */
  font-family: var(--font-ui);
  font-weight: 800; letter-spacing: .03em;
  font-size: 13.5px; padding: 9px 14px;
  border-width: 3px; border-radius: 10px;
  box-shadow: 0 4px 0 var(--btn-shadow);
}

/* --- form fields ---------------------------------------------------------- */
.field {
  font-family: var(--font-ui);
  font-size: 17px; font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 12px;
  padding: 11px 14px;
  width: 100%;
}
.field::placeholder { color: #B9A88E; }

.label {
  display: block;
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 6px;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack { display: grid; gap: 14px; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }

/* Accessible hiding: reachable by screen readers, invisible on screen. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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