.ba { width:min(1200px, 100%); margin:0 auto; padding:0 12px 20px; }
.ba-menu { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.ba-options,.ba-start { display:flex; flex-direction:column; gap:12px; padding:24px; }
.ba h3 { margin:0 0 8px; } .ba label,.ba legend { font-weight:600; }
.ba input:not([type=checkbox]):not([type=radio]),.ba select { width:100%; padding:10px 12px; color:inherit; border:1px solid #425368; border-radius:9px; background:#172532; font:inherit; }
.ba-toggle { display:flex; align-items:center; gap:10px; } .ba-toggle input { width:19px; height:19px; accent-color:#70df95; }
.ba-heads { border:0; padding:0; margin:0; min-width:0; } #ba-head-options { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:8px; }
.ba-head-choice { position:relative; display:flex; flex-direction:column; align-items:center; border:1px solid #425368; border-radius:12px; background:#172532; padding:6px; cursor:pointer; }
.ba-head-choice:has(input:checked) { border-color:#70df95; background:#204137; }
.ba-head-choice:focus-within { outline:2px solid #ccecff; outline-offset:2px; } .ba-head-choice input { position:absolute; top:8px; left:8px; }
.ba-head-choice canvas { width:72px; height:64px; } .ba-head-choice span { font-size:.8rem; }
.ba-start hr { border:0; border-top:1px solid #425368; width:100%; }
.ba-start details { font-size:.9rem; line-height:1.5; } .ba-start summary { cursor:pointer; font-weight:600; } .ba-start ol { padding-left:24px; }
.ba-lobby { padding:24px; max-width:720px; margin:auto; } .ba-lobby ul { padding:0; list-style:none; display:grid; gap:8px; }
.ba-lobby li { display:flex; align-items:center; gap:12px; padding:8px 12px; border-radius:9px; background:#172532; } .ba-member-head { width:48px; height:42px; }
.ba-lobby-options { display:grid; gap:10px; margin:20px 0; } .ba-actions { display:flex; gap:10px; flex-wrap:wrap; }
.ba-toolbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:8px 0; font-size:.9rem; } #ba-effect { flex:1; color:#9cf3bc; }
.ba-scores { display:flex; gap:8px; flex-wrap:wrap; margin:10px 0; }
.ba-score { border:1px solid #425368; border-radius:20px; padding:5px 12px; font-size:.85rem; background:#172532; } .ba-score.ba-dead { opacity:.5; }
.ba-arena { position:relative; background:#12212a; border:2px solid #4f6e70; border-radius:16px; overflow:hidden; }
#ba-canvas { display:block; width:100%; height:auto; touch-action:none; outline-offset:-5px; }
.ba-center { position:absolute; inset:0; display:grid; place-content:center; text-align:center; padding:16px; white-space:pre-line; font-weight:800; font-size:clamp(22px,5vw,64px); pointer-events:none; color:#fff; text-shadow:0 3px 8px #000; }
.ba-center:has(#ba-center-text:not(:empty)) { background:#08182055; }
.ba-dpad { margin:12px auto 0; text-align:center; touch-action:none; user-select:none; }
.ba-dpad button { width:58px; height:46px; margin:3px; border:1px solid #57746d; background:#204137; color:#c9ffe0; border-radius:12px; font:700 26px system-ui; cursor:pointer; touch-action:none; }
.ba-dpad button:active { background:#437b5c; } .ba-result { padding:20px; margin-top:12px; }
@media (pointer:fine) { .ba-dpad { display:none; } }
@media (max-width:720px) { .ba-menu { grid-template-columns:1fr; } .ba-options,.ba-start { padding:18px; } .ba { padding:0 6px 12px; } .ba-toolbar { gap:6px; } #ba-effect { flex-basis:100%; order:3; } }

/* Buff overlays never participate in arena or page layout. */
#ba-buff { position:relative; display:flex; align-items:center; gap:12px; width:fit-content; max-width:100%; box-sizing:border-box; padding:6px 12px 10px; border:2px solid #ffb13a; border-radius:10px; background:linear-gradient(180deg,#78140a,#3c0804); box-shadow:0 0 12px #ff782840; }
#ba-buff[hidden] { display:none; }
.ba-buff-copy { display:flex; flex-direction:column; min-width:0; max-width:240px; }
#ba-buff-name { color:#ffd24a; font-size:.85rem; text-transform:uppercase; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#ba-buff-owner { color:#ffe8d6; font-size:.72rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#ba-buff-timer { flex:none; min-width:2.6ch; text-align:center; font:900 1.7rem/1 system-ui,sans-serif; font-variant-numeric:tabular-nums; color:#fff; text-shadow:0 2px 0 #3a0a04; }
#ba-buff-progress { position:absolute; bottom:2px; left:8px; width:calc(100% - 16px); height:3px; border:0; border-radius:4px; overflow:hidden; appearance:none; background:#ffffff26; color:#ffd24a; }
#ba-buff-progress::-webkit-progress-bar { background:#ffffff26; }
#ba-buff-progress::-webkit-progress-value { background:#ffd24a; }
#ba-buff-progress::-moz-progress-bar { background:#ffd24a; }
#ba-buff.ba-buff-ending { border-color:#ff665b; }
.ba-buff-ending #ba-buff-timer { color:#ffb5ad; }
#ba-ghost-warning:not(:empty) { display:block; color:#ffd24a; font-size:.75rem; margin-top:3px; }

.ba-timers { display:flex; gap:6px; flex-wrap:wrap; }
.ba-time { border:1px solid #ffb13a; padding:4px 9px; border-radius:9px; background:#592719; color:#fff3d3; font-weight:800; font-variant-numeric:tabular-nums; }
.ba-action-controls { display:flex; justify-content:center; gap:6px; flex-wrap:wrap; margin-top:8px; }

.ba-overlays { position:absolute; z-index:3; top:8px; right:8px; max-width:calc(100% - 16px); display:flex; flex-direction:column; align-items:flex-end; gap:6px; pointer-events:none; }
.ba-overlays .ba-timers { justify-content:flex-end; max-width:300px; }
.ba-overlays #ba-buff { padding:6px 10px; gap:0; max-width:260px; }
.ba-overlays #ba-buff-timer,.ba-overlays #ba-buff-progress { display:none; }
.ba-overlays .ba-time { font-size:.8rem; padding:3px 7px; box-shadow:0 2px 8px #0005; }

#ba-retry { pointer-events:auto; justify-self:center; margin-top:18px; font-size:1rem; white-space:normal; text-shadow:none; }
