/* Neo Campus / field-first layout, inspired by a classic tabletop TCG.
   Presentation only: gameplay, CPU/online events and card decisions are untouched.
   Loaded AFTER mobile/desktop battle CSS in both authoritative duel clients. */
body.duel-active{
 --table-border:#374354;
 --table-ink:#f2f3f5;
 --table-muted:#aab3c1;
 --table-accent:#28be82;
 background:#191f29;color:var(--table-ink);
}
body.duel-active main{padding:6px clamp(5px,1vw,14px);background:#191f29}
body.duel-active #duel:not(.hidden){
 height:calc(100dvh - 12px);gap:6px;
 grid-template-rows:auto auto minmax(0,1fr) clamp(185px,25dvh,255px)!important;
}
body.duel-active .toolbar{
 min-height:36px;gap:8px;padding:2px 8px;
 background:#202631;border:1px solid #333e4b;border-radius:9px;
}
body.duel-active .toolbar .turn-summary{letter-spacing:.09em;color:#f5f6f8;font-size:12px}
body.duel-active .toolbar .signal{background:#22bb7b;box-shadow:0 0 0 3px #17b97728}
body.duel-active .toolbar #phaseText{font-size:12px}
body.duel-active .toolbar #scoreline,
body.duel-active .toolbar .tag{border-color:#445064;background:#28323d;color:#c4ccd8}
body.duel-active .toolbar button{border-color:#454e60;background:#29313e;color:#e2e8ef;border-radius:8px}
body.duel-active .toolbar button:hover:not(:disabled){background:#354253}
body.duel-active #turnChip{
 border:0;border-radius:99px;background:#28b980;color:#09271c;
 letter-spacing:.11em;font-weight:950;padding:3px 12px;font-size:11px;
}
body.duel-active .stage{
 min-width:0;border:0;border-radius:0;background:none;box-shadow:none;
 overflow:hidden;display:flex;flex-direction:column;gap:3px;
}
body.duel-active .stage .turn-coach,
body.duel-active .stage .opponent-activity-status{
 border-radius:7px;background:#252f3b;color:#c6d6dc;border-color:#3e5260;
}
body.duel-active .stage .arena-layout{
 display:block!important;position:relative;flex:1;min-height:0;min-width:0;
 isolation:isolate;overflow:hidden;
}
body.duel-active .stage .arena-field{
 height:100%;width:100%;display:grid;
 grid-template-rows:minmax(0,1fr) 8px minmax(0,1fr);
 gap:3px;min-height:0;
}
body.duel-active .stage .territory{
 display:flex;flex-direction:column;min-width:0;min-height:0;
 border:5px solid #303b47;border-radius:17px;
 overflow:hidden;position:relative;
 background-color:#48802e;
 background-image:radial-gradient(ellipse at 52% 45%,#83a34912 0%,#25452436 100%),
 linear-gradient(110deg,#2e622a20,#7b9b4830 55%,#295a271a),
 url('neo_duel_grass.svg');
 background-repeat:no-repeat,no-repeat,repeat;
 background-size:100% 100%,100% 100%,180px 180px;
 box-shadow:inset 0 0 0 2px #8aae5b50,inset 0 0 35px #193b2380,0 3px 9px #0005;
}
body.duel-active .stage .trainerbar,
body.duel-active .stage .trainerbar.player{
 min-height:32px;flex:none;z-index:7;
 margin:2px 3px 0;padding:2px 7px;
 border:1px solid #46535c;border-radius:10px;
 background:#222a36f2;box-shadow:0 2px 8px #13231d80;
 color:#f0f4f7;
}
body.duel-active .stage .trainerbar.player{margin:0 3px 2px}
body.duel-active .stage .trainerlabel{min-width:0;gap:7px}
body.duel-active .stage .trainerlabel>span{
 flex:0 0 25px;width:25px;height:25px;display:grid;place-items:center;
 border-radius:50%;background:#e7edf0;color:#28565a;
 border:2px solid #a6b8c6;font-size:15px;line-height:1;
}
body.duel-active .stage .trainerlabel strong{
 color:#f8faff;font-size:clamp(10px,1.2vw,13px);font-weight:900;
 text-transform:none;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
body.duel-active .stage .trainerlabel small{display:block;color:#9daab8;font-size:10px}
body.duel-active .stage .pile-tools{flex-wrap:nowrap;min-width:0;gap:5px}
body.duel-active .stage .pile-button,
body.duel-active .stage .deck-counter{
 display:flex;flex-direction:row;align-items:center;gap:6px;
 background:#222a36;border:1px solid #414c5b;border-radius:8px;
 padding:3px 8px;min-height:28px;min-width:0;font-size:11px;color:#d0d9e0;
 white-space:nowrap;
}
body.duel-active .stage .deck-counter{font-size:0!important}
body.duel-active .stage .deck-counter b,
body.duel-active .stage .pile-button b{color:#fff;font-size:14px}
body.duel-active .stage .deck-counter::before{
 content:"";display:block;width:17px;height:23px;flex:none;border-radius:3px;
 background:#195789 url('neo_card_back.svg') center/cover no-repeat;
 border:1px solid #657b9e;box-shadow:0 2px 3px #0007;
}
body.duel-active .stage .territory .field-row,
body.duel-active .stage .territory .field-row.bottom{
 display:grid;grid-template-columns:minmax(0,1fr);
 grid-template-rows:minmax(0,.9fr) minmax(0,1.1fr);
 flex:1;min-height:0;min-width:0;overflow:visible;
 padding:2px clamp(12px,3vw,26px);gap:1px;
}
body.duel-active .stage .player-territory .field-row.bottom{
 grid-template-rows:minmax(0,1.12fr) minmax(0,.88fr);
}
body.duel-active .stage .territory .field-row .zone{
 align-items:center;justify-content:center;min-width:0;min-height:0;max-height:100%;
}
body.duel-active .stage .territory .zone h3{
 color:#e3f1d7cf;text-shadow:0 1px 3px #17351d;
 letter-spacing:.09em;font-size:9px;font-weight:900;margin:0 0 3px;
}
body.duel-active .stage .territory .pokemon-strip{justify-content:center;max-width:100%;overflow:visible}
body.duel-active .stage .battleline{
 min-height:8px;height:8px;margin:0;
 border:0;border-radius:5px;background:#222c34;gap:0;overflow:visible;
 color:#d2deec;
}
body.duel-active .stage .battleline>span:first-child{display:none}
body.duel-active .stage .battleline #turnChip{
 position:absolute;top:calc(50% - 16px);left:50%;transform:translateX(-50%);
 z-index:11;box-shadow:0 2px 6px #0d161ad9;
}
body.duel-active .stage .poke{
 border:0;background:none;box-shadow:none;color:#f8fff5;
 --attachment-peek:clamp(8px,1.4vw,17px);
 --tool-peek:clamp(8px,1.4vw,17px);
}
body.duel-active .stage .poke .pokemon-face{
 border:1px solid #eceacfbb;box-shadow:0 4px 8px #12271a9e;
 background:#dbe5bb;border-radius:6px;
}
body.duel-active .stage .poke .pokemon-face img{
 display:block;width:100%;height:100%;object-fit:fill;
}
body.duel-active .stage .poke .hp-track{
 height:4px;border-radius:10px;background:#193823b8;
}
body.duel-active .stage .poke .hp-count{font-weight:900;color:#fff;text-shadow:0 1px 3px #111}
body.duel-active .stage .poke strong{color:#fff;text-shadow:0 1px 3px #142f13}
body.duel-active .stage .bench-zone .poke{
 --attachment-height:clamp(41px,7.1dvh,88px);
}
body.duel-active .stage .active-zone .poke{
 --attachment-height:clamp(70px,12.7dvh,146px);
}
body.duel-active .stage .territory .active-with-attacks{
 align-items:center;max-width:100%;min-width:0;
}
body.duel-active .stage .territory .active-with-attacks .inline-attack-panel{
 background:#182b27db;border:1px solid #6e8d69a8;
 box-shadow:0 5px 10px #11291772;border-radius:9px;
}
body.duel-active .stage .inline-attack-panel h4{color:#dcebc7}
body.duel-active .stage button.attack-action{
 background:#285d3fe8;border:1px solid #69b781a8;border-radius:7px;
 min-height:34px;color:#fbfffa;
}
body.duel-active .stage button.attack-action:hover:not(:disabled){background:#338554}
body.duel-active .stage button.attack-action:disabled{opacity:.57}
body.duel-active .stage .prize-sidebar{
 position:absolute;inset:0;z-index:9;display:block;
 border:0;padding:0!important;margin:0;background:none;pointer-events:none;
 width:100%;height:100%;overflow:visible;
}
body.duel-active .stage .prize-group{
 position:absolute;right:9px;z-index:9;
 display:grid;grid-template-columns:28px auto;column-gap:7px;align-items:center;
 width:110px;min-width:0;padding:6px;
 background:#222a36f0;color:#eaf1f7;border:1px solid #414e5b;
 border-radius:9px;box-shadow:0 3px 12px #14241a90;pointer-events:none;
}
body.duel-active .stage .prize-group:first-child{top:calc(50% - 89px)}
body.duel-active .stage .prize-group:last-child{bottom:calc(50% - 89px)}
body.duel-active .stage .prize-group h3{
 grid-column:2;grid-row:1;color:#abb5c5;margin:0!important;
 font-size:9px;line-height:1.2;letter-spacing:.04em;
}
body.duel-active .stage .prize-group .prize-count{
 grid-column:2;grid-row:2;display:block;margin:0;
 font-size:13px;font-weight:950;color:#fff;
}
body.duel-active .stage .prize-group .prize-grid{
 grid-column:1;grid-row:1 / 3;display:grid;grid-template-columns:28px;
 width:28px;height:38px;max-width:none;gap:0;
}
/* Keep all revealed Prize cards visible (Card-Flip Game and similar effects). */
body.duel-active .stage .prize-group:not(.prize-awaiting):not(:has(.prize-face-up)) .prize-back:not(:first-child){
 display:none;
}
body.duel-active .stage .prize-group:has(.prize-face-up){
 display:block;width:150px;
}
body.duel-active .stage .prize-group:has(.prize-face-up) .prize-grid{
 display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
 width:100%;height:auto;gap:3px;margin-top:4px;
}
body.duel-active .stage .prize-group:has(.prize-face-up) .prize-back{
 width:100%;height:42px;
}
body.duel-active .stage .prize-group .prize-back{
 width:28px;height:38px;min-height:0;border-radius:3px;
 background:#174976 url('neo_card_back.svg') center/cover no-repeat;
}
body.duel-active .stage .prize-group.prize-awaiting{
 width:170px;display:block;pointer-events:auto;z-index:60;
}
body.duel-active .stage .prize-group.prize-awaiting .prize-grid{
 width:100%;height:auto;grid-template-columns:repeat(3,minmax(0,1fr));
 gap:4px;margin-top:5px;
}
body.duel-active .stage .prize-group.prize-awaiting .prize-back{
 width:100%;height:auto;min-height:34px;
}
body.duel-active .stage .prize-select{pointer-events:auto}
body.duel-active .below{display:block;margin:0;position:relative;z-index:70;min-height:0;overflow:visible!important}
body.duel-active .below .main-column{
 display:flex;flex-direction:column;align-items:stretch;
 width:100%;height:100%!important;min-height:0!important;gap:5px;
}
body.duel-active .below .main-column>.panel{
 margin:0;min-width:0;max-width:none;border:1px solid #3a4654;
 border-radius:10px;background:#232a35;
}
body.duel-active .below .hand-panel{
 display:block!important;position:relative!important;
 flex:1 1 auto!important;min-width:0!important;width:100%!important;
 max-width:none!important;overflow:hidden!important;padding:0 6px!important;
 background:#222a35!important;
}
body.duel-active .hand-toggle{
 position:absolute!important;top:4px!important;bottom:auto!important;
 left:8px!important;right:auto!important;z-index:23;
 width:auto!important;height:25px!important;min-height:25px!important;
 padding:2px 9px!important;border:1px solid #566479!important;
 border-radius:6px;background:#2b3644;color:#e7edf0;
}
body.duel-active .hand-toggle-label{font-size:11px}
body.duel-active .hand-toggle-label::after{content:none}
body.duel-active .hand-panel .hand-fan,
body.duel-active .hand-panel:not(.tray-open):hover .hand-fan:not(.hidden),
body.duel-active .hand-panel:not(.tray-open):focus-within .hand-fan:not(.hidden){
 display:block;position:absolute!important;top:31px!important;bottom:1px!important;
 left:4px!important;right:4px!important;width:auto!important;height:auto!important;
 padding:3px 5px 4px!important;overflow-x:auto;overflow-y:hidden;
 scrollbar-width:thin;scrollbar-color:#657384 #26303b;
 filter:none;background:none;border:0;box-shadow:none;
}
body.duel-active .hand-panel .hand-fan.hidden{display:none!important}
body.duel-active .hand-fan-track{
 display:flex;flex-flow:row nowrap;align-items:flex-end;gap:8px;
 width:max-content!important;min-width:100%;height:100%;
 padding:0 8px 1px;
}
body.duel-active .hand-fan-card{
 position:relative!important;left:auto!important;bottom:auto!important;
 flex:0 0 clamp(76px,8.2vw,125px);width:clamp(76px,8.2vw,125px);
 height:calc(100% - 2px);min-height:0;max-height:100%;
 transform:none!important;z-index:auto!important;
 border:2px solid #e5c445;border-radius:7px;box-shadow:0 4px 9px #0007;
 transition:transform .13s,box-shadow .13s,border-color .13s;
}
body.duel-active .hand-fan-card:is(:hover,:focus-visible){
 transform:translateY(-6px)!important;z-index:5!important;
 border-color:#a4efd7;box-shadow:0 0 0 2px #98e9db,0 9px 19px #000a;
}
body.duel-active .hand-fan-card.selected{
 transform:translateY(-6px)!important;border-color:#ffdb69;
 box-shadow:0 0 0 2px #ffe9a1,0 6px 14px #000a;
}
body.duel-active .hand-fan-card img{width:100%;height:100%;object-fit:fill}
body.duel-active .below .turn-actions-panel{
 flex:0 0 53px!important;height:53px!important;min-height:0!important;
 width:100%!important;max-width:none!important;padding:4px 8px!important;
 justify-content:center;
}
body.duel-active .below .turn-actions-panel .turn-actions{
 display:flex;align-items:stretch;justify-content:center;flex-wrap:nowrap;
 width:100%;height:100%;gap:7px;
}
body.duel-active .below .turn-actions-panel .turn-actions button{
 flex:1 1 0;min-height:39px;max-width:180px;min-width:0;
 border-radius:9px;background:#28333f;border:1px solid #596475;
 color:#e8edf5;font-size:clamp(11px,1.1vw,14px);font-weight:850;
 white-space:normal;line-height:1.15;padding:4px 9px;
}
body.duel-active .below .turn-actions #endBtn{
 background:#28ab78;border-color:#39db9c;color:#092b21;
}
body.duel-active .below .turn-actions #endBtn:hover:not(:disabled){background:#36ca91}
body.duel-active .below .turn-actions #concedeBtn{
 background:#3b2732;border-color:#7b5263;color:#ffd7df;
}
body.duel-active .hand-tray-drawer,
body.duel-active .power-drawer{bottom:calc(clamp(185px,25dvh,255px) + 6px)}
body.duel-active #decisionBox:not(.hidden){z-index:170;max-height:60dvh;overflow:auto}
body.duel-active .prize-choice-panel{z-index:190}
/* Desktop mirrors the reference match cadence: table at left, persistent match
   information at right, cards below the table and commands below the rail. */
@media (min-width:781px){
 body.duel-active #duel:not(.hidden){
  grid-template-columns:minmax(0,1fr) clamp(292px,27vw,382px);
  grid-template-rows:auto minmax(0,1fr) clamp(185px,25dvh,255px)!important;
  column-gap:10px;row-gap:6px;
 }
 body.duel-active #duel>.toolbar{grid-column:1 / -1;grid-row:1}
 body.duel-active #duel>.stage{grid-column:1;grid-row:2;min-height:0}
 body.duel-active #duel>.below,
 body.duel-active #duel>.below>.main-column{display:contents}
 body.duel-active #duel>.below>.main-column>.hand-panel{
  grid-column:1;grid-row:3;height:100%;min-height:0;
 }
 body.duel-active #duel>.below>.side-column{
  grid-column:2;grid-row:2;display:flex;min-width:0;min-height:0;
  height:100%;gap:7px;padding:0;overflow:hidden;
 }
 body.duel-active #duel>.below>.side-column>#choiceDock{
  display:flex;flex:1;min-height:0;flex-direction:column;gap:7px;
 }
 body.duel-active #choiceDock>#decisionBox{
  flex:0 0 auto;margin:0;padding:12px;border-color:#3d4857;
  background:#232a35;border-radius:10px;
 }
 body.duel-active #choiceDock>#decisionBox:not(.active) #decisionOptions:empty,
 body.duel-active #choiceDock>#decisionBox:not(.active) #decisionActions:empty{display:none}
 body.duel-active #choiceDock>#logDrawer:not(.hidden){
  display:flex!important;flex:1 1 auto;min-height:0;margin:0;padding:0;
  flex-direction:column;border-color:#3d4857;background:#232a35;
 }
 /* Hidden history must never occupy a permanent match panel. */
 body.duel-active #choiceDock>#logDrawer.hidden{display:none!important}
 body.duel-active #choiceDock>#logDrawer header{
  flex:none;padding:10px 12px;border-bottom:1px solid #3d4857;
 }
 body.duel-active #choiceDock>#logDrawer .log-scroll{
  flex:1;min-height:0;max-height:none;overflow:auto;padding:3px 10px 10px;
 }
 body.duel-active #choiceDock>#logDrawer #closeLog,
 body.duel-active .toolbar #logToggle{display:inline-flex;align-items:center;justify-content:center}
 body.duel-active #duel>.below>.main-column>.turn-actions-panel{
  grid-column:2;grid-row:3;width:100%!important;height:100%!important;
  min-height:0!important;padding:8px!important;background:#232a35;
 }
 body.duel-active #duel>.below .turn-actions-panel .turn-actions{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-rows:repeat(3,minmax(42px,1fr));gap:7px;
 }
 body.duel-active #duel>.below .turn-actions-panel .turn-actions button{
  width:100%;height:100%;max-width:none;min-height:42px;
 }
 body.duel-active #duel>.below .turn-actions-panel #endBtn{grid-column:1 / -1}
 body.duel-active #duel>.below .turn-actions-panel #concedeBtn{grid-column:1 / -1}
 body.duel-active #duel>.error:not(.hidden),
 body.duel-active #duel>.prize-choice-panel:not(.hidden){
  position:fixed;left:50%;top:54px;transform:translateX(-50%);
  z-index:210;width:min(680px,calc(100vw - 24px));
 }
 body.duel-active #duel>.coin-fx,
 body.duel-active #duel>.ko-fx,
 body.duel-active #duel>.duel-feedback{position:fixed}
}
@media (max-width:780px){
 body.duel-active main{padding:4px}
 body.duel-active #duel:not(.hidden){
  height:calc(100dvh - 8px);gap:4px;
  grid-template-rows:auto auto minmax(0,1fr) clamp(186px,28dvh,244px)!important;
 }
 body.duel-active .toolbar{min-height:30px;padding:2px 5px;flex-wrap:nowrap;overflow:hidden}
 body.duel-active .toolbar .turn-summary{flex:none;font-size:10px;min-width:0}
 body.duel-active .toolbar #scoreline,body.duel-active .toolbar #stadiumText{display:none}
 body.duel-active .toolbar #phaseText{font-size:10px;white-space:nowrap}
 body.duel-active .toolbar button{flex:none;font-size:10px}
 body.duel-active .stage .trainerbar,
 body.duel-active .stage .trainerbar.player{min-height:28px;padding:1px 5px;margin-inline:2px}
 body.duel-active .stage .trainerlabel>span{width:22px;height:22px;flex-basis:22px;font-size:12px}
 body.duel-active .stage .trainerlabel strong{font-size:10px;max-width:78px}
 body.duel-active .stage .trainerlabel small{display:none}
 body.duel-active .stage .pile-tools{gap:3px}
 body.duel-active .stage .deck-counter,
 body.duel-active .stage .pile-button{font-size:9px;padding:2px 4px;min-height:25px}
 body.duel-active .stage .deck-counter::before{width:13px;height:18px}
 body.duel-active .stage .deck-counter b,
 body.duel-active .stage .pile-button b{font-size:11px}
 body.duel-active .stage .territory{border-width:3px;border-radius:12px}
 body.duel-active .stage .territory .field-row,
 body.duel-active .stage .territory .field-row.bottom{padding:1px 7px;gap:0}
 body.duel-active .stage .territory .zone h3{font-size:8px;margin-bottom:1px}
 body.duel-active .stage .territory .bench-zone .pokemon-strip{
  grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;
  padding:1px 12px 3px;overflow:visible;
 }
 body.duel-active .stage .territory .bench-zone .poke{
  --attachment-height:clamp(36px,6.4dvh,60px);
  --attachment-peek:6px;--tool-peek:6px;
  --attachment-overlap:4px;--tool-overlap:4px;
  max-height:none;
 }
 body.duel-active .stage .territory .active-zone .poke{
  --attachment-height:clamp(61px,10.9dvh,110px);
  --attachment-peek:11px;--tool-peek:11px;
 }
 body.duel-active .stage .territory .active-with-attacks{
  display:grid!important;grid-template-columns:minmax(0,43%) minmax(0,57%);
  width:100%;gap:0;
 }
 body.duel-active .stage .territory .active-with-attacks .active-slot{
  grid-column:1;grid-row:1;justify-content:center;padding:0 2px;
 }
 body.duel-active .stage .territory .active-with-attacks .inline-attack-panel{
  grid-column:2;grid-row:1;padding:4px 5px;max-width:100%;align-self:center;
 }
 body.duel-active .stage .territory button.attack-action{
  min-height:34px;padding:4px 5px;font-size:9px;
 }
 body.duel-active .stage .territory .attack-name{font-size:10px}
 body.duel-active .stage .prize-group{
  width:88px;right:5px;grid-template-columns:23px auto;
  column-gap:4px;padding:3px;border-radius:7px;
 }
 body.duel-active .stage .prize-group:first-child{top:calc(50% - 62px)}
 body.duel-active .stage .prize-group:last-child{bottom:calc(50% - 62px)}
 body.duel-active .stage .prize-group .prize-grid{width:23px;height:32px;grid-template-columns:23px}
 body.duel-active .stage .prize-group .prize-back{width:23px;height:32px}
 body.duel-active .stage .prize-group h3{font-size:7px}
 body.duel-active .stage .prize-group .prize-count{font-size:10px}
 body.duel-active .stage .prize-group.prize-awaiting{width:140px}
 body.duel-active .hand-fan-card{
  flex-basis:78px;width:78px;height:calc(100% - 2px);
 }
 body.duel-active .hand-fan-track{gap:7px;padding:0 4px}
 body.duel-active .below .hand-panel{min-height:0!important}
 body.duel-active .below,
 body.duel-active .below .main-column{height:100%!important;min-height:0!important}
 body.duel-active .below .turn-actions-panel{
  height:91px!important;flex-basis:91px!important;
 }
 body.duel-active .below .turn-actions-panel .turn-actions{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));
  grid-template-rows:repeat(2,minmax(38px,1fr));
  gap:4px;
 }
 body.duel-active .below .turn-actions-panel .turn-actions button{
  min-height:38px!important;max-width:none;padding:4px 2px;font-size:11px;
 }
 body.duel-active .below .turn-actions-panel .turn-actions #endBtn{
  grid-column:1 / 3;grid-row:2;font-size:13px;
 }
 body.duel-active .below .turn-actions-panel .turn-actions #concedeBtn{
  grid-column:3;grid-row:2;
 }
 body.duel-active .hand-tray-drawer,
 body.duel-active .power-drawer{bottom:calc(clamp(186px,28dvh,244px) + 5px)}
 body.duel-active .hand-panel .hand-fan,
 body.duel-active .hand-panel:not(.tray-open):hover .hand-fan:not(.hidden),
 body.duel-active .hand-panel:not(.tray-open):focus-within .hand-fan:not(.hidden){
  bottom:2px!important;left:3px!important;width:auto!important;height:auto!important;
 }
}
@media (max-width:435px){
 body.duel-active .stage .pile-button{font-size:0}
 body.duel-active .stage .pile-button::before{content:"♻";font-size:13px}
 body.duel-active .stage .pile-button b{font-size:11px}
 body.duel-active .stage .trainerlabel strong{max-width:70px}
 body.duel-active .stage #energyStatus{display:none}
 body.duel-active .stage .territory .bench-zone .pokemon-strip{padding-inline:5px}
 body.duel-active .stage .territory .active-with-attacks .active-slot{padding:0 5px}
 body.duel-active .stage .territory .active-zone .poke{--attachment-height:clamp(53px,9.7dvh,87px)}
 body.duel-active .stage .territory .bench-zone .poke{--attachment-height:clamp(31px,5.8dvh,48px)}
 body.duel-active .hand-toggle{font-size:10px;padding:2px 6px!important}
 body.duel-active .hand-fan-card{width:72px;flex-basis:72px}
}
@media (max-height:660px){
 body.duel-active #duel:not(.hidden){
  grid-template-rows:auto auto minmax(0,1fr) 159px!important;
 }
 body.duel-active .stage .territory .active-zone .poke{--attachment-height:52px}
 body.duel-active .stage .territory .bench-zone .poke{--attachment-height:30px}
 body.duel-active .hand-tray-drawer,body.duel-active .power-drawer{bottom:165px}
 body.duel-active .below .turn-actions-panel{height:79px!important;flex-basis:79px!important}
}
@media (prefers-reduced-motion:reduce){
 body.duel-active .hand-fan-card{transition:none}
}

