/* Artwork is selected by the existing learning bracket, without changing stored progress. */
body[data-age-theme=junior]{--age-art:url('../img/home-junior.webp');--age-panel:#47316d;--age-panel-low:#30234f;--age-edge:#b19bd8;background:radial-gradient(ellipse at top left,#7955bb,transparent 65%),linear-gradient(145deg,#34205c,#24183f)}
body[data-age-theme=quest]{--age-art:url('../img/quest-team.webp');--age-panel:#3c296c;--age-panel-low:#251743;--age-edge:#8f6fbc}
body[data-age-theme=teen]{--age-art:url('../img/home-teen-game.webp');--age-panel:#183a61;--age-panel-low:#112740;--age-edge:#467ca5;background:radial-gradient(ellipse at top left,#174979,transparent 65%),linear-gradient(145deg,#102749,#0b1729)}
body[data-age-theme=adult]{--age-art:url('../img/home-adult.webp');--age-panel:#1d344b;--age-panel-low:#132334;--age-edge:#526d86;background:radial-gradient(ellipse at top left,#23455f,transparent 65%),linear-gradient(145deg,#111e30,#0b1420)}
body[data-age-theme] .hero-scene{background-image:var(--age-art);background-position:center}.hero-scene{aspect-ratio:2.15}
body[data-age-theme=teen] .hero-scene,body[data-age-theme=junior] .hero-scene{background-position:center 12%}
.quest-brand-icon{display:inline-block;width:38px;height:38px;border-radius:11px;vertical-align:middle;margin-right:8px;box-shadow:0 2px 6px #0004}
body[data-age-theme=teen] #home .home-tabs,body[data-age-theme=adult] #home .home-tabs,body[data-age-theme=teen] .profile-row,body[data-age-theme=adult] .profile-row,body[data-age-theme=teen] .chip,body[data-age-theme=adult] .chip,body[data-age-theme=teen] .footer,body[data-age-theme=adult] .footer{background:#112943ed;border-color:#537d9d}
body[data-age-theme=teen] .footer button,body[data-age-theme=adult] .footer button,body[data-age-theme=teen] .top-btn,body[data-age-theme=adult] .top-btn{background:#1e405e;border-color:#648ba8;color:#f0faff}
body[data-age-theme=mini] .chip{background:#fff3e5;color:#4b3151;border-color:#bc8b76;box-shadow:0 3px 0 #bf967c}
body[data-age-theme] .panel,body[data-age-theme] #home .home-page .hero.hero-game{background:linear-gradient(135deg,var(--age-panel,#3c296c),var(--age-panel-low,#251743))!important;border-color:var(--age-edge,#8f6fbc)!important}
body[data-age-theme] .hero-scene:after{background:linear-gradient(transparent,var(--age-panel-low,#251743))}
body[data-age-theme=teen] .home-tab[aria-selected=true],body[data-age-theme=adult] .home-tab[aria-selected=true]{background:linear-gradient(#8de7ff,#3bb0de)!important;border-color:#c8f5ff!important;color:#102b41!important;box-shadow:0 3px 0 #1c597b!important}
body[data-age-theme=teen] .secondary,body[data-age-theme=adult] .secondary,body[data-age-theme=teen] .lang-chip,body[data-age-theme=adult] .lang-chip,body[data-age-theme=teen] .lesson,body[data-age-theme=adult] .lesson,body[data-age-theme=teen] .answer,body[data-age-theme=adult] .answer{background:linear-gradient(#224966,#162e48);border-color:#6389a5}
body[data-age-theme=teen] .mc-arena{background:linear-gradient(135deg,#426be0,#4436a4)}body[data-age-theme=adult] .mode-card{border-radius:16px;box-shadow:0 4px 0 #071421}.player-level-emblem{width:46px;height:46px;flex:none;filter:drop-shadow(0 3px 4px #0005)}
#profile-level-progress{height:12px;min-height:12px;border:1px solid #ffffff55;background:#120f29}#profile-xpbar{background:linear-gradient(90deg,#31c9ef,#87f4e1);box-shadow:0 0 12px #56daf5;transition:width .5s ease}
.level-up-toast{position:fixed;z-index:220;top:max(20px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:15px;padding:15px 24px;border:2px solid #ffe89d;border-radius:24px;background:linear-gradient(130deg,#5d3597,#152e54);box-shadow:0 0 40px #ffd65455,0 10px 35px #0008;color:#fff;font-size:24px;font-weight:900;max-width:calc(100vw - 24px);white-space:nowrap;pointer-events:none;animation:quest-level-pop .5s cubic-bezier(.2,.8,.2,1)}
.level-up-toast[hidden]{display:none}.level-up-emblem{width:64px;height:64px;filter:drop-shadow(0 0 12px #ffd65988)}@keyframes quest-level-pop{from{opacity:0;transform:translate(-50%,-24px) scale(.8)}to{opacity:1;transform:translate(-50%,0) scale(1)}}
body[data-age-theme=mini]{--age-panel:#fff3e5;--age-panel-low:#fff9ef;--age-edge:#d39975;color:#3e2a46;background:radial-gradient(ellipse at top,#ffedce,transparent 75%),linear-gradient(145deg,#ffe3c9,#ffccd0);background-attachment:fixed}
body.mini .mini-home{color:#3e2a46}body.mini .mini-home h1,body.mini .mini-hero p{color:#4b3151}.mini-elephant{width:min(54vw,230px);aspect-ratio:1;height:auto;object-fit:contain;border-radius:50%;box-shadow:0 6px 20px #b47c6440}.mini-hero{padding:6px 0 18px}
body.mini .mini-tile{background:linear-gradient(145deg,#fff9e9,#ffe4c9);border-color:#d49a72;color:#4c3250;box-shadow:0 5px 0 #c69376}body.mini .mini-tile strong{color:#4c3250}body.mini .mini-tile.done{border-color:#b97d00}body.mini .mini-card{background:#fff4e5;border-color:#c19687;color:#402a48}body.mini .mini-card strong,body.mini .mini-card small{color:#402a48}
body.mini .top-btn{background:#fff3e5;border-color:#bc8b76;color:#4b3151;box-shadow:0 3px 0 #bf967c}body.mini .logo.logo-home{color:#4b3151;text-shadow:none}body.mini .logo span{color:#8b4c20}body.mini .footer{background:#fff1e3ed;border-color:#c49a87}body.mini .footer button{background:#f4ddcf;color:#4b3151;border-color:#bb8c7c}body.mini .footer button.active{background:#ffd66a;color:#493230}body.mini .legal-note{background:#fff3e5;color:#533b51;border-color:#bb8b76}body.mini .legal-note a{color:#195276}body.mini #play .question,body.mini #play #kind{color:#432c49}body.mini #play .answer{color:#432c49;background:#fff1da;border-color:#c59878}body.mini #play .answer.selected{background:#d6f1e8;border-color:#318176}body.mini #play .answer.correct{background:#cef0db;border-color:#3c8060}body.mini #play .feedback{color:#fff}
.gate-card{position:relative;overflow:hidden;min-height:94px;justify-content:flex-start;padding:14px 20px;gap:18px}.gate-art{width:68px;height:68px;object-fit:cover;border-radius:16px;flex:none}.gate-card strong{text-align:left;font-size:18px}.gate-card:nth-of-type(4),.gate-card:nth-of-type(5){background:linear-gradient(135deg,#174976,#132942);border-color:#6f9fbd;box-shadow:0 5px 0 #081a2d}.gate-slon .gate-art{border-radius:50%}.gate-box{max-width:530px}
/* State feedback must take precedence over each theme's neutral surfaces. */
body[data-age-theme] .answer.selected{background:#254e65;border-color:#62ddff}
body[data-age-theme] .answer.correct{background:#174c3b;border-color:#7cf2ae}
body[data-age-theme] .answer.wrong{background:#642b4c;border-color:#ff92b0}
body[data-age-theme] .lesson.done{border-color:#65ddbd}
body[data-age-theme] .lang-chip.active{background:linear-gradient(#326577,#23424e);border:2px solid #6be4e3}
body.mini #play .answer.wrong{background:#f8d1d8;border-color:#a42d54;color:#54223a}
body.mini .slon-play{background:radial-gradient(ellipse at top,#fff3d8,transparent 70%),linear-gradient(145deg,#ffdfba,#ffced1);color:#4b3151}
body.mini .sp-bubble{color:#4b3151;text-shadow:none}body.mini .sp-word{color:#4b3151;background:#fff4df;border-color:#d6a077}body.mini .sp-dot{background:#e8c0a6;border-color:#a87860}body.mini .sp-dot.now{background:#ffd34e}body.mini .sp-dot.done{background:#56ae85}
/* German labels and file controls must wrap even on the smallest phones. */
button{overflow-wrap:anywhere}#home .home-page .row>*{min-width:0}.import-input{width:100%;min-width:0}.settings-extra{min-width:0}.top-ctl{flex-wrap:wrap}.lq-box{max-width:100%}body.in-play #check{box-shadow:0 -8px 12px 3px var(--age-panel-low,#251743),0 4px 0 #0a7a3a}
@media(max-width:699px){.hero-scene{aspect-ratio:1.6}.player-level-emblem{width:36px;height:36px}.top{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.top .logo.logo-home{font-size:clamp(20px,5.5vw,27px);letter-spacing:-1px;padding:0;justify-self:start;min-width:0}.top .top-ctl{grid-column:2;grid-row:1;margin:0;gap:5px}.top .stats{grid-column:1 / -1;grid-row:2}.top-btn{padding:5px 7px;font-size:14px;min-width:44px;min-height:44px}.top-btn .flag{width:26px;height:19px}#top-age:before{content:none}.hero-game .hero-text .pill{font-size:11px}body.mini .mini-home{padding:16px}.level-up-toast{font-size:20px;padding:12px 18px}}
@media(min-width:1000px){.hero-scene{aspect-ratio:2.25}.gate-box{max-width:600px}.gate-card{min-height:104px}.gate-art{width:76px;height:76px}}
@media(orientation:landscape) and (max-height:540px){.hero-scene{aspect-ratio:3.8}.mini-hero{display:grid;grid-template-columns:110px 1fr;text-align:left;gap:0 20px;padding-bottom:12px}.mini-elephant{width:100px;grid-row:1 / 3}.mini-hero h1{align-self:end}.mini-hero p{align-self:start}.mini-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.mini-tile{min-height:130px}.gate-box{margin:0 auto}.gate-card{min-height:80px}.gate-art{width:56px;height:56px}}
@media(max-width:699px){.quest-brand-icon{width:28px;height:28px;margin-right:5px;border-radius:8px}}
.mini-elephant,.sp-elephant,.gate-slon .gate-art{border-radius:0;background:transparent;box-shadow:none}
.sp-stage .sp-elephant{width:min(46vw,180px)}
@media(orientation:landscape) and (max-height:540px){.sp-stage .sp-elephant{width:100px}}
.mini-topic-scene{display:block;width:100%;height:auto;aspect-ratio:1.15;object-fit:contain;border-radius:16px;max-height:200px}.mini-tile:has(.mini-topic-scene){padding:10px 8px 14px;gap:8px}
@media(prefers-reduced-motion:reduce){.level-up-toast,#profile-xpbar{animation:none!important;transition:none!important}}
