/* Full viewport battle entry. Only the roster and info dialog scroll. */
.arena-roster-empty{grid-column:1/-1;text-align:center;font-size:12px;color:#d5dcec}.arena-selection-warning{color:#ffe39a!important}body[data-screen=arena] .arena-roster-pager[hidden],body[data-screen=arena] .arena-factions[hidden]{display:none}
.unit-preparation-label span{overflow:hidden;text-overflow:ellipsis;min-width:0}.unit-preparation-label i{flex:none}body[data-screen=arena][data-phase=setup] .unit-label.monsters{max-width:56px}
body[data-screen=arena]{--arena-nav:calc(58px + env(safe-area-inset-bottom));height:100dvh;overflow:hidden;padding:0}
body[data-screen=arena] .app-header{display:none}
body[data-screen=arena] .hub-navigation{height:var(--arena-nav);background:linear-gradient(#505874,#292e45);border-top:3px solid #99a8cd}
body[data-screen=arena] .hub-navigation button{color:#c3cbe1;flex-direction:column;gap:2px;font-size:9px;min-width:0}
body[data-screen=arena] .hub-navigation button[aria-current=page]{background:linear-gradient(#7a8cb6,#4b567c);color:#fff}
body[data-screen=arena] #arena-screen{position:fixed;inset:0 0 var(--arena-nav);height:auto;min-height:0;max-width:1100px;margin:auto;display:grid;grid-template-rows:minmax(0,1fr) clamp(220px,39dvh,340px) 58px;grid-template-areas:'battle' 'roster' 'actions';overflow:hidden;background:#293447}
body[data-screen=arena] .battle-panel{grid-area:battle;display:block;position:relative;min-height:0;min-width:0;padding:0;overflow:hidden;background:#1d2723}
body[data-screen=arena] .arena-stage{position:absolute;inset:0;height:100%;min-height:0;border:0;border-radius:0}
body[data-screen=arena] .battle-toolbar{position:absolute;z-index:3;top:0;left:0;right:0;height:28px;padding:0 12px;background:linear-gradient(#101826cc,transparent);pointer-events:none}
body[data-screen=arena] .phase-tag{font-size:8px;letter-spacing:1px}body[data-screen=arena] #battle-hint{font-size:9px;max-width:none;color:#d7e0e1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}body[data-screen=arena] .timer b{font-size:12px;color:#eee4c9}
body[data-screen=arena] .team-banner{top:34px;left:12px;right:12px;transform:none;justify-content:space-between;gap:8px;z-index:2;background:linear-gradient(90deg,#16232999,transparent,#261e2899);border-radius:8px;padding:5px 9px}
body[data-screen=arena][data-phase=setup] .team-banner{top:22px;padding:3px 9px}
body[data-screen=arena] .team-banner>div{gap:3px;min-width:100px;flex:1}body[data-screen=arena] .team-banner>div>span{font-size:10px;font-weight:800;letter-spacing:.6px}body[data-screen=arena] .team-banner b{font-size:10px}body[data-screen=arena] .team-banner small{font-size:9px;color:#f8df82}body[data-screen=arena] .team-banner strong{font-size:13px}body[data-screen=arena] .versus{font:900 italic 34px Georgia,serif;color:#ffe082;-webkit-text-stroke:1px #a46b26;text-shadow:0 3px #322e37,0 0 12px #eec75d88}
body[data-screen=arena] .ground-caption,body[data-screen=arena] .camera-caption{display:none}
body[data-screen=arena] .battle-zoom-control{position:absolute;right:10px;bottom:10px;z-index:9;display:flex;align-items:center;gap:3px;padding:4px;border:1px solid #c6d3ef;background:linear-gradient(#64789dcc,#394966e8);border-radius:8px;box-shadow:0 3px 10px #10152299,inset 0 1px #f5f8ff66;backdrop-filter:blur(5px)}
body[data-screen=arena] .battle-zoom-control[hidden]{display:none}
body[data-screen=arena] .battle-zoom-control button{width:32px;height:32px;padding:0;border:1px solid #d5e0f5;border-radius:6px;background:linear-gradient(#91a7cf,#60769d);color:#fff;font:900 20px/1 Arial;text-shadow:0 1px #27344d;box-shadow:inset 0 1px #fff5;cursor:pointer}
body[data-screen=arena] .battle-zoom-control button:disabled{opacity:.35;cursor:default}
body[data-screen=arena] .battle-zoom-control output{min-width:52px;padding:0 3px;text-align:center;color:#fff4c4;font-size:9px;font-weight:800;line-height:1.1;text-shadow:0 1px 2px #182034}
body[data-screen=arena] .roster-panel{grid-area:roster;width:auto;min-height:0;overflow:hidden;order:initial;padding:5px 12px 3px;border:0;border-top:4px solid #94acdb;background:linear-gradient(#535c80,#414861);display:flex;gap:2px;box-shadow:inset 0 2px #d2e7ff55}
body[data-screen=arena] .panel-heading{flex:none;height:18px}body[data-screen=arena] .panel-heading h1{font-size:12px;font-weight:800;margin:0;letter-spacing:0}body[data-screen=arena] .count-badge{font-size:9px;padding:3px 7px;border:1px solid #8291b7;background:#282e4866;color:#f4e7b7}
body[data-screen=arena] .roster-help{flex:none;color:#e0e8ff;font-size:9px;line-height:1.35;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:12px}
body[data-screen=arena] .hero-roster{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-rows:max-content;align-content:start;gap:6px;padding:3px 6px;max-width:490px;width:100%;margin:0 auto;scrollbar-width:thin;scrollbar-color:#a7b3d3 #343c58;overscroll-behavior:contain}
body[data-screen=arena] .hero-card{display:block;width:100%;height:auto;aspect-ratio:1;min-width:0;max-height:79px;padding:0;border:2px solid #97a7c8;border-radius:3px;background:radial-gradient(#66799b,#242e48);overflow:visible;cursor:pointer}
body[data-screen=arena] .hero-card[data-stars='3']{border-color:#a878e0}body[data-screen=arena] .hero-card[data-stars='4']{border-color:#ebbc54}body[data-screen=arena] .hero-card[data-stars='5']{border-color:#ef6181}
body[data-screen=arena] .hero-card[aria-pressed=true]{outline:2px solid #fff1a4;outline-offset:2px;box-shadow:0 0 9px #ffd86966}
body[data-screen=arena] .hero-card img{position:absolute;inset:0;width:100%;height:100%;transform:none;object-fit:cover;filter:drop-shadow(0 2px 2px #1118)}
body[data-screen=arena] .hero-info{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body[data-screen=arena] .hero-check{position:absolute;left:0;right:0;top:9%;font:bold 43px Arial;color:#92fc64;text-align:center;text-shadow:0 3px 1px #163021,1px 0 #1a3827;pointer-events:none}
.arena-card-level{position:absolute;right:2px;top:0;font-size:11px;font-weight:900;color:white;text-shadow:0 1px 2px #000}.arena-card-stars{position:absolute;bottom:-3px;left:0;right:0;font-size:12px;color:#ffe768;text-align:center;letter-spacing:-2px;text-shadow:0 1px 2px #3c2620;white-space:nowrap}.arena-card-faction{position:absolute;left:-5px;top:-5px;font-size:13px;line-height:20px;width:20px;height:20px;text-align:center;clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);background:#5686c8;color:#ecf4ff;text-shadow:0 1px #24365d;font-weight:bold;z-index:1}
.arena-card-faction[data-faction=wild],.arena-filter[data-faction=wild]{background:linear-gradient(#93bf66,#46792e)}.arena-card-faction[data-faction=shadow],.arena-filter[data-faction=shadow]{background:linear-gradient(#b785db,#644590)}.arena-card-faction[data-faction=undead],.arena-filter[data-faction=undead]{background:linear-gradient(#71ce8c,#377659)}
body[data-screen=arena] .copy-tools{display:flex;flex:none;align-items:center;justify-content:center;gap:13px;height:17px;margin:0;font-size:9px}.copy-tools.arena-roster-pager button{font-size:10px;padding:2px 8px;background:#333e60;border:1px solid #879cc7;border-radius:4px;color:#f1e9cb}
.arena-factions{display:flex;flex:none;justify-content:center;align-items:center;gap:15px;height:30px}.arena-filter{width:30px;height:30px;padding:0;border:2px solid #99b6da;background:linear-gradient(#789cd4,#3a587c);font-size:19px;color:white;border-radius:9px;font-weight:800}.arena-filter[aria-pressed=true]{border-color:#ffe89b;box-shadow:0 0 7px #f2d98566}.arena-filter[data-faction=all]{font-size:10px;background:linear-gradient(#a5b4d0,#697591)}
body[data-screen=arena] .formation-tools{display:flex;flex:none;justify-content:center;gap:24px;padding:0;height:25px}.formation-tools .text-button{font-size:10px;padding:5px 3px;color:#e4e9fa;text-decoration-color:#a4b4df}
.arena-card-power{position:absolute;inset:auto 0 0;height:12px;display:flex;align-items:center;justify-content:center;gap:2px;background:#172038eb;color:#ffe798;font-size:9px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums;pointer-events:none}.arena-card-power svg{width:11px;height:11px;flex:none}body[data-screen=arena] .arena-card-stars{bottom:11px}
body[data-screen=arena] .battle-actions{grid-area:actions;display:flex;min-height:0;padding:6px 12px;gap:10px;border-top:2px solid #7a8caf;background:linear-gradient(#59688f,#444c70);flex-wrap:nowrap}
body[data-screen=arena] .action-buttons{flex:1;justify-content:center;gap:8px;min-width:0}body[data-screen=arena] #start{height:44px;flex:1;min-width:0;max-width:230px;background:linear-gradient(#ffed8d 0 42%,#ffcf37 43%,#efac10);border:2px solid #fff0b2;color:#403622;box-shadow:0 3px #8b602a;font-size:15px;font-weight:900;border-radius:5px}
body[data-screen=arena] .battle-actions .secondary-button{height:40px;min-width:35px;padding:0 8px;border:1px solid #bccbe9;background:linear-gradient(#94aad0,#5c7097);color:white;border-radius:6px;font-weight:bold}body[data-screen=arena] .arena-back{font-size:25px}body[data-screen=arena] #battle-info-open{font:700 20px Georgia,serif}body[data-screen=arena] #speed{font-size:12px}
body[data-screen=arena]:not([data-phase=setup]):is([data-phase=running],[data-phase=paused],[data-phase=victory],[data-phase=defeat],[data-phase=draw]) #arena-screen{grid-template-rows:minmax(0,1fr) 58px;grid-template-areas:'battle' 'actions'}
body[data-screen=arena]:not([data-phase=setup]):is([data-phase=running],[data-phase=paused],[data-phase=victory],[data-phase=defeat],[data-phase=draw]) .roster-panel{display:none}
.unit-preparation-label{display:none}body[data-screen=arena][data-phase=setup] .unit-preparation-label{display:flex;align-items:center;justify-content:center;gap:3px;background:#151e29cc;padding:2px 4px;border-radius:3px;font-size:8px;max-width:83px;overflow:hidden;text-overflow:ellipsis}.unit-preparation-label i{font-style:normal;color:#aee3fa}body[data-screen=arena][data-phase=setup] .unit-label>span{display:none}body[data-screen=arena][data-phase=setup] .unit-health{height:3px;margin-top:2px;width:34px}body[data-screen=arena] .unit-label{min-width:34px;max-width:90px}
.battle-info-dialog .encounter-bar{min-height:0;padding:12px 0}.battle-info-dialog .encounter-bar p{display:block}.battle-info-dialog .stage-preparation{padding:12px 0;background:none;border:0}.battle-info-dialog .combat-feed{height:auto;display:block}.battle-info-dialog .combat-feed p{white-space:normal}
body[data-screen=arena] .loading-screen{padding:16px}body[data-screen=arena] .loading-screen img{width:40px;margin-bottom:10px}body[data-screen=arena] .loading-screen h2{font-size:20px}body[data-screen=arena] .loading-screen progress{margin:8px}
@media(min-width:851px){body[data-screen=arena] #arena-screen{grid-template-rows:minmax(0,1fr) clamp(195px,31dvh,280px) 60px}body[data-screen=arena] .hero-roster{max-width:530px}body[data-screen=arena] .hero-card{max-height:88px}}
@media(max-height:620px) and (orientation:portrait){body[data-screen=arena] #arena-screen{grid-template-rows:minmax(0,1fr) 180px 52px}body[data-screen=arena] .team-banner{top:29px;padding:3px}body[data-screen=arena] .team-banner b{font-size:9px}body[data-screen=arena] .team-banner strong{font-size:11px}body[data-screen=arena] .battle-actions{padding:4px 10px}body[data-screen=arena] #start{height:39px}body[data-screen=arena] .battle-zoom-control{right:7px;bottom:7px}body[data-screen=arena] .battle-zoom-control button{width:29px;height:29px}}
@media(max-height:550px) and (orientation:landscape){body[data-screen=arena] #arena-screen{grid-template-columns:minmax(0,1fr) 260px;grid-template-rows:minmax(0,1fr) 50px;grid-template-areas:'battle roster' 'actions actions'}body[data-screen=arena] .roster-panel{border-top:0;border-left:3px solid #94acdb;padding:5px}body[data-screen=arena] .hero-roster{gap:6px}.arena-factions{gap:10px}body[data-screen=arena] .formation-tools{gap:9px}body[data-screen=arena] .hero-check{font-size:31px}}
@media(prefers-reduced-motion:reduce){body[data-screen=arena] .hero-card,body[data-screen=arena] .slot-button{transition:none}}
body[data-screen=arena] .scene-vignette{box-shadow:inset 0 0 85px #0003;background:linear-gradient(#10182126,transparent 22%,transparent 85%,#10182140)}
body[data-screen=arena]:not([data-phase=setup]) .unit-label>span{display:inline-block;max-width:90px;overflow:hidden;text-overflow:ellipsis;padding:1px 4px;border-radius:3px;background:#172735d9;color:#f3fbff;font-size:9px;font-weight:700;text-shadow:0 1px 2px #000}
body[data-screen=arena]:not([data-phase=setup]) .unit-label.monsters>span{background:#351b24d9;color:#ffe1d8;font-size:8px}
body[data-screen=arena] .unit-health{height:5px;width:42px;border-color:#0c1726;background:#0e1828;box-shadow:0 1px 3px #0009}
body[data-screen=arena] .unit-health i{background:#83e1eb}body[data-screen=arena] .unit-label.monsters .unit-health i{background:#ff9583}
body[data-screen=arena] .unit-label::after{content:"";position:absolute;top:100%;left:50%;width:1px;height:var(--label-lift,0);transform-origin:top;transform:rotate(var(--label-angle,0rad));background:linear-gradient(#b5eafa99,#b5eafa33);pointer-events:none}body[data-screen=arena] .unit-label.monsters::after{background:linear-gradient(#ffb4a699,#ffb4a633)}
@media(max-height:550px) and (orientation:landscape){body[data-screen=arena] .team-banner{top:24px;padding:3px 8px}body[data-screen=arena] .team-banner>div{display:flex;align-items:center;justify-content:center;gap:6px}body[data-screen=arena] .team-banner>div>span{font-size:9px}body[data-screen=arena] .team-banner .versus{font-size:24px}}
body[data-screen=arena] .guide{top:auto;bottom:calc(var(--arena-nav) + 62px);padding:8px 12px;max-width:400px}
body[data-screen=arena] .guide p{margin:4px 0;font-size:11px;line-height:1.4}body[data-screen=arena] .guide img{width:28px;height:40px}
body[data-screen=arena] .result-overlay{padding:12px;overflow:hidden}body[data-screen=arena] .result-card{max-height:100%;overflow-y:auto;overscroll-behavior:contain}
@media(max-height:550px) and (orientation:landscape){body[data-screen=arena]:not([data-phase=setup]) #arena-screen{grid-template-columns:minmax(0,1fr)}body[data-screen=arena] .guide{right:12px;max-width:236px}}
