:root { color-scheme:light; --paper:#fff9f0; --ink:#343454; --purple:#8750a8; --muted:#686580; --accent:#eea537; --line:color-mix(in srgb,var(--purple) 22%,white); --soft:color-mix(in srgb,var(--purple) 12%,white); --shadow:color-mix(in srgb,var(--purple) 28%,white); --deep:color-mix(in srgb,var(--purple) 80%,black); --celebration-motion:party-pop; font-family:'Trebuchet MS', 'Arial Rounded MT Bold', Arial, sans-serif; color:var(--ink); background:var(--paper); }
:root[data-theme="space"] { --paper:#f6f4ff; --purple:#6550ad; --accent:#e3b94a; --celebration-motion:star-burst; }
:root[data-theme="cats"] { --paper:#fff7ef; --purple:#995021; --accent:#e79c38; --celebration-motion:paw-party; }
:root[data-theme="dogs"] { --paper:#f0f8ff; --purple:#235f96; --accent:#d2a932; --celebration-motion:paw-party; }
:root[data-theme="unicorns"] { --paper:#fff4fc; --purple:#a03485; --accent:#b5a1ef; --celebration-motion:rainbow-sparkle; }
:root[data-theme="unicorns"] body { background:linear-gradient(125deg,#fff4fc 0%,#f4ecff 35%,#e8f8ff 70%,#fff9e7 100%); }
:root[data-theme="unicorns"] .word-card::before { background:#ffcde4bb; }
:root[data-theme="unicorns"] .word-card::after { background:#c5eaffbb; }
:root[data-theme="unicorns"] progress::-webkit-progress-value { background:linear-gradient(90deg,#e77c9f,#f1bd62,#8bcab0,#8ebae7,#b597dd); }
:root[data-theme="unicorns"] progress::-moz-progress-bar { background:linear-gradient(90deg,#e77c9f,#f1bd62,#8bcab0,#8ebae7,#b597dd); }
:root[data-theme="sea"] { --paper:#eafbf8; --purple:#147080; --accent:#e590b4; --celebration-motion:bubble-rise; }
:root[data-theme="sea"] body { background:radial-gradient(ellipse at 5% 20%,#ffddeb90,transparent 45%),linear-gradient(155deg,#eafbf8,#e4f3ff 70%,#e5e8ff); }
:root[data-theme="sea"] .word-card::before { background:#a4e7dc; }
:root[data-theme="sea"] .word-card::after { background:#f8bad5; }
:root[data-theme="sea"] progress::-webkit-progress-value { background:linear-gradient(90deg,#148d95,#5fc7bb,#e590b4); }
:root[data-theme="sea"] progress::-moz-progress-bar { background:linear-gradient(90deg,#148d95,#5fc7bb,#e590b4); }
:root[data-theme="cars"] { --paper:#fff4f1; --purple:#b33c34; --accent:#e3a63c; --celebration-motion:car-race; }
:root[data-theme="dinosaurs"] { --paper:#f1f8e9; --purple:#357640; --accent:#a4be52; --celebration-motion:dino-stomp; }
:root[data-theme="superheroes"] { --paper:#fff3fc; --purple:#9130ad; --accent:#e0ad31; --celebration-motion:hero-zoom; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
.privacy-link { text-align:center; font-size:12px; margin:0 0 24px; }
.privacy-link a, .setting-help a, .privacy-page a { color:var(--purple); }
.privacy-page { max-width:720px; padding:32px 0; line-height:1.65; }
.privacy-page h1 { margin:24px 0 12px; }
.privacy-page h2 { font-size:20px; margin:28px 0 8px; }
body { margin:0; background:radial-gradient(ellipse at 5% 25%,color-mix(in srgb,var(--accent) 9%,transparent),transparent 35%),radial-gradient(ellipse at 95% 60%,color-mix(in srgb,var(--purple) 7%,transparent),transparent 35%); }
button, select, input { font:inherit; }
button, select, summary, label:has(input) { cursor:pointer; }
button { color:inherit; -webkit-tap-highlight-color:transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible { outline:4px solid #e58827; outline-offset:5px; }
button:disabled { cursor:default; opacity:.4; }
.app { width:min(1120px,calc(100% - 64px)); margin:auto; }
.site-header { display:grid; grid-template-columns:1fr auto; align-items:center; column-gap:10px; row-gap:4px; padding:16px 0 12px; border-bottom:2px dashed var(--line); }
.brand { display:flex; align-items:center; text-decoration:none; color:var(--ink); font-weight:700; }
.brand-icon { color:var(--accent); font-size:40px; line-height:1; margin-right:10px; }
.brand-copy { display:flex; align-items:baseline; flex-wrap:wrap; gap:8px; min-width:0; }
.brand-byline { font-size:12px; color:var(--purple); }
.header-tagline { grid-column:1 / -1; margin:0 0 0 50px; font-size:13px; color:var(--muted); }
main { max-width:720px; margin:auto; }
h1 { font-size:28px; letter-spacing:-1px; font-weight:800; margin:0; line-height:1.15; }
h1 span { color:var(--purple); }
.practice { padding-top:24px; }
.practice-controls { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.segmented { display:flex; background:var(--soft); padding:5px; border-radius:17px; gap:4px; width:100%; }
.segmented button { border:0; background:transparent; border-radius:12px; min-height:48px; padding:0 20px; font-size:15px; font-weight:700; flex:1; }
.segmented button[aria-pressed="true"] { background:var(--purple); color:#fff; box-shadow:0 3px 0 var(--deep); }
.week-control { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:14px; color:var(--ink); }
select { color:var(--ink); border:2px solid var(--line); background:#fff; padding:13px 10px; border-radius:13px; font-size:14px; }
.deck-description { margin:0; font-size:13px; color:var(--muted); }
.practice-filter { display:flex; align-items:center; gap:8px; min-height:44px; }
.setting-help { margin:0 0 4px 29px; font-size:13px; line-height:1.5; color:var(--muted); max-width:440px; }
input[type="checkbox"] { accent-color:var(--purple); width:21px; height:21px; margin:0; flex-shrink:0; cursor:pointer; }
.word-card { position:relative; background:#fffefa; border:3px solid var(--shadow); border-radius:30px; box-shadow:0 7px 0 var(--line); min-height:320px; display:flex; flex-direction:column; padding:21px 27px 18px; margin-top:20px; transition:background .18s,border-color .18s; }
.word-card::before,.word-card::after { content:''; position:absolute; width:42px; height:18px; background:color-mix(in srgb,var(--accent) 35%,transparent); top:-10px; border-radius:2px; transform:rotate(-13deg); left:45px; }
.word-card::after { left:auto; right:45px; transform:rotate(13deg); background:color-mix(in srgb,var(--purple) 25%,transparent); }
.word-card.is-learned { background:color-mix(in srgb,var(--purple) 14%,#fffefa); border-color:var(--purple); box-shadow:0 7px 0 var(--shadow); }
.card-topline { display:flex; justify-content:space-between; color:#716b5b; font-size:11px; font-weight:700; letter-spacing:1px; }
#word-week { background:var(--soft); padding:6px 10px; border-radius:9px; color:var(--purple); }
.learned-badge { display:inline-flex; align-items:center; gap:5px; padding:4px 10px; border-radius:10px; background:var(--purple); color:white; font-size:12px; font-weight:700; letter-spacing:0; }
.learned-badge svg { width:22px; height:22px; }
#card-counter { padding:6px 8px; border:0; border-radius:9px; background:var(--soft); color:var(--purple); font:inherit; font-weight:700; min-height:32px; text-decoration:underline dotted; text-underline-offset:3px; }
#progress-text { padding:5px 2px; border:0; background:transparent; color:inherit; font:inherit; font-weight:700; text-decoration:underline dotted; text-underline-offset:3px; }
.word-stage { display:flex; flex-direction:column; gap:20px; align-items:center; justify-content:center; flex:1; min-height:210px; }
.review-button { background:var(--purple); color:white; border:0; border-radius:14px; padding:14px 22px; font-size:17px; font-weight:700; min-height:48px; }
.hear-word { display:flex; align-items:center; justify-content:center; gap:9px; align-self:center; min-height:54px; min-width:164px; margin:0 0 13px; padding:9px 20px; background:var(--soft); color:var(--purple); border:2px solid var(--line); border-radius:16px; font-size:17px; font-weight:700; box-shadow:0 3px 0 var(--shadow); }
.hear-word svg { width:32px; height:32px; flex-shrink:0; }
.hear-word:hover:not(:disabled) { background:var(--line); }
.hear-word.is-playing { background:var(--line); border-color:var(--purple); }
.hear-word:active:not(:disabled) { transform:translateY(2px); box-shadow:none; }
.audio-status { color:#924421; font-size:13px; line-height:1.5; text-align:center; margin:0 0 13px; max-width:340px; align-self:center; }
#word { font-family:'Trebuchet MS',Arial,sans-serif; font-size:clamp(76px,25vw,150px); line-height:1.1; font-weight:700; letter-spacing:-3px; color:#30344d; }
.word-card.empty #word { font-size:clamp(32px,8vw,60px); letter-spacing:-1.5px; text-align:center; }
.card-bottomline { display:flex; justify-content:center; align-items:center; gap:13px; color:#706b5d; font-size:14px; min-height:24px; }
.tiny-spark { color:var(--accent); font-size:19px; }
.card-actions { display:grid; grid-template-columns:108px 1fr 1fr; align-items:stretch; gap:13px; margin:24px 0 13px; }
.arrow-button { min-width:108px; min-height:88px; padding:10px 18px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; border:2px solid var(--line); border-radius:22px; font-size:15px; font-weight:700; background:var(--soft); box-shadow:0 4px 0 var(--shadow); }
.nav-icon { width:42px; height:42px; flex-shrink:0; }
.arrow-button:hover:not(:disabled) { background:var(--line); transform:translateY(-1px); }
.arrow-button:active:not(:disabled) { transform:translateY(3px); box-shadow:none; }
.next-button { background:var(--purple); color:#fff; border-color:var(--purple); box-shadow:0 4px 0 var(--deep); }
.next-button:hover:not(:disabled) { background:var(--deep); }
.learned-control { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; font-size:15px; font-weight:700; min-height:88px; padding:8px 23px; background:color-mix(in srgb,var(--accent) 24%,white); border:2px solid color-mix(in srgb,var(--accent) 65%,white); border-radius:22px; box-shadow:0 4px 0 color-mix(in srgb,var(--accent) 40%,white); }
.learned-control input { position:absolute; width:100%; height:100%; inset:0; opacity:0; z-index:1; }
.learned-control > span,.learned-control > svg { pointer-events:none; }
.learned-control:has(input:focus-visible) { outline:4px solid #e58827; outline-offset:5px; }
.learned-star { font-size:38px; line-height:1; opacity:.7; }
.learned-check { display:none; width:42px; height:42px; flex-shrink:0; }
.learned-control:has(input:checked) { background:var(--purple); color:white; border-color:var(--deep); box-shadow:0 4px 0 var(--deep); }
.learned-control:has(input:checked) .learned-star { display:none; }
.learned-control:has(input:checked) .learned-check { display:block; }
.learned-control:has(input:disabled) { opacity:.5; }
.deck-actions { display:flex; justify-content:space-between; align-items:center; margin:0 1px 20px; }
.text-button { display:flex; align-items:center; gap:8px; border:0; background:transparent; color:var(--purple); font-size:14px; font-weight:700; padding:10px 3px; min-height:44px; }
.text-button:hover { text-decoration:underline; }
.text-button span { font-size:25px; }
.keyboard-hint { font-size:11px; color:var(--muted); }
kbd { font:inherit; padding:3px 5px; border:1px solid var(--line); border-radius:4px; margin:0 1px; }
.progress-panel { display:flex; align-items:center; background:var(--soft); border:2px solid var(--line); border-radius:21px; padding:18px 21px; gap:17px; }
.week-retry { margin:4px 0 16px; text-align:center; }
.week-retry button { display:flex; align-items:center; justify-content:center; gap:12px; width:100%; min-height:54px; padding:8px 14px; border:2px solid var(--purple); border-radius:18px; background:color-mix(in srgb,var(--accent) 26%,white); color:var(--ink); box-shadow:0 4px 0 var(--shadow); font-size:18px; font-weight:700; }
.week-retry button > span:first-child { font-size:28px; }
.week-retry p { margin:9px 8px 0; font-size:12px; line-height:1.5; color:var(--muted); }
.progress-icon { font-size:36px; }
.progress-content { flex:1; min-width:0; }
.progress-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:14px; font-weight:700; margin-bottom:11px; }
#progress-text { color:var(--muted); font-size:12px; white-space:nowrap; font-weight:400; }
progress { display:block; width:100%; height:11px; border:0; border-radius:8px; overflow:hidden; background:var(--line); accent-color:var(--purple); }
progress::-webkit-progress-bar { background:var(--line); border-radius:8px; }
progress::-webkit-progress-value { background:var(--purple); border-radius:8px; }
progress::-moz-progress-bar { background:var(--purple); }
.progress-panel { margin-top:24px; }
.grown-up-settings { margin-top:23px; border-top:2px dashed var(--line); border-bottom:2px dashed var(--line); }
.parent-settings { display:grid; gap:12px; padding:0 0 15px; }
.word-list { border-top:1px solid var(--line); padding-top:18px; }
.list-heading { margin:0 0 12px; font-size:15px; }
summary { display:flex; justify-content:space-between; align-items:center; list-style:none; padding:20px 2px; font-size:15px; font-weight:700; min-height:56px; }
summary::-webkit-details-marker { display:none; }
#list-count { color:var(--muted); margin-left:4px; font-weight:400; }
.details-plus { font-size:25px; color:var(--purple); }
details[open] .details-plus { transform:rotate(45deg); }
.list-help { font-size:13px; color:var(--muted); margin:0 0 18px; }
.list-week { margin-bottom:20px; }
.list-week h2 { margin:0 0 10px; font-size:12px; letter-spacing:1px; color:var(--muted); text-transform:uppercase; }
.list-words { display:flex; flex-wrap:wrap; gap:10px; }
.word-chip { display:flex; align-items:center; gap:10px; padding:5px 12px; border:2px solid var(--line); border-radius:13px; background:#fffefa; }
.word-chip:has(input:checked) { background:var(--soft); border-color:var(--shadow); }
.word-chip button { min-height:40px; border:0; padding:3px 5px; background:transparent; font-size:22px; }
footer { text-align:center; font-size:13px; color:var(--muted); padding:25px 0; }
footer > span { color:#ce5365; font-size:19px; margin-right:4px; }
footer p { font-size:11px; margin:10px 0 0; }
footer .storage-detail { font-size:10px; margin-top:6px; }
#storage-note.storage-error { color:#a33b25; font-weight:700; font-size:13px; }
.noscript { padding:20px; text-align:center; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.celebration { display:none; pointer-events:none; position:absolute; inset:0; overflow:hidden; border-radius:26px; z-index:2; }
.celebration-message { position:absolute; top:17%; left:50%; transform:translateX(-50%); background:var(--purple); color:white; border:3px solid #fff; box-shadow:0 4px 0 var(--shadow); border-radius:20px; padding:11px 18px; white-space:nowrap; font-size:22px; font-weight:700; }
.celebration-message span { color:#ffd05f; }
.confetti-piece { position:absolute; top:62%; left:50%; font-size:32px; color:var(--accent); --dx:-130px; --dy:-160px; --spin:-90deg; }
.confetti-piece:nth-of-type(2) { --dx:100px; --dy:-170px; --spin:120deg; color:#80beac; }
.confetti-piece:nth-of-type(3) { --dx:-75px; --dy:-210px; --spin:80deg; color:#a882cf; }
.confetti-piece:nth-of-type(4) { --dx:155px; --dy:-110px; --spin:-120deg; color:#ed907c; }
.confetti-piece:nth-of-type(5) { --dx:-165px; --dy:-75px; --spin:110deg; color:#a882cf; }
.confetti-piece:nth-of-type(6) { --dx:65px; --dy:-225px; --spin:150deg; color:#80beac; }
.confetti-piece:nth-of-type(7) { --dx:160px; --dy:30px; --spin:-60deg; color:#ed907c; }
.confetti-piece:nth-of-type(8) { --dx:-145px; --dy:50px; --spin:170deg; }
.confetti-piece:nth-of-type(9) { --dx:-40px; --dy:-195px; --spin:-120deg; color:#80beac; }
.confetti-piece:nth-of-type(10) { --dx:115px; --dy:75px; --spin:150deg; color:#a882cf; }
.confetti-piece:nth-of-type(11) { --dx:-80px; --dy:85px; --spin:-80deg; color:#ed907c; }
.confetti-piece:nth-of-type(12) { --dx:35px; --dy:-185px; --spin:200deg; }
.word-card.celebrate .celebration { display:block; }
.word-card.celebrate .confetti-piece { animation:var(--celebration-motion) 1250ms cubic-bezier(.12,.7,.35,1) both; }
:root[data-theme="cars"] .word-card[data-reward-style="theme"] .confetti-piece { left:-10%; top:50%; }
:root[data-theme="cars"] .word-card[data-reward-style="theme"] .confetti-piece:nth-of-type(3n + 1) { top:30%; animation-delay:70ms; }
:root[data-theme="cars"] .word-card[data-reward-style="theme"] .confetti-piece:nth-of-type(3n + 2) { top:70%; animation-delay:130ms; }
.word-card[data-reward-style="burst"] { --celebration-motion:reward-burst; }
.word-card[data-reward-style="fountain"] { --celebration-motion:reward-fountain; }
.word-card[data-reward-style="swirl"] { --celebration-motion:reward-swirl; }
.word-card[data-reward-style="rain"] { --celebration-motion:reward-rain; }
.word-card[data-reward-style="rain"] .confetti-piece { top:0; }
.word-card[data-reward-style="fountain"] .confetti-piece { top:90%; }
.word-card.celebrate .celebration-message { animation:little-cheer 1400ms ease-out both; }
.practice:has(.word-card.celebrate) .learned-star { animation:star-pop 550ms ease-out; }
.practice:has(.word-card.celebrate) .learned-check { animation:star-pop 550ms ease-out; }
@keyframes star-burst { 0% { opacity:0; transform:translate(-50%,0) scale(.3); } 12% { opacity:1; } 75% { opacity:1; } 100% { opacity:0; transform:translate(var(--dx),var(--dy)) rotate(var(--spin)) scale(1.1); } }
@keyframes little-cheer { 0% { opacity:0; transform:translate(-50%,15px) scale(.7); } 18%,78% { opacity:1; transform:translate(-50%,0) scale(1); } 100% { opacity:0; transform:translate(-50%,-8px) scale(1); } }
@keyframes star-pop { 50% { transform:rotate(15deg) scale(1.4); } }
@keyframes party-pop { 0% { opacity:0; transform:translateY(-55px) scale(.3); } 15%,70% { opacity:1; } 100% { opacity:0; transform:translate(var(--dx),calc(var(--dy) + 200px)) rotate(var(--spin)) scale(.9); } }
@keyframes paw-party { 0% { opacity:0; transform:scale(.2); } 20% { opacity:1; transform:translate(0,-35px) rotate(-15deg); } 60% { opacity:1; } 100% { opacity:0; transform:translate(var(--dx),var(--dy)) rotate(20deg) scale(1.15); } }
@keyframes car-race { 0% { left:-10%; opacity:0; transform:rotate(-5deg); } 15%,80% { opacity:1; } 100% { left:110%; opacity:0; transform:rotate(5deg); } }
@keyframes dino-stomp { 0% { opacity:0; transform:translateY(35px) scale(.4); } 25% { opacity:1; transform:translateY(-35px) scale(1.3); } 60% { opacity:1; } 100% { opacity:0; transform:translate(var(--dx),var(--dy)) rotate(-15deg) scale(1); } }
@keyframes hero-zoom { 0% { opacity:0; transform:translateY(65px) scale(.1); } 20% { opacity:1; } 75% { opacity:1; } 100% { opacity:0; transform:translate(var(--dx),var(--dy)) rotate(var(--spin)) scale(1.7); } }
@keyframes rainbow-sparkle { 0% { opacity:0; transform:translateY(25px) scale(.2); } 20% { opacity:1; transform:translateY(-20px) scale(1.3); } 55% { opacity:1; } 100% { opacity:0; transform:translate(var(--dx),var(--dy)) rotate(25deg) scale(.7); } }
@keyframes bubble-rise { 0% { opacity:0; transform:translateY(85px) scale(.2); } 20%,70% { opacity:1; } 50% { transform:translate(calc(var(--dx) * .4),-60px) rotate(-12deg) scale(1.1); } 100% { opacity:0; transform:translate(var(--dx),-240px) rotate(20deg) scale(.5); } }
@keyframes reward-burst { 0% { opacity:0; transform:translate(0,0) scale(.1); } 18% { opacity:1; transform:scale(1.6); } 75% { opacity:1; } 100% { opacity:0; transform:translate(var(--dx),var(--dy)) rotate(var(--spin)) scale(.8); } }
@keyframes reward-fountain { 0% { opacity:0; transform:translate(0,30px) scale(.5); } 12%,70% { opacity:1; } 60% { transform:translate(calc(var(--dx) * .7),-210px) rotate(var(--spin)) scale(1.1); } 100% { opacity:0; transform:translate(var(--dx),-60px) rotate(var(--spin)) scale(.7); } }
@keyframes reward-swirl { 0% { opacity:0; transform:rotate(-180deg) translateX(5px) scale(.2); } 15%,75% { opacity:1; } 100% { opacity:0; transform:rotate(180deg) translate(var(--dx),var(--dy)) scale(1.2); } }
@keyframes reward-rain { 0% { opacity:0; transform:translate(var(--dx),-50px) rotate(-30deg); } 15%,70% { opacity:1; } 100% { opacity:0; transform:translate(calc(var(--dx) * .65),330px) rotate(var(--spin)) scale(.7); } }
.milestone-party { position:fixed; inset:0; z-index:30; pointer-events:none; display:grid; place-items:center; overflow:hidden; background:radial-gradient(ellipse at center,color-mix(in srgb,var(--paper) 90%,transparent),color-mix(in srgb,var(--purple) 16%,transparent)); }
.milestone-badge { position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; gap:14px; text-align:center; width:min(500px,calc(100% - 40px)); padding:28px 22px; border:4px solid white; border-radius:36px; background:var(--purple); color:white; box-shadow:0 10px 0 var(--shadow),0 18px 70px #24213730; animation:week-victory 700ms cubic-bezier(.2,.8,.4,1.3) both; }
.milestone-symbol { display:block; font-size:100px; line-height:1.15; filter:drop-shadow(0 6px 0 #00000015); }
#milestone-title { font-size:clamp(25px,5vw,38px); line-height:1.1; }
#milestone-subtitle { font-size:16px; line-height:1.5; }
.milestone-pieces { position:absolute; inset:0; }
.milestone-piece { position:absolute; left:var(--x); top:110%; font-size:clamp(30px,7vw,55px); animation:milestone-rise 2600ms ease-out var(--delay) both; }
.milestone-party[data-kind="all"] .milestone-badge { background:linear-gradient(140deg,var(--purple),var(--deep)); border-color:#ffe397; animation:all-victory 1000ms cubic-bezier(.2,.8,.4,1.2) both; }
.milestone-party[data-kind="all"] .milestone-piece { top:-15%; animation:milestone-cascade 3100ms ease-in var(--delay) both; }
@keyframes week-victory { 0% { opacity:0; transform:translateY(70px) rotate(-8deg) scale(.25); } 75% { opacity:1; transform:translateY(-12px) rotate(3deg) scale(1.06); } 100% { opacity:1; transform:none; } }
@keyframes all-victory { 0% { opacity:0; transform:scale(.15) rotate(-15deg); } 60% { opacity:1; transform:scale(1.1) rotate(5deg); } 80% { transform:scale(.95) rotate(-3deg); } 100% { opacity:1; transform:none; } }
@keyframes milestone-rise { 0% { opacity:0; transform:translateY(0) scale(.4); } 15%,80% { opacity:1; } 100% { opacity:0; transform:translate(var(--drift),-125svh) rotate(var(--spin)) scale(1.2); } }
@keyframes milestone-cascade { 0% { opacity:0; transform:translateY(0) rotate(0); } 10%,85% { opacity:1; } 100% { opacity:0; transform:translate(var(--drift),130svh) rotate(var(--spin)); } }
.theme-trigger { display:flex; align-items:center; justify-content:center; gap:7px; border:2px solid var(--line); background:white; color:var(--purple); border-radius:15px; padding:5px 12px; font-weight:700; font-size:13px; min-height:48px; }
#theme-current-icon { font-size:31px; line-height:1.1; }
.theme-dialog { width:min(520px,calc(100% - 28px)); max-height:calc(100svh - 32px); padding:23px; border:3px solid var(--line); border-radius:27px; background:var(--paper); color:var(--ink); overflow:auto; }
.theme-dialog::backdrop { background:#24213770; }
.theme-dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:18px; }
.theme-dialog-heading h2 { font-size:23px; letter-spacing:-.5px; margin:0; }
.theme-close { width:44px; height:44px; border:0; background:var(--soft); border-radius:50%; font-size:30px; color:var(--purple); flex-shrink:0; }
.theme-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.theme-option { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; min-height:132px; padding:15px 5px 12px; border:3px solid transparent; border-radius:20px; background:var(--tile,#eeebff); color:var(--ink); font-size:14px; font-weight:700; }
.theme-option[data-theme-choice="cats"] { --tile:#ffead8; }
.theme-option[data-theme-choice="party"] { --tile:#fff0cd; }
.theme-option[data-theme-choice="dogs"] { --tile:#e1f1ff; }
.theme-option[data-theme-choice="unicorns"] { background:linear-gradient(135deg,#ffe4f1,#eee2ff 50%,#ddf4ff); }
.theme-option[data-theme-choice="unicorns"] .theme-picture { font-size:37px; white-space:nowrap; }
.theme-option[data-theme-choice="sea"] { background:linear-gradient(140deg,#b9eee6,#e6e4ff 70%,#ffd9e7); }
.theme-option[data-theme-choice="sea"] .theme-picture { font-size:37px; white-space:nowrap; }
.theme-option[data-theme-choice="cars"] { --tile:#ffe3dd; }
.theme-option[data-theme-choice="dinosaurs"] { --tile:#e4f1d1; }
.theme-option[data-theme-choice="superheroes"] { --tile:#f9e0f6; }
.theme-picture { font-size:53px; line-height:1.1; }
.theme-check { display:none; position:absolute; top:4px; right:7px; width:22px; height:22px; border-radius:50%; background:var(--purple); color:white; font-size:16px; }
.theme-option[aria-pressed="true"] { border-color:var(--purple); }
.theme-option[aria-pressed="true"] .theme-check { display:block; }
.theme-option:hover { border-color:var(--shadow); }
@media (max-width:600px) {
  .app { width:calc(100% - 28px); }
  .site-header { padding:10px 0 8px; }
  h1 { font-size:clamp(17px,5vw,24px); }
  .brand-icon { font-size:35px; margin-right:8px; }
  .brand-copy { display:block; }
  .brand-byline { font-size:11px; }
  .header-tagline { margin:0 0 0 43px; font-size:11px; }
  .theme-trigger { flex-direction:column; gap:1px; padding:4px 9px; font-size:10px; min-height:54px; }
  #theme-current-icon { font-size:31px; }
  .practice { padding-top:14px; }
  .practice-controls { align-items:stretch; gap:8px; }
  .segmented { flex:1; }
  .segmented button { padding:0 12px; flex:1; font-size:13px; min-height:44px; }
  .week-control { font-size:14px; gap:10px; }
  .week-control select { font-size:13px; padding:10px 7px; }
  .practice-filter { gap:6px; }
  .practice-filter input { width:20px; height:20px; }
  .word-card { min-height:210px; height:clamp(210px,calc(100svh - 380px),310px); padding:14px 18px 10px; margin-top:14px; border-radius:25px; }
  .word-stage { min-height:0; gap:12px; }
  #word { font-size:clamp(64px,22vw,110px); letter-spacing:-2px; }
  .card-bottomline { display:none; }
  .hear-word { min-height:52px; margin-bottom:4px; padding:7px 18px; font-size:16px; }
  .audio-status { font-size:12px; line-height:1.3; margin:3px 0; }
  .card-actions { grid-template-columns:65px 1fr 1.05fr; gap:8px; margin-top:18px; }
  .arrow-button { min-width:0; min-height:82px; padding:7px 5px; font-size:13px; gap:3px; border-radius:20px; }
  .nav-icon { width:37px; height:37px; }
  .learned-control { padding:7px 5px; gap:3px; min-height:82px; font-size:13px; border-radius:20px; }
  .learned-star { font-size:35px; }
  .learned-check { width:38px; height:38px; }
  .keyboard-hint { line-height:1.7; }
  .deck-actions { margin-bottom:16px; }
  .progress-panel { padding:16px 13px; gap:10px; }
  .progress-icon { font-size:29px; }
  .progress-heading { font-size:12px; gap:6px; }
  #progress-text { font-size:11px; }
  .theme-dialog { padding:16px; border-radius:22px; }
  .theme-dialog-heading { margin-bottom:12px; }
  .theme-dialog-heading h2 { font-size:21px; }
  .theme-options { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .theme-option { min-height:112px; font-size:14px; gap:7px; }
  .theme-picture { font-size:48px; }
}
@media (max-width:350px) { .progress-heading { display:block; } #progress-text { display:block; margin-top:5px; } .segmented button { padding:0 8px; } .arrow-button { min-width:65px; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none !important; animation:none !important; } .confetti-piece,.milestone-pieces { display:none; } }

/* Empty icon slots use the saved theme immediately, before app.js or word data. */
.brand-icon:empty::before, #theme-current-icon:empty::before { content:var(--theme-icon, '🎉'); }
.learned-star:empty::before { content:var(--theme-reward, '🌟'); }
.progress-icon:empty::before { content:var(--theme-progress, '🎈'); }
.progress-heading > span:first-child:empty::before { content:var(--theme-encouragement, 'Look at you go!'); }
.transfer-button { border:0; border-radius:14px; background:var(--accent); color:white; padding:13px 17px; font:inherit; font-weight:700; cursor:pointer; margin-top:12px; min-height:48px; }
.transfer-button:disabled { opacity:.55; cursor:default; }
#transfer-source { max-width:100%; min-width:0; font-size:12px; }
#transfer-controls .week-control { display:grid; gap:8px; }
#transfer-status { overflow-wrap:anywhere; }
#old-site-link { display:inline-block; margin-top:10px; font-size:14px; }
#old-site-link[hidden] { display:none; }
.transfer-page { max-width:540px; padding-top:40px; }
.transfer-page h1 { font-size:30px; line-height:1.2; }
.transfer-symbol { font-size:44px; margin:0 0 16px; }
