.solo-shell{max-width:950px}.solo-shell header{display:flex;align-items:center;justify-content:space-between;gap:12px}.solo-shell a{color:var(--cyan)}.solo-card{padding:22px;margin:20px 0;border:1px solid var(--line);border-radius:14px;background:var(--p)}.solo-card p{line-height:1.6;color:var(--dim)}.solo-options,.solo-top,.solo-stats,.solo-ammo{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:14px 0}.solo-options label{display:flex;align-items:center;gap:8px}.solo-top>span{flex:1;font-weight:800;color:var(--cyan)}.solo-stats{justify-content:space-between;font-weight:800}.solo-ammo>span{flex:1;font:600 14px monospace;line-height:1.8}.solo-note{font-size:12px;color:var(--dim)}.core-panel{display:flex;gap:24px;align-items:center;min-height:130px;border:1px solid var(--line);border-radius:12px;padding:16px;background:linear-gradient(110deg,#14283f,#111827)}.core-panel>div:last-child{flex:1;min-width:0}.core-panel h2{font-size:19px;margin:0}.core-panel p{font-size:12px;color:var(--dim);margin:8px 0}.core-panel progress{width:100%;accent-color:#b78bff}.core-art{width:90px;height:90px;position:relative;flex-shrink:0}.core-art i{position:absolute;inset:12px;border:2px solid var(--cyan);transform:rotate(45deg);box-shadow:0 0 16px #65e8e425;animation:core-turn 14s linear infinite}.core-art i:nth-child(2){inset:23px;border-color:#b78bff;animation-direction:reverse}.core-art i:nth-child(3){inset:34px;background:var(--cyan);animation:none}.core-panel.hit{animation:core-hit .3s ease-out}#soloNotice{min-height:20px;font-size:13px;color:#ffc38d}#soloField{height:42vh;min-height:250px}.upgrade-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}.upgrade-grid button{text-align:left;white-space:normal;line-height:1.5;padding:16px}.solo-shell [hidden]{display:none!important}.solo-shell #soloKeyboard{display:none}.solo-shell.mobile-game #soloKeyboard{display:block}.solo-shell.mobile-game{padding:8px}.solo-shell.mobile-game #soloField{height:32dvh;min-height:180px}.solo-shell.mobile-game .core-art{width:52px;height:52px}.solo-shell.mobile-game .core-panel{min-height:85px;padding:10px;gap:10px}.solo-shell.mobile-game .core-art i{inset:6px}.solo-shell.mobile-game .core-art i:nth-child(2){inset:13px}.solo-shell.mobile-game .core-art i:nth-child(3){inset:20px}.solo-shell.mobile-game .solo-card{padding:15px}.solo-shell.mobile-game .solo-stats{font-size:12px}.effects-reduced .core-art i,.effects-reduced .core-panel.hit,.effects-reduced .damage-pulse{animation:none!important}@media(prefers-reduced-motion:reduce){.core-art i,.core-panel.hit{animation:none!important}}@keyframes core-turn{to{transform:rotate(405deg)}}@keyframes core-hit{50%{border-color:#b78bff;box-shadow:0 0 20px #b78bff55}}
.core-panel[data-stage="6"] .core-art i{border-radius:50%}.core-panel[data-stage="9"] .core-art i{border-color:#ff93a5}.core-panel[data-stage="9"] .core-art i:nth-child(3){background:#ff93a5} @media(max-width:500px){.solo-shell.mobile-game h1{font-size:14px}.solo-shell.mobile-game header a{font-size:11px}.solo-shell.mobile-game #soloField{height:27dvh;min-height:170px}.solo-shell.mobile-game .solo-top{gap:6px;margin:8px 0}.solo-shell.mobile-game .solo-top button{padding:8px}.solo-shell.mobile-game .solo-stats{margin:8px 0}.solo-shell.mobile-game .core-panel p{font-size:11px}.solo-shell.mobile-game #soloNotice{margin:8px 0}}
.solo-mode{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:16px 0;font-weight:700}.solo-mode select{max-width:100%;min-width:0}.core-panel[data-stage="endless"] .core-art i{border-radius:50%;border-color:var(--red)}

#soloAmmo.stock-full{color:#ffd58a}#soloField.stock-full{box-shadow:inset 0 3px 0 #ffd58a66}

/* Keep recovery, pause and results reachable without scrolling past the keyboard. */
#soloOverlay:not([hidden]){position:fixed;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:min(860px,calc(100% - 28px));max-height:calc(100dvh - 32px);overflow-y:auto;margin:0;z-index:20;box-shadow:0 0 0 100vmax #050b16cc,0 20px 70px #0009;overscroll-behavior:contain}
#soloOverlay:focus{outline:none}
.upgrade-grid button:disabled{border:1px dashed #637587;opacity:.75}
@media(max-width:500px){#soloOverlay:not([hidden]){width:calc(100% - 20px);padding:18px}.upgrade-grid{grid-template-columns:minmax(0,1fr)}.upgrade-grid button{padding:12px}}
.solo-basics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:16px 0}.solo-basics span{padding:12px;border:1px solid var(--line);border-radius:8px;color:var(--dim);font-size:12px}.solo-basics b{display:block;color:var(--cyan);font-size:14px;margin-bottom:4px}@media(max-width:400px){.solo-basics{gap:5px}.solo-basics span{padding:8px;font-size:11px}}
.upgrade-card strong{display:block;font-size:15px;margin-bottom:5px}.upgrade-card span{display:block;font-weight:500;font-size:12px;line-height:1.6}.upgrade-card:disabled span{color:#b6c2cd}.solo-shell.mobile-game #soloGame>.solo-note{display:none}.solo-shell.mobile-game .keyboard-row button{height:53px}@media(max-height:500px){.solo-shell.mobile-game .keyboard-row button{height:41px}}
.upgrade-grid .upgrade-card{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start}
@media(min-width:501px){.upgrade-grid:has(.upgrade-card){grid-template-columns:repeat(2,minmax(0,1fr))}.upgrade-grid .upgrade-card:last-child{grid-column:1/-1}}
.solo-dialog-open{overflow:hidden}
.solo-backdrop:not([hidden]){position:fixed;inset:0;z-index:19;background:#050b16cc}
#soloOverlay:not([hidden]){box-shadow:0 20px 70px #0009}
.core-panel[data-stage="9"] progress{accent-color:#ff93a5}
.solo-card .record-banner{padding:10px 12px;border:1px solid #65e8e455;border-radius:8px;color:var(--cyan);background:#122d38;font-size:13px;font-weight:700}
.solo-sound{margin:8px 0}.solo-sound>summary{padding:12px;min-height:48px;font-size:14px}.solo-sound .audio-controls{padding:4px 12px 12px;justify-content:flex-start}
@media(min-width:700px) and (max-height:500px){
 .solo-shell.mobile-game #soloGame{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,1fr);grid-template-areas:"field top" "field stats" "field core" "field notice" "field ammo" "field keyboard";gap:4px 12px}
 .solo-shell.mobile-game #soloField{grid-area:field;height:calc(100dvh - 125px);min-height:180px}
 .solo-shell.mobile-game .solo-top{grid-area:top;margin:0}.solo-shell.mobile-game .solo-stats{grid-area:stats;margin:0;font-size:11px}
 .solo-shell.mobile-game #corePanel{grid-area:core;min-height:0;padding:8px}.solo-shell.mobile-game .core-art{display:none}.solo-shell.mobile-game .core-panel h2{font-size:15px}.solo-shell.mobile-game .core-panel p{margin:4px 0}.solo-shell.mobile-game #soloNotice{grid-area:notice;margin:0;min-height:16px;font-size:11px}
 .solo-shell.mobile-game .solo-ammo{grid-area:ammo;margin:0}.solo-shell.mobile-game .solo-ammo>span{font-size:11px}
 .solo-shell.mobile-game #soloKeyboard{grid-area:keyboard}.solo-shell.mobile-game .keyboard-row button{height:38px}
 .solo-shell.mobile-game .core-panel[data-stage="endless"] #coreHint{display:none}
}
@media(max-height:700px) and (max-width:699px){.solo-shell.mobile-game .core-art{display:none}.solo-shell.mobile-game .core-panel{min-height:0;padding:8px}.solo-shell.mobile-game .core-panel h2{font-size:15px}.solo-shell.mobile-game .core-panel p{margin:5px 0}.solo-shell.mobile-game .core-panel[data-stage="endless"] #coreHint{display:none}.solo-shell.mobile-game .solo-top>span{font-size:12px}.solo-shell.mobile-game .keyboard-row button{height:48px}}
body.solo-playing:has(.solo-shell.mobile-game){overflow:hidden}
body.solo-playing .solo-shell.mobile-game #soloGame{position:fixed;inset:0;height:100dvh;z-index:10;background:var(--bg);padding:calc(6px + env(safe-area-inset-top)) 8px calc(6px + env(safe-area-inset-bottom));display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:"top" "stats" "core" "notice" "field" "ammo" "keyboard";grid-template-rows:auto auto auto auto minmax(0,1fr) auto auto;gap:5px;overflow:hidden}
body.solo-playing .solo-shell.mobile-game .solo-top{grid-area:top;margin:0;gap:6px;flex-wrap:nowrap}
body.solo-playing .solo-shell.mobile-game .solo-top>span{font-size:12px;min-width:0}
body.solo-playing .solo-shell.mobile-game .solo-top button{padding:8px;min-height:36px;font-size:12px}
body.solo-playing .solo-shell.mobile-game .solo-stats{grid-area:stats;margin:0;font-size:11px}
body.solo-playing .solo-shell.mobile-game #corePanel{grid-area:core;min-height:0;padding:6px 8px}
body.solo-playing .solo-shell.mobile-game .core-art{display:none}
body.solo-playing .solo-shell.mobile-game .core-panel h2{font-size:14px}
body.solo-playing .solo-shell.mobile-game .core-panel p{margin:3px 0;font-size:11px}
body.solo-playing .solo-shell.mobile-game .core-panel:not([data-stage="tutorial"]) #coreHint{display:none}
body.solo-playing .solo-shell.mobile-game #soloNotice{grid-area:notice;margin:0;height:16px;min-height:16px;line-height:16px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Reserve the action-message row even when its live region is empty. */
body.solo-playing .solo-shell.mobile-game #soloField{grid-area:field;height:100%;min-height:0}
body.solo-playing .solo-shell.mobile-game .solo-ammo{grid-area:ammo;margin:0;min-height:36px}
body.solo-playing .solo-shell.mobile-game #soloKeyboard{grid-area:keyboard;min-width:0}
body.solo-playing .solo-shell.mobile-game #soloGame>.solo-note{display:none}
@media(min-width:700px) and (max-height:500px){body.solo-playing .solo-shell.mobile-game #soloGame{grid-template-columns:minmax(0,1fr) minmax(280px,1fr);grid-template-areas:"field top" "field stats" "field core" "field notice" "field ammo" "field keyboard";grid-template-rows:auto auto auto auto auto minmax(0,1fr);gap:4px 10px}body.solo-playing .solo-shell.mobile-game #soloKeyboard{align-self:end}}
/* Align setup controls and keep each option a clear, consistent target. */
.solo-mode{display:grid;grid-template-columns:100px minmax(0,1fr);column-gap:8px;font-size:13px}.solo-mode select,.solo-options select{width:100%;min-width:0;min-height:46px;font-size:13px}
.solo-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:stretch}.solo-options>label{min-width:0;font-size:13px}.solo-options>label:has(select){grid-column:1/-1;display:grid;grid-template-columns:100px minmax(0,1fr)}
.solo-options>label:has(input[type="checkbox"]){min-height:52px;padding:10px;border:1px solid var(--line);border-radius:8px;background:#0b172a;cursor:pointer}.solo-options input[type="checkbox"]{width:18px;height:18px;margin:0;flex-shrink:0;accent-color:var(--cyan)}
#startSolo{min-height:46px;min-width:160px}
@media(max-width:650px){.solo-mode,.solo-options>label:has(select){grid-template-columns:76px minmax(0,1fr)}.solo-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.solo-options>label:has(input[type="checkbox"]){font-size:12px;padding:9px}#startSolo{width:100%}}
@media(max-width:359px){.solo-options{grid-template-columns:minmax(0,1fr)}}

/* Boss emblems (art: Codex, docs/art/bosses.md): replace the abstract core rings on boss stages */
.core-panel[data-boss=prism-array] .core-art{background:url(art/bosses/prism-array.webp) center/contain no-repeat}
.core-panel[data-boss=orbit-engine] .core-art{background:url(art/bosses/orbit-engine.webp) center/contain no-repeat}
.core-panel[data-boss=rift-core] .core-art{background:url(art/bosses/rift-core.webp) center/contain no-repeat}
.core-panel:is([data-boss=prism-array],[data-boss=orbit-engine],[data-boss=rift-core]) .core-art{filter:drop-shadow(0 0 10px var(--boss-glow,#65e8e466))}
.core-panel:is([data-boss=prism-array],[data-boss=orbit-engine],[data-boss=rift-core]) .core-art i{display:none}
.solo-shell.mobile-game .core-panel:is([data-boss=prism-array],[data-boss=orbit-engine],[data-boss=rift-core]) .core-art{background-image:var(--boss-small)}
.core-panel[data-boss=prism-array]{--boss-small:url(art/bosses/prism-array-128.webp)}
.core-panel[data-boss=orbit-engine]{--boss-small:url(art/bosses/orbit-engine-128.webp)}
.core-panel[data-boss=rift-core]{--boss-small:url(art/bosses/rift-core-128.webp)}
html[data-theme="arcade"] .core-panel{--boss-glow:#1d1a14cc}
html[data-theme="endboss"] .core-panel{--boss-glow:#9256aacc}
/* Layered bosses: contained, transform-only motion; approved emblems are the fallback. */
.core-art .boss-motion{display:none;position:absolute;inset:8%;overflow:visible;pointer-events:none}
.core-art .boss-motion b{display:none;position:absolute;inset:0;background:center/contain no-repeat;transform-origin:center;animation:none}
.core-panel:is([data-boss=prism-array],[data-boss=orbit-engine],[data-boss=rift-core]) .core-art{overflow:hidden;isolation:isolate;filter:none}
body.solo-playing .core-panel[data-boss]:not([data-boss=""]) .core-art .boss-motion{display:block}
body.solo-playing .core-panel[data-boss]:not([data-boss=""]) .core-art{background-image:none}
.core-panel[data-boss=prism-array] .boss-left{background-image:url(art/bosses/prism-array-left.webp);display:block;animation:boss-left-breathe 5s ease-in-out infinite}
.core-panel[data-boss=prism-array] .boss-right{background-image:url(art/bosses/prism-array-right.webp);display:block;animation:boss-right-breathe 5s ease-in-out infinite}
.core-panel[data-boss=rift-core] .boss-left{background-image:url(art/bosses/rift-core-left.webp);display:block;animation:boss-left-breathe 7s ease-in-out infinite}
.core-panel[data-boss=rift-core] .boss-right{background-image:url(art/bosses/rift-core-right.webp);display:block;animation:boss-right-breathe 7s ease-in-out infinite}
.core-panel:is([data-boss=prism-array],[data-boss=rift-core]) .boss-light{display:block;inset:16% 47%;z-index:-1;border-radius:50%;background:radial-gradient(ellipse,#fff 0%,var(--boss-glow,#65e8e466) 45%,transparent 75%);animation:boss-light-breathe 5s ease-in-out infinite}
.core-panel[data-boss=rift-core] .boss-light{animation:boss-fissure 7s ease-in-out infinite}
.core-panel[data-boss=orbit-engine] .orbit-half{display:block;animation:boss-orbit-a 6s ease-in-out infinite}
.core-panel[data-boss=orbit-engine] .orbit-back{background-image:url(art/bosses/orbit-engine-back.webp);z-index:0}
.core-panel[data-boss=orbit-engine] .orbit-front{background-image:url(art/bosses/orbit-engine-front.webp);z-index:3}
.core-panel[data-boss=orbit-engine] .orbit-b{animation:boss-orbit-b 8s ease-in-out infinite}
.core-panel[data-boss=orbit-engine] .orbit-core{display:block;background-image:url(art/bosses/orbit-engine-core.webp);z-index:2;animation:boss-core-pulse 4s ease-in-out infinite}
@keyframes boss-left-breathe{0%,100%{transform:translateX(0)}50%{transform:translateX(-3%)}}
@keyframes boss-right-breathe{0%,100%{transform:translateX(0)}50%{transform:translateX(3%)}}
@keyframes boss-light-breathe{0%,100%{opacity:.3;transform:scaleY(.85)}50%{opacity:.8;transform:scaleY(1)}}
@keyframes boss-fissure{0%,100%{opacity:.35}35%{opacity:.65}45%{opacity:.5}55%{opacity:.8}65%{opacity:.6}}
@keyframes boss-core-pulse{0%,100%{filter:brightness(.95);transform:scale(.97)}50%{filter:brightness(1.15);transform:scale(1.02)}}
/* Each pair shares a projected plane; its rear half stays behind the core. */
@keyframes boss-orbit-a{0%,100%{transform:rotate(-35deg) scaleY(.48)}50%{transform:rotate(-12deg) scaleY(.76)}}
@keyframes boss-orbit-b{0%,100%{transform:rotate(45deg) scaleY(.72)}50%{transform:rotate(68deg) scaleY(.42)}}
body.solo-dialog-open .core-art .boss-motion b{animation-play-state:paused}
body.solo-playing.effects-reduced .core-panel[data-boss]:not([data-boss=""]) .core-art .boss-motion{display:none}
body.solo-playing.effects-reduced .core-panel[data-boss]:not([data-boss=""]) .core-art{background-image:var(--boss-small);background-position:center;background-size:contain;background-repeat:no-repeat}
@media(prefers-reduced-motion:reduce){body.solo-playing .core-panel[data-boss]:not([data-boss=""]) .core-art .boss-motion{display:none}body.solo-playing .core-panel[data-boss]:not([data-boss=""]) .core-art{background-image:var(--boss-small);background-position:center;background-size:contain;background-repeat:no-repeat}}
/* Existing compact layouts hide decorative cores; retain a fixed 52px boss slot on phones. */
body.solo-playing .solo-shell.mobile-game .core-panel[data-boss]:not([data-boss=""]) .core-art{display:block;width:52px;height:52px;flex:0 0 52px}

/* Stable boss timing/status geometry, including phase announcements. */
.core-panel #coreStatus{height:18px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Boss messages share one reserved phone panel; neither text nor phase can resize it. */
body.solo-playing .solo-shell.mobile-game #corePanel[data-boss]:not([data-boss=""]){box-sizing:border-box;height:76px;min-height:76px;max-height:76px;overflow:hidden}
body.solo-playing .solo-shell.mobile-game #coreStatus{min-height:18px;max-height:18px}
/* Damage forecasts change text, never the space reserved for mobile controls. */
.solo-shell.mobile-game #soloSend{width:130px;min-width:130px;height:44px;min-height:44px;flex:0 0 130px;white-space:nowrap;font-variant-numeric:tabular-nums}
.solo-shell.mobile-game .solo-ammo>span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Lessons keep feedback in the instruction card; reserve the small phone field for letter tiles. */
body.anagram-lesson #soloNotice{display:none}
body.anagram-lesson #soloField .danger{color:var(--dim);border-top-color:var(--line)}
@media(max-height:650px) and (max-width:699px){body.anagram-lesson #coreStatus{display:none}}

/* Desktop battles reserve fixed HUD/core/notice rows and let only the field flex. */
body.solo-playing .solo-shell:not(.mobile-game) #soloGame{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:44px 22px 110px 20px minmax(120px,1fr) 44px 22px;gap:6px;height:calc(100dvh - 190px)}
body.solo-playing .solo-shell:not(.mobile-game) :is(.solo-top,.solo-stats,.solo-ammo,#soloNotice,#soloGame>.solo-note){margin:0;min-width:0}
body.solo-playing .solo-shell:not(.mobile-game) .core-panel{height:110px;min-height:0;padding:10px 14px;overflow:hidden}
body.solo-playing .solo-shell:not(.mobile-game) .core-art{width:68px;height:68px}
body.solo-playing .solo-shell:not(.mobile-game) #soloNotice{height:20px;min-height:20px;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.solo-playing .solo-shell:not(.mobile-game) #soloField{height:100%;min-height:0}
body.solo-playing .solo-shell:not(.mobile-game) #soloGame>.solo-note{line-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.upgrade-grid .chapter-stop{grid-column:1/-1;background:transparent;color:var(--dim);border:1px solid var(--line)}
body.translate-run .solo-shell #soloKeyboard{display:none!important}body.translate-run .solo-shell.mobile-game #soloAnswerForm{grid-area:keyboard;margin:4px 0}
#translateIntro .solo-mode{margin:8px 0}#translateIntro>p{margin:6px 0 4px}.translate-summary{display:inline-block;margin:6px 0 4px!important;padding:5px 10px;border:1px solid var(--line);border-radius:999px;background:#0b172a;font:700 12px/1.4 system-ui,sans-serif!important}.translate-rules{margin:8px 0}.translate-rules p{margin:6px 0;font-size:13px}
