/* Assistance is a scene overlay: opening it never changes the arena or command geometry. */
.battle { position:relative; }
.hint-companion {
 position:absolute; z-index:8; left:22px; top:94px; width:320px; max-height:var(--scene-size,calc(100dvh - 350px));
 border:2px solid #e2c58a; border-radius:22px; padding:12px 16px;
 background:radial-gradient(ellipse at 0 0,#245d78,#0a203bee 65%),#091c34;
 box-shadow:inset 0 0 0 4px #06172a,inset 0 0 0 5px #bb975e66,0 12px 40px #000a;
 color:#fff5d6; overflow:auto; scrollbar-width:thin;
}
.hint-companion>header { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.hint-companion>header img { width:46px; height:46px; object-fit:contain; filter:drop-shadow(0 0 8px #52deff66); }
.hint-companion h2 { font-size:19px; line-height:1.1; margin:3px 0 0; }
.hint-companion small { color:#cbdce8; font-size:10px; letter-spacing:.06em; }
.hint-companion .icon-button { width:44px; height:44px; min-width:44px; margin-left:auto; }
.hint-question,.hint-return { display:none; }
.hint-companion .learning-hint { margin:0; padding:0; border:0; box-shadow:none; background:none; }
.hint-companion .learning-hint>p { font-size:13px; line-height:1.35; margin:6px 0 9px; }
.hint-companion .star-array,.hint-companion .share-hint { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin:0; }
.hint-companion .star-row { min-height:44px; width:100%; padding:4px; display:flex; align-items:center; justify-content:center; gap:1px; border:1px solid #7599ad; border-radius:9px; background:#06172e; }
.hint-companion .star-row .icon { width:clamp(7px,1vw,15px); height:15px; flex:0 1 15px; }
.hint-companion .share-group { min-height:44px; padding:4px; display:flex; align-items:center; justify-content:center; gap:6px; }
.hint-companion .share-group small { display:none; }
.hint-companion .hint-equation { font-size:18px; display:block; line-height:1.3; margin:8px 0; padding:7px; border:1px solid #c9ab6a77; border-radius:10px; background:#06162b; }
.hint-pages { display:flex; align-items:center; justify-content:center; gap:20px; margin:6px 0 0; }
.hint-pages .mini-button { min-width:44px; min-height:44px; background:#123553; border:1px solid #c9b680; }
.hint-companion .number-explanation { font-size:24px; margin:8px 0; }
.hint-companion .number-steps { display:flex; flex-wrap:wrap; justify-content:center; gap:6px; }
.hint-companion .number-steps button { min-height:44px; padding:6px 10px; }
.hint-companion .number-explanation output { font-size:26px; }

/* Empty loading deck, never prefilled with the requested number of containers. */
.work-platform {
 border:1px solid #c7a974; border-bottom:9px solid #172a3b; border-radius:25px;
 background:radial-gradient(ellipse at 50% 0,#38637680,transparent 70%),repeating-linear-gradient(0deg,#b4d4dc08 0 1px,transparent 1px 20px),linear-gradient(135deg,#122f47e8,#08192fe8)!important;
 box-shadow:inset 0 0 0 4px #071a2d,inset 0 0 0 5px #a78c5555,0 10px 0 #061226,0 18px 25px #0008;
}
.work-platform:after { background:linear-gradient(90deg,transparent,#81e8ed,transparent); opacity:.75; }
.empty-loading { width:100%; min-height:130px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; color:#d9e8eb; text-align:center; }
.empty-loading>.icon { width:38px; height:38px; padding:6px; border:1px solid #bc9d60; border-radius:50%; color:#ffe8aa; }
.empty-loading strong { font:500 20px Fredoka; color:#ffebba; }
.empty-loading span { font-size:13px; }
.physical-containers:has(.empty-loading) { grid-template-columns:1fr; }
.packing-actions { display:flex; justify-content:center; gap:8px; }
.packing-count { font-size:13px; color:#d0e8ef; }
.group-controls { gap:10px 16px; }
.battle .command-panel { background:radial-gradient(ellipse at 50% -40%,#35749a8c,transparent 65%),repeating-linear-gradient(120deg,#b6d8f105 0 1px,transparent 1px 29px),linear-gradient(110deg,#0a2341f5,#06142cf9); }
.battle .command-panel:before,.battle .command-panel:after { color:#ffebba; filter:drop-shadow(0 0 5px #deb76199); }
.battle .answer { box-shadow:inset 0 0 0 3px #081b32,inset 0 0 0 4px #b3975a77,0 4px 8px #0007; }
.battle .answer:hover { background:linear-gradient(#215d7a,#102b4e); box-shadow:inset 0 0 0 3px #0b2540,0 0 16px #6ad8f88c; }
.battle.is-correct .command-panel h2 { align-self:center!important; }

/* Beam endpoints follow the contained sprite pixels, rather than percentages of the arena. */
.energy-link { position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.energy-link path { fill:none; stroke-linecap:round; stroke-linejoin:round; }
.combat-fx .impact-ring { left:calc(var(--impact-x) - 70px); top:calc(var(--impact-y) - 70px); right:auto; }
.combat-fx i { left:var(--impact-x); top:var(--impact-y); right:auto; }
@media(min-width:601px) {
 .battle.encounter-groups { grid-template-rows:82px minmax(250px,1fr) 250px; --scene-size:max(250px,calc(100dvh - 344px)); }
 .group-controls { display:grid; grid-template-columns:auto auto; justify-content:center; align-items:center; }
 .packing-actions { grid-column:1; grid-row:1; }
 .packing-count { grid-column:1; grid-row:2; }
 .group-controls>.primary { grid-column:2; grid-row:1/3; min-height:58px; }
 .hint-companion { width:300px; }
}
@media(min-width:601px) and (orientation:portrait) {
 .battle.encounter-groups { grid-template-rows:90px minmax(300px,1fr) 280px; --scene-size:max(300px,calc(100dvh - 382px)); }
 .hint-companion { top:100px; left:15px; }
}
@media(max-width:600px) {
 .hint-companion { position:fixed; left:12px; right:12px; top:85px; width:auto; max-height:calc(100dvh - 105px); }
 .group-controls { display:flex; flex-direction:column; }
 .packing-actions { flex-direction:column; width:100%; }
 .empty-loading { min-height:125px; }
}

/* Painted story artifacts occupy the scene, with their full transparent silhouette. */
.device-scene .story-object { object-fit:contain; width:100%; height:0; min-height:0; flex:1 1 0; max-height:none; filter:drop-shadow(0 8px 10px #031b32aa); }
.device-scene .scene-milestones { margin-top:5px; margin-bottom:0; }
.device-scene>p { flex:none; margin:0 0 8px; padding:6px 12px; font-size:14px; border-radius:14px; background:#061b32d9; color:#fff5d6; }
.device-scene .device-orbit { bottom:16%; opacity:.35; }
.battle.encounter-groups .question-caption { max-width:900px; margin:5px auto 12px; }
