@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fredoka:wght@400;500;600&display=swap');
:root{--ink:#243d39;--green:#255f4d;--cream:#faf8f0;--muted:#5e6d66;--line:#dce3d7;--selected:#e0ecd9;--hero:#eaf0df;--planet:#f8d786;--orbit:#f5ebca;--star:#32634e;--float:#fffdf6;--pill:#ecf1e7;--track:#e4e9df;--progress:#5c8d65;--success:#edf3e6;--focus:#ad5c0d;--ending:#fff2d5}
:root[data-reader="moon"]{--ink:#352d51;--green:#65449a;--cream:#f8f5fd;--muted:#70647d;--line:#e1d8ee;--selected:#e9ddf7;--hero:#ece3f7;--planet:#c8b3ee;--orbit:#e1d4f6;--star:#7653ab;--float:#fdfaff;--pill:#eee7f6;--track:#e6ddef;--progress:#8060ad;--success:#efe7f9;--focus:#70469c;--ending:#efe5fb}
*{box-sizing:border-box}body{margin:0;background:var(--cream);color:var(--ink);font-family:'DM Sans',sans-serif}header{max-width:1160px;margin:auto;padding:25px 32px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line)}#brand{text-decoration:none;color:var(--green);font-size:30px;font-family:Fredoka,sans-serif;font-weight:500}nav{display:flex;gap:12px}button,select{font:inherit;cursor:pointer}button{border:1px solid var(--line);border-radius:14px;background:white;color:var(--ink);padding:13px 19px;font-weight:600}button:hover{border-color:var(--green);transform:translateY(-1px)}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid var(--focus);outline-offset:4px}button:disabled{cursor:default;transform:none;opacity:.7}.primary{background:var(--green);color:white;border-color:var(--green)}.quiet{background:transparent;border:0}.selected{background:var(--selected);border-color:var(--green)}main{max-width:1100px;margin:auto;padding:38px 30px;min-height:78vh}h1,h2,h3{font-family:Fredoka,sans-serif;font-weight:500;line-height:1.1}h1{font-size:58px;margin:16px 0}h2{font-size:32px}h3{font-size:25px;margin:12px 0}p{line-height:1.65}.eyebrow{text-transform:uppercase;letter-spacing:2px;font-size:12px;font-weight:700;color:var(--green)}.muted{color:var(--muted)}.profiles{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:28px}.hero{display:grid;grid-template-columns:1.25fr 1fr;gap:40px;align-items:center;background:var(--hero);border-radius:30px;padding:35px 42px;overflow:hidden}.hero p{max-width:440px;font-size:17px}.art{height:260px;position:relative;display:flex;justify-content:center;align-items:center}.planet{position:absolute;width:230px;height:230px;border-radius:50%;background:var(--planet);box-shadow:0 0 0 18px var(--orbit)}.book{position:relative;font-size:110px;transform:rotate(-12deg);filter:drop-shadow(8px 16px 0 #234e3520)}.star{position:absolute;font-size:39px;color:var(--star)}.s1{top:8px;right:12px}.s2{bottom:22px;left:9px}.float{position:absolute;right:12px;bottom:20px;border-radius:18px;padding:12px 19px;background:var(--float);transform:rotate(7deg);font-weight:700;box-shadow:0 8px 15px #234e3510}.sectionhead{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:25px}.sectionhead h2{margin-bottom:9px}.filters{display:flex;gap:8px;flex-wrap:wrap;margin:22px 0}.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}.card{background:white;border:1px solid var(--line);border-radius:22px;overflow:hidden;display:flex;flex-direction:column}.cover{height:135px;display:flex;align-items:center;justify-content:center;font-size:65px;position:relative}.cover:after{content:'✦';position:absolute;right:30px;top:20px;font-size:24px;opacity:.45}.cardbody{padding:22px;display:flex;flex-direction:column;flex:1}.cardbody p{font-size:14px;margin:0 0 20px}.cardbody button{margin-top:auto;width:100%}.tag{font-size:11px;text-transform:uppercase;letter-spacing:1.5px;font-weight:700}.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.pill{background:var(--pill);border-radius:20px;padding:7px 12px;font-size:13px}.reader{max-width:760px;margin:0 auto}.paper{background:white;border:1px solid var(--line);border-radius:24px;padding:30px 38px;margin:20px 0}.story p{font-size:21px;line-height:1.9;margin:0 0 22px}.story.large p{font-size:26px}.story p.clue{background:#fff0bf;border-radius:10px;padding:10px}.question{font-size:23px;line-height:1.4}.answers{display:grid;gap:10px;margin:22px 0}.answers button{text-align:left;line-height:1.5}.feedback{background:var(--success);border-radius:16px;padding:18px;line-height:1.6;margin:15px 0}.feedback.try{background:#fff2d6}.progress{height:7px;background:var(--track);border-radius:8px;overflow:hidden;margin:20px 0}.progress span{display:block;height:100%;background:var(--progress)}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.stat{padding:22px;background:var(--hero);border-radius:18px}.stat strong{font-size:32px;display:block}table{width:100%;border-collapse:collapse;font-size:14px}td,th{text-align:left;border-bottom:1px solid var(--line);padding:14px 8px}footer{text-align:center;padding:25px;color:var(--muted);font-size:13px}.empty{padding:30px;background:white;border-radius:18px}.celebrate{font-size:75px;text-align:center}.ending{background:var(--ending);border-radius:16px;padding:22px}.sr{position:absolute;width:1px;height:1px;overflow:hidden} @media(max-width:750px){header{padding:18px}#brand{font-size:24px}nav{gap:0}nav button{padding:10px;font-size:12px}main{padding:24px 18px}.hero{grid-template-columns:1fr;padding:27px;gap:0}h1{font-size:42px}.art{height:180px}.planet{width:155px;height:155px}.book{font-size:85px}.grid{grid-template-columns:1fr 1fr}.sectionhead{align-items:flex-start;flex-direction:column}.paper{padding:24px}.stats{grid-template-columns:1fr}.story p{font-size:20px}}@media(max-width:480px){.grid{grid-template-columns:1fr}.cover{height:115px}.profiles{font-size:14px}.profiles button{padding:11px}.hero h1{font-size:38px}.art{display:none}h2{font-size:28px}}

/* Each profile keeps its own color in the picker, even before selection. */
.profiles [data-theme="sun"]{--profile-accent:#255f4d;--profile-soft:#e0ecd9}
.profiles [data-theme="moon"]{--profile-accent:#65449a;--profile-soft:#e9ddf7}
.profiles [data-reader],.profiles [data-p]{color:var(--profile-accent);border-color:var(--profile-accent)}
.profiles [data-reader].selected,.profiles [data-p].selected{background:var(--profile-soft);box-shadow:inset 0 0 0 1px var(--profile-accent)}
input{color:var(--ink)}

input,select{font:inherit;max-width:100%;border:1px solid var(--line);border-radius:12px;padding:12px;background:white;color:var(--ink)}input:focus-visible{outline:3px solid var(--focus);outline-offset:3px}.kid-list{display:grid;gap:12px;margin-top:20px}.kid-list .row{justify-content:space-between;border-top:1px solid var(--line);padding-top:12px}.kid-list span{overflow-wrap:anywhere;min-width:0;flex:1}.kid-list button{color:#8b3b35}fieldset{border:1px solid var(--line);border-radius:14px;padding:16px;margin-bottom:22px}.cast-choice{display:flex;align-items:center;gap:10px;padding:8px;overflow-wrap:anywhere}.cast-choice input{width:20px;height:20px;flex-shrink:0}#story-theme{display:block;width:100%;margin-top:10px}.hero button{margin:6px 0}.reader h1,.reader h2,.profiles button{overflow-wrap:anywhere}

footer a{color:inherit;text-underline-offset:3px}footer a:hover{color:var(--green)}

/* Keep the name picker and its pencil as separate, keyboard-accessible buttons. */
.reader-profile{display:inline-flex;align-items:stretch;max-width:100%}
.reader-profile [data-reader]{min-width:0;border-radius:14px 0 0 14px}
.profiles .edit-name{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;min-width:44px;min-height:44px;padding:10px;color:var(--profile-accent);border-color:var(--profile-accent);border-left:0;border-radius:0 14px 14px 0}
.reader-profile [data-reader].selected+.edit-name{background:var(--profile-soft)}
.rename-notice{margin:-12px 0 24px;color:var(--green)}
.name-dialog{width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;border:1px solid var(--line);border-radius:24px;background:var(--cream);color:var(--ink);padding:28px;box-shadow:0 20px 70px #0003}
.name-dialog::backdrop{background:#18232080}
.name-dialog form{display:grid;gap:14px}
.name-dialog h2,.name-dialog p{margin:0}
.name-dialog input{width:100%;min-width:0;font-size:18px}
.name-dialog .muted{font-size:14px}
.name-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;margin-top:8px}
