/* Story recorder styles. System fonts only (no font downloads). Big type, big targets, warm cream. */

:root {
  --rose: #A8616C;
  --blue: #4F6378;
  --gold: #D8BA77;
  --gold-light: #EBD195;
  --gold-dark: #7d6226;
  --cream: #FBF5E9;
  --card: #FFFDF8;
  --ink: #2B2320;
  --muted: #5E514A;
  --line: #E4D8C0;
  --red: #C0392B;
  --ed: var(--rose);                 /* edition color for text and borders */
  --ed-bg: var(--rose);              /* edition color for bands and buttons (split for both) */
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body[data-ed="dad"]  { --ed: var(--blue); --ed-bg: var(--blue); }
body[data-ed="both"] { --ed: var(--blue); --ed-bg: linear-gradient(90deg, var(--rose) 0 50%, var(--blue) 50% 100%); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--cream); color: var(--ink);
  font: 21px/1.5 var(--sans);
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; }

/* Top band */
.band {
  background: var(--ed-bg); color: #fff; border-bottom: 4px double var(--gold);
  padding: 10px 16px calc(10px) ; padding-top: max(10px, env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.band-title { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--gold-light); }
.band-actions { display: flex; gap: 8px; }
.pill {
  min-height: 48px; padding: 8px 16px; border-radius: 24px; border: 2px solid var(--gold-light);
  background: rgba(0,0,0,.18); color: #fff; font-size: 18px;
}

main { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 18px 16px 24px; }
.screen { display: flex; flex-direction: column; gap: 16px; }

/* Start screen */
.cover {
  background: var(--ed-bg); color: #fff; text-align: center; border-radius: 14px;
  padding: 26px 18px 22px; border: 3px double var(--gold); box-shadow: inset 0 0 0 6px rgba(216,186,119,.35);
}
body.picking .cover { background: linear-gradient(90deg, var(--rose) 0 50%, var(--blue) 50% 100%); }
.cover-small { letter-spacing: .3em; text-transform: uppercase; font-family: var(--serif); color: var(--gold-light); font-size: 17px; }
.cover-rule { width: 90px; height: 2px; background: var(--gold); margin: 10px auto; position: relative; }
.cover-rule::after { content: ""; position: absolute; left: 50%; top: -3px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--gold); }
.cover-title { font-family: var(--serif); font-style: italic; font-weight: normal; font-size: 34px; margin: 4px 0 8px; color: var(--gold-light); }
.lead { margin: 0; font-size: 20px; }
.h-step { font-family: var(--serif); font-weight: normal; font-size: 26px; margin: 8px 0 0; }
.h-screen { font-family: var(--serif); font-weight: normal; font-size: 32px; margin: 4px 0 0; color: var(--ed); }
.center { text-align: center; }

.choices { display: flex; flex-direction: column; gap: 12px; }
.choice {
  min-height: 92px; border-radius: 14px; border: 3px double var(--gold); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px;
}
.choice-small { letter-spacing: .25em; text-transform: uppercase; font-size: 15px; color: var(--gold-light); font-family: var(--serif); }
.choice-name { font-family: var(--serif); font-style: italic; font-size: 32px; color: var(--gold-light); }
.ed-mom { background: var(--rose); }
.ed-dad { background: var(--blue); }
.ed-both { background: linear-gradient(90deg, var(--rose) 0 50%, var(--blue) 50% 100%); }

.mode-card {
  text-align: left; background: var(--card); border: 3px solid var(--ed); border-radius: 14px;
  padding: 18px; display: flex; flex-direction: column; gap: 4px; min-height: 120px;
}
.mode-card:first-of-type { border-width: 4px; box-shadow: 0 0 0 4px rgba(216,186,119,.45); }
.mode-name { font-family: var(--serif); font-size: 30px; color: var(--ed); }
.mode-sub { font-weight: 700; font-size: 21px; }
.mode-desc { color: var(--muted); font-size: 19px; }

