:root {
  --bg: #f6f1e7;
  --ink: #2b2a28;
  --muted: #6b665d;
  --card: #fffdf8;
  --line: #d9d1c0;
  --accent: #2f5d50;
  --bad: #9b2c2c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1c1a;
    --ink: #ece7dc;
    --muted: #a39d90;
    --card: #262522;
    --line: #3d3a35;
    --accent: #7fb5a3;
    --bad: #e08a8a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 Georgia, "Times New Roman", serif;
}

/* Site navigation: a plain top bar, ready for more links. */
.site-nav { border-bottom: 1px solid var(--line); }
.site-nav ul { display: flex; justify-content: flex-end; gap: 1.5rem; margin: 0; padding: 0 1.25rem; list-style: none; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); }

main {
  max-width: 34rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 2rem;
}

header { text-align: center; margin-bottom: 2rem; }
h1 { margin: 0 0 .75rem; line-height: 0; }
#logo {
  max-width: 100%;
  height: auto;
  animation: gentle-glow 4s ease-in-out infinite;
}

@keyframes gentle-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(56, 161, 255, 0.10)); }
  50% { filter: drop-shadow(0 0 9px rgba(56, 161, 255, 0.38)); }
}

@media (prefers-reduced-motion: reduce) {
  #logo, #logo .kid, #logo .parent { animation: none; }
}
h2 { font-size: 1.25rem; margin: 0 0 .25rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
}

.step-count { color: var(--muted); font-size: .85rem; margin: 0 0 1rem; }
.step-count:empty { display: none; }

label { display: block; font-weight: bold; margin-bottom: .35rem; }
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 .75rem; }

input[type="text"], input[type="password"] {
  width: 100%;
  padding: .6rem .7rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}

input:focus-visible, button:focus-visible, .tile:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.actions { margin-top: 1.25rem; }

