
:root{color-scheme:light;--ink:#251744;--muted:#625475;--purple:#6030ca;--deep:#482492;--line:#e8ddf7;--paper:#fff;--bg:#f9f6ff;--display:'Outfit','Nunito',system-ui,sans-serif;--text:'Nunito',system-ui,sans-serif}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--text);font-weight:700;line-height:1.45}
button,input{font:inherit}
button{color:inherit;cursor:pointer}
button:disabled{cursor:default}
a{color:var(--deep)}
:focus-visible{outline:3px solid #6330c4;outline-offset:4px}
[tabindex="-1"]{scroll-margin-top:20px}
.skip{position:absolute;left:12px;top:10px;transform:translateY(-150%);z-index:5;border-radius:12px;background:white;padding:12px}
.skip:focus{transform:none}
.wrap{width:min(1120px,calc(100% - 64px));margin-inline:auto}
.top{background:#fdfbff;border-bottom:1px solid var(--line)}
.top-inner{height:76px;display:flex;align-items:center;justify-content:space-between;position:relative;gap:16px}
.brand,.tabs button,.sound,.back,.text-button{border:0;background:transparent}
.brand{font-family:var(--display);font-size:23px;font-weight:800;display:flex;align-items:center;gap:11px;padding:0;white-space:nowrap}
.brand-icon{width:38px;height:38px;border-radius:12px;background:#6e3bd1;color:white;display:grid;place-items:center;font-size:25px;box-shadow:inset 0 0 0 1px #5122ab}
.tabs{display:flex;gap:6px}
.tabs button,.sound{min-height:44px;padding:8px 15px;border-radius:12px;color:var(--muted);white-space:nowrap;font-weight:800}
.tabs button[aria-current="page"],.tabs button:hover,.sound:hover{color:var(--deep);background:#eee5ff}
.sound{border:1px solid #e5d8f6;display:flex;align-items:center;gap:7px;background:white}
.sound span{color:var(--purple);font-size:19px;line-height:1}
.sound-menu{position:absolute;right:0;top:65px;z-index:4;width:255px;padding:18px;border:1px solid var(--line);border-radius:17px;background:white;box-shadow:0 12px 30px #31126922}
.sound-menu h2{margin:0 0 8px;font-size:19px}
.sound-menu label{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:15px}
.sound-menu input{width:20px;height:20px;accent-color:var(--purple)}
.sound-menu .text-button{min-height:44px;padding:6px 2px;text-align:left;font-size:14px}
.sound-menu .text-button:disabled{opacity:.6}
.sound-menu p{margin:5px 0 0;color:var(--muted);font-size:13px}
main{min-height:65vh}
.hero{position:relative;overflow:hidden;isolation:isolate;border-radius:25px;margin-top:28px;min-height:380px;display:grid;align-items:center;background:#eee3ff;box-shadow:inset 0 0 0 1px #e7d4fc}
.hero::before{content:'';position:absolute;inset:0;z-index:-2;background:url('unicorn-quest.webp') right 37% / min(100%,920px) auto no-repeat}
.hero::after{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#eee3ff 0%,#eee3ff 22%,#eee3ffed 32%,#eee3ff00 64%);pointer-events:none}
.hero-copy{padding:36px 52px;width:min(595px,65%)}
.hero-label,.count,.topic-tag{display:inline-flex;align-items:center;gap:7px;padding:5px 12px;border-radius:999px;background:#faf5ff;color:#51289c;font-size:13px;font-weight:900;border:1px solid #dbc8f7}
.hero-label span{font-size:14px}
h1,h2,h3,p{margin-top:0}
h1,h2,h3{font-family:var(--display);font-weight:750;line-height:1.08}
.hero h1{font-size:clamp(45px,6vw,76px);line-height:.98;letter-spacing:-.06em;margin:15px 0 15px}
.hero h1 em{font-style:normal;color:#6332b7}
.hero p{font-size:17px;max-width:320px;color:#554268;margin-bottom:22px}
.primary,.secondary{min-height:48px;border-radius:13px;padding:10px 19px;display:inline-flex;align-items:center;justify-content:center;gap:13px;font-weight:900}
.primary{border:1px solid #5828ba;background:#6531cc;color:white;box-shadow:0 3px 0 #48239b}
.primary:hover{background:#5426b1}
.secondary{border:1px solid #e0d1f2;background:white;color:var(--deep)}
.secondary:hover{background:#f1e9ff}
.primary[disabled]{background:#e9e0f5;box-shadow:none;color:#645775;border-color:#e6dcf3}
.subjects{margin-top:37px}
.section-head{display:flex;justify-content:space-between;align-items:end;gap:12px;margin-bottom:17px}
.section-head h2{font-size:clamp(29px,4.2vw,39px);letter-spacing:-.035em;margin:0 0 5px}
.section-head p,.card p,.panel p,.source-info{color:var(--muted)}
.section-head p{margin:0}
.count{white-space:nowrap;background:#f2e9ff}
.subject-grid,.topic-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}
.card{width:100%;display:flex;min-height:142px;text-align:left;padding:17px;gap:14px;position:relative;background:white;border:1px solid var(--line);border-radius:19px;box-shadow:0 3px 0 #eadff87d;align-items:flex-start}
.card:hover{border-color:#a789dc;background:#fefaff}
.card h3{font-size:22px;margin:2px 23px 6px 0;letter-spacing:-.02em}
.card p{font-size:14px;margin:0 0 8px}
.card small{font-size:13px;color:#58369b;font-weight:900}
.card-icon{width:49px;height:49px;flex:0 0 49px;display:grid;place-items:center;border-radius:15px;font-size:24px;background:var(--tint,#eee5ff);color:var(--accent,#5729a3);font-weight:900}
.arrow{position:absolute;right:15px;top:16px;font-size:20px;color:#6840ae}
.source-info{margin-top:27px;font-size:14px;border-top:1px solid var(--line);padding-top:13px}
.source-info summary{min-height:40px;cursor:pointer;color:var(--deep);font-weight:900}
.source-info p{max-width:80ch}
.footer{display:flex;justify-content:space-between;gap:10px;border-top:1px solid var(--line);margin-top:32px;padding:19px 0 28px;color:var(--muted);font-size:13px}
.footer-star{color:var(--purple);margin-right:4px}
.inner{padding-top:29px}
.back{padding:8px 6px;min-height:44px;color:var(--deep);font-weight:900;margin-bottom:12px}
.back:hover,.text-button:hover{text-decoration:underline}
.page-head{border:1px solid var(--line);border-radius:23px;background:linear-gradient(120deg,#f1e6ff,#ebefff);padding:25px 28px;margin-bottom:22px;display:flex;gap:17px;align-items:center}
.page-head h1,.heading{font-size:clamp(31px,6vw,51px);letter-spacing:-.05em;margin:0 0 5px}
.page-head p{margin:0;color:var(--muted)}
.panel{border:1px solid var(--line);border-radius:21px;background:white;padding:clamp(17px,4vw,29px);box-shadow:0 4px 0 #eee4fb}
.quiz-frame{width:min(810px,100%);margin:auto}
.quiz-top{display:flex;justify-content:space-between;align-items:center;gap:10px}
.quiz-top .back{margin:0}
.quiz-header{background:#efe6fd;padding:13px 17px;margin:8px 0 17px;border-radius:14px;display:grid;gap:8px}
.quiz-header div{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#553a79}
progress{width:100%;height:10px;appearance:none;border:0;border-radius:12px;background:#ded1f3;color:var(--purple)}
progress::-webkit-progress-bar{background:#ded1f3;border-radius:12px}
progress::-webkit-progress-value{background:#7945d7;border-radius:12px}
progress::-moz-progress-bar{background:#7945d7;border-radius:12px}
.question-title{font-size:clamp(23px,4vw,33px);letter-spacing:-.028em;margin:9px 0 19px}
fieldset{border:0;margin:0;padding:0;min-width:0}
.options{display:grid;gap:9px}
.option{position:relative;display:flex;align-items:center;gap:12px;min-height:49px;padding:8px 13px;border:1px solid #e8ddf4;border-radius:12px;background:#fcfaff;cursor:pointer}
.option:hover,.option:has(:checked){border-color:#9d76db;background:#f0e7fc}
.option:has(:focus-visible){outline:3px solid var(--purple);outline-offset:2px}
.option:has(:disabled){cursor:default}
.option input{width:18px;height:18px;margin:0;flex:none;accent-color:#6531cc}
.option-letter{color:#5e3997;min-width:18px}
.option.tried{background:#faf5fd;color:#705b82}
.option.right{border-color:#65ad91;background:#eaf8ef;color:#20543f}
.option-status{margin-left:auto;font-size:12px;font-weight:900;text-align:right}
.feedback{margin:16px 0 0;padding:12px 14px;border-radius:12px;background:#f6ebff;color:#4c237b}
.feedback.good{background:#e9f6ee;color:#20543f}
.feedback p{margin:0;color:inherit}
.feedback .text-button{padding:4px 0;min-height:44px}
.quiz-actions{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;margin-top:19px;align-items:center}
.text-button{color:var(--deep);padding:7px 4px;min-height:44px;font-weight:900}
.text-button:hover{color:#351364}
.score-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin:16px 0}
.score-box{background:#f5edff;border-radius:12px;padding:8px;text-align:center;color:#543480;overflow-wrap:anywhere}
.score-box strong{display:block;font-family:var(--display);font-size:27px;color:var(--deep)}
.score-box span{font-size:12px}
.history-grid{display:grid;gap:13px}
.history-card{padding:17px 19px}
.history-card h2{font-size:22px;margin:0 0 5px}
.history-card p{margin:0}
.history-card .score-grid{margin-bottom:8px}
.history-extra{font-size:14px}
.history-header{margin-bottom:20px}
.dim{color:var(--muted)}
.keep-going{margin-bottom:20px;display:flex;justify-content:space-between;align-items:center;gap:15px;flex-wrap:wrap}
.keep-going h2{margin:0 0 5px}
.keep-going p{margin:0}
.alert{margin-top:16px;padding:10px 12px;border-radius:10px;background:#f9e8f0;color:#633552}
dialog{width:min(440px,calc(100% - 28px));border:1px solid var(--line);border-radius:18px;padding:24px;color:var(--ink)}
dialog::backdrop{background:#23113d70}
dialog h2{margin-bottom:9px}
dialog p{color:var(--muted)}
dialog form{display:flex;gap:10px;justify-content:end;flex-wrap:wrap}
@media(max-width:880px){.subject-grid,.topic-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.hero-copy{padding-left:35px}.hero::before{background-size:auto 138%;background-position:right 43%}}
@media(max-width:580px){.wrap{width:calc(100% - 28px)}.top-inner{height:auto;min-height:66px;display:grid;grid-template-columns:1fr auto;gap:4px 10px;padding:10px 0 6px}.brand{font-size:20px}.brand-icon{width:34px;height:34px}.sound{grid-column:2;grid-row:1}.tabs{grid-row:2;grid-column:1/-1}.tabs button{min-height:42px}.sound-menu{top:57px}.hero{margin-top:14px;border-radius:20px;min-height:528px;align-items:start}.hero-copy{padding:21px 20px;width:100%}.hero h1{font-size:clamp(40px,12vw,55px);margin:12px 0}.hero p{font-size:15px;margin-bottom:15px;max-width:260px}.hero::before{background-size:auto 360px;background-position:right bottom -15px}.hero::after{background:linear-gradient(180deg,#eee3ff 0%,#eee3ff 40%,#eee3ff00 65%)}.subjects{margin-top:24px}.subject-grid,.topic-grid{grid-template-columns:1fr;gap:10px}.card{min-height:104px}.card h3{font-size:21px}.count{font-size:11px;padding:4px 8px}.page-head{padding:18px}.score-box{padding:6px 3px}.quiz-header{font-size:13px}.quiz-actions .primary,.quiz-actions .secondary{padding:8px 12px}.option-status{max-width:64px}.footer{flex-wrap:wrap}}
@media(prefers-reduced-motion:no-preference){button,.card{transition:background-color 130ms,border-color 130ms}}
@media(forced-colors:active){.option:has(:checked),.tabs [aria-current]{border:2px solid Highlight}}

.trail-stars{
  display:inline-flex;align-items:center;gap:8px;justify-self:start;
  color:#4f336b;font-size:13px;font-weight:900
}
.star-glyphs{font-size:19px;color:#854811;letter-spacing:.13em;line-height:1}
.feedback .star-earned{color:#754312;font-weight:900;margin-top:7px}
.quiz-indicators{flex-wrap:wrap}
.level-badge{
  display:inline-flex;padding:3px 9px;border-radius:99px;background:#e2f3f7;
  color:#25516a;font-size:13px;font-weight:900
}
.level-badge[data-level="1"]{background:#e3d7fc;color:#492780}
.level-badge[data-level="2"]{background:#f8dfef;color:#733051}
.feedback .level-change{margin-top:6px;font-weight:900}
.starting-clue{
  margin:0 0 16px;padding:10px 13px;border:1px solid #dcd5f6;
  border-radius:12px;background:#f5efff;color:#50357a
}
.starting-clue strong{display:block}
.question-diagram{
  margin:0 0 18px;padding:14px 16px 16px;
  border:1px solid #dcd5f6;border-radius:16px;background:#f7f6ff;color:#362459
}
.question-diagram figcaption{margin-bottom:11px;color:#593990;font-weight:900}
.diagram-flow,.diagram-bars{margin:0;padding:0;list-style:none}
.diagram-flow{display:flex;gap:21px;align-items:stretch}
.diagram-flow li{
  position:relative;flex:1;display:grid;place-items:center;min-height:45px;
  padding:6px 9px;border:1px solid #cbbcec;border-radius:9px;background:#fff;
  font-weight:900;text-align:center;overflow-wrap:anywhere
}
.diagram-flow li + li::before{
  content:'→';position:absolute;inset-inline-start:-20px;color:#6b46a7;font-size:17px
}
.diagram-grid{
  display:grid;grid-template-columns:repeat(var(--columns),minmax(20px,42px));
  gap:4px;width:fit-content;max-width:100%
}
.diagram-cell{
  display:grid;place-items:center;aspect-ratio:1;border:1px solid #c5b5e5;border-radius:5px;
  background:#fff;font-weight:900;color:#452276
}
.diagram-cell[data-tile="*"],.diagram-cell[data-tile="A"]{background:#e8d7ff;border-color:#a581d7}
.diagram-cell[data-tile="B"]{background:#d9edff;color:#1e557f;border-color:#85accd}
.diagram-bars{display:grid;gap:8px;max-width:460px}
.diagram-bars li{display:grid;grid-template-columns:6.5em minmax(0,1fr) 2.5ch;gap:9px;align-items:center}
.bar-track{display:block;background:#e8e0f6;border-radius:4px;height:14px}
.bar-track span{display:block;height:100%;background:#7542c6;border:1px solid #6232b0;border-radius:4px}
.diagram-table{width:100%;border-collapse:collapse;text-align:left}
.diagram-table th,.diagram-table td{padding:7px 9px;border:1px solid #d9ccec}
.diagram-table thead{background:#ebe2fb}
.diagram-table tbody{background:#fff}
.diagram-line{position:relative;height:114px;margin-inline:10px}
.diagram-line::before{content:'';position:absolute;inset:54px 0 auto;border-top:3px solid #6944a5}
.diagram-line .pin{
  position:absolute;left:var(--at);top:49px;transform:translateX(-50%);
  width:13px;height:13px;background:#6635b5;border-radius:50%
}
.pin span{
  position:absolute;bottom:17px;left:50%;transform:translateX(-50%);
  text-align:center;font-size:13px;font-weight:900;line-height:1.1
}
.pin.below span{bottom:auto;top:17px}
.diagram-symbols{display:flex;gap:9px;color:#824609;font-size:clamp(30px,6vw,44px);line-height:1.1}
.half-star{
  color:#824609;background:linear-gradient(90deg,#824609 50%,#b4a4c3 50%);
  -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent
}
.balloon-track{position:relative;height:85px;max-width:370px}
.balloon-arrow{position:absolute;left:0;top:19px;font-weight:900;color:#53368b}
.balloon-shape{
  position:absolute;top:17px;left:46%;width:77px;height:52px;
  border:2px solid #7541a9;border-radius:48% 50% 50% 48%;background:#e4c6fa
}
.balloon-shape::after{
  content:'';position:absolute;right:-9px;top:21px;width:9px;height:9px;
  background:#e4c6fa;border:2px solid #7541a9;border-radius:3px
}
.balloon-string{position:absolute;left:0;right:0;top:43px;border-top:2px dashed #63438d}
@media(max-width:580px){
  .question-diagram{padding:12px}
  .diagram-flow li{font-size:13px;padding:5px}
  .diagram-flow{gap:17px}
  .diagram-flow li + li::before{inset-inline-start:-16px}
  .diagram-flow.flow-long{flex-direction:column;gap:15px}
  .diagram-flow.flow-long li{min-height:29px}
  .diagram-flow.flow-long li + li::before{
    inset-inline-start:50%;top:-21px;transform:translateX(-50%) rotate(90deg)
  }
}
@media(forced-colors:active){
  .diagram-cell[data-tile="*"],.diagram-cell[data-tile="A"],.diagram-cell[data-tile="B"],
  .bar-track span,.diagram-line .pin{forced-color-adjust:none}
}

.tabs{margin-inline:auto}
.player-switch{
  display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:7px 11px;
  border:1px solid #d9c7f5;border-radius:12px;background:#f0e7ff;color:var(--deep);
  font-weight:900;min-width:0
}
.player-switch:hover{background:#e7d7fb}
.player-switch-icon{font-size:18px;line-height:1;flex:none}
#active-player-name{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#player-greeting{overflow-wrap:anywhere}
.player-welcome{
  min-height:510px;background:#eee3ff;
}
.player-welcome::before{background-size:min(100%,1020px) auto;background-position:right 42%}
.player-welcome .player-box{
  z-index:1;width:min(485px,53%);margin:clamp(20px,5vw,54px);
  background:#fff;box-shadow:0 4px 15px #46248515
}
.player-welcome h1{font-size:clamp(32px,5vw,51px);line-height:1.03;margin:0 0 11px}
.player-welcome h1:has(+ #player-intro[hidden]){margin-bottom:22px}
.player-welcome .player-box p{font-size:16px;max-width:none;margin:0 0 18px}
.player-list{list-style:none;display:grid;gap:8px;padding:4px;margin:0 -4px 16px;max-height:254px;overflow:auto}
.player-option{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;
  min-height:55px;width:100%;padding:8px 10px;border:1px solid #dfd1f5;border-radius:12px;
  background:#f9f5ff;text-align:left;color:#492780;font-weight:900
}
.player-option:hover{background:#ede3fc}
.player-label{overflow-wrap:anywhere}
.player-initial{
  display:grid;place-items:center;min-width:33px;height:33px;padding:0 4px;border-radius:10px;
  background:#ead9ff;color:#6231a1;font-family:var(--display)
}
.player-list li:nth-child(3n + 2) .player-initial{background:#dbeeff;color:#315a8c}
.player-list li:nth-child(3n) .player-initial{background:#f9dff1;color:#823d68}
.player-form{display:grid;gap:8px}
.player-form label{font-weight:900}
.player-form-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.player-form input{
  flex:1;min-width:min(140px,100%);width:0;min-height:48px;border:1px solid #bb9edb;border-radius:11px;
  padding:8px 11px;color:var(--ink);font-size:16px;background:#fff
}
.player-form input[aria-invalid="true"]{border-color:#9c3c65}
.player-welcome .player-box .player-error{color:#843854;font-size:14px;margin:0}
.player-error:empty{display:none}
.player-welcome .player-box .player-note{color:var(--muted);font-size:13px;margin:16px 0 0}
@media(max-width:760px){
  .player-welcome .player-box{width:min(440px,61%)}
  .player-welcome::before{background-size:auto 108%}
}
@media(max-width:580px){
  .tabs{grid-column:1;justify-self:start;margin:0;gap:0}
  .tabs button{padding-inline:9px}
  .player-switch{grid-row:2;grid-column:2;justify-self:end;max-width:min(120px,28vw);padding-inline:7px}
  #active-player-name{max-width:none}
  .player-welcome{min-height:0;padding:15px 14px 228px}
  .player-welcome .player-box{width:100%;margin:0}
  .player-welcome::before{background-size:auto 310px;background-position:right bottom -18px}
  .player-welcome::after{background:linear-gradient(180deg,#eee3ff 0 40%,#eee3ff00 85%)}
  .player-welcome h1{font-size:38px}
  .player-form-row .primary{width:100%;order:1}
}