/* Buttons */
.big {
  width: 100%; min-height: 72px; border-radius: 40px; font-size: 26px; font-weight: 700;
  border: 0; padding: 12px 20px; display: flex; align-items: center; justify-content: center; gap: 12px;
}
.main { background: var(--ed-bg); color: #fff; border: 3px solid var(--gold); box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.main:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.alt { background: var(--card); color: var(--ink); border: 3px solid var(--ed); }
.danger-btn { background: var(--red); color: #fff; }
.row { display: flex; gap: 10px; }
.sec {
  flex: 1; min-height: 56px; border-radius: 30px; background: var(--card); border: 2px solid var(--line);
  font-size: 19px; font-weight: 600; padding: 8px 10px; white-space: nowrap;
}
.sec.wide { width: 100%; flex: none; }
.link-btn {
  background: none; border: 0; min-height: 52px; font-size: 19px; color: var(--ed);
  text-decoration: underline; text-underline-offset: 4px; padding: 8px;
}
.link-btn.danger { color: var(--red); }
.pill-lg { min-height: 52px; padding: 8px 18px; border-radius: 28px; border: 2px solid var(--ed); background: var(--card); font-size: 19px; font-weight: 600; }

/* Golden words toggle */
.gold-toggle {
  min-height: 52px; padding: 8px 18px; border-radius: 28px; border: 3px solid var(--gold);
  background: var(--card); color: var(--ink); font-size: 19px; font-weight: 700;
}
.gold-toggle .star { color: var(--gold-dark); font-size: 24px; vertical-align: -2px; }
.gold-toggle[aria-pressed="true"] { background: var(--gold); color: #2b2008; }
.gold-toggle[aria-pressed="true"] .star { color: #2b2008; }
.gold-toggle.small { min-height: 48px; font-size: 17px; padding: 6px 14px; }

/* Question screen */
.q-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 19px; color: var(--muted); align-items: baseline; }
.q-chapter { font-family: var(--serif); font-style: italic; color: var(--ed); font-size: 21px; }
.q-count { white-space: nowrap; font-weight: 600; }
.progress { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--gold); transition: width .3s; }
.big-progress { height: 18px; border-radius: 9px; }
.question {
  font-family: var(--serif); font-size: 32px; line-height: 1.3; margin: 14px 0 6px; min-height: 3.9em;
}
@media (min-width: 600px) { .question { font-size: 38px; } }
.answered { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.answered-tick { font-weight: 700; color: #2e6b3a; font-size: 20px; margin-right: 4px; }
.mic-btn { min-height: 88px; font-size: 30px; }
.mic-ico { font-size: 34px; }

/* Talking screen */
.talk-q { font-family: var(--serif); font-size: 24px; line-height: 1.35; margin: 4px 0; color: var(--muted); }
.rec-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; }
.rec-dot {
  width: 150px; height: 150px; border-radius: 50%; background: var(--red);
  display: flex; align-items: center; justify-content: center; font-size: 64px;
  box-shadow: 0 0 0 0 rgba(192,57,43,.6); animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(192,57,43,.55); }
  70% { box-shadow: 0 0 0 30px rgba(192,57,43,0); }
  100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); }
}
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
.rec-time { font-size: 48px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rec-label { color: var(--muted); font-size: 20px; }

/* Mic and problem screens */
.mic-art { font-size: 72px; text-align: center; }
.body-text { font-size: 21px; margin: 0; }
.body-text p { margin: 0 0 12px; }
.body-text ol { padding-left: 1.3em; margin: 0 0 12px; }
.hint { color: var(--muted); font-size: 18px; margin: 0; }

/* Question list */
.ch-block { border-top: 2px solid var(--gold); padding-top: 6px; margin-top: 8px; }
.ch-head {
  width: 100%; min-height: 60px; text-align: left; background: none; border: 0; padding: 8px 0;
  font-family: var(--serif); font-size: 25px; color: var(--ed); display: flex; justify-content: space-between; align-items: center;
}
.ch-head .ch-count { font-family: var(--sans); font-size: 17px; color: var(--muted); }
.q-item {
  width: 100%; min-height: 56px; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin: 6px 0; font-size: 19px; display: flex; gap: 10px; align-items: flex-start;
}
.q-item.current { border: 3px solid var(--ed); }
.q-item .mark { width: 1.4em; flex: none; text-align: center; font-weight: 700; }
.q-item .mark.done { color: #2e6b3a; }
.q-item .mark.gold { color: var(--gold-dark); }

/* Finish */
.card { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--gold); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-h { font-family: var(--serif); font-weight: normal; font-size: 26px; margin: 0; }
.warn { background: #fff3d6; border: 2px solid var(--gold); border-radius: 10px; padding: 12px; font-size: 19px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 19px; }
.check input { width: 30px; height: 30px; accent-color: var(--blue); }

/* Toast after saving an answer */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(8px + env(safe-area-inset-top));
  width: min(640px, calc(100% - 24px)); background: #2B2320; color: #fff; border-radius: 16px;
  padding: 10px 12px 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 20px; z-index: 20;
}

/* Erase dialog */
.dialog-back { position: fixed; inset: 0; background: rgba(30,20,15,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 30; }
.dialog { background: var(--cream); border-radius: 16px; padding: 22px 18px; max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 12px; border: 3px double var(--gold); }
.dialog h2 { font-family: var(--serif); font-weight: normal; font-size: 30px; margin: 0; color: var(--red); }
.dialog p { margin: 0; font-size: 20px; }

.foot {
  text-align: center; font-size: 17px; color: var(--muted); padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
