/* Readable stadium HUD. Artwork is an elastic SVG skin; all labels stay live text. */
.battle-bottom{grid-template-columns:210px minmax(280px,1fr) 270px 245px;grid-template-areas:'player hand log turn';gap:14px;align-items:stretch}
.match-trainer{border:0;border-radius:0;background:url('assets/ui/hud-player.svg') center/100% 100% no-repeat;box-shadow:none;overflow:visible;isolation:isolate;color:#fff}
.match-trainer .hud-portrait{position:relative;min-width:0;overflow:hidden;border-radius:48% 48% 15px 15px;background:radial-gradient(ellipse at 50% 65%,#0e9ee969,transparent 70%)}
.match-trainer .hud-portrait:after{content:'';position:absolute;inset:7% 5% 2%;border:1px solid #46d8ff66;border-radius:50%;pointer-events:none;z-index:-1}
.match-trainer .trainer-model{display:block;width:100%;height:100%;margin:0;min-width:0;min-height:0}
.match-trainer .trainer-model canvas,.match-trainer .trainer-fallback{width:100%;height:100%;object-fit:contain;object-position:center bottom}
.match-trainer .trainer-details{min-width:0;gap:4px;text-align:center;align-items:center}
.match-trainer .trainer-details strong{font-size:clamp(17px,1.2vw,23px);overflow-wrap:anywhere;line-height:1.2}
.match-trainer .trainer-details .hero-power{font-size:13px;color:#b8e9ff}
.match-trainer .trainer-details small{font-size:12px;line-height:1.3;color:#c4e7f8}
.match-trainer .trainer-details .hud-side{font-size:10px;font-weight:900;letter-spacing:1.3px;color:#6fe6ff}
.match-trainer .rank-label{display:flex;align-items:center;gap:5px;font-size:13px;color:#d6f2ff}
.match-trainer img.rank-icon{width:32px;height:32px;object-fit:contain}
.player-trainer{padding:15px 14px 17px;max-height:none;min-height:280px;display:grid;grid-template-rows:130px auto auto;gap:7px}
.player-trainer .hud-portrait{width:100%;height:130px}
.trainer-card-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;width:100%;align-self:end}
.trainer-card-stats>span,.trainer-card-stats>button{border:1px solid #3fa1cf99;border-radius:13px;background:#053754c9;min-height:52px;min-width:0;display:flex;flex-wrap:wrap;justify-content:center;align-content:center;align-items:center;gap:2px 5px;padding:5px;color:#ecfbff;font:inherit}
.trainer-card-stats b{font-size:17px;line-height:1.1}.trainer-card-stats small{width:100%;font-size:10px;line-height:1.2;text-align:center;letter-spacing:.3px}
.trainer-card-stats .nav-icon,.trainer-card-stats img.deck-back-thumb{width:17px;height:23px;object-fit:contain;border-radius:3px}
.rival-trainer{background-image:url('assets/ui/hud-opponent.svg');width:310px;max-width:100%;height:auto;min-height:156px;display:grid;grid-template-columns:minmax(0,1fr) 112px;grid-template-rows:auto auto;gap:7px;padding:17px 16px}
.rival-trainer .hud-portrait{grid-column:2;grid-row:1/3;height:135px;width:100%;background:radial-gradient(ellipse at center,#ef23502b,transparent 70%)}
.rival-trainer .hud-portrait:after{border-color:#ff548e88}.rival-trainer .trainer-details{grid-column:1;grid-row:1;align-items:start;text-align:left}
.rival-trainer .trainer-details .hud-side{color:#ff8aa5}.rival-trainer .trainer-details strong{font-size:17px}.rival-trainer .trainer-details .hero-power{color:#ffcad8}
.rival-trainer .trainer-card-stats{grid-column:1;grid-row:2}.rival-trainer .trainer-card-stats>span,.rival-trainer .trainer-card-stats>button{background:#4f1022b3;border-color:#a74b6788;min-height:43px;padding:3px}
.rival-trainer .trainer-card-stats b{font-size:14px}.rival-trainer .trainer-card-stats small{font-size:9px}.rival-trainer .rank-label{font-size:12px}
.match-log{grid-area:log;margin:0;padding:16px 14px;background:url('assets/ui/hud-log.svg') center/100% 100% no-repeat;border:0;border-radius:0;min-width:0;display:flex;flex-direction:column;max-height:380px;align-self:stretch}
.log-head{display:flex;align-items:center;justify-content:space-between;gap:6px;border-bottom:1px solid #3b86aa99;padding:0 0 9px;margin-bottom:10px}
.log-head h2{font-size:19px;display:flex;align-items:center;gap:8px;margin:0;color:#fff}.log-head .nav-icon{height:26px;width:22px}
.log-head button{border:1px solid #4db6dc;border-radius:50%;width:36px;height:36px;flex:none;background:linear-gradient(#0d6090,#062a4d);color:#eafaff;font-size:24px;line-height:1;cursor:pointer}
.log-lines{overflow-y:auto;max-height:290px;min-height:0;scrollbar-width:thin;scrollbar-color:#29a6d9 #06324e;padding-right:6px;font-size:13px;line-height:1.5;color:#edf7ff}
.log-lines[hidden]{display:none}.log-turn h3{display:flex;align-items:center;gap:12px;color:#7fe6ff;font-size:12px;letter-spacing:.6px;margin:5px 0 10px}.log-turn h3:after{content:'';height:1px;background:#397f9c66;flex:1}
.log-turn ol{list-style:none;padding:0 0 0 18px;margin:0 0 17px 7px;border-left:1px solid #4ca1c080}.log-event{position:relative;padding:0 0 13px;margin:0;overflow-wrap:anywhere}.log-event:last-child{padding-bottom:0}
.log-event:before{content:'';position:absolute;left:-24px;top:4px;width:10px;height:10px;border-radius:50%;background:#5b9ab5;border:1px solid #7dbbd5}.turn-event:before{background:#30c4ff;border-color:#a1eaff;box-shadow:0 0 8px #27bbff88}.result-event:before{background:#ffce57;border-color:#fff0b7}
.match-log.is-collapsed{align-self:start;min-height:65px}.match-log.is-collapsed .log-head{margin:0;border:0;padding:0}
.hand-panel{padding:15px 14px 12px;border-radius:18px;border:1px solid #7ed5fa;background:linear-gradient(135deg,#06466aef,#052541f5);box-shadow:inset 0 0 16px #168bc330;min-width:0}
.hand-head{border-bottom:1px solid #3b86aa99;padding-bottom:10px}.hand-head>span:first-child{display:flex;align-items:center;gap:8px;font-size:20px;font-weight:800}.hand-head .nav-icon{height:27px;width:24px}.hand-head b{color:#82edff;font-size:17px;white-space:nowrap}
.hand{padding-top:14px}.hand>.card{min-width:125px;max-width:155px;flex-basis:clamp(125px,8vw,155px)}.selected-summary{min-height:58px;border:0;background:#041c3077;padding:8px 10px}
.turn-panel{background:linear-gradient(145deg,#075582f0,#05263ff5);border:1px solid #8be3ff;justify-content:center;padding:18px 16px;border-radius:18px;box-shadow:inset 0 0 22px #0b8cd244}
.turn-panel>.button.primary{min-height:54px;font-size:21px}.turn-panel .energy-counter strong{font-size:34px}.turn-panel .plan-list{line-height:1.4;max-height:110px}.turn-panel .turn-actions .button{min-height:42px}
.battle-bottom .finished-summary{grid-area:hand;grid-column:auto;grid-row:auto;padding:20px;min-width:0}
.level-progress{padding:15px 18px;margin-top:18px}.level-progress>div:first-child{display:flex;justify-content:space-between;gap:8px;color:#a8ebff;font-size:14px}.level-progress progress{display:block;width:100%;height:8px;border:0;border-radius:8px;accent-color:#4ad6ff;margin:10px 0;background:#082438}.level-progress p{font-size:13px;margin:6px 0;line-height:1.5}.level-progress progress::-webkit-progress-bar{background:#082438;border-radius:8px}.level-progress progress::-webkit-progress-value{background:linear-gradient(90deg,#3ab5ed,#7bffe4);border-radius:8px}.wallet .level-pill{font-size:13px;color:#9eeaff;white-space:nowrap}
.rank-gallery{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:20px 0}.rank-gallery span{text-align:center;display:flex;flex-direction:column;gap:6px}.rank-gallery img{width:52px;height:52px;object-fit:contain;margin:auto}.rank-gallery small{font-size:11px}
.card-back-picker{border:1px solid #5fb6d988;border-radius:14px;margin:18px 0 10px;padding:10px}.card-back-picker legend{font-weight:800;color:#d7f5ff;padding:0 6px}.card-back-picker p,.card-back-picker small{font-size:12px;line-height:1.4;color:#b5dce9;margin:2px 0 9px}.card-back-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:10px}.card-back-options button{border:2px solid transparent;border-radius:10px;background:#032b48;padding:5px;display:flex;flex-direction:column;gap:5px;align-items:center;color:#dff6ff;font-size:12px;min-width:0}.card-back-options button[aria-pressed=true]{border-color:#ffe291;background:#285169;box-shadow:0 0 9px #ffcc4a44}.card-back-options img{width:100%;max-width:75px;aspect-ratio:5/7;object-fit:contain}.card-back-options button:focus-visible{outline:3px solid #9feaff}
.starter-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin:20px 0}.starter-choices article{min-width:0;border:1px solid #73c5e9;background:linear-gradient(#0d4670,#072a46);border-radius:18px;padding:15px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:8px}.starter-choices .trainer-portrait{width:100%;height:185px;margin:0}.starter-choices h3{font-size:25px}.starter-choices p{font-size:14px;line-height:1.4;flex:1;margin:0}.starter-choices small{font-size:12px}.starter-choices .button{width:100%;font-size:15px;padding:10px 6px;min-height:48px;margin-top:7px}
dialog:has(.starter-choices){max-width:850px;width:calc(100% - 28px)}.match-rewards{display:flex;flex-direction:column;align-items:center;gap:10px;margin:14px 0 20px;color:#a4eeff}.level-unlock{display:flex;align-items:center;gap:12px;flex-wrap:wrap;text-align:left;background:#042940;border:1px solid #64d9dd;border-radius:12px;padding:10px 14px}.level-unlock img{width:58px;height:58px;object-fit:cover;border-radius:8px}.level-unlock span{font-size:14px}.level-unlock b{color:#ffdf85}
@media(min-width:1550px){.zones{margin-left:224px;margin-right:259px}.match-header{grid-template-columns:1fr auto 1fr;min-height:100px;align-items:start;margin-bottom:0}.match-header .rival-trainer{margin-bottom:15px}.match-tools{margin-left:224px}.turn-chip{margin-top:10px}.zone-title p{font-size:14px}.zone-info{min-height:115px}.zone-field .card,.slot{max-height:175px}.battle-bottom{margin-top:14px}}
@media(max-width:1300px){.battle-bottom{grid-template-columns:190px minmax(0,1fr) 230px;grid-template-areas:'player hand turn' 'log log log';gap:12px}.match-log{max-height:270px}.log-lines{max-height:185px}.player-trainer{min-height:280px}.hand>.card{min-width:120px;flex-basis:120px}.rank-gallery{gap:4px}}
@media(max-width:950px){.battle-bottom{grid-template-columns:200px minmax(0,1fr);grid-template-areas:'hand hand' 'player turn' 'log log';align-items:stretch}.battle-bottom .finished-summary{grid-area:hand}.player-trainer{min-height:285px}.player-trainer .hud-portrait{height:130px}.turn-panel{display:flex;flex-direction:column;gap:10px}.turn-panel>.plan-list{max-height:100px;width:100%}.hand>.card{min-width:135px;flex-basis:135px;max-width:150px}.rival-trainer{width:285px;grid-template-columns:minmax(0,1fr) 95px}.rival-trainer .trainer-details strong{font-size:16px}.rival-trainer .hud-portrait{height:130px}.match-header{grid-template-columns:minmax(120px,1fr) auto minmax(240px,1fr)}.hand-head>span:first-child{font-size:19px}.card-back-options{grid-template-columns:repeat(6,minmax(0,1fr))}.card-back-options img{max-width:85px}.starter-choices .trainer-portrait{height:165px}}
@media(max-width:620px){.match-header{display:grid;grid-template-columns:minmax(0,1fr) minmax(175px,1fr);grid-template-areas:'tools rival' 'turn rival';gap:8px;align-items:start}.rival-trainer{width:100%;min-height:156px;grid-template-columns:minmax(0,1fr) 58px;padding:12px 10px;gap:4px}.rival-trainer .hud-portrait{height:110px}.rival-trainer .trainer-details strong{font-size:14px}.rival-trainer .trainer-details .hero-power{font-size:10px}.rival-trainer .trainer-details small{font-size:10px}.rival-trainer .rank-label{font-size:10px;gap:3px}.rival-trainer img.rank-icon{width:24px;height:24px}.rival-trainer .trainer-card-stats{grid-column:1/-1}.rival-trainer .trainer-card-stats>span,.rival-trainer .trainer-card-stats>button{min-height:38px;flex-wrap:nowrap}.rival-trainer .trainer-card-stats small{width:auto;font-size:9px}.rival-trainer .trainer-card-stats .nav-icon,.rival-trainer .deck-back-thumb{display:none}.battle-bottom{grid-template-columns:145px minmax(0,1fr);gap:10px}.player-trainer{padding:12px 9px;min-height:270px;grid-template-rows:118px auto auto;gap:4px}.player-trainer .hud-portrait{height:118px}.player-trainer .trainer-details strong{font-size:17px}.player-trainer .trainer-details .hero-power{font-size:12px}.player-trainer .trainer-details small{font-size:11px}.trainer-card-stats{gap:3px}.trainer-card-stats .nav-icon,.trainer-card-stats img.deck-back-thumb{display:none}.trainer-card-stats b{font-size:15px}.trainer-card-stats>span,.trainer-card-stats>button{min-height:44px;padding:3px}.hand-panel{padding:12px 10px}.hand-head>span:first-child{font-size:18px}.hand-head span+span{font-size:11px}.hand>.card{min-width:125px;max-width:125px;flex-basis:125px}.selected-summary p{font-size:13px}.turn-panel{padding:13px 9px;gap:9px}.turn-panel .energy-counter strong{font-size:28px}.turn-panel>.button.primary{font-size:17px;min-height:54px;padding:9px 3px}.turn-panel>.help{font-size:12px}.turn-panel .plan-list{font-size:12px;line-height:1.5}.turn-panel .tiny{min-height:42px}.match-log{padding:15px 14px}.log-lines{font-size:14px}.log-head h2{font-size:20px}.card-back-options{grid-template-columns:repeat(3,minmax(0,1fr))}.card-back-options img{max-width:80px}.wallet .level-pill{display:none}.starter-choices{grid-template-columns:1fr}.starter-choices article{display:grid;grid-template-columns:80px minmax(0,1fr);gap:6px 12px;text-align:left}.starter-choices .trainer-portrait{grid-column:1;grid-row:1/6;height:160px}.starter-choices h3,.starter-choices strong,.starter-choices p,.starter-choices small,.starter-choices .button{grid-column:2;margin:0}.starter-choices .button{font-size:14px}.rank-gallery img{width:40px;height:40px}.rank-gallery small{font-size:10px}}
@media(prefers-reduced-motion:reduce){.match-trainer,.match-log{animation:none}}
