/* Trainer panels follow the supplied reference: compact portraits, not tall cards. */
.battle-bottom{grid-template-columns:280px minmax(280px,1fr) 290px 260px}
.reference-hud.match-trainer{position:relative;box-sizing:border-box;min-width:0;max-width:none;border:0;border-radius:0;overflow:visible;background-repeat:no-repeat;background-size:100% 100%;color:#f4fcff;filter:drop-shadow(0 3px 7px #001f3899)}
.reference-hud.player-trainer{display:grid;grid-template-columns:1fr;grid-template-rows:134px 44px 44px;gap:3px;width:100%;height:250px;min-height:0;max-height:250px;padding:12px 17px 10px 24px;align-self:end;align-items:center;background-image:url('assets/ui/hud-player.svg')}
.player-portrait-row{display:grid;grid-template-columns:minmax(0,1fr) 58px;gap:9px;align-items:center;min-width:0;height:134px}
.reference-hud .hud-portrait{position:relative;display:block;margin:0;aspect-ratio:1;min-width:0;border-radius:50%;overflow:hidden;isolation:isolate;border:1.5px solid #5ce5ff;box-shadow:0 0 14px #08b7ff70,inset 0 0 18px #0099cf88;background:radial-gradient(circle at 45% 40%,#1879ae,#06325c 70%)}
.reference-hud .hud-portrait:after{display:none}
.reference-hud.player-trainer .hud-portrait{width:134px;height:134px;justify-self:center}
.reference-hud .trainer-model{display:block;width:100%;height:100%;min-width:0;min-height:0;max-height:none;position:relative;margin:0;flex:none}
.reference-hud .trainer-model .trainer-fallback,.reference-hud .trainer-model canvas{display:block;width:100%;height:100%;max-width:none;object-fit:contain;object-position:center top}
.reference-hud .trainer-model .model-loading{font-size:0;inset:auto 6px 5px;min-height:0;padding:0;gap:0;background:none}
.reference-hud .model-loading>img{width:18px;height:18px}.reference-hud .model-loading>span{display:none}
.player-emblems{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-width:0}
.reference-hud img.hud-rank-badge{width:50px;height:50px;max-width:100%;object-fit:contain;filter:drop-shadow(0 0 8px #29b7d950)}
.reference-hud .hud-deck-count{display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;color:#c7edff;font-size:13px;line-height:1}
.reference-hud .hud-deck-count img{width:20px;height:28px;object-fit:contain;border:1px solid #8ecfe999;border-radius:4px;box-shadow:3px -2px 0 #0e4774}
.hud-identity{display:flex;flex-direction:column;text-align:center;align-items:center;gap:3px;line-height:1.1;min-width:0}
.hud-identity strong{font-size:22px;font-weight:900;white-space:nowrap}.hud-identity>span{font-size:13px;color:#8fd8f4;letter-spacing:.3px}
.hud-counters{display:grid;grid-template-columns:1fr 1fr;gap:9px;width:100%;min-width:0}
.hud-counters>span,.hud-counters>button{display:flex;align-items:center;justify-content:center;gap:15px;min-width:0;min-height:42px;padding:4px 9px;background:linear-gradient(120deg,#054c73e6,#042a49e6);border:1px solid #43c5f599;border-radius:22px;color:#eefaff;box-shadow:inset 0 1px 6px #1384b935;font:inherit}
.hud-counters .nav-icon{width:25px;height:29px;object-fit:contain}.hud-counters>span>span,.hud-counters>button>span{display:flex;flex-direction:column;align-items:center;gap:2px}.hud-counters b{font-size:18px;line-height:1}.hud-counters small{font-size:11px;line-height:1.1;letter-spacing:.5px}
.reference-hud.rival-trainer{display:grid;grid-template-columns:105px minmax(0,1fr);grid-template-rows:57px 82px 30px;gap:6px 2px;align-items:start;align-self:start;justify-self:end;width:280px;height:205px;min-height:0;padding:19px 13px 10px 21px;background-image:url('assets/ui/hud-opponent.svg')}
.rival-identity{grid-column:1;grid-row:1;display:flex;flex-direction:column;gap:3px;align-self:center;z-index:2;min-width:0}.rival-identity strong{font-size:19px;line-height:1.2}.rival-identity>span{font-size:16px;font-weight:800;line-height:1.2;overflow-wrap:anywhere}
.reference-hud.rival-trainer .hud-portrait{grid-column:2;grid-row:1/3;width:140px;height:140px;max-width:none;justify-self:end;align-self:start;clip-path:inset(0 round 50% 50% 9% 9%);border-color:#d74068;background:radial-gradient(circle at center,#7e163b99,#3b102377);box-shadow:inset 0 0 22px #db29652b,0 0 10px #f52b6033;border-radius:50% 50% 9% 9%}
.reference-hud.rival-trainer>img.hud-rank-badge{position:absolute;top:18px;right:10px;width:35px;height:35px;z-index:3;filter:drop-shadow(0 0 6px #ec4d7255)}
.rival-hand{grid-column:1;grid-row:2;align-self:end;display:flex;flex-direction:column;gap:12px;padding-bottom:3px;z-index:2}
.hand-dots{display:flex;gap:4px;height:10px;align-items:center}.hand-dots i{display:block;width:7px;height:7px;border:1px solid #b6b9ca80;border-radius:50%;background:#5b58604d}.hand-dots i.filled{background:linear-gradient(#bdc9d4,#5f6d83);border-color:#dbe0edbb;box-shadow:0 0 3px #e0d2df40}
.rival-hand-count{display:flex;align-items:center;gap:12px;border-top:1px solid #a5627766;border-bottom:1px solid #a5627744;padding:8px 0;width:90px}.rival-hand-count .nav-icon{width:23px;height:27px;object-fit:contain;filter:grayscale(1) brightness(1.9)}.rival-hand-count b{font-size:20px}.rival-hand-count small{font-size:10px;color:#edc7d2}
.rival-footer{grid-column:1/-1;grid-row:3;display:flex;align-items:center;gap:8px;min-width:0;padding-top:8px;border-top:1px solid #c64e6f66;line-height:1;z-index:2}
.rival-footer>strong{font-size:12px;letter-spacing:1.1px;color:#ff4a70}.rival-footer>span{font-size:10px;color:#e5c6d3}.rival-footer .hud-deck-count{margin-left:auto;font-size:11px}.rival-footer .hud-deck-count img{width:13px;height:18px;border-color:#c2758a;box-shadow:2px -1px 0 #743047}
@media(min-width:1550px){.zones{margin-left:294px;margin-right:294px}.match-header{position:relative;min-height:80px;margin-bottom:10px;grid-template-columns:1fr auto 1fr;align-items:center}.match-tools{margin-left:294px}.match-header .reference-hud.rival-trainer{position:absolute;right:0;top:90px;margin:0}.match-header .turn-chip{margin-top:0}.battle-bottom{gap:14px}}
@media(max-width:1549px) and (min-width:951px){.match-header{min-height:205px;align-items:start}.match-header .turn-chip{margin-top:14px}.match-header .match-tools{margin-top:14px}}
@media(max-width:1300px){.battle-bottom{grid-template-columns:250px minmax(0,1fr) 230px}.reference-hud.player-trainer{padding-left:20px;padding-right:13px}.player-portrait-row{grid-template-columns:minmax(0,1fr) 45px;gap:4px}.reference-hud img.hud-rank-badge{width:43px;height:43px}}
@media(max-width:950px){.battle-bottom{grid-template-columns:250px minmax(0,1fr)}.match-header{grid-template-columns:minmax(90px,1fr) auto 280px;gap:10px;min-height:205px;align-items:start}.reference-hud.rival-trainer{width:280px;height:205px}.match-header .turn-chip{padding:12px;font-size:20px;margin-top:12px}.reference-hud.player-trainer{min-height:0;max-height:250px}.reference-hud.player-trainer .hud-portrait{width:134px;height:134px}}
@media(max-width:620px){.battle-bottom{grid-template-columns:minmax(138px,.9fr) minmax(0,1.1fr)}.match-header{grid-template-columns:minmax(0,1fr) 190px;min-height:170px;gap:8px}.reference-hud.rival-trainer{width:190px;height:170px;grid-template-columns:77px minmax(0,1fr);grid-template-rows:49px 58px 24px;gap:5px 0;padding:14px 9px 10px 14px}.rival-identity strong{font-size:16px}.rival-identity>span{font-size:14px}.reference-hud.rival-trainer .hud-portrait{width:88px;height:108px}.reference-hud.rival-trainer>img.hud-rank-badge{width:26px;height:26px;top:12px;right:7px}.rival-hand{gap:8px;padding:0}.hand-dots{gap:3px}.hand-dots i{width:6px;height:6px}.rival-hand-count{width:68px;padding:5px 0;gap:8px}.rival-hand-count .nav-icon{width:17px;height:20px}.rival-hand-count b{font-size:17px}.rival-hand-count small{font-size:9px}.rival-footer{gap:5px;padding-top:7px}.rival-footer>strong{font-size:10px;letter-spacing:.4px}.rival-footer>span{font-size:9px}.rival-footer .hud-deck-count{gap:3px;font-size:10px}.rival-footer .hud-deck-count img{width:10px;height:14px}.reference-hud.player-trainer{height:219px;max-height:219px;padding:15px 9px 12px 13px;grid-template-rows:107px 40px 39px;gap:3px}.player-portrait-row{height:107px;grid-template-columns:minmax(0,1fr) 33px;gap:1px}.reference-hud.player-trainer .hud-portrait{width:min(100%,100px);height:auto;aspect-ratio:1}.reference-hud.player-trainer img.hud-rank-badge{width:31px;height:31px}.player-emblems{gap:8px}.reference-hud.player-trainer .hud-deck-count{gap:3px;font-size:11px}.reference-hud.player-trainer .hud-deck-count img{width:13px;height:19px}.hud-identity strong{font-size:17px}.hud-identity>span{font-size:12px}.hud-counters{gap:5px}.hud-counters>span,.hud-counters>button{min-height:38px;padding:4px;gap:5px;border-radius:15px}.hud-counters .nav-icon{display:none}.hud-counters b{font-size:16px}.hud-counters small{font-size:10px}.match-header .turn-chip{font-size:17px;padding:8px 5px;margin:0;min-width:0}}
