/* ── The shell every activity in the suite wears ───────────────────────
   Built for a Promethean panel: a five-year-old is about 43 inches tall and
   works comfortably below about 48, so everything they touch sits in the
   lower half of the glass. The number lives up top where the whole room
   reads it and nobody needs to reach it. Targets are palm-sized and drop
   zones snap generously, because aim at arm's length on glass is about an
   inch. */
:root {
  --paper: #fbf7ef; --card: #ffffff; --ink: #241f1a; --soft: #6c6256; --rule: #e4dbcb;
  --slot: #f5efe3; --ok: #2f8f63; --ok-soft: #e2f2e8; --notyet: #d4663f; --notyet-soft: #fbe9e0;
  --mark: #c98a05; --violet: #574a9c; --kid: #574a9c; --kid-soft: #ece9f6;
  --display: 'Andika', 'Trebuchet MS', sans-serif;
  --sans: 'Lexend', ui-sans-serif, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171b2a; --card: #202639; --ink: #f3eee4; --soft: #a7a394; --rule: #333a52;
    --slot: #1b2030; --ok: #5ec38c; --ok-soft: #1e3a2c; --notyet: #f08a5f; --notyet-soft: #3a2519;
    --mark: #f6c63f; --violet: #a195e8; --kid-soft: #262b42;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #171b2a; --card: #202639; --ink: #f3eee4; --soft: #a7a394; --rule: #333a52;
  --slot: #1b2030; --ok: #5ec38c; --ok-soft: #1e3a2c; --notyet: #f08a5f; --notyet-soft: #3a2519;
  --mark: #f6c63f; --violet: #a195e8; --kid-soft: #262b42;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--sans);
  overscroll-behavior: none; touch-action: manipulation;
}
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
a { color: var(--violet); }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }

.screen {
  min-height: 100%; display: flex; flex-direction: column; gap: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 16px 22px; max-width: 1280px; margin: 0 auto; width: 100%;
}

.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bar .brand { font-family: var(--display); font-weight: 700; font-size: clamp(1rem, 2.2vw, 1.2rem); }
.bar .std {
  font-size: .62rem; letter-spacing: .09em; text-transform: uppercase; color: var(--soft);
  border: 1px solid var(--rule); border-radius: 999px; padding: 4px 10px;
}
.bar .home { font-size: .76rem; color: var(--soft); text-decoration: none; }
.bar .home:hover { color: var(--violet); }

.masthead { display: flex; align-items: center; gap: clamp(12px, 3vw, 30px); flex-wrap: wrap; }
.masthead .ask { font-family: var(--display); font-size: clamp(1.05rem, 2.6vw, 1.5rem); line-height: 1.15; }
.masthead .ask small { display: block; font-family: var(--sans); font-size: .62em; color: var(--soft); margin-top: 3px; }
.masthead .target {
  font-family: var(--display); font-weight: 700; color: var(--kid);
  font-size: clamp(3rem, 11vw, 7rem); line-height: .9;
}
.masthead .jar { width: min(16vw, 92px); flex: none; text-align: center; }
.masthead .jar svg { width: 100%; height: auto; }
.masthead .jar .count { font-size: .62rem; color: var(--soft); display: block; }
.masthead .jar .count small { display: block; }
.tally-line { font-size: .8rem; color: var(--soft); }

.big {
  font-family: var(--sans); font-weight: 700; font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  padding: clamp(14px, 2.4vw, 20px) clamp(24px, 5vw, 44px); border-radius: 16px; border: none;
  background: var(--violet); color: var(--card);
}
.big:disabled { opacity: .4; cursor: not-allowed; }
.ghost {
  font-family: var(--sans); font-size: .9rem; padding: 10px 16px; border-radius: 11px;
  border: 2px solid var(--rule); background: transparent; color: var(--soft);
}
.ghost:hover { border-color: var(--violet); color: var(--violet); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mat-controls { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: auto; padding-top: 14px; }

/* ── the passcode gate ───────────────────────────────────────────── */
.suite-gate {
  position: fixed; inset: 0; z-index: 70; background: rgba(20,17,13,.72);
  display: grid; place-items: center; padding: 20px;
}
.suite-gate-in {
  background: var(--card); border: 2px solid var(--rule); border-radius: 18px;
  padding: 24px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px;
}
.suite-gate-in h3 { font-family: var(--display); margin: 0; font-size: 1.25rem; }
.suite-gate-in p { margin: 0; font-size: .92rem; color: var(--soft); line-height: 1.5; }
.suite-gate-in input {
  font: inherit; font-size: 1.4rem; letter-spacing: .3em; text-align: center; padding: 14px;
  border-radius: 12px; border: 2px solid var(--rule); background: var(--paper); color: var(--ink);
}
.suite-wrong { color: var(--notyet); font-size: .9rem; min-height: 1.2em; }
.suite-row { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.suite-ghost {
  font-size: .9rem; padding: 10px 16px; border-radius: 11px; border: 2px solid var(--rule);
  background: transparent; color: var(--soft);
}
.suite-go {
  font-weight: 700; font-size: 1rem; padding: 12px 22px; border-radius: 12px; border: none;
  background: var(--violet); color: var(--card); text-decoration: none; display: inline-block;
}

/* ── the nudge ───────────────────────────────────────────────────── */
.nudge {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 14px);
  background: var(--card); border: 2px solid var(--kid); color: var(--ink);
  border-radius: 16px; padding: 14px 20px; font-size: clamp(.95rem, 2.2vw, 1.1rem);
  text-align: center; max-width: min(460px, 90vw); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 60; line-height: 1.4;
}
.nudge.on { opacity: 1; transform: translate(-50%, 0); }
.nudge .big-emoji { display: block; font-size: 1.8em; line-height: 1; margin-bottom: 4px; }

/* ── setup ───────────────────────────────────────────────────────── */
.setup { justify-content: center; max-width: 620px; }
.setup h1 { font-family: var(--display); font-size: clamp(1.6rem, 5vw, 2.4rem); margin: 0 0 6px; }
.setup .sub { color: var(--soft); line-height: 1.55; margin: 0 0 8px; }
.setup label { display: block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); margin-bottom: 8px; }
.setup input[type="text"] {
  width: 100%; font: inherit; font-size: clamp(1.1rem, 3vw, 1.5rem); padding: 14px 16px;
  border-radius: 14px; border: 2px solid var(--rule); background: var(--card); color: var(--ink);
}
.colours { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 10px; }
.swatch { height: clamp(56px, 11vw, 82px); border-radius: 14px; border: 4px solid transparent; }
.swatch[aria-pressed="true"] { border-color: var(--ink); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
