/* Andika (SIL, OFL 1.1, see fonts/OFL.txt): made for beginning readers, with
   single-story a and g, a serifed capital I and a distinct l. */
@font-face { font-family: "Andika"; src: url("fonts/andika-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("fonts/andika-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #fff8ec;
  --card: #ffffff;
  --ink: #2b2118;
  --muted: #7a6a5a;
  --accent: #f2a33a;
  --accent-ink: #5a3500;
  --go: #3fa66b;
  --bad: #e0614a;
  --line: #ecdcc4;
  /* Single-story "a" and "g", like the letters kids learn to read. */
  --letters: "Andika", "Century Gothic", "Futura", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 17px/1.4 "Andika", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .45; }

.screen { max-width: 720px; margin: 0 auto; padding: 16px; min-height: 100vh; display: flex; flex-direction: column; gap: 16px; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; flex: 1; text-align: center; }
.title { font-family: var(--letters); font-size: 32px; margin: 0; }
.hint, .mode, .credit { color: var(--muted); margin: 0; }
.credit { font-size: 13px; text-align: center; }
.error { color: var(--bad); min-height: 1.2em; margin: 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.bar { display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; }
.bar h1 { font-size: 20px; text-align: center; margin: 0; }
.link { background: none; border: 0; padding: 8px; color: var(--accent-ink); font-weight: 600; text-align: left; }

.big { border: 0; border-radius: 16px; padding: 14px 22px; background: var(--accent); color: #fff; font-weight: 700; font-size: 18px; }
.big.go { background: var(--go); }
.big.rec { background: var(--bad); }
.card { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 16px; }

/* home */
.play { width: 180px; height: 180px; border-radius: 50%; border: 0; background: var(--go); color: #fff; font-size: 80px; padding-left: 18px; box-shadow: 0 8px 0 #2d7a4e; }
.play:active { transform: translateY(4px); box-shadow: 0 4px 0 #2d7a4e; }
.start-card { display: flex; flex-direction: column; gap: 14px; align-items: center; max-width: 360px; }
.start-card p { margin: 0; }
.left-to-record { border: 2px dashed var(--accent); background: #fff1dc; color: var(--accent-ink); border-radius: 14px; padding: 10px 18px; font-weight: 700; }
.parent { width: 100%; max-width: 420px; border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); }
.parent summary { cursor: pointer; font-weight: 600; list-style-position: inside; }
.parent nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.parent .mode { margin-top: 8px; }

/* setup */
.form { display: flex; flex-direction: column; gap: 18px; }
.form label, .field { display: flex; flex-direction: column; gap: 8px; font-weight: 600; }
.form small { font-weight: 400; color: var(--muted); }
.label { font-weight: 600; }
input[type="text"] { font: inherit; padding: 12px; border-radius: 12px; border: 2px solid var(--line); background: #fff; }
.choice { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.choice span { color: var(--muted); font-weight: 400; }
.picked { border-color: var(--accent) !important; background: #fff1dc; }
.segs { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { flex: 1 1 auto; padding: 12px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-family: var(--letters); font-size: 20px; white-space: nowrap; }

/* recording */
.done-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #e4f5ea; border: 2px solid #a9dcbc; border-radius: 18px; padding: 14px 16px; font-size: 18px; }
.letter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.record-panel { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.tip { margin: 0; max-width: 34em; min-height: 4.2em; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 440px; }
.slots .big { padding: 14px 6px; font-size: 17px; white-space: nowrap; }
.status { color: var(--muted); min-height: 1.4em; margin: 0; }

/* letters and pictures */
.tile { font-family: var(--letters); font-size: 64px; line-height: 1; aspect-ratio: 1; border-radius: 22px; border: 3px solid var(--line); background: #fff; box-shadow: 0 5px 0 var(--line); }
.tile.small { font-size: 22px; letter-spacing: -1px; border-radius: 12px; box-shadow: 0 3px 0 var(--line); }
.tile.done { background: #e4f5ea; border-color: #a9dcbc; }
/* Line height leaves room for descenders (p g j q y) so they don't overlap what's below. */
.big-letter { font-family: var(--letters); font-size: 150px; line-height: 1.3; font-weight: 700; }
.record-panel .big-letter { font-size: 110px; }
.picture { border: 3px solid var(--line); background: #fff; border-radius: 24px; padding: 8px; box-shadow: 0 5px 0 var(--line); }
.picture img { display: block; width: 100%; height: auto; }
.big-pic { width: min(62vw, 300px); }

/* play */
.play-bar { grid-template-columns: 48px 1fr 48px; }
.play-bar .link { font-size: 24px; color: var(--muted); }
.dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.dot.on { background: var(--go); }
.stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; flex: 1; min-height: 220px; }
.replay { border: 0; background: none; font-size: 36px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding-bottom: 24px; }
.choices button:disabled { opacity: 1; }
.choices button:disabled:not(.right):not(.wrong) { opacity: .5; }
.choices .right { border-color: var(--go); background: #e4f5ea; box-shadow: 0 5px 0 var(--go); }
.choices .wrong { border-color: var(--bad); animation: shake .4s; }
.speaking { border-color: var(--accent); transform: scale(1.05); transition: transform .15s; }
.pair { display: flex; align-items: center; gap: 24px; }
.pair img { width: 150px; height: 150px; }
.pair { flex-wrap: wrap; justify-content: center; gap: 12px; }
.pair img.anchor-img { width: 130px; height: 130px; }
.pair .big-letter { font-size: 110px; }
.meet { display: flex; align-items: center; gap: 18px; border: 3px solid var(--line); background: #fff; border-radius: 28px; padding: 16px 24px; box-shadow: 0 5px 0 var(--line); }
.meet img { width: min(42vw, 200px); height: auto; }
.choices.one { grid-template-columns: 1fr; }
.next { font-size: 24px; padding: 18px; }
.cheer { animation: pop .5s; }
.stars { font-size: 52px; letter-spacing: 4px; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* progress */
.card h2 { font-size: 17px; margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--letters); font-size: 26px; min-width: 52px; padding: 4px 10px; border-radius: 12px; background: #f4ece0; display: inline-flex; flex-direction: column; align-items: center; }
.chip small { font-family: system-ui, sans-serif; font-size: 11px; color: var(--muted); }
.chip.learning { background: #fde3dc; }
.chip.getting { background: #fff1dc; }
.chip.known { background: #e4f5ea; }

@media (max-width: 420px) {
  .tile { font-size: 52px; }
  .big-letter { font-size: 120px; }
  .record-panel .big-letter { font-size: 96px; }
  .choices { gap: 10px; }
  .pair img, .pair img.anchor-img { width: 96px; height: 96px; }
  .pair .big-letter { font-size: 84px; }
}


/* about */
.lead { margin: 0; font-size: 18px; }
.about h2 { font-size: 18px; margin: 0 0 8px; }
.about p { margin: 0; }
.about ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.about .refs { font-size: 14px; }
.about a { color: var(--accent-ink); }

/* Who's playing? and child switching */
.who { display: grid; gap: 12px; width: min(100%, 360px); margin: 8px 0 16px; }
.who-name { font-size: 26px; }
.link.switch { align-self: flex-end; font-size: 15px; }
.link.danger { color: #b3261e; margin-top: 18px; text-align: center; }
