/* app.css: phone-first, calm, big tap targets. Light and dark. */
:root {
  --bg: #f6f7f5; --card: #ffffff; --ink: #1d2422; --muted: #5f6b67; --line: #dde3e0;
  --teal: #0f7c74; --teal-ink: #ffffff; --teal-soft: #dff1ee; --good: #1f8a4c; --good-soft: #e3f4ea;
  --warm: #b4570d; --warm-soft: #fbeee2; --bad-soft: #f6e9e9; --gold: #c99a06;
  --radius: 16px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #101514; --card: #19201f; --ink: #e9efed; --muted: #9aa8a4; --line: #2b3533;
    --teal: #3cb8ac; --teal-ink: #062421; --teal-soft: #173a36; --good: #4cc47d; --good-soft: #17301f;
    --warm: #f0a35c; --warm-soft: #3a2a1a; --bad-soft: #3a2222; --shadow: none; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
#screen { max-width: 560px; margin: 0 auto; padding: calc(16px + var(--safe-t)) 16px calc(96px + var(--safe-b)); min-height: 100vh; }
h1 { font-size: 30px; line-height: 1.15; margin: 8px 0 6px; letter-spacing: -.01em; }
h2 { font-size: 22px; margin: 18px 0 8px; } h3 { font-size: 18px; margin: 18px 0 6px; } h4 { margin: 10px 0 4px; font-size: 16px; }
p { margin: 8px 0; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.sub { color: var(--muted); margin-top: 0; font-size: 18px; }
.eyebrow { color: var(--muted); font-size: 14px; margin: 4px 0 8px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--teal-soft); color: var(--teal); margin: 0 0 6px; }
.row { display: flex; gap: 10px; align-items: center; margin: 12px 0; } .row.wrap { flex-wrap: wrap; } .row.equal > * { flex: 1; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card h3 { margin-top: 0; }

/* buttons */
button { font: inherit; color: inherit; }
.btn { border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 600; min-height: 48px; cursor: pointer; }
.btn.primary { background: var(--teal); color: var(--teal-ink); }
.btn.soft { background: var(--teal-soft); color: var(--teal); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn:disabled { opacity: .5; }
.link { background: none; border: 0; color: var(--teal); padding: 6px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: #b33; }

/* home */
.go { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 150px; margin: 18px 0 6px;
  border: 0; border-radius: 28px; background: var(--teal); color: var(--teal-ink); box-shadow: 0 8px 24px rgba(15,124,116,.28); cursor: pointer; }
.go:active { transform: scale(.985); }
.go-word { font-size: 54px; font-weight: 800; line-height: 1; } .go-sub { font-size: 15px; opacity: .92; margin-top: 8px; padding: 0 12px; text-align: center; }
.go:disabled { background: var(--line); color: var(--muted); box-shadow: none; }
.why-today { color: var(--muted); font-size: 14px; text-align: center; margin: 0 0 14px; }
.today { display: flex; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.today > div { display: flex; flex-direction: column; } .label { font-size: 13px; color: var(--muted); }
.pips { display: flex; gap: 6px; margin-top: 6px; } .pip { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--teal); } .pip.on { background: var(--teal); }
.streak { font-size: 20px; font-weight: 700; }
.week { display: flex; gap: 6px; align-items: center; margin: 12px 0 4px; }
.wd { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.wd.done { background: var(--teal); color: var(--teal-ink); border-color: var(--teal); } .wd.freeze { background: var(--teal-soft); color: var(--teal); } .wd.future { opacity: .5; }
.notice { background: var(--teal-soft); color: var(--ink); padding: 10px 12px; border-radius: 12px; }
.class-link { display: block; margin: 18px auto 0; }
.verse { font-size: 14px; color: var(--muted); font-style: italic; margin: 22px 8px 6px; text-align: center; }
.verse .ref { font-style: normal; font-size: 13px; } .lord { font-variant: small-caps; }

/* lesson */
.ltop { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; padding: 6px 0; background: var(--bg); z-index: 2; }
.close { border: 0; background: none; font-size: 20px; color: var(--muted); width: 36px; height: 36px; }
.progress { flex: 1; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; } .progress i { display: block; height: 100%; background: var(--teal); border-radius: 99px; transition: width .3s; }
.q .prompt { font-size: 21px; line-height: 1.35; margin: 6px 0 14px; } .q .prompt svg { max-width: 100%; height: auto; display: block; margin: 10px auto; color: var(--ink); }
.def { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px; font-size: 18px; }
.gap { display: inline-block; min-width: 3em; border-bottom: 2px solid var(--teal); color: transparent; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); min-height: 54px; cursor: pointer; font-size: 17px; }
.opt.good { border-color: var(--good); background: var(--good-soft); } .opt.bad { border-color: var(--warm); background: var(--warm-soft); } .opt.gone { opacity: .25; text-decoration: line-through; }
.typed { display: flex; flex-direction: column; gap: 10px; }
.in, input:not([type=checkbox]):not([type=date]):not([type=time]), select, textarea { font: inherit; font-size: 18px; padding: 13px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); width: 100%; }
.in:focus, textarea:focus { outline: none; border-color: var(--teal); }
input[type=date], input[type=time] { font: inherit; padding: 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }
.part { display: flex; gap: 8px; align-items: center; } .part span { min-width: 2.2em; font-weight: 600; }
.keys { display: flex; flex-wrap: wrap; gap: 6px; } .key { min-width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 18px; }
.qbar { display: flex; justify-content: space-between; margin-top: 8px; }
.hint { display: none; } .hint.show { display: block; background: var(--teal-soft); padding: 10px 12px; border-radius: 12px; }
.fb { display: none; } .fb.show { display: block; margin-top: 16px; padding: 14px 16px; border-radius: 14px; }
.fb.right { background: var(--good-soft); } .fb.wrong, .fb.skip { background: var(--warm-soft); }
.fb-line { font-size: 19px; font-weight: 600; margin-top: 0; } .why { color: var(--ink); }
.fb .next { width: 100%; }
.steps summary, .model summary, .extra summary { cursor: pointer; color: var(--teal); font-weight: 600; }
.shake { animation: shake .35s; } @keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.clues { padding-left: 22px; } .clues li { margin: 6px 0; font-size: 18px; }
.mic { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 64px; border-radius: 16px; border: 2px solid var(--teal); background: var(--teal-soft); color: var(--teal); font-weight: 700; font-size: 18px; margin-bottom: 8px; }
.mic-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--teal); } .mic.on .mic-dot { background: #d33; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .5; } }
.heard { min-height: 1.4em; }
.picked { min-height: 40px; padding-left: 22px; } .picked li { margin: 6px 0; }
.pool, .mcol { display: flex; flex-direction: column; gap: 8px; }
.chip { text-align: left; padding: 11px 13px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font-size: 16px; cursor: pointer; }
.chip.sel { border-color: var(--teal); background: var(--teal-soft); } .chip.good { border-color: var(--good); background: var(--good-soft); opacity: .7; } .chip.bad { border-color: var(--warm); background: var(--warm-soft); }
.chip.nudge { animation: shake .3s; }
.match { display: grid; grid-template-columns: 2fr 3fr; gap: 10px; } .match .chip.d { font-size: 14px; }

/* explainer */
.explainer h2 { margin-top: 0; font-size: 26px; } .explainer .big, .long .big { font-size: 19px; line-height: 1.5; }
.method { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 12px; padding: 4px 14px 8px; margin: 12px 0; }
.method ol { margin: 6px 0; padding-left: 20px; }
.ex-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; } .ex-buttons .btn { flex: 1 1 auto; min-height: 44px; padding: 10px 12px; }
.explainer .go, .explainer > .btn.primary { width: 100%; }
.more-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: 10px 0; position: relative; }
.more-card h4 { margin-top: 2px; }
.ai-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; padding: 1px 6px; border-radius: 6px; background: var(--warm-soft); color: var(--warm); }
.more-card .ai-tag { position: absolute; right: 10px; top: 10px; }
.wsteps li { margin: 8px 0; }

