/* Scoped to the pilot arena: other mini-games retain their current layout. */
#bossBattle { position:fixed;inset:0;z-index:9500;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);place-items:center;background:#080311ed;color:#ffedbb;font-family:inherit;isolation:isolate;overscroll-behavior:contain;padding:18px; }
#bossBattle * { box-sizing:border-box; }
#bossBattle .bbFrame { width:min(1080px,100%);height:min(850px,96dvh);display:grid;grid-template-rows:auto minmax(0,1fr) auto;border:2px solid #a7813f;border-radius:22px;overflow:hidden;background:#180d29;box-shadow:0 0 0 5px #332135,0 22px 90px #000c; }
#bossBattle .bbHeader { position:relative;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 26px;background:linear-gradient(110deg,#2a123a,#120e23);border-bottom:2px solid #b48b42; }
#bossBattle h2 { margin:0;color:#ffe3a0;font-size:clamp(24px,3vw,38px);line-height:1.1;text-shadow:0 2px 3px #000; }
#bossBattle .bbSubtitle {margin:4px 0 0;color:#d4bfaa;font-size:12px;}
#bossBattle .bbIndicators {display:flex;gap:28px;flex-shrink:0;text-align:center;font-size:12px;color:#ffe3a0;}
#bossBattle .bbArmor,#bossBattle .bbTurns {display:flex;gap:7px;margin-top:6px;justify-content:center;}
#bossBattle .bbArmor i {display:block;width:26px;height:30px;background:linear-gradient(125deg,#fff0a7,#a66b17 60%,#f7d075);clip-path:polygon(50% 0,95% 18%,88% 68%,50% 100%,12% 68%,5% 18%);box-shadow:inset 0 0 0 4px #ffd66f;}
#bossBattle .bbArmor i.broken {opacity:.23;background:#6d6668;}
#bossBattle .bbTurns i {display:block;width:19px;height:19px;margin-top:5px;border:2px solid #ebc379;border-radius:50%;background:radial-gradient(circle at 35% 28%,#eee,var(--bb-accent) 20%,#38195e 80%);box-shadow:0 0 7px #ffdc8644;}
#bossBattle .bbTurns i.used {opacity:.3;background:#302239;}
#bossBattle .bbArena {position:relative;min-height:0;overflow:hidden;isolation:isolate;background:#1c1b36;}
#bossBattle .bbScenery {position:absolute;inset:0;background-size:cover;background-position:center 60%;}
#bossBattle .bbMist {position:absolute;inset:auto 0 0;height:20%;background:linear-gradient(0deg,#170d27cc,transparent);z-index:2;pointer-events:none;}
#bossBattle .bbBoss {position:absolute;height:100%;max-width:100%;aspect-ratio:1;bottom:0;left:0;right:0;margin:auto;background-size:300% 200%;background-repeat:no-repeat;transform-origin:50% 75%;will-change:transform;filter:drop-shadow(0 8px 9px #05051566);}
#bossBattle .bbBoss.bbFallback {background-size:contain;background-position:center!important;}
#bossBattle .bbCanvas {mix-blend-mode:screen;position:absolute;inset:0;width:100%;height:100%;z-index:3;pointer-events:none;}
#bossBattle .bbCallout {position:absolute;z-index:4;left:5%;right:5%;top:13%;text-align:center;font-size:clamp(22px,4vw,42px);font-weight:900;color:#fff5cc;text-shadow:0 3px 4px #000,0 0 12px #321326;background:linear-gradient(90deg,transparent,#1e112799,transparent);}
#bossBattle .bbCallout:empty {display:none;}
#bossBattle .bbControls {position:relative;z-index:4;padding:0 24px 14px;background:linear-gradient(#281435,#170b26);border-top:2px solid #b48b42;text-align:center;}
#bossBattle .bbHint {position:relative;margin:-1px -24px 10px;padding:10px 16px;background:#180d27e8;border-bottom:1px solid #9b783e;color:#fff0b9;font-size:16px;font-weight:700;min-height:41px;}
#bossBattle .bbAttacks {display:flex;justify-content:center;gap:24px;}
#bossBattle .bbHint[hidden] + .bbAttacks {padding-top:16px;}
#bossBattle [data-action] {appearance:none;border:none;border-radius:12px;box-shadow:none;display:grid;justify-items:center;gap:7px;padding:4px 8px 8px;background:transparent;color:#fff0cf;font-family:inherit;font-size:14px;font-weight:800;cursor:pointer;min-width:130px;min-height:90px;}
#bossBattle .bbMedallion {display:grid;place-items:center;width:78px;height:78px;border-radius:50%;border:3px solid #f5d991;background:radial-gradient(circle at 35% 22%,#fff3a6,#f4b439 40%,#a4650b 72%,#513507 85%);box-shadow:0 0 0 3px #7a501d,0 0 0 5px #e0b970,0 5px 10px #0008,inset 0 0 8px #fff7ce;}
#bossBattle .bbMedallion svg {width:48px;height:48px;fill:#513007;stroke:#fff1ad;stroke-width:1.3;filter:drop-shadow(0 2px 1px #fff5a2);}
#bossBattle [data-action]:disabled {cursor:default;opacity:.7;}
#bossBattle button:focus-visible {outline:3px solid #fff;outline-offset:4px;}
#bossBattle .bbLedger {display:flex;justify-content:space-between;gap:12px;max-width:650px;margin:8px auto 0;padding-top:10px;border-top:1px solid #a47a37;font-size:14px;}
#bossBattle .bbCoins {font-size:22px;color:#ffda74;margin-left:6px;}
#bossBattle .bbError {color:#ffdad5;margin:6px 0;font-size:13px;}
#bossBattle .bbError:empty {display:none;}
#bossBattle .bbContinue,#bossBattle .bbRetry {background:linear-gradient(#ffe999,#ffb52e);color:#32142c;border:1px solid #ffdd88;border-radius:12px;min-height:44px;padding:10px 28px;font-family:inherit;font-size:16px;font-weight:700;margin-top:8px;}
#bossBattle button[hidden] {display:none;}
@media(max-width:600px) {
 #bossBattle {padding:0;}
 #bossBattle .bbFrame {width:100%;height:100dvh;border-radius:0;border-width:1px;}
 #bossBattle .bbHeader {padding:calc(12px + env(safe-area-inset-top,0px)) 14px 10px;flex-direction:column;gap:10px;}
 #bossBattle h2 {font-size:28px;text-align:center;}
 #bossBattle .bbSubtitle {display:none;}
 #bossBattle .bbIndicators {width:100%;justify-content:space-between;padding:0 12px;}
 #bossBattle .bbBoss {height:auto;width:118%;max-width:none;left:-9%;right:auto;bottom:0;}
 #bossBattle .bbControls {padding:0 10px calc(12px + env(safe-area-inset-bottom,0px));}
 #bossBattle .bbHint {margin:0 -10px 6px;font-size:13px;padding:9px 8px;}
 #bossBattle .bbAttacks {gap:4px;}
 #bossBattle [data-action] {min-width:0;flex:1;font-size:12px;padding:7px 2px;}
 #bossBattle .bbMedallion {width:65px;height:65px;}
 #bossBattle .bbLedger {font-size:12px;align-items:center;}
 #bossBattle .bbCoins {font-size:18px;}
}
@media(max-height:520px) and (min-width:601px) {
 #bossBattle {padding:0;}
 #bossBattle .bbFrame {height:100dvh;width:100%;border-radius:0;grid-template-columns:minmax(0,1fr) 250px;grid-template-rows:auto minmax(0,1fr);}
 #bossBattle .bbHeader {grid-column:1/-1;padding:8px 18px;}
 #bossBattle h2 {font-size:24px;}
 #bossBattle .bbSubtitle {display:none;}
 #bossBattle .bbArmor i {height:20px;width:18px;}
 #bossBattle .bbTurns i {height:15px;width:15px;}
 #bossBattle .bbControls {grid-row:2;grid-column:2;border-top:0;border-left:1px solid #ba984f;padding:0 12px max(8px,env(safe-area-inset-bottom));overflow-y:auto;}
 #bossBattle .bbHint {margin:0 -12px 8px;font-size:12px;}
 #bossBattle .bbAttacks {gap:2px;flex-direction:column;}
 #bossBattle [data-action] {display:flex;min-height:55px;gap:12px;padding:5px 12px;}
 #bossBattle .bbMedallion {width:40px;height:40px;flex-shrink:0;}
 #bossBattle .bbMedallion svg {width:28px;height:28px;}
 #bossBattle .bbLedger {flex-direction:column;gap:3px;font-size:11px;}
}
@media(prefers-reduced-motion:reduce) { #bossBattle * {animation:none!important;transition:none!important;} }
/* Match the approved composition: a centered title above the full arena. */
#bossBattle .bbFrame {width:min(980px,100%);border-radius:16px;box-shadow:0 0 0 3px #302034,0 0 0 4px #9b7537,0 22px 90px #000c;}
#bossBattle .bbHeader {display:grid;grid-template-columns:1fr 2fr 1fr;padding:12px 22px;background:linear-gradient(100deg,#130e22f5,#271333f5,#130e22f5);}
#bossBattle .bbHeader > div:first-child {grid-column:2;grid-row:1;text-align:center;}
#bossBattle .bbIndicators {display:contents;}
#bossBattle .bbIndicators > div:first-child {grid-column:1;grid-row:1;}
#bossBattle .bbIndicators > div:last-child {grid-column:3;grid-row:1;}
#bossBattle .bbSubtitle {letter-spacing:2px;text-transform:uppercase;font-size:10px;}
#bossBattle .bbControls {background:linear-gradient(#120a20e6,#140b1bee),var(--bb-arena) center bottom/cover;}
#bossBattle.bbExposed .bbArmor {opacity:.5;}
#bossBattle.bbExposed .bbBoss {filter:drop-shadow(0 0 12px var(--bb-accent));}
@media(max-width:600px) {
 #bossBattle .bbFrame {border-radius:0;}
 #bossBattle .bbHeader {grid-template-columns:1fr 1fr;gap:8px;padding:calc(12px + env(safe-area-inset-top,0px)) 14px 10px;}
 #bossBattle .bbHeader > div:first-child {grid-column:1/-1;grid-row:1;}
 #bossBattle .bbIndicators > div:first-child {grid-column:1;grid-row:2;}
 #bossBattle .bbIndicators > div:last-child {grid-column:2;grid-row:2;}
 #bossBattle .bbBoss {height:min(94%,calc(100vw - 20px));width:auto;max-width:none;left:50%;right:auto;top:50%;bottom:auto;translate:-50% -50%;}
}
@media(max-height:520px) and (min-width:601px) {
 #bossBattle .bbHeader {padding:8px 18px;}
 #bossBattle .bbFrame {width:100%;border-radius:0;}
}