/* v0.80 — definitive hand dock.
   Older presentation layers experimented with a zero-sized floating hand.
   Keep the authoritative renderer, but give it one real, measurable region so
   setup can never start with the player's cards off-screen. */
@media (min-width:781px){
 body.duel-active #duel:not(.hidden){
  --neo-hand-row:clamp(196px,27dvh,274px);
  grid-template-rows:auto minmax(0,1fr) var(--neo-hand-row)!important;
 }
 body.duel-active #duel>.below>.main-column>.hand-panel{
  display:block!important;position:relative!important;
  width:100%!important;height:100%!important;
  min-width:0!important;min-height:0!important;max-width:none!important;
  padding:34px 8px 32px!important;overflow:hidden!important;
  pointer-events:auto!important;isolation:isolate;
  border:1px solid #3f4b59!important;border-radius:11px!important;
  background:#222a35!important;box-shadow:inset 0 1px #ffffff0b!important;
 }
 body.duel-active #duel>.below>.main-column>.hand-panel .hand-toggle{
  position:absolute!important;inset:5px auto auto 8px!important;
  width:auto!important;height:25px!important;min-height:25px!important;
  padding:2px 9px!important;z-index:4;pointer-events:auto;
  border:1px solid #566479!important;border-radius:6px!important;
  background:#2b3644!important;box-shadow:none!important;
 }
 body.duel-active #duel>.below>.main-column>.hand-panel .hand-fan:not(.hidden){
  display:block!important;position:relative!important;
  inset:auto!important;width:100%!important;height:100%!important;
  max-width:none!important;padding:0!important;overflow-x:auto!important;
  overflow-y:hidden!important;z-index:2;pointer-events:auto;
  background:transparent!important;border:0!important;box-shadow:none!important;
 }
 body.duel-active #duel>.below>.main-column>.hand-panel .hand-fan-track{
  display:flex!important;position:relative!important;align-items:flex-end!important;
  gap:9px!important;width:max-content!important;min-width:100%!important;
  height:100%!important;padding:0 8px!important;
 }
 body.duel-active #duel>.below>.main-column>.hand-panel .hand-fan-card{
  position:relative!important;inset:auto!important;
  flex:0 0 clamp(94px,8.8vw,132px)!important;
  width:clamp(94px,8.8vw,132px)!important;height:100%!important;
  max-height:100%!important;transform:none!important;
 }
 body.duel-active #duel>.below>.main-column>.hand-panel .hand-fan-card:is(:hover,:focus-visible),
 body.duel-active #duel>.below>.main-column>.hand-panel .hand-fan-card.selected{
  transform:translateY(-7px)!important;
 }
 body.duel-active #duel>.below>.main-column>.turn-actions-panel{
  max-height:var(--neo-hand-row);
 }
}
@media (max-width:780px){
 body.duel-active #duel:not(.hidden){
  grid-template-rows:auto auto minmax(0,1fr) 222px!important;
 }
 body.duel-active .below,
 body.duel-active .below .main-column{height:222px!important;min-height:222px!important}
 body.duel-active .below .main-column{
  display:flex!important;flex-direction:column!important;gap:4px!important;
 }
 body.duel-active .below .hand-panel{
  display:block!important;position:relative!important;
  flex:1 1 auto!important;width:100%!important;height:auto!important;
  min-width:0!important;min-height:122px!important;max-width:none!important;
  padding:29px 4px 4px!important;overflow:hidden!important;
  pointer-events:auto!important;border:1px solid #3f4b59!important;
  border-radius:9px!important;background:#222a35!important;
 }
 body.duel-active .below .hand-panel .hand-toggle{
  position:absolute!important;inset:3px auto auto 5px!important;
  height:23px!important;min-height:23px!important;padding:1px 7px!important;
  box-shadow:none!important;z-index:4;
 }
 body.duel-active .below .hand-panel .hand-fan:not(.hidden){
  display:block!important;position:relative!important;inset:auto!important;
  width:100%!important;height:100%!important;max-width:none!important;
  padding:0!important;overflow-x:auto!important;overflow-y:hidden!important;
  pointer-events:auto;z-index:2;
 }
 body.duel-active .below .hand-panel .hand-fan-track{
  display:flex!important;position:relative!important;align-items:flex-end!important;
  gap:6px!important;width:max-content!important;min-width:100%!important;
  height:100%!important;padding:0 4px!important;
 }
 body.duel-active .below .hand-panel .hand-fan-card{
  position:relative!important;inset:auto!important;transform:none!important;
  flex:0 0 72px!important;width:72px!important;height:100%!important;
 }
 body.duel-active .below .turn-actions-panel{
  flex:0 0 91px!important;width:100%!important;height:91px!important;
 }
}