/* finish */
.finish { text-align: center; padding-top: 30px; } .finish .row { justify-content: center; } .finish .btn { min-width: 140px; }
.moment { font-style: italic; }
.presults { list-style: none; padding: 0; text-align: left; } .presults li { padding: 6px 0; border-bottom: 1px solid var(--line); } .presults .pass { color: var(--muted); }

/* subjects */
.subject { display: grid; grid-template-columns: 1fr; gap: 6px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 8px 0; cursor: pointer; }
.subject > span:first-child { font-weight: 600; } .subject.off { opacity: .45; }
.bar { position: relative; display: block; height: 8px; border-radius: 99px; background: var(--line); overflow: visible; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--teal); } .bar b { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--ink); opacity: .55; }
.topics { list-style: none; padding: 0; } .topics li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.tname { flex: 1; text-align: left; background: none; border: 0; padding: 12px 0; cursor: pointer; }
.topics li.started .tname::before { content: "◐ "; color: var(--teal); } .topics li.settled .tname::before { content: "● "; color: var(--teal); }
.inclass { font-size: 13px; color: var(--muted); white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.pbar { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: center; margin: 10px 0; font-size: 15px; }
.race > div { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 8px; margin: 6px 0; } .race i { display: block; height: 12px; border-radius: 99px; background: var(--teal); } .race .ghost i { background: var(--muted); opacity: .5; }
.summary { white-space: pre-wrap; font: 15px/1.5 inherit; font-family: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-size: 15px; color: var(--muted); } .field.sm { flex: 1; }
.tick { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--teal); flex: none; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 10px 0; }
.seg button { flex: 1; border: 0; background: var(--card); padding: 10px; min-height: 44px; } .seg button.on { background: var(--teal); color: var(--teal-ink); }
.seg.tiny { margin: 4px 0; } .seg.tiny button { padding: 6px 8px; min-height: 36px; font-size: 13px; }
.mtopics { list-style: none; padding: 0; } .mtopics li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.qrow { display: grid; grid-template-columns: 54px 60px 10px 60px 1fr; gap: 6px; align-items: center; margin: 6px 0; } .qrow input, .qrow select { padding: 8px; font-size: 15px; }
.focus li { font-weight: 600; margin: 4px 0; }
.checks { list-style: none; padding: 0; } .checks label { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; }
.essay { min-height: 220px; line-height: 1.5; } .source { background: var(--card); border-left: 4px solid var(--line); padding: 10px 14px; border-radius: 8px; font-size: 16px; }
.points { list-style: none; padding: 0; } .points label { display: flex; gap: 10px; padding: 6px 0; align-items: flex-start; }

