/* TheBSMU 1.4: study surfaces, companions and feedback. */
html{overscroll-behavior-y:none;background:var(--bg)}
body{background:var(--bg)}
#chrome-top{background:var(--bg);height:max(env(safe-area-inset-top,0px),0px)}
#header{position:fixed;top:0;background:var(--bg);transform:translateZ(0)}
.test-detail{max-width:740px;margin:auto}.test-detail>.text-btn{display:inline-flex;align-items:center;gap:7px;margin:0 0 20px}
.test-detail h1{font-size:clamp(26px,4vw,38px);overflow-wrap:anywhere}.test-detail .heading{margin:0 0 24px}
.test-overview{padding:26px}.test-meter{height:12px;border-radius:20px;overflow:hidden;display:flex;background:var(--tint);box-shadow:inset 0 2px 5px var(--glass-shade);margin-bottom:20px}.test-meter i{height:100%;background:var(--good);transition:width .6s var(--ease)}.test-meter i+i{background:var(--bad)}
.test-totals{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-bottom:28px;font-size:0.75rem;color:var(--muted)}.test-totals b{font-size:1.125rem;font-weight:600;color:var(--ink);margin-left:4px}.test-overview>.small{margin-top:21px;line-height:1.8}
.range-fields{display:grid;grid-template-columns:1fr 1fr;gap:14px}#start-form>.btn{margin-top:24px}#start-form>.note{margin-top:22px}#start-form .motion-option{padding:15px 0;border-top:0;border-bottom:1px solid var(--line)}
.attempts-list .study-card{width:100%}.attempts-list h3{overflow-wrap:anywhere}
.review-page{max-width:820px;margin:auto;padding-bottom:40px}.review-page .heading p{max-width:650px}.review-page .chips{align-items:center}.review-page .chip{display:flex;align-items:center;gap:6px}.review-page .chip .icon{width:15px;height:15px}
#review-count{padding:10px 0 17px}.review-question{margin-bottom:18px}.review-question h2{font-weight:550;font-size:1.1rem;margin:14px 0 20px}.review-options{display:grid;gap:7px}.review-option{display:flex;align-items:flex-start;gap:12px;padding:13px 12px;border-radius:15px;font-size:.88rem;line-height:1.6}.review-letter{display:grid;place-items:center;border-radius:50%;background:var(--tint);color:var(--accent);width:26px;height:26px;flex-shrink:0;font-size:0.75rem;font-weight:600}.review-option.is-correct{background:var(--good-soft);color:var(--good);font-weight:550}.is-correct .review-letter{background:var(--good);color:var(--surface)}.review-tick{margin-left:auto;flex-shrink:0;font-size:1.25rem}.review-pairs{display:grid;gap:8px}.review-pairs>div{display:grid;grid-template-columns:1fr 18px 1fr;gap:10px;padding:14px;border-radius:14px;background:var(--good-soft);color:var(--good);font-size:.85rem}.review-pairs .icon{width:17px}.review-pairs strong{font-weight:550}.review-page mark{background:var(--tint);color:var(--accent);border-radius:3px;padding:0 2px;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.review-dock{position:fixed;bottom:calc(12px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(600px,calc(100% - 24px));display:flex;gap:8px;align-items:center;border:1px solid var(--glass-edge);background:var(--glass);backdrop-filter:blur(28px) saturate(1.5);-webkit-backdrop-filter:blur(28px) saturate(1.5);box-shadow:inset 0 1px 2px var(--glass-edge),0 12px 38px var(--glass-shade);border-radius:36px;padding:9px;z-index:35}.review-dock .icon-btn{flex-shrink:0;border-radius:50%}.review-search{flex:1;display:flex;align-items:center;background:var(--tint);border-radius:28px;min-width:0;padding-left:13px;box-shadow:inset 0 2px 6px var(--glass-shade)}.review-search>.icon{color:var(--muted);width:19px}.review-search input{padding:12px 8px;border:0;box-shadow:none;background:transparent;min-width:0;font-size:1rem;appearance:none;-webkit-appearance:none}.review-search input::-webkit-search-cancel-button{display:none}.review-dock>.text-btn{font-size:1.562rem;min-width:34px;padding:3px}.review-search:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.hint-area{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0 18px}.hint-area>.text-btn{display:flex;align-items:center;gap:8px;min-height:44px}.hint-area .icon{width:17px;height:17px}.hint-note{display:flex;align-items:center;gap:10px;padding:13px 15px;background:var(--tint);border-radius:15px;color:var(--accent);font-size:0.75rem;flex:1}.hint-area>small{max-width:85px;font-size:0.625rem}.result-message h1{margin-bottom:13px}.result-message p{font-size:0.8125rem;line-height:1.7;max-width:320px;margin:auto}
.pet-slot[hidden]{display:none!important}.pet-slot{margin:20px 0}.pet-habitat{border:1px solid var(--line);border-radius:23px;padding:14px 18px 0;background:linear-gradient(120deg,var(--surface),var(--tint));overflow:hidden;box-shadow:inset 0 1px 1px var(--glass-edge)}.pet-habitat-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.pet-habitat-head .text-btn{font-size:0.6875rem;min-height:40px;padding:5px 7px}.pet-habitat-head>div{display:flex}.pet-land{height:135px;position:relative}.pet-ground{position:absolute;bottom:12px;left:0;right:0;height:1px;background:var(--line)}
.pet-character{display:block;position:relative;width:76px;height:81px;transform-origin:center bottom;animation:pet-breathe 4s ease-in-out infinite}.pet-art{width:100%;height:100%;overflow:visible;filter:drop-shadow(0 4px 1px #1a12211c);image-rendering:pixelated}.pet-walker{position:absolute;left:4%;bottom:12px;padding:0;z-index:2;animation:pet-walk 18s ease-in-out infinite}.pet-walker:hover .pet-character{rotate:5deg}.pet-bubble{position:relative;border:1px solid var(--line);border-radius:17px 17px 17px 5px;background:var(--surface);padding:12px 14px;color:var(--ink);font-size:0.75rem;line-height:1.65;box-shadow:0 5px 15px #26172e08}.pet-land .pet-bubble{position:absolute;right:0;top:5px;width:min(260px,calc(100% - 83px));z-index:3}.pet-coach{display:flex;align-items:center;gap:12px;text-align:left}.pet-tap{padding:0;flex-shrink:0}.pet-coach .pet-character{width:55px;height:59px}.pet-coach .pet-bubble{flex:1}.pet-eyes{transform-origin:center 15px;animation:pet-blink 6.7s infinite}.pet-tail{transform-box:fill-box;transform-origin:bottom left;animation:pet-tail 1.7s ease-in-out infinite}.pet-happy-mouth,.pet-closed-eyes{display:none}.pet-flying-heart,.pet-zzz,.pet-bowl{display:none;position:absolute;pointer-events:none}.pet-flying-heart{color:#d74489;right:-5px;top:0;font-size:1.25rem;text-shadow:1px 1px var(--surface)}.pet-zzz{right:-5px;top:-5px;color:var(--accent);font-size:0.875rem;font-weight:700}.pet-bowl{bottom:-4px;right:0;color:var(--accent);font-size:1.688rem}
[data-emotion=love] .pet-flying-heart{display:block;animation:pet-love 1.6s ease-in-out 3}[data-emotion=love] .pet-happy-mouth,[data-emotion=eat] .pet-happy-mouth{display:block}[data-emotion=love] .pet-smile,[data-emotion=eat] .pet-smile{display:none}[data-emotion=wink] .pet-eye-right{height:1px;transform:translateY(1px)}[data-emotion=sleep] .pet-eyes{display:none}[data-emotion=sleep] .pet-closed-eyes{display:block}[data-emotion=sleep] .pet-zzz{display:block;animation:pet-love 3s ease-in-out infinite}[data-emotion=sleep]{rotate:-8deg}[data-emotion=eat] .pet-bowl{display:block}[data-emotion=eat]{animation:pet-munch .6s ease-in-out 8}.pet-resting .pet-walker{animation-play-state:paused}
.pet-settings{padding:24px;margin-top:20px}.pet-settings .motion-option{padding:0 0 20px;border-top:0}.pet-picker{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:17px}.pet-choice{display:grid;justify-items:center;gap:5px;min-width:0;border:1px solid var(--line);background:var(--bg);border-radius:16px;padding:12px 5px}.pet-choice>.pet-art{width:55px;height:59px}.pet-choice strong{font-size:0.75rem;font-weight:550}.pet-choice small{font-size:0.625rem;text-align:center}.pet-choice[aria-pressed=true]{border-color:var(--accent);background:var(--tint);box-shadow:0 0 0 2px var(--tint)}.pet-choice:hover .pet-art{translate:0 -3px}.pet-choice .pet-art{transition:translate .4s var(--ease)}
.celebration{position:fixed;inset:0;pointer-events:none;z-index:50;overflow:hidden}.celebration i{position:absolute;left:var(--x);top:-20px;width:7px;height:12px;background:var(--accent);border-radius:2px;animation:confetti-fall 2.4s var(--delay) cubic-bezier(.18,.5,.4,1) both}.celebration i:nth-child(2n){background:var(--good)}.celebration i:nth-child(3n){background:#d6b46e}.celebration .star{width:12px;height:12px;clip-path:polygon(50% 0,63% 37%,100% 50%,63% 63%,50% 100%,37% 63%,0 50%,37% 37%)}
@keyframes pet-blink{0%,44%,48%,100%{scale:1 1}46%{scale:1 .08}}
@keyframes pet-breathe{50%{transform:translateY(-2px) scale(1.02)}}
@keyframes pet-tail{50%{rotate:14deg}}
@keyframes pet-walk{0%,15%,100%{left:4%}40%,55%{left:64%}70%,85%{left:33%}}
@keyframes pet-love{0%{opacity:0;transform:translate(0,8px) scale(.5)}40%{opacity:1}100%{opacity:0;transform:translate(7px,-18px) scale(1.2)}}
@keyframes pet-munch{50%{transform:translateY(3px) rotate(3deg)}}
@keyframes confetti-fall{0%{opacity:0;transform:translateY(0) rotate(0)}10%{opacity:.85}100%{opacity:0;transform:translate(var(--drift),72vh) rotate(var(--spin))}}
@media(min-width:1001px){.review-dock{left:calc(50% + 135px)}.pet-land{height:145px}.pet-land .pet-bubble{width:300px}.pet-walker{animation-name:pet-walk}.pet-habitat{max-width:700px}.pet-habitat-head .text-btn{min-height:32px}}
@media(max-width:370px){.test-overview{padding:20px}.test-totals{font-size:0.6875rem}.test-totals b{font-size:1rem}.pet-settings{padding:18px}.pet-picker{grid-template-columns:repeat(2,minmax(0,1fr))}.pet-land .pet-bubble{font-size:0.6875rem}.review-question{padding:18px}.review-option{padding:11px 8px;gap:8px}}
@media(prefers-reduced-motion:reduce){.pet-character,.pet-walker,.pet-art *{animation:none!important}.celebration{display:none}}
body[data-motion=reduced] .celebration{display:none}

@media(max-width:1000px){dialog{margin:auto auto 0;max-width:640px;width:100%;border-radius:28px 28px 0 0;max-height:91dvh}#sheet{max-height:90dvh;padding-bottom:calc(25px + env(safe-area-inset-bottom))}#sheet:before{content:'';display:block;width:36px;height:5px;border-radius:5px;background:var(--line);margin:-10px auto 21px}}
