/* v123: the battlefield starts at the top edge; persistent HUD never reserves a row. */
#survival-screen:not([hidden]){grid-template-rows:minmax(0,1fr) auto}
#survival-screen .boss-hud{
 position:absolute;z-index:3;inset:16px auto auto 18px;width:min(310px,calc(100% - 36px));
 padding:10px 13px 9px;pointer-events:none;user-select:none;
 border:1px solid #d8bc8740;border-left:2px solid #b89366;border-radius:3px;
 background:linear-gradient(110deg,#09131bd9,#101a23a3 65%,#131c2470);
 box-shadow:0 3px 16px #03080c30;text-shadow:0 1px 3px #000;
}
#survival-screen .boss-hud .threat-line{gap:12px;font-size:12px;line-height:17px;color:#edddc0}
#survival-screen .boss-health{display:flex;align-items:baseline;gap:5px;white-space:nowrap;font-variant-numeric:tabular-nums}
#survival-screen .boss-health b{font-size:12px;font-weight:650;color:#f5ece1}
#survival-screen .boss-health small{font-size:10px;color:#bdc2c7;font-weight:400}
#survival-screen .boss-hud .threat-meter{height:4px;margin-top:6px;background:#100d12b8;box-shadow:0 0 0 1px #ffffff0b}
#survival-screen .boss-hud .threat-meter i{background:linear-gradient(90deg,#96424d,#d98b8d)}
#survival-screen .boss-hud[data-phase="prepare"] .threat-meter i{background:linear-gradient(90deg,#9c713c,#edc18a)}
#survival-screen .boss-hud .threat-caption{font-size:10px;line-height:14px;margin-top:5px;color:#bfc9d0;white-space:nowrap}
#survival-screen .boss-hud.is-critical{border-left-color:#e7a199}
#survival-screen .boss-hud.is-critical .threat-meter i{background:linear-gradient(90deg,#ab2c40,#f0a3a2)}
#survival-screen .field-frame>.battle-warning{
 position:absolute;z-index:4;top:18px;left:50%;transform:translateX(-50%);width:max-content;max-width:min(480px,calc(100% - 36px));height:auto;min-height:0;overflow:visible;text-overflow:clip;
 padding:7px 14px;border:1px solid #dfa16a73;border-radius:3px;background:#20161bcb;
 color:#ffe0bc;font-size:12px;line-height:17px;white-space:normal;text-align:center;pointer-events:none;
 box-shadow:0 3px 18px #0003;text-shadow:0 1px 2px #000;
}
#survival-screen .field-frame>.battle-warning::after{display:block;height:2px;margin-top:5px}
#survival-screen .camera-tools .battle-settings-trigger{display:grid;place-items:center;width:29px;min-width:29px;padding:0;color:#e6c591;border-color:#ae8a555e;background:#1c2938}
#survival-screen .battle-settings-trigger svg{width:16px;height:16px}
#survival-screen .battle-settings-trigger:hover{background:#35404b;border-color:#d1ac70;color:#ffe3b2}
#battle-settings{
 position:fixed;inset:0;margin:auto;width:min(404px,calc(100vw - 28px));max-height:calc(100dvh - 28px);
 padding:24px;border:1px solid #b9955e8c;border-radius:12px;overflow-y:auto;color:#ebe8df;
 background:linear-gradient(145deg,#17212bee,#0a131cf5 68%);box-shadow:0 25px 90px #000b;
}
#battle-settings::backdrop{background:#03080c9c;backdrop-filter:blur(4px)}
#battle-settings[open]{display:grid;gap:18px}
#battle-settings .settings-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
#battle-settings .settings-heading .kicker{font-size:9px;letter-spacing:.13em;color:#baab92}
#battle-settings h2{margin:6px 0 0;font-size:23px;font-weight:650;letter-spacing:-.03em;color:#f2e4c9}
#battle-settings-close{display:grid;place-items:center;min-height:30px;width:30px;padding:0;font-size:23px;line-height:1;background:none;border-color:#9eaaab40;color:#b9c4cb}
#battle-settings-help{margin:-5px 0 0;font-size:12px;line-height:1.5;color:#aebac4}
#battle-settings .settings-section{display:grid;gap:13px;margin:0;padding:0 0 18px;border-bottom:1px solid #a9acac29}
#battle-settings .settings-row{display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:13px;color:#dfddd6}
#battle-settings .settings-row :is(button,select){min-width:116px;min-height:36px;font-size:12px}
#battle-settings #sound{display:flex;align-items:center;justify-content:center;gap:7px}
#battle-settings .settings-volume{display:grid;grid-template-columns:1fr auto;align-items:center;gap:9px;font-size:13px}
#battle-settings .settings-volume output{font-size:12px;color:#daba83;font-variant-numeric:tabular-nums}
#battle-settings #music-volume{grid-column:1/-1;width:100%;margin:2px 0;accent-color:#d6b27b;cursor:pointer}
#difficulty-help{color:#a5afb6;font-size:11px;margin-top:-5px;line-height:1.5}
#battle-settings .settings-session{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#battle-settings .settings-session button{min-height:36px;font-size:12px;background:#14212b;border-color:#52606e80}
#battle-settings .settings-resume{min-height:40px;font-size:13px;font-weight:700;background:#cda975;color:#11191c;border-color:#e1c092}
#battle-settings .settings-resume:hover{background:#e3bf8c}
#battle-settings .settings-shortcut{text-align:center;font-size:10px;color:#8f9ca6;margin-top:-8px}
@media(max-width:1150px){
 #survival-screen .field-frame>.battle-warning{top:86px}
}
@media(max-width:760px){
 #survival-screen .boss-hud{inset:10px auto auto 12px;width:min(270px,calc(100% - 24px));padding:8px 11px}
 #survival-screen .field-frame>.battle-warning{top:86px;font-size:11px;padding:5px 10px;max-width:calc(100% - 24px)}
 #survival-screen .camera-tools{flex-wrap:wrap}
}
@media(max-width:540px){
 #survival-screen .boss-hud{width:246px}
 #survival-screen .boss-hud .threat-line{font-size:11px}
 #survival-screen .boss-health b{font-size:11px}
 #survival-screen .boss-health small{font-size:9px}
 #survival-screen .boss-hud .threat-caption{font-size:9px}
 #battle-settings{padding:19px;gap:15px}
 #survival-screen .control-strip{column-gap:4px;row-gap:4px}
}
@media(max-height:560px){
 #battle-settings{padding:16px 20px}
 #battle-settings[open]{gap:11px}
 #battle-settings .settings-section{padding-bottom:10px;gap:9px}
 #battle-settings-help{font-size:11px}
 #battle-settings .settings-shortcut{display:none}
}