/* map */
.region { margin: 14px 0; } .places { display: flex; flex-wrap: wrap; gap: 6px; }
.place { display: inline-block; width: 18px; height: 18px; border-radius: 5px; vertical-align: middle; }
.place.fog { background: var(--line); } .place.explored { background: var(--teal-soft); border: 2px solid var(--teal); } .place.settled { background: var(--teal); }
.legend { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* party */
.party { position: fixed; inset: 0; background: var(--teal); color: var(--teal-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; z-index: 50; transition: background .2s; }
.party.flash-got { background: var(--good); } .party.flash-pass { background: var(--warm); }
.pt-top { position: absolute; top: calc(10px + var(--safe-t)); left: 20px; right: 20px; display: flex; justify-content: space-between; font-size: 26px; font-weight: 800; }
.pt-word { font-size: clamp(40px, 11vw, 96px); font-weight: 800; text-align: center; line-height: 1.05; }
.pt-clues { font-size: 16px; opacity: .85; max-width: 640px; margin-top: 16px; }
.pt-tap { position: absolute; inset: 0; display: flex; z-index: -1; } .pt-tap button { flex: 1; background: transparent; border: 0; color: transparent; }
.pt-stop { position: absolute; bottom: calc(14px + var(--safe-b)); color: var(--teal-ink); }
.party .pt-tap { z-index: 0; } .party > *:not(.pt-tap) { position: relative; z-index: 1; pointer-events: none; } .party .pt-stop, .party .pt-top { pointer-events: auto; position: absolute; }

/* nav */
#nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); z-index: 10; }
#nav button { flex: 1; border: 0; background: none; color: var(--muted); font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; min-height: 48px; }
#nav button.on { color: var(--teal); font-weight: 700; } #nav .ico { font-size: 20px; line-height: 1.1; }
.settings h3 { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 14px; }
details { margin: 10px 0; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: .85em; line-height: 1; } .frac sup, .frac sub { font-size: 1em; vertical-align: baseline; }