button {
  font: inherit;
  padding: .6rem 1.2rem;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
button:disabled { opacity: .5; cursor: wait; }
@media (prefers-color-scheme: dark) { button { color: #14201c; } }

.error { color: var(--bad); margin: 1rem 0 0; }
.note { color: var(--muted); margin: 1rem 0 0; }
.progress.overall { margin-bottom: 1.25rem; height: 8px; }

.rules { list-style: none; padding: 0; margin: .75rem 0 0; font-size: .9rem; }
.rules li { padding: .15rem 0 .15rem 1.4rem; position: relative; color: var(--muted); }
.rules li::before { content: "\2715"; position: absolute; left: 0; color: var(--bad); }
.rules li.ok::before { content: "\2713"; color: var(--accent); }

.meter { height: 8px; background: var(--line); border-radius: 4px; margin-top: .6rem; overflow: hidden; }
.meter span { display: block; height: 100%; width: 3%; background: var(--bad); transition: width .2s; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: .3rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.tile[aria-pressed="true"] { border: 5px solid var(--accent); padding: 0; background: var(--card); }
.silhouette { width: 100%; max-width: 72px; height: 76px; fill: currentColor; }
.silhouette .accent { fill: var(--accent); }
.silhouette .lens { fill: none; stroke: var(--bg); stroke-width: 1.6; }
.silhouette .shrug { fill: currentColor; }
.tile[aria-pressed="true"] .silhouette .lens { stroke: var(--card); }
.crowd { display: flex; flex-wrap: wrap; gap: .25rem; }
.crowd .silhouette { width: 36px; height: 48px; }

.choices { display: flex; flex-direction: column; gap: .5rem; margin: .5rem 0; }
.choice {
  width: 100%;
  min-height: 44px;
  text-align: left;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--line);
}
.choice.small { font-size: .7rem; }
.fine-print { font-size: .7rem; margin: .75rem 0 .35rem; }
button.choice.small { width: auto; }

.cookie-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem .75rem; margin: .5rem 0; }
.stars { display: flex; flex-wrap: wrap; }
.star {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.5rem;
  color: var(--muted);
  background: transparent;
  border: 0;
}
.star.on { color: var(--accent); }

.fake-dialog { border: 2px solid var(--line); border-radius: 8px; background: var(--bg); padding: 1rem; margin: .5rem 0; }
.fake-dialog p { margin: 0 0 .75rem; }
.dialog-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.dialog-buttons button { min-height: 44px; min-width: 44px; }
.dialog-reply { margin: .75rem 0 0; }

.progress { height: 14px; background: var(--line); border-radius: 7px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.status { color: var(--muted); font-size: .9rem; margin: .6rem 0 0; min-height: 1.4em; }


/* Logo colors and figure animation. The inline svg in index.html uses these classes. */
:root {
  --logo-ink-1: #173B66;
  --logo-ink-2: #102C50;
  --logo-cut: #ffffff;
  --fig-blue: #3298F6;
  --fig-green: #55BF55;
}

@media (prefers-color-scheme: dark) {
  :root {
    --logo-ink-1: #E8EEF7;
    --logo-ink-2: #C9D6E8;
    --logo-cut: var(--bg);
  }
}

.ink-top { stop-color: var(--logo-ink-1); }
.ink-bottom { stop-color: var(--logo-ink-2); }
.logo-cut { fill: var(--logo-cut); }
.fig-blue-fill { fill: var(--fig-blue); }
.fig-green-fill { fill: var(--fig-green); }

#logo .kid { transform-box: fill-box; transform-origin: 50% 100%; animation: breathe 3.2s ease-in-out infinite; transition: opacity .15s; }
#logo .kid-green { animation-delay: -1.6s; }
#logo .parent { transform-box: fill-box; transform-origin: 50% 50%; animation: peek 4.8s ease-in-out infinite; }

@keyframes breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.13); } }
@keyframes peek { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* While a scene plays the two figures are out of the logo. */
.logo-away #fig-blue, .logo-away #fig-green { opacity: 0; }

/* Must come after the figure animation rules above: equal specificity, later wins. */
@media (prefers-reduced-motion: reduce) {
  #logo .kid, #logo .parent { animation: none; }
}

/* The scene canvas: covers the page and never intercepts clicks or typing. */
.stage-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* Show/Hide button beside a password box. */
.pw-row { display: flex; gap: .5rem; align-items: stretch; }
.pw-row input { flex: 1; min-width: 0; }
.pw-toggle {
  min-width: 4.5rem;
  min-height: 44px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

/* The password meter turns green once every rule is met. */
.meter span.full { background: var(--accent); }

/* Tapping the logo replays the animation. */
#logo { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* "Forgot password?" is a plain text link under the card. */
.forgot { margin: .5rem 0 0; text-align: center; }
.link-button {
  min-height: 44px;
  padding: 0 .5rem;
  color: var(--accent);
  background: transparent;
  border: 0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* The act title card: one centered line while the act sets up. */
.title-card { display: block; padding: 2rem 0; text-align: center; font-size: 1.8rem; }

/* Step 4: the Terms box and the runaway I Agree button. */
.terms { height: 8rem; overflow: auto; border: 2px solid var(--line); border-radius: 6px; padding: .5rem .75rem; margin: .5rem 0; font-size: .85rem; }
.terms p { margin: 0 0 .6rem; }
.agree-area { position: relative; width: 100%; height: 6rem; margin: .5rem 0; }
.agree { position: absolute; min-width: 44px; min-height: 44px; white-space: nowrap; transition: left .25s, top .25s; }
.agree.lying { transform: rotate(90deg); white-space: normal; width: 5.5rem; }
@media (prefers-reduced-motion: reduce) { .agree { transition: none; } }

/* Step 9: hold to groan. No selection, no touch menu, no scroll gesture while held. */
.hold {
  width: 100%;
  min-height: 56px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Steps 8 and 17: small gray text under an input. */
.small-gray { color: var(--muted); font-size: .75rem; margin: .35rem 0 .75rem; }

/* Step 12: the lie detector, or a still stamp when motion is reduced. */
.polygraph { display: flex; justify-content: center; margin: .75rem 0; color: var(--bad); }
.polygraph svg { width: 100px; height: 50px; }
.polygraph .needle { transform-origin: 50px 48px; animation: polygraph-sweep 1.5s ease-in-out; }
@keyframes polygraph-sweep {
  0% { transform: rotate(-60deg); }
  25% { transform: rotate(55deg); }
  50% { transform: rotate(-45deg); }
  75% { transform: rotate(40deg); }
  100% { transform: rotate(0deg); }
}
.stamp { display: inline-block; padding: .2rem .8rem; border: 3px solid var(--bad); border-radius: 4px; font-weight: bold; font-size: 1.6rem; letter-spacing: .15em; transform: rotate(-8deg); }

/* Step 13: the sentence box. */
.reading-box { min-height: 4.5rem; padding: .75rem; margin: .5rem 0; border: 2px solid var(--line); border-radius: 6px; font-size: 1.1rem; }

/* Step 14: the big timer and the Zero button. */
.big-timer { margin: .5rem 0; text-align: center; font-size: 3rem; font-variant-numeric: tabular-nums; }
.zero { width: 100%; min-height: 56px; font-size: 1.2rem; }
.question { margin: .5rem 0; font-size: 1.1rem; }

/* Step 15: the numerals alone, so a copy gets only them. */
.roman-date { user-select: all; font-weight: bold; }
