/* GPS Kids Speak. Same brand as the daily game: paper / navy / blue / yellow, DM Sans + Young Serif (self-hosted). */
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/fonts/dmsans.woff2) format("woff2"); }
@font-face { font-family: "Young Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/youngserif.woff2) format("woff2"); }
:root {
  --paper: #fbf8ef; --surface: #fff; --ink: #14213d; --muted: #4c5873; --line: #dbe3ee;
  --blue: #1458d4; --yellow: #f3bd35; --yellow-soft: #fff4d1; --red: #c23a2f; --green: #137a3c; --wa: #25d366; --navy: #14213d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.4; -webkit-font-smoothing: antialiased; }
button, textarea { font-family: inherit; color: inherit; }
a { color: var(--blue); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Every view = one phone screen */
.view { min-height: 100vh; min-height: 100svh; max-width: 520px; margin: 0 auto; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; }
.brand { font-family: "Young Serif", Georgia, serif; font-size: 1.3rem; }
.brand b { font-weight: 400; color: var(--blue); }
.bar-title { font-weight: 800; font-size: 1.05rem; }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); font-size: 1.15rem; font-weight: 800; cursor: pointer; display: grid; place-items: center; }
.pill { border-radius: 999px; padding: 8px 12px; font-weight: 800; font-size: .95rem; white-space: nowrap; border: 2px solid var(--line); background: var(--surface); min-height: 44px; display: inline-flex; align-items: center; gap: 4px; }
.band-pill { cursor: pointer; }
.band-pill::after { content: "▾"; font-size: .8rem; opacity: .7; }
.streak { background: var(--yellow-soft); border-color: var(--yellow); }
.streak.hot { background: var(--yellow); }
.kicker { margin: 0; display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.free-pill { background: var(--green); color: #fff; padding: 3px 9px; border-radius: 999px; letter-spacing: .08em; font-size: .72rem; }
h1 { font-family: "Young Serif", Georgia, serif; font-weight: 400; margin: 0; text-wrap: balance; }
.privacy { margin: 0; font-size: .82rem; color: var(--muted); text-align: center; }
.parent { margin: 0; font-size: .82rem; color: var(--ink); text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.parent a { font-weight: 700; }

/* Buttons */
.btn { display: block; width: 100%; text-align: center; text-decoration: none; font-weight: 800; font-size: 1.25rem; padding: 17px 16px; border-radius: 20px; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-go { background: var(--blue); color: #fff; box-shadow: 0 10px 26px rgba(20, 88, 212, .28); }
.btn-go.stop { background: var(--red); box-shadow: 0 10px 26px rgba(194, 58, 47, .28); }
.btn-wa { background: var(--wa); color: #0b3d1f; font-size: 1.05rem; padding: 14px; }
.actions { display: grid; gap: 6px; }
.sub-actions { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.link-btn { background: none; border: none; color: var(--blue); font-weight: 700; font-size: .95rem; padding: 10px 10px; min-height: 44px; cursor: pointer; }

/* Pick */
.pick-hero { text-align: center; display: grid; gap: 10px; justify-items: center; padding-top: 6px; }
.pick-hero h1 { font-size: 2.3rem; line-height: 1.05; }
.thesis { margin: 0; font-size: 1.05rem; max-width: 30ch; }
.bands { display: grid; gap: 10px; flex: 1; align-content: center; }
.band { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 12px 16px; cursor: pointer; }
.band.on { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20, 88, 212, .15); }
.band .e { font-size: 2rem; width: 44px; text-align: center; }
.band strong { display: block; font-size: 1.2rem; }
.band small { color: var(--muted); font-size: .95rem; }

/* Home */
.xp { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 800; color: var(--muted); }
.xp-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.xp-bar i { display: block; height: 100%; width: 0; background: var(--yellow); border-radius: 99px; transition: width .6s; }
.challenge { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; text-align: center; align-items: center; }
.type-chip { margin: 0; display: inline-block; background: var(--yellow-soft); border: 2px solid var(--yellow); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 1rem; }
.type-chip.small { font-size: .9rem; padding: 5px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prompt { font-size: 1.85rem; line-height: 1.18; }
.prompt.long { font-size: 1.5rem; }
.goal { margin: 0; font-size: 1rem; color: var(--muted); max-width: 34ch; }
.goal b { color: var(--ink); }
.done-row { margin: 0; text-align: center; font-weight: 800; color: var(--green); }
.done-row.nudge { color: var(--red); }

/* Record */
.rec-prompt { margin: 0; font-family: "Young Serif", Georgia, serif; font-size: 1.2rem; line-height: 1.25; text-align: center; }
.timer-wrap { text-align: center; }
.timer { font-size: 3.4rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.timer.rec::before { content: ""; display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: var(--red); margin-right: 10px; vertical-align: middle; animation: blink 1s infinite; }
.t-bar { position: relative; height: 10px; border-radius: 99px; background: var(--line); margin: 10px 0 4px; overflow: visible; }
.t-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--blue); }
.t-bar i.met { background: var(--green); }
.t-bar b { position: absolute; top: -4px; width: 3px; height: 18px; background: var(--ink); border-radius: 2px; }
.t-note { margin: 0; font-size: .85rem; color: var(--muted); font-weight: 700; }
.transcript { flex: 1; min-height: 120px; width: 100%; resize: none; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); padding: 12px 14px; font-size: 1.1rem; line-height: 1.45; }
.transcript:focus { border-color: var(--blue); outline: none; }
.rec-status { margin: 0; text-align: center; font-size: .9rem; color: var(--muted); min-height: 1.3em; }

/* Feedback */
.stars { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.skill { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px 12px; }
.skill span { display: block; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.skill b { font-size: 1.5rem; letter-spacing: 2px; color: var(--yellow); font-weight: 400; }
.skill b i { font-style: normal; color: #c9d2df; }
.stats { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: .85rem; }
.stat b { font-weight: 800; }
.coach { flex: 1; background: var(--surface); border: 2px solid var(--yellow); border-radius: 18px; padding: 10px 14px; overflow: auto; }
.coach-h { margin: 0 0 4px; font-weight: 800; }
.coach ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.coach li { padding-left: 28px; position: relative; font-size: 1rem; line-height: 1.35; }
.coach li::before { position: absolute; left: 0; top: 0; }
.coach li.well::before { content: "✅"; }
.coach li.next::before { content: "👉"; }
.coach li.loading { padding-left: 0; color: var(--muted); }
.coach li.loading::after { content: "…"; animation: blink 1s infinite; }
.answer { margin: 0; font-size: .9rem; background: var(--yellow-soft); border-radius: 12px; padding: 6px 10px; }
.reward { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.reward span { font-weight: 800; background: var(--navy); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: .9rem; }

/* Share */
.card-wrap { flex: 1; display: grid; place-items: center; min-height: 0; }
.card-wrap img { max-width: 100%; max-height: 52svh; width: auto; height: auto; border-radius: 18px; box-shadow: 0 12px 32px rgba(20, 33, 61, .18); background: var(--surface); }
.share-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.share-row .native { grid-column: 1 / -1; }
.sh { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; font-size: .82rem; text-decoration: none; color: var(--ink); cursor: pointer; padding: 6px 4px; }
.sh svg { width: 22px; height: 22px; }
.sh.native { flex-direction: row; gap: 8px; font-size: 1.1rem; font-weight: 800; background: var(--blue); border-color: var(--blue); color: #fff; min-height: 52px; }
.sh.wa { color: #0b6b33; }

/* Sheet + modal */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(20, 33, 61, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; background: var(--paper); border-radius: 22px 22px 0 0; padding: 18px 18px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.sheet-h { margin: 0; font-weight: 800; font-size: 1.2rem; text-align: center; }
.sheet-text { margin: 0; font-size: .95rem; color: var(--muted); text-align: center; }
.modal { border-radius: 22px; margin: auto 18px; text-align: center; }
#modal { align-items: center; }
.modal-emoji { font-size: 4rem; width: 110px; height: 110px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); box-shadow: 0 0 0 8px var(--yellow-soft); animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.modal-h { margin: 6px 0 0; font-family: "Young Serif", Georgia, serif; font-size: 1.8rem; }
.modal-p { margin: 0; font-size: 1.05rem; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: .95rem; z-index: 50; max-width: 90vw; text-align: center; }

@keyframes blink { 50% { opacity: .25; } }
@keyframes pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (max-height: 700px) { .prompt { font-size: 1.5rem; } .timer { font-size: 2.6rem; } .btn { padding: 14px; } .pick-hero h1 { font-size: 1.9rem; } .band { padding: 8px 14px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.inline-link { background: none; border: none; padding: 4px 2px; font: inherit; font-weight: 700; color: var(--blue); text-decoration: underline; cursor: pointer; }

/* Recording */
.stage { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.mic-panel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 14px; min-height: 120px; }
.mic-panel.live { border-color: var(--red); }
.meter { display: flex; align-items: center; gap: 5px; height: 56px; }
.meter i { width: 9px; height: 8px; border-radius: 6px; background: var(--line); transition: height .08s; }
.mic-panel.live .meter i { background: var(--red); }
.mic-msg { margin: 0; font-size: 1.05rem; font-weight: 700; max-width: 30ch; }
.captions { margin: 0; font-size: .95rem; color: var(--muted); max-height: 5.5em; overflow: auto; }
.err-panel { background: var(--yellow-soft); border: 2px solid var(--yellow); border-radius: 18px; padding: 14px; display: grid; gap: 8px; }
.err-h { margin: 0; font-weight: 800; font-size: 1.1rem; }
.err-p { margin: 0; font-size: .98rem; }
.err-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.play-wrap { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 6px 10px; font-weight: 700; font-size: .9rem; }
.play-wrap audio { flex: 1; min-width: 0; height: 40px; }
.play-wrap.small { padding: 2px 8px; }
.play-wrap.small audio { height: 34px; }
.transcript { min-height: 90px; }
.nowords { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-weight: 700; text-align: center; }
.coach-src { float: right; font-size: .75rem; font-weight: 800; letter-spacing: .04em; border-radius: 999px; padding: 2px 9px; background: var(--line); color: var(--ink); }
.coach-src.ai { background: var(--blue); color: #fff; }
.coach-why { margin: 0 0 6px; font-size: .85rem; color: var(--muted); }
.heard { margin-top: 6px; font-size: .9rem; }
.heard summary { cursor: pointer; font-weight: 700; color: var(--blue); }
.heard p { margin: 4px 0 0; color: var(--muted); }
/* My recordings */
.recs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1; align-content: start; overflow: auto; }
.recs li { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; display: grid; gap: 6px; }
.rec-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 800; font-size: .92rem; }
.rec-p { margin: 0; font-size: .88rem; color: var(--muted); }
.rec-row { display: flex; align-items: center; gap: 8px; }
.rec-row audio { flex: 1; min-width: 0; height: 36px; }
.del { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.1rem; flex: none; }
.recs .empty { text-align: center; color: var(--muted); font-weight: 700; }
