:root{color-scheme:light;--plum:#292040;--ink:#281940;--muted:#62566f;--violet:#643ac3;--line:#e6dae8;--paper:#fcf8f2;--white:#fffdfb;--shadow:0 12px 30px #37234f12}
*{box-sizing:border-box}
body{margin:0;background:radial-gradient(ellipse at 98% 20%,#f7eefb 0,transparent 45%),var(--paper);color:var(--ink);font:1rem/1.55 ui-rounded,"Trebuchet MS",system-ui,sans-serif}
button,input,textarea,select{font:inherit}
button{color:inherit;cursor:pointer}
button:disabled{cursor:default}
button:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #a87cf0;outline-offset:3px}
.shell{width:min(1120px,calc(100% - 64px));margin-inline:auto}
.site-header{background:#fffcf8e0;border-bottom:1px solid #e8dee9}
.header-inner{min-height:77px;display:flex;align-items:center;justify-content:space-between;gap:14px}
.brand{border:0;background:none;display:inline-flex;align-items:center;gap:12px;padding:0;text-align:left;font-weight:900;font-size:1.04rem;line-height:1.2}
.crest{width:37px;height:37px;border-radius:12px;background:#eaddfa;display:grid;place-items:center;color:#693dc3;font-size:1.24rem;box-shadow:inset 0 0 0 1px #d9c6f4}
.meter{display:flex;gap:10px;align-items:center;font-size:.875rem;font-weight:750;color:#59466e;white-space:nowrap}
.meter progress{width:86px;height:9px;appearance:none;border:0;border-radius:20px;overflow:hidden;background:#ece1f4}
progress::-webkit-progress-bar{background:#ece1f4}progress::-webkit-progress-value{background:#8555d9}progress::-moz-progress-bar{background:#8555d9}
main{padding-top:27px;min-height:72vh}
.hero{isolation:isolate;position:relative;min-height:425px;display:flex;align-items:center;overflow:hidden;border-radius:28px;background:#271c48;box-shadow:0 14px 36px #422f6130;color:white}
.hero::before,.hero::after{content:"";position:absolute;inset:0;z-index:-1}
.hero::before{background:url(school.webp) center 52% / cover no-repeat}
.hero::after{background:linear-gradient(90deg,#231637fa 1%,#271841e8 27%,#2c1d4b8c 49%,transparent 73%)}
.hero-inner{padding:42px 52px;width:min(100%,550px)}
.eyebrow{display:flex;align-items:center;gap:9px;color:#7649b4;font-weight:850;font-size:.875rem;letter-spacing:.045em}
.hero .eyebrow{color:#f3d9ff}
h1,h2,h3,p{margin:0}
h1,h2{line-height:1.12;letter-spacing:-.043em;font-weight:900}
.hero h1{font-size:clamp(3rem,6.6vw,5.25rem);max-width:470px;margin:12px 0 15px}
.hero p{font-size:1.1rem;max-width:370px;color:#f8edf9}
.button{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:47px;border:1px solid transparent;border-radius:13px;padding:10px 20px;font-weight:850;background:var(--violet);color:white;line-height:1.3}
.button:hover{background:#5128ac}
.button:disabled{opacity:.5}
.button-light{background:#ffe0ef;color:#351c4a;box-shadow:0 5px 0 #c583b9}
.button-light:hover{background:#ffd2e8}
.hero .button{margin-top:24px}
.button-secondary{background:#fffafc;border-color:#e3d6e9;color:#563880}
.button-secondary:hover{background:#f1e7fa}
.section-header{margin:31px 0 18px;display:flex;align-items:end;justify-content:space-between;gap:12px}
.section-header h2{font-size:clamp(1.7rem,4vw,2.25rem)}
.section-header p{margin-top:6px;color:var(--muted)}
.text-button{border:0;background:none;color:#6942a9;font-weight:800;padding:6px 0;text-decoration:underline;text-underline-offset:4px;text-align:left}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.card{min-width:0;min-height:161px;text-align:left;border:1px solid var(--line);border-radius:19px;background:var(--white);box-shadow:var(--shadow);padding:17px 18px;position:relative;display:grid;grid-template-columns:53px 1fr;gap:13px;align-items:start}
.card[disabled]{background:#fffbf9c4}
.card:not([disabled]):hover{border-color:#a783dc;transform:translateY(-2px)}
.card.current{border-color:#b594e7}
.icon{display:grid;place-items:center;background:var(--tile);color:var(--symbol);border-radius:15px;width:53px;height:53px;font-size:1.75rem;line-height:1}
.card h3{line-height:1.2;font-size:1.25rem;margin:3px 0 4px}
.card p,.state{font-size:.875rem;color:var(--muted)}
.state{margin-top:10px;font-weight:800;display:block}
.card.current .state,.card.done .state{color:#6845a5}
.screen{max-width:760px;margin:9px auto 0}
.panel{padding:clamp(23px,5vw,47px);border-radius:26px;background:var(--white);border:1px solid var(--line);box-shadow:var(--shadow);margin-top:11px}
.panel h1{font-size:clamp(2rem,6vw,3.55rem);margin:8px 0 14px}
.panel h2{font-size:clamp(1.5rem,5vw,2rem);margin:10px 0 16px}
.panel p+p{margin-top:12px}
.story{padding:18px 20px;border-radius:15px;background:#f6effb;margin:20px 0}
.practice{padding:17px 20px;background:#fff2dc;border-radius:15px;margin-top:14px}
.actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}
form label{display:block;font-weight:800;margin:18px 0 6px}
select,textarea{width:100%;border:1px solid #d5c6e1;background:#fff;color:var(--ink);border-radius:11px;padding:10px 13px}
select{appearance:none;background:linear-gradient(45deg,transparent 50%,#6845a5 50%) right 19px center/6px 6px no-repeat,linear-gradient(135deg,#6845a5 50%,transparent 50%) right 13px center/6px 6px no-repeat,#fff;padding-right:35px}
textarea{min-height:80px;resize:vertical}
.option{width:100%;display:flex;align-items:center;gap:12px;text-align:left;background:#fff;border:1px solid #ddd0e9;border-radius:13px;padding:12px 14px;margin:10px 0;font-weight:700}
.option:hover,.option[aria-pressed=true]{border-color:#9468d7;background:#f6effc}
.letter{flex:none;display:grid;place-items:center;width:34px;height:34px;border-radius:9px;color:#5a3599;background:#eee3fc}
.feedback{border-radius:13px;background:#fff2dc;padding:15px;margin-top:13px}
.feedback.good{background:#e8f6e8}
.result{text-align:center}
.result .icon{margin:0 auto 15px}
.result .actions{justify-content:center}
footer{padding-block:26px;color:#6b5b79;text-align:center;font-size:.875rem}
footer span{color:#8353b3;margin-right:4px}
@media(max-width:850px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:590px){.shell{width:calc(100% - 30px)}.header-inner{min-height:64px}.meter progress{width:42px}.hero{min-height:470px;align-items:end;border-radius:21px}.hero::before{background-position:70% 22%;background-size:auto 78%}.hero::after{background:linear-gradient(0deg,#261840 4%,#261840f2 26%,#26184056 68%,transparent 94%)}.hero-inner{padding:22px}.hero h1{font-size:clamp(2.6rem,12vw,4rem);margin-block:8px 12px}.hero p{font-size:1rem}.hero .button{margin-top:17px}.grid{grid-template-columns:1fr;gap:11px}.card{min-height:112px}.section-header{align-items:flex-start;flex-direction:column;gap:2px}.state{margin-top:4px}main{padding-top:15px}}
@media(prefers-reduced-motion:no-preference){.card,.button{transition:background .16s,transform .16s,border-color .16s}}
.tabs{display:flex;flex-wrap:wrap;gap:8px;margin-top:22px}
.tabs .button{min-height:43px;padding:8px 13px;font-size:.92rem}
.card-title{display:block;font-weight:900;font-size:1.2rem;line-height:1.2;margin:3px 0 5px}
.card-description{display:block;font-size:.875rem;line-height:1.45;color:var(--muted)}
.card{grid-template-columns:71px 1fr}
.portrait{overflow:hidden;width:71px;height:71px}
.portrait img{width:100%;height:100%;object-fit:cover;display:block}
.lesson-heading{display:flex;align-items:center;gap:17px}
.lesson-heading .portrait,.result .portrait{width:92px;height:92px;flex:none}
.panel h1.question{font-size:clamp(1.7rem,5vw,2.7rem)}
.centered{justify-content:center}
.mission{display:grid;grid-template-columns:53px 1fr auto;gap:12px;align-items:center;border:1px solid var(--line);border-radius:16px;padding:12px;margin:9px 0}
.mission .portrait{width:53px;height:53px}
.mission span:not(.portrait){color:var(--muted)}
.rewards{list-style:none;padding:0}
.rewards li{display:flex;justify-content:space-between;gap:14px;padding:11px 14px;background:#f7edfc;border-radius:12px;margin:8px 0}
.gem{font-size:5.5rem;line-height:1.2;color:#8f4bd6;text-shadow:0 6px #ead8fb}
.emotion-buttons,.settings{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.emotion-buttons button[aria-pressed=true]{background:#e8d8fa;border-color:#9468d7}
.settings{flex-direction:column;margin-bottom:20px}
.settings input{accent-color:var(--violet);width:18px;height:18px;vertical-align:text-bottom}
.mentor-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.mentor-choice{margin:0}
.mentor-choice .portrait{width:53px;height:53px}
.still *{transition:none!important;animation:none!important}
@media(max-width:590px){.hero::before{background-repeat:no-repeat}.shell{width:calc(100% - 30px)}.card{padding:14px}.mission{grid-template-columns:45px 1fr}.mission .portrait{width:45px;height:45px}.mission .button{grid-column:2;justify-self:start}.mentor-grid{grid-template-columns:1fr}}
.chat-feed{display:grid;gap:10px;max-height:370px;overflow:auto;margin-top:18px;padding:12px;border:1px solid var(--line);border-radius:16px;background:#fcf8fe}
.chat-feed p+p{margin:0}.chat-bubble{max-width:90%;justify-self:start;white-space:pre-wrap;overflow-wrap:anywhere;padding:10px 13px;border-radius:13px;background:#eee3fb}.chat-bubble strong{display:block;color:#573183;margin-bottom:3px;font-size:.875rem}.chat-bubble.user{justify-self:end;background:#fff0d9}.chat-bubble.user strong{color:#7b4514}.ai-consent{display:flex;align-items:flex-start;gap:9px}.ai-consent input{margin-top:5px;flex:none}
.topic-history{margin-top:22px;border-top:1px solid var(--line);padding-top:15px}.topic-history summary{cursor:pointer;font-weight:850;color:#563880}.topic-history p{margin-top:8px}.topic-history ul{list-style:none;padding:0;margin:6px 0 0}.topic-history li{display:flex;align-items:baseline;gap:8px 18px;flex-wrap:wrap}.topic-history time{font-size:.875rem;color:var(--muted)}
#sync-code{width:100%;border:1px solid #d5c6e1;background:#fff;color:var(--ink);border-radius:11px;padding:10px 13px}.sync-code{font-size:clamp(.84rem,2.1vw,1.1rem);font-weight:bold;overflow-wrap:anywhere;user-select:all}.sync-help{color:var(--muted);margin-top:7px;font-size:.925rem}#sync-notice:empty{display:none}
.hero-cast{position:absolute;right:4%;bottom:8%;display:grid;grid-template-columns:repeat(4,1fr);align-items:end;gap:11px;width:min(48%,475px)}.hero-pony{border:1px solid #fff9;border-radius:20px;background:#30204dcc;color:#fff;padding:6px;min-width:0;display:grid;justify-items:center;gap:5px;font-weight:800;font-size:clamp(.65rem,1.15vw,.91rem);line-height:1.15;box-shadow:0 6px 15px #1a10377a}.hero-pony:hover{background:#5b3984;border-color:#fff}.hero-pony .portrait{width:100%;height:auto;aspect-ratio:1;border-radius:14px}.hero-pony.favorite-pony{grid-row:2;transform:translateX(53%);border-color:#f6cbf2}.hero-pony.favorite-pony:last-child{grid-column:3}.hero::after{background:linear-gradient(90deg,#231637fa 1%,#271841e8 27%,#2c1d4b8c 49%,transparent 73%)}
@media(max-width:750px){.hero-cast{right:3.5%;width:46%;gap:7px}.hero-pony{border-radius:13px;padding:4px}.hero-pony .portrait{border-radius:9px}.hero-inner{padding-inline:28px}.hero h1{font-size:clamp(2.6rem,7.8vw,4rem)}}
@media(max-width:590px){.hero{align-items:end;min-height:565px}.hero::before{background-size:auto 78%;background-position:72% 0}.hero::after{background:linear-gradient(0deg,#261840 4%,#261840f2 26%,#26184055 74%,transparent 99%)}.hero-inner{padding:21px}.hero h1{font-size:clamp(2.6rem,11vw,3.8rem)}.hero-cast{right:6%;top:20px;bottom:auto;width:88%;gap:7px}.hero-pony{font-size:.77rem}.hero-pony .portrait{max-width:76px}}
.header-controls,.language-switch{display:flex;align-items:center;gap:12px}.language-switch{gap:4px}.language-switch a{display:block;color:#62428b;font-weight:850;font-size:.81rem;padding:5px 7px;border-radius:8px;text-decoration:none}.language-switch a[aria-current=page]{background:#eaddfa;color:#412773}.language-switch a:focus-visible{outline:2px solid #8451c4}@media(max-width:590px){.header-controls{gap:6px;flex-wrap:wrap;justify-content:flex-end}.language-switch a{padding:4px 5px}.header-controls .meter{gap:4px}.header-controls .meter progress{width:24px}.header-inner{padding-block:7px}.brand{gap:7px}}
.hero::before{content:none}.hero-scene{position:absolute;inset:0;z-index:-2;width:100%;height:100%;object-fit:cover;object-position:center 45%;pointer-events:none}.hero::after{z-index:-1}.button[hidden]{display:none}@media(max-width:590px){.hero-scene{height:81%;object-position:72% 15%}}
.chat-consent{border-top:0;margin-top:12px;padding:8px 12px;border-radius:12px;background:#f6effb}.chat-consent .ai-consent{margin:8px 0 3px}
