/* Shared DOM table: each card keeps its existing two-sided 3D scene. */
.visual-table{position:relative;min-width:0;padding:14px 10px 24px;color:var(--chalk);background:var(--felt);touch-action:auto}
.table-caption{position:relative;margin:0 0 14px;font-size:13px;line-height:1.6;color:var(--chalk);max-width:70ch}
.table-plane{position:relative;display:flex;flex-direction:column;gap:12px;min-width:0;padding:18px;border:2px solid var(--felt-2);border-radius:6px;background:var(--felt-2)}
.table-side{position:relative;min-width:0;transform-style:preserve-3d}
.table-side-heading{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 12px;padding:0;background:none;border:0;position:relative;color:var(--chalk)}
.table-side-heading>div{flex:1;min-width:0}
.table-side-heading h3{margin:3px 0 0;font-size:16px;line-height:1.4;overflow-wrap:anywhere}
.table-zone-label{font-size:12px;line-height:1.4;letter-spacing:.05em;text-transform:uppercase;color:var(--chalk)}
.table-prize-progress{font-size:12px;font-weight:700;color:var(--rare);background:var(--felt);padding:7px 9px;border:1px solid var(--felt-2);border-radius:20px}
.table-turn-tag{font-size:12px;line-height:1.3;padding:6px 8px;border-radius:6px;background:var(--rare);color:var(--felt);font-weight:750}
.table-side-body{display:grid;grid-template-columns:64px minmax(0,1fr) 66px;gap:12px;align-items:center;transform-style:preserve-3d}
.table-field{display:flex;flex-direction:column;gap:12px;min-width:0;transform-style:preserve-3d}
.table-side[data-side=rival] .table-bench{order:-1}
.table-zone{position:relative;min-width:0}
.table-zone h4{font-size:12px;line-height:1.4;text-transform:uppercase;letter-spacing:.03em;margin:0 0 8px;color:var(--chalk)}
.table-prizes{text-align:center}
.table-prize-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.table-prize{display:block;width:100%;aspect-ratio:5/7;box-shadow:2px 4px 0 var(--felt),3px 6px 10px color-mix(in srgb,var(--felt) 50%,transparent)}
.table-prizes>b{display:block;font-size:12px;line-height:1.4;margin-top:8px;color:var(--chalk)}
.table-piles{display:flex;flex-direction:column;gap:18px;align-self:stretch;justify-content:center}
.table-pile-zone{text-align:center}
.table-stack{position:relative;min-height:66px;display:flex;justify-content:center;align-items:center;transform-style:preserve-3d}
.table-stack:not(.table-stack-empty)::before,.table-stack:not(.table-stack-empty)::after{content:"";position:absolute;inset:0 3px 0 4px;border-radius:5px;background:var(--felt-2);border:1px solid var(--chalk-dim);transform:translate3d(3px,4px,-2px);pointer-events:none}
.table-stack:not(.table-stack-empty)::after{transform:translate3d(5px,7px,-4px);background:var(--felt)}
.table-stack .table-card{width:52px}
.table-stack .table-card .card-scene{width:100%}
.table-stack .card-fallback-label,.table-stack .card-fallback-name,.table-stack .card-fallback-type,.table-stack .card-fallback-note,.table-stack .card-fallback-edition{display:none}
.table-pile-count{display:block;font-size:13px;color:var(--rare);margin-top:8px}
.table-empty-pile{font-size:12px;color:var(--chalk-dim);border:1px dashed var(--felt-2);border-radius:6px;width:46px;height:65px;display:grid;place-items:center}
.table-mon{position:relative;min-width:0;border:1px solid var(--chalk-dim);border-radius:13px;background:linear-gradient(140deg,color-mix(in srgb,var(--felt-2) 93%,transparent),color-mix(in srgb,var(--felt) 94%,transparent));transform-style:preserve-3d}
.table-active{display:flex;align-items:center;justify-content:center;gap:14px;padding:13px;box-shadow:0 5px 0 var(--felt),0 9px 14px color-mix(in srgb,var(--felt) 40%,transparent);transform:translateZ(6px)}
.table-mon-info{min-width:0;flex:1;position:relative}
.table-mon-info h4{font-size:14px;line-height:1.4;margin:4px 0 7px;color:var(--chalk);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.table-hp{display:flex;flex-direction:column;gap:6px;color:#eefbf6}
.table-hp strong{font-size:14px;line-height:1.4}
.table-hp progress{appearance:none;-webkit-appearance:none;width:100%;height:6px;max-width:150px;border:0;border-radius:5px;background:var(--felt-2);accent-color:#82e5b7;overflow:hidden}
.table-hp progress::-webkit-progress-bar{background:var(--felt-2);border-radius:5px}
.table-hp progress::-webkit-progress-value{background:#82e5b7;border-radius:5px}
.table-hp progress::-moz-progress-bar{background:#82e5b7;border-radius:5px}
.table-damage{display:block;font-size:12px;line-height:1.5;margin-top:5px;color:var(--chalk)}
.table-energies{display:flex;flex-wrap:wrap;gap:4px;margin-top:7px;position:relative}
.table-energy{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:44px;min-width:44px;padding:5px 6px;font-size:12px;line-height:1.2;border:1px solid var(--chalk-dim);background:var(--felt-2);color:var(--rare);border-radius:7px}
.table-energy>span{font-size:12px;color:var(--rare)}
.table-energy-type{display:block;color:var(--rare);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.table-no-energy{font-size:12px;line-height:1.5;color:var(--chalk)}
.table-tool{display:block;width:100%;min-height:44px;margin-top:6px;padding:5px;font-size:12px;line-height:1.35;border:1px solid var(--chalk-dim);color:var(--chalk);background:var(--felt-2);overflow-wrap:anywhere}
.table-bench{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;min-width:0;transform-style:preserve-3d}
.table-bench-mon{display:flex;flex-direction:column;align-items:center;padding:7px 5px;text-align:center;box-shadow:0 4px 0 var(--felt);transform:translateZ(3px)}
.table-bench-mon .table-card{width:100%;max-width:53px}
.table-bench-mon .table-mon-info{width:100%}
.table-bench-mon .table-mon-info h4{font-size:12px;line-height:1.3;margin:6px 0 4px;text-align:center}
.table-bench-mon .table-zone-label{display:none}
.table-bench-mon .table-hp strong{font-size:12px}
.table-bench-mon .table-damage{font-size:12px}
.table-bench-mon .table-energies{justify-content:center}
.table-bench-mon .table-energy{width:100%;font-size:12px}
.table-bench-mon .table-tool{font-size:12px}
.table-empty-slot{display:grid;place-items:center;min-height:74px;padding:4px;border:1px dashed color-mix(in srgb,var(--chalk-dim) 42%,transparent);border-radius:9px;background:color-mix(in srgb,var(--felt) 20%,transparent);color:var(--chalk-dim);font-size:12px;line-height:1.3}
.table-card{position:relative;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;width:84px;min-width:44px;min-height:44px;padding:0;border:0;border-radius:7px;background:transparent;transform:translateZ(8px);vertical-align:top;touch-action:manipulation;flex-shrink:0}
.table-card .card-scene{width:100%}
.table-card .card-scene::before{inset:5% 0 0}
.table-card:focus-visible,.table-energy:focus-visible,.table-tool:focus-visible{outline:3px solid var(--rare);outline-offset:5px}
.table-active>.table-card{width:100px}
.table-card-back{position:relative;width:100%;aspect-ratio:5/7;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9%;border:2px solid var(--rare);border-radius:6px;background:repeating-linear-gradient(45deg,color-mix(in srgb,var(--ink),#fff 9%) 0 6px,var(--ink) 6px 12px);box-shadow:0 4px 7px #0006;color:var(--paper);pointer-events:none}
.table-card-back>b{font-size:12px;line-height:1;letter-spacing:.04em}
.table-ball{position:relative;display:block;width:48%;aspect-ratio:1;border:3px solid var(--rare);border-radius:50%;background:var(--paper)}
.table-ball::after{content:none}
.table-midline{display:flex;align-items:center;justify-content:center;gap:12px;height:36px;position:relative}
.table-midline::before,.table-midline::after{content:"";flex:1;height:1px;background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--chalk-dim) 60%,transparent),transparent)}
.table-midline .table-ball{width:34px;flex-shrink:0;border-width:2px;border-color:var(--chalk-dim);background:transparent}
.table-midline .table-ball::after{content:none}
.table-hand-zone{margin:14px 0 0;min-width:0}
.table-hand-zone h4{display:flex;align-items:center;gap:8px;font-size:14px;line-height:1.5;text-transform:none;letter-spacing:0}
.table-hand-zone h4>span{color:var(--chalk);font-weight:400;font-size:12px}
.table-hand{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-start;min-width:0;max-width:100%;padding:10px 5px 14px}
.table-hand-item{display:flex;flex-direction:column;gap:7px;align-items:center;min-width:0;width:64px;flex:0 0 64px;text-align:center}
.table-hand-item .table-card{width:64px}
.table-hand-item>span{font-size:12px;line-height:1.35;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--chalk)}
.table-hand-hidden{gap:6px;max-height:73px}
.table-hand-hidden .table-card{width:30px;min-width:30px;min-height:0}
.table-hand-hidden .table-card-back>b{display:none}
.table-private{pointer-events:none}
.table-observer{margin:7px 0 0;color:var(--chalk);font-size:12px;line-height:1.6;position:relative}
.table-observer>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;color:var(--chalk);font-size:13px;line-height:1.4;gap:8px}
.table-observer>summary::before{content:"＋";color:var(--rare)}
.table-observer[open]>summary::before{content:"−"}
.table-observer p{font-size:12px;line-height:1.7;margin:7px 0;overflow-wrap:anywhere}
.table-observer-note{color:var(--rare)}
.table-stadium{position:relative;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;font-size:13px;color:var(--chalk);text-align:center}
.table-stadium button{min-height:44px;min-width:44px;padding:7px 12px;font-size:13px;border-color:var(--chalk-dim);background:var(--felt-2);color:var(--chalk);max-width:100%;overflow-wrap:anywhere}
.table-empty{font-size:13px;color:var(--chalk);min-height:0;padding:10px 12px;text-align:center}
.table-empty-hand{font-size:12px;color:var(--chalk-dim)}
.table-card-fallback{display:grid;place-items:center;aspect-ratio:5/7;width:100%;padding:8px;border:2px solid var(--rare);border-radius:6px;background:var(--felt-2);font-size:12px;overflow-wrap:anywhere}
.table-camera{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0;color:var(--chalk);font-size:13px}
.lesson-coach{display:flex;align-items:center;gap:16px;min-width:0;margin:14px 0 16px}
.lesson-coach .pikachu-pixel{--pixel-scale:2;align-self:center}
.lesson-coach-bubble{position:relative;flex:1;min-width:0;padding:16px 20px;background:var(--felt);border:1px solid var(--chalk-dim);border-radius:16px;color:var(--chalk)}
.lesson-coach-bubble::before{content:"";position:absolute;left:-7px;top:50%;width:12px;height:12px;background:var(--felt);border:solid var(--chalk-dim);border-width:0 0 1px 1px;transform:translateY(-50%) rotate(45deg)}
.lesson-coach-name{display:block;font-size:12px;font-weight:700;color:var(--rare);margin-bottom:5px}
.lesson-coach h3{font-size:21px;line-height:1.3;margin:0 0 6px;color:var(--chalk);overflow-wrap:anywhere}
.lesson-coach p{font-size:14px;line-height:1.55;margin:6px 0 0;overflow-wrap:anywhere}
.lesson-coach .lesson-coach-action{color:var(--chalk);font-weight:650}
.lesson-coach .lesson-coach-rule{color:var(--chalk)}
.lesson-coach #lessonFeedback:not(:empty){margin:10px 0 0;padding:10px;border-left:3px solid var(--rare);background:var(--felt-2);color:var(--rare)}
.lesson-arena .lesson-attack-line{top:-8px;left:calc(50% - 14px);width:28px;height:56px}
@media(max-width:650px){.lesson-coach{gap:10px;align-items:flex-start;margin:10px 0 14px}.lesson-coach .pikachu-pixel{--pixel-scale:1;align-self:flex-start;margin-top:18px}.lesson-coach-bubble{padding:12px}.lesson-coach-bubble::before{top:38px}.lesson-coach h3{font-size:18px}.lesson-coach p{font-size:13px;line-height:1.5}.lesson-coach-name{font-size:12px}}
@media(forced-colors:active){.lesson-coach-bubble,.lesson-coach-bubble::before{background:Canvas;color:CanvasText;border-color:CanvasText}.lesson-coach-name,.lesson-coach h3,.lesson-coach .lesson-coach-action,.lesson-coach .lesson-coach-rule{color:CanvasText}.lesson-coach #lessonFeedback:not(:empty){background:Canvas;color:CanvasText;border-color:CanvasText}}
@media(hover:hover) and (pointer:fine){.table-card:not(.table-private):hover{transform:translateZ(15px)}}
@media(max-width:700px){
 .visual-table{padding:8px 0 18px}
 .table-plane{padding:12px 10px;gap:9px}
 .table-side-body{grid-template-columns:1fr 1fr;gap:12px}.table-field{grid-column:1/-1;grid-row:1}.table-prizes{grid-column:1;grid-row:2}.table-piles{grid-column:2;grid-row:2;flex-direction:row;gap:12px;align-self:center}
 .table-prize-cards{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.table-prize{width:24px}.table-stack{min-height:65px}.table-stack .table-card{width:44px}.table-pile-count{font-size:12px}
 .table-active{padding:12px 10px;gap:12px}.table-active>.table-card{width:85px}.table-mon-info h4{font-size:14px}.table-hp progress{max-width:130px}
 .table-bench{grid-template-columns:repeat(auto-fill,minmax(92px,1fr));padding:4px 0;gap:9px}
 .table-bench-mon{padding:8px 5px}.table-bench-mon .table-card{max-width:58px}.table-empty-slot{display:none}
 .table-side-heading{gap:8px;margin-bottom:10px}.table-side-heading h3{font-size:14px}.table-prize-progress{font-size:12px;padding:6px 8px}.table-turn-tag{font-size:12px}
 .table-hand{gap:9px}.table-hand-item{width:68px;flex-basis:68px}.table-plane,.table-side,.table-field,.table-side-body{max-width:100%}.table-hand-item .table-card{width:68px}.table-midline{height:27px}.table-midline .table-ball{width:25px}
}
@media(prefers-reduced-motion:reduce){.table-card,.table-active,.table-bench-mon{transition:none!important}.table-card:not(.table-private):hover{transform:translateZ(8px)}}

/* ===== Arena de duelo (replay del combate automático y mesa libre). Arte propio: tapete, zonas, dorsos y emblema en CSS/SVG. =====
   Todo se mide con --w (ancho de una carta de Banca), calculado desde el alto y el ancho disponibles del escenario (container
   queries cqh/cqw): el duelo cabe siempre en pantalla y, si no cabe, las cartas se hacen más pequeñas. En la capa inmersiva usa toda la ventana. */
.duel-stage{--felt:#0f1a16;--felt-2:#1e3a2f;--chalk:#ecf1ea;--chalk-dim:#9fb3a6;--rival:#a48fd0;--you:#4f8fe0;--gold:#f2b705;--action:#c8321a;--dmg:#8f1d12;--num:'Big Shoulders Display','Arial Narrow',sans-serif;font-family:'Atkinson Hyperlegible',system-ui,sans-serif;position:relative;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:8px;height:calc(100dvh - var(--header-offset) - 12px);min-height:440px;margin:0 0 16px}
#autoBoard{grid-row:1;grid-column:1;position:relative;min-height:0;min-width:0}
#autoBoard>.empty{display:grid;place-items:center;height:100%;padding:20px;text-align:center;border:1px dashed #ecf1ea66;border-radius:6px}
.duel{--amul:1.55;--hdiv:8.2;position:absolute;inset:0;container-type:size;color:var(--chalk);--w:clamp(30px,min(calc((100cqh - 96px) / var(--hdiv)),calc((100cqw - 24px) / (var(--cols,5) * 1.18))),150px)}
.duel-mat{position:absolute;inset:0;display:grid;grid-template-rows:minmax(0,1fr) auto minmax(0,1fr);overflow:hidden;border:1.5px solid #ecf1ea22;border-radius:6px;background:radial-gradient(ellipse 60% 55% at 50% 50%,var(--felt-2) 0%,var(--felt) 75%);box-shadow:0 10px 24px #050c0966}

.duel-mat::after{content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;box-shadow:inset 0 0 90px #050c09b3;z-index:30}
.duel-side{position:relative;z-index:1;display:flex;flex-direction:column;justify-content:space-between;align-items:center;gap:calc(var(--w) * .1);min-height:0;min-width:0;padding:calc(var(--w) * .4) 10px 6px}
.duel-side[data-side=rival]{background:linear-gradient(180deg,#a48fd01a,transparent 55%)}
.duel-side[data-side=own]{flex-direction:column-reverse;padding:6px 10px calc(var(--w) * .4);background:linear-gradient(0deg,#4f8fe01a,transparent 55%)}
.duel-hand-zone{position:absolute;left:0;right:0;z-index:6;height:calc(var(--w) * .4)}
.duel-side[data-side=rival] .duel-hand-zone{top:0}
.duel-side[data-side=own] .duel-hand-zone{bottom:0}
.duel-hand{--cw:calc(var(--w) * .9);--avail:min(calc(100cqw - 40px),calc(var(--w) * 9));position:absolute;left:0;right:0;display:flex;justify-content:center;pointer-events:none}
.duel-side[data-side=own] .duel-hand{bottom:calc(var(--w) * -.86);align-items:flex-end}
.duel-side[data-side=rival] .duel-hand{top:calc(var(--w) * -.86);align-items:flex-start}
.duel-fan-item{flex:none;display:block;width:var(--cw);margin-left:calc(min(var(--w) * .5,(var(--avail) - var(--cw)) / max(1,var(--n) - 1)) - var(--cw));transform:translateY(var(--y)) rotate(var(--r));transform-origin:50% 140%;transition:transform .16s ease;pointer-events:auto}
.duel-side[data-side=rival] .duel-fan-item{transform-origin:50% -40%}
.duel-fan-item:first-child{margin-left:0}
.duel-hand-card,.duel-hand-back{width:100%;min-width:0}
.duel-side[data-side=own] .duel-fan-item:focus-within,.duel-side[data-side=own] .duel-fan-item.is-lifted{transform:translateY(calc(var(--y) - var(--w) * .9)) rotate(0deg);z-index:5}
@media(hover:hover) and (pointer:fine){.duel-side[data-side=own] .duel-fan-item:hover{transform:translateY(calc(var(--y) - var(--w) * .9)) rotate(0deg);z-index:5}}
.duel-bench{position:relative;flex:none;display:grid;grid-template-columns:repeat(var(--cols,5),var(--w));justify-content:center;column-gap:calc(var(--w) * .14)}
.duel-slot{position:relative;display:flex;justify-content:center;width:var(--w)}
.duel-empty-slot{height:calc(var(--w) * 1.4);border:1px dashed #ecf1ea40;border-radius:calc(var(--w) * .08);background:#ffffff09}
.duel-row{flex:none;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;width:100%;column-gap:calc(var(--w) * .2)}
.duel-active-slot{position:relative;width:calc(var(--w) * var(--amul));padding:0;justify-content:center}
.duel-active-slot::before{content:"";position:absolute;inset:calc(var(--w) * -.12) calc(var(--w) * -.14);border:1px solid #ecf1ea33;border-radius:calc(var(--w) * .14);pointer-events:none}
.duel-empty-mon{width:100%;aspect-ratio:5/7;border:1px dashed #ecf1ea40;border-radius:calc(var(--w) * .1);background:#ffffff09}
.duel-card{position:relative;display:block;width:var(--w);min-width:44px;padding:0;border:0;border-radius:6px;background:transparent;vertical-align:top;touch-action:manipulation;flex:none}
.duel-card .card-scene{width:100%}
.duel-card .card-scene::before{display:none}
.duel-card:focus-visible{outline:2px solid var(--chalk);outline-offset:3px}
.duel-private{pointer-events:none;min-width:0}
.duel .table-card-back{border-radius:5px;border-width:1px;box-shadow:inset 0 0 0 1px #0a120f,0 2px 4px #050c0999}
.duel .table-card-back>b{display:none}
.duel-mon{--mw:var(--w);position:relative;display:flex;flex-direction:column;align-items:center;width:var(--mw)}
.duel-mon-active{--mw:calc(var(--w) * var(--amul))}
.duel-mon-frame{position:relative;width:100%;filter:drop-shadow(0 4px 6px #050c0999)}
.duel-mon-card{width:100%;min-width:0;border-radius:calc(var(--w) * .06)}
.duel-name{position:absolute;left:0;right:0;bottom:0;z-index:2;padding:1px 4px;border-radius:0 0 calc(var(--w) * .06) calc(var(--w) * .06);background:linear-gradient(transparent,#000d 40%);font-size:12px;line-height:16px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff;pointer-events:none}
.duel-hp{position:absolute;left:-6px;top:-8px;z-index:3;overflow:hidden;padding:1px 7px 5px;border:1px solid #6fe2a8;border-radius:10px;background:#0f1a16f2;color:#fff;font-size:12px;line-height:16px;font-weight:700;white-space:nowrap}
.duel-hp b{font-family:var(--num);font-size:16px;font-weight:900}
.duel-hp-bar{position:absolute;left:0;right:0;bottom:0;height:4px;background:#2a3f35}
.duel-hp-fill{display:block;height:100%;background:#6fe2a8}
.duel-hp-fill.is-mid{background:#f1c94a}
.duel-hp-fill.is-low{background:#ff7d6e}
.duel-dmg{position:absolute;right:-8px;top:-8px;z-index:3;display:grid;place-items:center;min-width:26px;height:26px;padding:0 4px;border:3px solid #fff;border-radius:50%;background:var(--dmg);color:#fff;font-family:var(--num);font-size:16px;font-weight:900;line-height:1;box-shadow:0 2px 5px #000a}
.duel-energies{position:absolute;left:3px;right:3px;bottom:19px;z-index:3;display:flex;justify-content:flex-start;flex-wrap:nowrap}
.duel-pip{--pip:#d9dfe5;flex:none;display:grid;place-items:center;width:18px;height:18px;border:1.5px solid #08213a;border-radius:50%;background:var(--pip);color:#10223a;font-size:12px;font-weight:800;line-height:1;box-shadow:0 1px 3px #0009}
.duel-pip+.duel-pip{margin-left:-4px}
.duel-energies.is-many .duel-pip+.duel-pip{margin-left:-9px}
.duel-pip[data-type=Fighting]{--pip:#d98a52}
.duel-pip[data-type=Fire]{--pip:#f57d5c}
.duel-pip[data-type=Water]{--pip:#5fb0f0}
.duel-pip[data-type=Grass]{--pip:#6fd27e}
.duel-pip[data-type=Lightning]{--pip:#f8d84a}
.duel-pip[data-type=Psychic]{--pip:#cf8cf0}
.duel-pip[data-type=Darkness]{--pip:#4b4b6e;color:#fff}
.duel-pip[data-type=Metal]{--pip:#aeb9c4}
.duel-pip[data-type=Dragon]{--pip:#d8b24a}
.duel-pip[data-type=Fairy]{--pip:#f3a7d0}
.duel-badge{position:absolute;z-index:3;display:grid;place-items:center;width:20px;height:20px;border:1.5px solid #fff;border-radius:50%;background:#3a5c4c;color:#fff;font-size:12px;font-weight:800;line-height:1}
.duel-tool{left:-7px;top:calc(50% - 10px)}
.duel-cond{right:-7px;top:calc(50% - 10px);background:#8a45c8}
.duel-lefts{justify-self:start;display:flex;align-items:flex-start;gap:calc(var(--w) * .3);margin-left:calc(var(--w) * .1)}
.duel-prizes{position:relative}
.duel-prize-stack{position:relative;width:calc(var(--w) * 1.15 * var(--pz,1));height:calc(var(--w) * 1.34 * var(--pz,1))}
.duel-card.duel-prize{position:absolute;left:calc(var(--i) * var(--w) * .07 * var(--pz,1));top:calc(var(--i) * var(--w) * .055 * var(--pz,1));width:calc(var(--w) * .72 * var(--pz,1));min-width:0;box-shadow:0 2px 3px #050c09cc}
.duel-piles{justify-self:end;display:flex;gap:calc(var(--w) * .22);margin-right:calc(var(--w) * .1)}
.duel-pile{position:relative;width:calc(var(--w) * .85)}
.duel-stack{position:relative;width:100%;aspect-ratio:5/7}
.duel-pile-card{width:100%;min-width:0}
.duel-stack.is-thin .duel-pile-card{box-shadow:1px 1px 0 #14261e,2px 2px 0 #0a120f}
.duel-stack.is-thick .duel-pile-card{box-shadow:1px 1px 0 #14261e,2px 2px 0 #0a120f,3px 3px 0 #14261e,4px 4px 0 #0a120f,5px 5px 0 #14261e,6px 6px 0 #07100c,7px 8px 6px #050c0999}
.duel-pile-card .card-fallback-label,.duel-pile-card .card-fallback-name,.duel-pile-card .card-fallback-type,.duel-pile-card .card-fallback-note,.duel-pile-card .card-fallback-edition,.duel-hand-card .card-fallback-label,.duel-hand-card .card-fallback-type,.duel-hand-card .card-fallback-note,.duel-hand-card .card-fallback-edition{display:none}
.duel-empty-pile{display:block;width:100%;height:100%;border:1px dashed #ecf1ea40;border-radius:calc(var(--w) * .08);background:#ffffff09}
.duel-count{position:absolute;z-index:4;display:grid;place-items:center;min-width:24px;height:24px;padding:0 5px;border:2px solid var(--gold);border-radius:12px;background:#0f1a16f2;color:var(--gold);font-family:var(--num);font-size:16px;font-weight:900;line-height:1;box-shadow:0 2px 4px #0009}
.duel-prizes .duel-count{right:0;top:-8px;bottom:auto}
.duel-pile .duel-count{right:-6px;top:-8px;bottom:auto}
.duel-piles .duel-pile:first-child .duel-count{right:50%;bottom:50%;transform:translate(50%,50%)}
.duel-mid{position:relative;z-index:2;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:10px;padding:2px 12px;min-height:44px}
.duel-mid::before{content:"";position:absolute;left:0;right:0;top:50%;border-top:1.5px dashed #ecf1ea33}

.duel-plate{position:relative;z-index:1;display:flex;flex-direction:column;min-width:0;max-width:100%;padding:2px 10px;border:1.5px solid #ecf1ea66;border-radius:3px;background:#0f1a16e6}
.duel-plate.is-rival{justify-self:start;border-color:var(--rival)}
.duel-plate.is-own{justify-self:end;align-items:flex-end;border-color:var(--you)}
.duel-plate.is-turn{box-shadow:0 0 0 2px var(--gold)}
.duel-plate-name{max-width:100%;font-size:12px;font-weight:700;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.duel-plate-prizes{max-width:100%;font-size:12px;line-height:16px;color:var(--gold);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.duel-center{position:relative;z-index:1;display:flex;align-items:center;gap:8px}

.duel-turn-label{padding:3px 12px;border:1.5px solid var(--gold);border-radius:3px;background:#0f1a16f2;color:var(--gold);font-size:13px;font-weight:800;line-height:18px;white-space:nowrap}
.duel-emblem{position:relative;flex:none;width:46px;height:46px}
.duel-emblem svg{display:block;width:100%;height:100%}
.duel-emblem b{position:absolute;inset:0;display:grid;place-items:center;color:var(--gold);font-size:12px;font-weight:900}
.duel-stadium button{min-height:44px;max-width:150px;padding:4px 10px;border-color:#ecf1ea66;background:transparent;color:var(--chalk);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.duel-observers{display:flex;flex-direction:column;gap:2px}
.duel-observer{color:var(--chalk-dim);font-size:12px;line-height:1.6}
.duel-observer>summary{min-height:44px;display:flex;align-items:center;gap:8px;cursor:pointer;color:var(--chalk);font-size:13px}
.duel-observer>summary::before{content:"＋";color:var(--gold)}
.duel-observer[open]>summary::before{content:"−"}
.duel-observer p{margin:6px 0;font-size:12px;line-height:1.7;overflow-wrap:anywhere}
.duel-observer-note{color:#f0d090}
.duel-fx{position:absolute;inset:0;pointer-events:none;z-index:40;overflow:hidden}
.duel-banner{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:10px 26px;border:3px solid var(--gold);border-radius:3px;background:#0f1a16;color:var(--gold);font-size:clamp(18px,calc(var(--w) * .5),30px);font-weight:900;line-height:1.3;white-space:nowrap;box-shadow:0 10px 30px #050c09cc}
.duel-float{font-family:var(--num);position:absolute;transform:translate(-50%,0);font-size:clamp(30px,calc(var(--w) * .8),56px);font-weight:900;line-height:1;color:#ff8a7a;-webkit-text-stroke:4px #2a0a0a;paint-order:stroke fill;text-shadow:0 3px 6px #000b}
.duel-float.is-heal{color:#9ff0c6}
.duel-ghost{position:absolute;margin:0;z-index:5;pointer-events:none}
.duel-bar{position:relative;grid-row:2;grid-column:1;display:flex;align-items:center;gap:8px;padding:6px 10px;border:1.5px solid #ecf1ea33;border-radius:3px;background:var(--felt);color:var(--chalk)}
.duel-bar[hidden],.duel-panel[hidden]{display:none}
.duel-bar button{min-height:44px;padding:6px 12px;font-size:13px;line-height:1.2;white-space:normal;overflow-wrap:normal}
.duel-bar #replayTurn{flex:1;min-width:80px;margin:0}
.duel-bar #replayLabel{min-width:7ch;font-size:13px;line-height:1.3;white-space:nowrap}
.duel-panel{grid-row:1;grid-column:1;z-index:20;justify-self:end;align-self:stretch;display:flex;flex-direction:column;width:min(380px,100%);min-height:0;margin:8px;padding:10px 12px;border:1.5px solid #ecf1ea33;border-radius:3px;background:var(--felt);box-shadow:0 10px 30px #050c09cc}
.duel-panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.duel-panel-head h3{margin:0;font-size:15px;color:var(--chalk)}
.duel-panel-head button{min-width:44px;min-height:44px}
.duel-panel .auto-log{flex:1;min-height:0;overflow:auto;max-height:none}
.duel-panel #autoObservers{flex:none;padding-top:6px;border-top:1px solid #ecf1ea26}
@media(min-width:900px){.duel-bench{column-gap:calc(var(--w) * .45)}}
@media(max-width:899px){
 .duel-side{padding-inline:6px}
 .duel-mid{gap:6px;padding:2px 6px;min-height:40px}
 .duel-plate{padding:1px 7px}
 .duel-emblem{width:40px;height:40px}
 .duel-stadium button{max-width:70px}
 #replayControls.duel-bar{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:4px 6px;padding:6px}
 #replayControls>button:nth-of-type(-n+3){grid-column:span 4}
 #replayControls #soundToggle{grid-column:span 3}
 #replayControls #replayTurn{grid-column:span 4}
 #replayControls #replayLabel{grid-column:span 2;min-width:0;font-size:12px;white-space:normal;text-align:center}
 #replayControls #logToggle{grid-column:span 3}
 .duel-bar button{padding:4px 6px;font-size:12px}
 .duel-panel{align-self:end;height:62%;width:auto;justify-self:stretch}
}
/* En móvil el escenario sale de los márgenes de la página (6vw + relleno del panel) para usar todo el ancho. */
@media(max-width:650px){.duel-stage{margin-inline:calc(-6vw - 12px)}}
@media(max-width:420px){.duel-center{gap:4px}.duel-turn-label{padding:2px 8px;font-size:12px}.duel-emblem{width:34px;height:34px}.duel-mid{gap:4px;padding:2px 4px}.duel-plate{padding:1px 6px}}
@media(max-aspect-ratio:1/1){.duel{--amul:1.7;--hdiv:8.7}.duel-piles{display:grid;grid-template-columns:repeat(2,calc(var(--w) * .85));gap:calc(var(--w) * .3) calc(var(--w) * .2);margin-right:0}.duel .duel-plate-tools{display:none}.duel .duel-plate:has(.duel-plate-tools){flex-direction:column;align-items:flex-start}.duel[data-interactive] .duel-mid{min-height:44px}}
@media(prefers-reduced-motion:reduce){.duel-fan-item{transition:none!important}.duel-mid::before{animation:none}}
@media(forced-colors:active){.duel-mat,.duel-plate,.duel-bar,.duel-panel,.duel-turn-label,.duel-count,.duel-hp,.duel-dmg{border:1px solid CanvasText;background:Canvas;color:CanvasText}}
/* ===== Capa inmersiva y modo interactivo (mesa libre) ===== */
.duel-stage[hidden]{display:none}
html.arena-open,html.arena-open body{overflow:hidden;overscroll-behavior:none}
.duel-stage.is-immersive{position:fixed;inset:0;z-index:2000;width:100vw;height:100dvh;min-height:0;margin:0;padding:6px 6px calc(6px + env(safe-area-inset-bottom));gap:6px;background:var(--felt)}
.arena-exit,.arena-fs{display:none}
.is-immersive .arena-exit,.is-immersive .arena-fs:not([hidden]){position:absolute;top:14px;z-index:60;display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:6px 12px;}
.is-immersive .arena-exit{right:14px}
.is-immersive .arena-fs:not([hidden]){right:calc(14px + 11.5rem)}
@media(max-width:650px){.arena-exit-text{display:none}.is-immersive .arena-exit{min-width:44px;justify-content:center}.is-immersive .arena-fs:not([hidden]){display:none}}
.duel[data-interactive] .duel-card:not(.duel-private),.duel[data-interactive] .duel-draw,.duel[data-interactive] .duel-pip{touch-action:none;-webkit-user-drag:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:grab}
.duel[data-interactive] .duel-prizes{touch-action:none;cursor:grab}
.duel-card.is-selected,.duel-pip.is-selected{outline:3px solid var(--gold);outline-offset:2px;box-shadow:0 0 18px #f2b705aa}
.duel-mon.is-selected .duel-mon-frame{filter:drop-shadow(0 0 10px #f2b705)}
.is-dragging{opacity:.35}
.is-drop-ok{outline:2px dashed var(--gold);outline-offset:2px;background-color:#f2b70520}
.is-drop-over{outline:3px dashed var(--gold);outline-offset:2px;background-color:#f2b70540;box-shadow:0 0 24px #f2b70599}
.duel-drag-ghost{position:fixed;left:0;top:0;z-index:3000;pointer-events:none;opacity:.96;filter:drop-shadow(0 14px 14px #000a)}
.duel-drag-ghost>*{display:block;width:100%;height:100%;margin:0}
html.is-dragging-card,html.is-dragging-card *{cursor:grabbing!important}
.duel-move{position:absolute;left:50%;top:50%;z-index:8;transform:translate(-50%,-50%);min-width:44px;min-height:44px;padding:4px 10px;border:2px dashed var(--gold);border-radius:3px;background:#0f1a16e6;color:var(--gold);font-family:inherit;font-size:12px;font-weight:700;line-height:1.1;animation:duelPulse 1.7s ease-in-out infinite}
.duel-actions{position:absolute;inset:0;z-index:7;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;pointer-events:none}
.duel-actions .duel-move{position:static;transform:none;pointer-events:auto}
.duel-hand-zone .duel-move{top:calc(var(--w) * .25)}
.duel-plate-text{display:flex;flex-direction:column;min-width:0}
.duel-plate:has(.duel-plate-tools){flex-direction:row;align-items:center;gap:6px}
.duel-plate-tools{display:flex;gap:4px;flex:none}
.duel-plate-tools button{min-width:44px;min-height:44px;padding:0;font-size:13px;font-weight:800;border-color:#ecf1ea66;background:transparent;color:var(--chalk)}
.duel[data-interactive] .duel-mid{min-height:50px}
.duel-badge.duel-extra{left:-7px;bottom:20px;top:auto;background:#5c4b0a}
.duel-pile-card.duel-draw{cursor:pointer}
.duel-hand-card.is-selected{outline-offset:-1px}
#manualBoard{grid-row:1;grid-column:1;position:relative;min-height:0;min-width:0}
#manualPanelBody{flex:1;min-height:0;overflow:auto}
.duel-panel h4{margin:10px 0 6px;font-size:13px;color:var(--chalk)}
.duel-panel .controls{display:flex;flex-wrap:wrap;gap:6px}
.duel-panel .controls button{min-height:44px}
.duel-panel .log{max-height:none;font-size:12px}
.duel-check{display:inline-flex;align-items:center;gap:6px;min-height:44px;font-size:13px}
.duel-bar-turn{flex:1;min-width:0;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:700;color:var(--gold)}
@media(max-width:899px){#manualBar{flex-wrap:wrap;justify-content:center}#manualBar button{flex:1 1 30%;padding:4px 6px;font-size:12px}.duel-bar-turn{flex:1 1 100%;order:-1}}
.duel-private.duel-draw{pointer-events:auto;min-width:0}
.duel-pile-name,.duel-zone-name{display:block;margin-top:2px;font-size:12px;line-height:14px;text-align:center;color:var(--chalk-dim);text-shadow:0 1px 2px #000c;white-space:nowrap}
.duel-count{pointer-events:none}
.duel-move.is-short{min-width:44px;padding:4px 6px}
.duel-plate-text{max-width:100%}
.duel .duel-plate:has(.duel-plate-tools){min-width:0}
@media(max-width:700px){.duel-mon-bench .duel-hp-unit{display:none}}

/* ===== Botones de la arena (Mesa nocturna; solo dentro de .duel-stage) =====
   Jerarquía: .is-primary (bermellón con sombra dura de tiza), .is-glass (contorno de tiza translúcido, por defecto), .is-quiet (texto de tiza tenue).
   Iconos SVG propios en línea (.abtn-icon). Estados: hover (el primario se levanta 2 px), :active, :focus-visible (anillo de tiza 2 px a 3 px), :disabled legible. */
.duel-stage .abtn{position:relative;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:44px;min-height:44px;padding:6px 14px;border:1.5px solid #ecf1ea66;border-radius:3px;background:transparent;color:var(--chalk);font-family:inherit;font-weight:700;font-size:14px;line-height:1.15;cursor:pointer;transition:transform 100ms cubic-bezier(.2,.8,.2,1),box-shadow 100ms cubic-bezier(.2,.8,.2,1),background-color 100ms linear}
.abtn-icon{display:block;flex:none;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.abtn-icon .fill{fill:currentColor}
.abtn-label{min-width:0;text-align:center;overflow-wrap:normal}
.abtn-icons{display:inline-flex}
.abtn[data-state=playing] .abtn-icons .abtn-icon:nth-child(2),.abtn[data-state=paused] .abtn-icons .abtn-icon:nth-child(1){display:none}
.abtn[aria-pressed=false] .abtn-icon .on,.abtn[aria-pressed=true] .abtn-icon .off{display:none}
.duel-stage .abtn.is-primary{min-height:48px;border-color:var(--chalk);background:var(--action);color:#fff;box-shadow:3px 3px 0 var(--chalk)}
.duel-stage .abtn.is-quiet{border-color:transparent;color:var(--chalk-dim)}
.duel-stage .abtn.is-icon{padding:0;width:44px}
@media(hover:hover) and (pointer:fine){
 .duel-stage .abtn:hover:not(:disabled){background-color:#ecf1ea1a}
 .duel-stage .abtn.is-quiet:hover:not(:disabled){color:var(--chalk)}
 .duel-stage .abtn.is-primary:hover:not(:disabled){transform:translateY(-2px);background-color:#a82812;box-shadow:3px 5px 0 var(--chalk)}
}
.duel-stage .abtn:active:not(:disabled){transform:translateY(0)}
.duel-stage .abtn.is-primary:active:not(:disabled){transform:translate(2px,2px);box-shadow:1px 1px 0 var(--chalk)}
.duel-stage .abtn:focus-visible,.duel-stage .abtn-switch:has(input:focus-visible),.duel-plate-tools .duel-chip-dmg:focus-visible,.duel-move:focus-visible{outline:2px solid var(--chalk);outline-offset:3px}
.duel-stage .abtn:disabled{cursor:not-allowed;border:1.5px dashed #9fb3a6!important;background:#16231d!important;color:#b9c9be!important;transform:none;box-shadow:none}
.duel-stage .abtn:disabled .abtn-icon{color:#b9c9be}
.duel-stage .abtn.is-spin .abtn-icon{animation:abtnCoin .7s ease}
@keyframes abtnCoin{from{transform:rotateY(0)}to{transform:rotateY(720deg)}}
/* Interruptor accesible: es un checkbox real (role="switch") con aspecto de palanca; conserva su comportamiento. Lo usan «Ver ambas manos» y «Saltar animaciones». */
.abtn-switch{cursor:pointer;gap:8px;padding-right:12px}
.abtn-switch input{position:absolute;inset:0;z-index:2;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.abtn-switch input:disabled{cursor:default}
.switch-track{position:relative;flex:none;width:40px;height:22px;border:1.5px solid #ecf1ea99;border-radius:999px;background:transparent;transition:background-color 100ms linear}
.switch-thumb{position:absolute;top:2px;left:2px;width:15px;height:15px;border-radius:50%;background:var(--chalk);transition:transform 100ms cubic-bezier(.2,.8,.2,1),background-color 100ms linear}
.abtn-switch input:checked~.switch-track{background:var(--gold);border-color:var(--gold)}
.abtn-switch input:checked~.switch-track .switch-thumb{transform:translateX(18px);background:var(--felt)}
/* Fichas de daño: +10 círculo #8f1d12 con borde blanco de 3 px; −10 círculo de contorno de tiza y fondo transparente. Nunca bermellón. */
.duel-plate-tools .duel-chip-dmg{min-width:44px;width:44px;height:44px;min-height:44px;padding:0;border:3px solid #fff;border-radius:50%;color:#fff;font-family:var(--num);font-size:18px;font-weight:900;line-height:1;white-space:nowrap;transition:transform 100ms cubic-bezier(.2,.8,.2,1),background-color 100ms linear}
.duel-plate-tools .duel-chip-dmg.is-plus{background:var(--dmg)}
.duel-plate-tools .duel-chip-dmg.is-minus{border:2px solid var(--chalk);background:transparent;color:var(--chalk)}
@media(hover:hover) and (pointer:fine){.duel-plate-tools .duel-chip-dmg:hover{transform:translateY(-2px)}.duel-plate-tools .duel-chip-dmg.is-minus:hover{background:#ecf1ea1a}}
.duel-plate-tools .duel-chip-dmg:active{transform:translateY(0)}
/* Destinos válidos: borde dorado discontinuo con brillo pulsante mientras hay selección */
@keyframes duelPulse{0%,100%{box-shadow:0 0 0 0 #f2b70500}50%{box-shadow:0 0 18px 2px #f2b70566}}
.duel[data-interactive] .duel-mid{min-height:54px}
@media(max-width:899px){
 .duel-stage .abtn{flex-direction:column;gap:2px;padding:4px 6px;font-size:12px;line-height:1.1}
 .duel-stage .abtn-icon{width:18px;height:18px}
 .duel-stage .abtn.is-icon,.duel-stage .arena-exit.abtn{flex-direction:row}
 .duel-stage .abtn-switch{flex-direction:row;flex-wrap:nowrap;gap:6px}
 .duel-stage .abtn-switch .abtn-label{text-align:left}
 #manualBar .abtn{flex:1 1 28%}
 #manualBar .abtn-switch{flex:1 1 40%}
}
/* Móvil: la Zona perdida va bajo los Premios (columna izquierda) y el abanico del rival asoma lo bastante para reconocerse */
@media(max-aspect-ratio:1/1){
 .duel-lefts{flex-direction:column;align-items:center;gap:8px;margin-left:0}
 .duel-lefts .duel-pile{width:calc(var(--w) * .6)}
 .duel-side[data-side=rival]{padding-top:calc(var(--w) * .62)}
 .duel-side[data-side=rival] .duel-hand-zone{height:calc(var(--w) * .62)}
 .duel-side[data-side=rival] .duel-hand{top:calc(var(--w) * -.6)}
}
@media(prefers-reduced-motion:reduce){
 .duel-stage .abtn,.duel-plate-tools .duel-chip-dmg,.switch-track,.switch-thumb{transition:none!important}
 .duel-stage .abtn.is-spin .abtn-icon{animation:none}
 .duel-move{animation:none}
}
@media(forced-colors:active){.duel-stage .abtn{border:1px solid ButtonText;background:ButtonFace;color:ButtonText}}
.duel-stage.is-immersive .arena-exit,.duel-stage.is-immersive .arena-fs{position:absolute}

/* ===== Espaciado: escala de 4/8/12/16/24 px en toda la arena ===== */
.duel-stage{--s1:4px;--s2:8px;--s3:12px;--s4:16px;--s5:24px}
.duel{--hconst:124px;--w:clamp(30px,min(calc((100cqh - var(--hconst) - var(--hb,0px)) / var(--hdiv)),calc((100cqw - 40px - (var(--cols,5) - 1) * 12px) / var(--cols,5))),150px)}
.duel-stage .duel-side{padding-left:var(--s4);padding-right:var(--s4)}
.duel-stage .duel-mid{padding:2px var(--s4);gap:var(--s3)}
.duel-stage .duel-plate{padding:var(--s1) var(--s3)}
.duel-stage .duel-plate:has(.duel-plate-tools){gap:var(--s3)}
.duel-stage .duel-plate-tools{gap:var(--s2)}
.duel-stage .duel-turn-label{padding:var(--s1) var(--s3)}
.duel-stage .duel-hp{padding:3px var(--s2) 7px}
.duel-stage .duel-dmg{min-width:30px;height:30px;padding:0 var(--s1)}
.duel-stage .duel-count{min-width:26px;height:26px;padding:0 var(--s1)}
.duel-stage .duel-pile-name{margin-top:var(--s1)}
.duel-stage .duel-name{padding:2px 6px}
.duel-stage .duel-bar{gap:var(--s3);padding:var(--s2) var(--s3)}
.duel-stage .abtn{padding:var(--s2) var(--s3)}
.duel-stage .duel-move{padding:var(--s2) var(--s3)}
.duel-stage .duel-move.is-short{padding:var(--s2) 10px}
.is-immersive .arena-exit{top:var(--s4);right:var(--s4)}
.is-immersive .arena-fs:not([hidden]){top:var(--s4);right:calc(var(--s4) + 11rem)}
@media(max-width:899px){
 .duel-stage .duel-bar,#replayControls.duel-bar{gap:var(--s2);padding:var(--s2)}
 .duel-stage .abtn{padding:var(--s2) 10px}
 .duel-stage .duel-mid{gap:var(--s2);padding:2px var(--s3)}
 .duel-stage .duel-side{padding-left:var(--s3);padding-right:var(--s3)}
}
@media(max-width:420px){.duel-stage .duel-side{padding-left:var(--s3);padding-right:var(--s3)}.duel-stage .duel-mid{padding:2px var(--s3)}}

/* Espaciado: correcciones de la auditoría */
.duel-stage .duel-pip{width:20px;height:20px}
.duel-stage .duel-pile-name{width:max-content;margin-left:50%;transform:translateX(-50%);padding:0 var(--s1);text-align:center}
.duel-stage .duel-piles{gap:max(calc(var(--w) * .22),var(--s4));margin-right:calc(var(--w) * .1 + var(--s2))}
.duel-stage .duel-lefts{margin-left:calc(var(--w) * .1 + var(--s2))}
.duel-stage .duel-actions .duel-move{pointer-events:auto}
.duel-stage .duel-plate-prizes .duel-prizes-word{white-space:nowrap}
@media(max-width:420px){.duel-stage .duel-plate-prizes .duel-prizes-word{display:none}.duel-stage .duel-plate{padding:var(--s1) var(--s2)}}
.duel-stage .duel-pile-name{line-height:16px}
.duel-empty-slot{position:relative}
.duel-empty-slot .duel-move{top:50%}
.duel-stage .duel-pile-name{line-height:20px}
@media(max-aspect-ratio:1/1){.duel-stage .duel-lefts{gap:var(--s4)}}
.duel-stage .duel-row{column-gap:var(--s4)}
.duel-stage .duel-actions{gap:var(--s2)}
.duel-bar #replayLabel{flex:none}
@media(min-width:900px){.duel-stage.is-immersive .duel-panel{margin-top:calc(var(--s4) + 44px + var(--s2))}}
@media(max-width:899px){
 #replayControls.duel-bar #replayTurn{grid-column:span 3}
 #replayControls.duel-bar #replayLabel{grid-column:span 2}
 #replayControls.duel-bar #logToggle{grid-column:span 4}
}
.duel-stage .duel-name{padding:3px 6px}
.duel-bar #replayLabel{padding:var(--s1) var(--s2);border:1px solid #ecf1ea40;border-radius:3px;background:var(--felt)}
@media(max-width:899px){
 #replayControls.duel-bar #replayTurn{grid-column:span 2}
 #replayControls.duel-bar #replayLabel{grid-column:span 3}
}
.duel-stage .duel-bench{column-gap:max(calc(var(--w) * .14),var(--s3))}
@media(min-width:900px){.duel-stage .duel-bench{column-gap:calc(var(--w) * .45)}}
@media(max-aspect-ratio:1/1){.duel-stage .duel-lefts{gap:var(--s5)}}
.duel-stage .duel-piles{gap:max(calc(var(--w) * .22),20px)}
.duel-stage .duel-row{column-gap:20px}
.duel-stage .duel-move.is-short{padding:var(--s2) 6px}
.duel-stage .duel-piles{gap:max(calc(var(--w) * .22),22px)}
.duel-stage .duel-hand-zone .duel-move{top:auto;bottom:calc(100% + var(--s2))}
.duel-stage .duel-side[data-side=rival] .duel-hand-zone .duel-move{bottom:auto;top:calc(100% + var(--s2))}
.mv-ico{display:none}
@media(max-width:420px){.duel-stage .mv-word{display:none}.duel-stage .mv-ico{display:inline;font-size:18px;line-height:1}}
@media(max-aspect-ratio:1/1){.duel-stage .duel-lefts{gap:28px}}
@media(max-aspect-ratio:1/1){.duel-stage .duel-lefts{flex-direction:column;align-items:center;gap:var(--s3)}.duel{--pz:.8}}
@media(max-width:400px){.duel-stage .duel-piles{gap:24px}.duel-stage .duel-row{column-gap:16px}}
.duel-stage .duel-move{white-space:nowrap}

/* ===== Ronda 4: solapes entre zonas, abanico rival y pips con símbolo ===== */
.duel-pip svg{display:block;width:12px;height:12px;fill:currentColor}
.duel-stage .duel-side[data-side=rival]{padding-top:calc(var(--w) * .4 + 14px)}
.duel-stage .duel-side[data-side=own]{padding-bottom:calc(var(--w) * .4 + 14px)}
@media(max-aspect-ratio:1/1){
 .duel-stage .duel-side[data-side=rival]{padding-top:calc(var(--w) * .62 + 14px)}
 .duel-stage .duel-piles{gap:12px;margin-right:0}
 .duel-stage .duel-piles .duel-pile,.duel-stage .duel-lefts .duel-pile{width:calc(var(--w) * .6)}
 .duel-stage .duel-row{column-gap:12px}
}

@media(max-aspect-ratio:1/1){.duel{--hconst:168px}}
@media(max-width:420px){.duel-stage .duel-side{padding-left:18px;padding-right:18px}.duel-stage .duel-lefts{gap:var(--s2)}.duel{--pz:.7}}
@media(max-width:420px){.duel-stage .duel-lefts{gap:var(--s5)}}
@media(max-width:360px){
 .duel{--pz:.55}
 .duel-stage .duel-lefts{gap:var(--s4)}
 .duel-stage .duel-lefts .duel-pile{width:calc(var(--w) * .5)}
 .duel-stage .duel-piles{gap:36px}
}
@media(max-width:360px){.duel{--amul:1.6}.duel-stage .duel-piles{gap:28px}.duel-stage .duel-row{column-gap:12px}}
@media(max-width:360px){.duel{--amul:1.45}.duel-stage .duel-piles{gap:34px}.duel-stage .duel-piles .duel-pile{flex:none}.duel-stage .duel-row{column-gap:8px}}
@media(max-width:360px){.duel{--amul:1.6}.duel-stage .duel-piles{display:flex;flex-direction:column;align-items:center;gap:var(--s4)}.duel-stage .duel-row{column-gap:12px}}
@media(max-width:360px){.duel-stage .duel-piles{gap:var(--s1);margin-right:var(--s3)}.duel-stage .duel-piles .duel-pile{width:calc(var(--w) * .5)}}
@media(max-width:360px){.duel-stage .duel-piles{gap:14px}}
@media(max-width:899px){#replayControls.duel-bar .arena-skip{grid-column:1/-1}}
/* Cajón de la arena sobre fieltro: texto de tiza y botones de contorno (el tema del sitio es claro) */
.duel-stage .duel-panel{color:var(--chalk)}
.duel-stage .duel-panel button:not(.abtn){min-height:44px;padding:var(--s2) var(--s3);border:1.5px solid #ecf1ea66;border-radius:3px;background:transparent;color:var(--chalk);font-size:14px;font-weight:700}
.duel-stage .duel-panel button:not(.abtn):hover:not(:disabled){background:#ecf1ea1a}
.duel-stage .duel-panel button:not(.abtn):focus-visible{outline:2px solid var(--chalk);outline-offset:3px}
.duel-stage .duel-panel button:not(.abtn):disabled{background:#16231d!important;border:1.5px dashed #9fb3a6!important;color:#b9c9be!important}
@media(max-width:360px){.duel-stage .abtn-switch .abtn-icon{display:none}}
#replayTurn{accent-color:var(--gold)}
/* Retrato: con Atkinson (más ancha) y filete de 1,5 px, la banda central y el borde derecho necesitan un poco más de aire */
@media(max-aspect-ratio:1/1){.duel-stage .duel-plate{padding-block:2px}.duel-stage .duel-mid{padding-block:0}}
@media(max-width:360px){.duel-stage .duel-piles{margin-right:16px}}
@media(max-aspect-ratio:1/1){.duel-stage .duel-mid,.duel-stage .duel[data-interactive] .duel-mid{min-height:40px}}
@media(max-width:360px){.duel{--hconst:184px}}
@media(max-width:360px){.duel-stage .duel-piles{gap:20px}}

/* ===== Todo a la vista (mesa libre, replay y lección): barra de selección, último movimiento, pistas, pilas, moneda y condiciones ===== */
/* El escenario gana una fila fija de información entre la mesa y la barra: no se mueve al seleccionar. */
#manualStage{grid-template-rows:minmax(0,1fr) auto auto}
#manualInfo{grid-row:2;grid-column:1}
#manualBar{grid-row:3}
#duelStage{grid-template-rows:minmax(0,1fr) auto auto auto}
#duelInfo{grid-row:2;grid-column:1}
#duelStage>#turnSummary{grid-row:3;grid-column:1}
#duelStage>#replayControls{grid-row:4;grid-column:1}
.duel-info{display:flex;flex-direction:column;gap:2px;min-width:0;padding:6px var(--s3,12px);border:1.5px solid #ecf1ea33;border-radius:3px;background:var(--felt);color:var(--chalk)}
.duel-last{margin:0;font-size:13px;line-height:18px;font-weight:700;color:var(--gold);overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:anywhere}
.duel-last:empty{display:none}
.duel-result{margin:0;font-size:14px;line-height:20px;font-weight:800;color:var(--chalk)}
.duel-hint{margin:0;font-size:12px;line-height:16px;color:var(--chalk-dim)}
.hint-touch{display:none}
@media(hover:none){.hint-fine{display:none}.hint-touch{display:inline}}
.duel-sel{display:flex;flex-direction:column;gap:6px;margin-top:4px;padding-top:6px;border-top:1px solid #ecf1ea26}
.duel-sel-name{margin:0;font-size:13px;line-height:18px;color:var(--chalk-dim);overflow-wrap:anywhere}
.duel-sel-name b{color:var(--gold);font-size:14px}
.duel-sel-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s2,8px) var(--s3,12px)}
.duel-sel-dmg,.duel-sel-conds{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var(--s2,8px)}
.duel-sel-dmgnum{min-width:2ch;font-family:var(--num);font-size:22px;font-weight:900;line-height:1;text-align:center;color:#fff}
.duel-sel .duel-chip-dmg{min-width:44px;width:44px;height:44px;min-height:44px;padding:0;border:3px solid #fff;border-radius:50%;color:#fff;font-family:var(--num);font-size:18px;font-weight:900;line-height:1;white-space:nowrap;cursor:pointer}
.duel-sel .duel-chip-dmg.is-plus{background:var(--dmg)}
.duel-sel .duel-chip-dmg.is-minus{border:2px solid var(--chalk);background:transparent;color:var(--chalk)}
.duel-sel .duel-chip-dmg:focus-visible{outline:2px solid var(--chalk);outline-offset:3px}
.duel-stage .duel-sel .abtn{flex-direction:row;gap:6px;padding:var(--s2,8px) 10px;font-size:13px}
.duel-stage .abtn.is-cond[aria-pressed=true]{border-color:var(--gold);background:var(--gold);color:var(--felt)}
.duel-stage .abtn.is-cond[aria-pressed=true] .abtn-icon{color:var(--felt)}
.duel-stage .abtn.is-cond .abtn-icon{width:18px;height:18px}
/* Pilas: nombre como botón («Ver»), Robar sobre el mazo, Barajar y Tomar junto a su pila */
.duel-stage .duel-pile-name.duel-pile-open{position:relative;appearance:none;display:block;border:0;border-radius:0;background:none;color:var(--chalk);font:inherit;font-size:12px;line-height:20px;text-decoration:underline dotted;text-underline-offset:3px;cursor:pointer}
.duel-stage .duel-pile-name.duel-pile-open:focus-visible,.duel-pile-act:focus-visible,.duel-badge.duel-extra:focus-visible{outline:2px solid var(--chalk);outline-offset:2px}
.duel-pile-act{position:relative;display:block;width:max-content;margin:8px 0 0 50%;transform:translateX(-50%);min-height:24px;padding:2px 8px;border:1.5px solid #ecf1ea88;border-radius:3px;background:transparent;color:var(--chalk);font:700 12px/16px 'Atkinson Hyperlegible',system-ui,sans-serif;cursor:pointer}
.duel-pile-act::before{content:"";position:absolute;inset:-10px -4px}
@media(hover:hover) and (pointer:fine){.duel-pile-act:hover,.duel-stage .duel-pile-name.duel-pile-open:hover{background:#ecf1ea1a}}
.duel-draw-label{position:absolute;left:50%;bottom:6px;z-index:2;transform:translateX(-50%);padding:1px 6px;border:1px solid var(--gold);border-radius:3px;background:#0f1a16f2;color:var(--gold);font:700 12px/16px 'Atkinson Hyperlegible',system-ui,sans-serif;white-space:nowrap;pointer-events:none}
.duel-stage .duel-mon-bench .duel-extra{cursor:pointer;pointer-events:auto}
.duel-badge.duel-extra{font-family:inherit;padding:0;cursor:pointer}
/* Condiciones especiales: insignias legibles en una fila propia bajo la carta (nunca encima: un toque en la carta no puede caer en ellas; quitarlas es una acción de la barra de selección). El Pokémon reserva esa fila. */
.duel-conds{position:absolute;left:50%;transform:translateX(-50%);top:calc(100% + 3px);z-index:4;display:flex;flex-flow:row nowrap;justify-content:center;gap:3px;width:max-content;pointer-events:none}
.duel-mon:has(.duel-conds){margin-bottom:23px}
/* Sin ancho para los nombres (≤360 px, o tres Condiciones en móvil): solo el símbolo; el nombre sigue en el título, en la lectura de la carta y en los botones de la barra de selección. */
@media(max-width:360px){.duel-conds .duel-cond-badge b{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;width:1px;overflow:hidden;position:absolute;white-space:nowrap}.duel-conds .duel-cond-badge{padding:0 4px}}
@media(max-width:600px){.duel-conds:has(.duel-cond-badge:nth-child(3)) .duel-cond-badge b{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;width:1px;overflow:hidden;position:absolute;white-space:nowrap}.duel-conds:has(.duel-cond-badge:nth-child(3)) .duel-cond-badge{padding:0 4px}}
.duel-cond-badge{position:relative;display:inline-flex;align-items:center;gap:4px;height:20px;padding:0 6px 0 4px;border:1.5px solid var(--gold);border-radius:11px;background:#0f1a16f2;color:var(--chalk);font:700 12px/1 'Atkinson Hyperlegible',system-ui,sans-serif;white-space:nowrap}
.duel-cond-badge svg{flex:none;width:14px;height:14px;fill:none;stroke:var(--gold);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
/* Aviso de la moneda: Cara / Sello en el centro de la mesa */
.duel-notice{position:absolute;left:50%;top:42%;z-index:45;transform:translate(-50%,-50%);margin:0;padding:10px 28px;border:2px solid var(--gold);border-radius:4px;background:#0f1a16f5;color:var(--gold);font:900 clamp(30px,7vw,60px)/1 var(--num);letter-spacing:.05em;text-transform:uppercase;pointer-events:none;animation:duelNotice .2s var(--e-out,ease-out)}
@keyframes duelNotice{from{opacity:0;transform:translate(-50%,-50%) scale(.9)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}
@media(prefers-reduced-motion:reduce){.duel-notice{animation:none}}
/* Bandeja «Ver mi mano» y panel de pila */
.duel-tray{position:absolute;left:0;right:0;bottom:0;z-index:28;max-height:64%;overflow:auto;padding:var(--s3,12px);border-top:2px solid var(--gold);background:#0f1a16f5}
.duel-tray-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;color:var(--chalk)}
.duel-tray-cards{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--s2,8px)}
.duel-tray-card{width:max(56px,calc(var(--w) * 1.05))}
.duel-tray-empty{color:var(--chalk-dim);font-size:13px}
.duel-pile-note{margin:0 0 8px;font-size:12px;line-height:1.5;color:var(--chalk-dim)}
.duel-pile-find{display:grid;gap:4px;margin-bottom:8px;font-size:12px;color:var(--chalk-dim)}
.duel-pile-find input{min-height:44px;padding:0 10px;border:1.5px solid #ecf1ea66;border-radius:3px;background:#16231d;color:var(--chalk);font:inherit;font-size:14px}
.duel-pile-list{flex:1;min-height:0;display:grid;align-content:start;gap:6px;margin:0;padding:0;overflow:auto;list-style:none}
.duel-pile-list li{margin:0}
.duel-pile-list button{width:100%;text-align:left}
.duel-pile-list li>span,.duel-pile-empty{display:block;padding:8px 12px;border:1px solid #ecf1ea26;border-radius:3px;font-size:14px;color:var(--chalk)}
/* Replay: resumen del turno dentro del escenario (columna en escritorio, franja plegable en móvil) */
.duel-stage .duel-summary{position:relative;margin:0;padding:0;border:0;color:var(--chalk);min-height:0}
.duel-summary-box>summary{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;min-height:44px;padding:6px var(--s3,12px);border:1.5px solid #ecf1ea33;border-radius:3px;background:var(--felt);color:var(--chalk);cursor:pointer;list-style:none}
.duel-summary-box>summary::-webkit-details-marker{display:none}
.duel-summary-box>summary::before{content:"＋";color:var(--gold)}
.duel-summary-box[open]>summary::before{content:"−"}
.duel-summary-box .eyebrow{margin:0;font-size:12px;color:var(--gold)}
.duel-summary-box .tag{margin-left:auto;font-size:12px}
.duel-summary-body{padding:8px 12px 12px;border:1.5px solid #ecf1ea33;border-top:0;background:var(--felt);overflow:auto}
.duel-summary .turn-metrics{margin:0 0 8px;border-bottom-color:#ecf1ea40}
.duel-summary .turn-metrics>div{padding:6px 8px 6px 0}
.duel-summary .turn-metrics strong{font-size:26px;color:var(--chalk)}
.duel-summary .turn-metrics span,.duel-summary .turn-secondary,.duel-summary .muted{font-size:12px;line-height:1.5;color:var(--chalk-dim)}
.duel-summary .turn-action-list{margin:8px 0}
.duel-summary .turn-action-list li{padding:6px 0;border-bottom-color:#ecf1ea26;font-size:13px;line-height:1.4;color:var(--chalk)}
.duel-summary .turn-action-list li.consequence{color:var(--chalk-dim)}
.duel-summary .turn-action-list li>span{flex-basis:56px;color:var(--gold)}
@media(max-width:899px){
 .duel-summary-box[open] .duel-summary-body{position:absolute;left:0;right:0;bottom:calc(100% - 2px);z-index:26;max-height:min(52vh,420px);border-top:1.5px solid #ecf1ea33;box-shadow:0 -10px 24px #050c09cc}
}
@media(min-width:1100px){
 #duelStage{grid-template-columns:minmax(0,1fr) 300px;column-gap:8px}
 #duelStage>#turnSummary{grid-column:2;grid-row:1 / 4;overflow:auto;border:1.5px solid #ecf1ea33;border-radius:3px;background:var(--felt)}
 #duelStage>#turnSummary .duel-summary-box>summary{border:0;border-bottom:1px solid #ecf1ea26}
 #duelStage>#turnSummary .duel-summary-body{border:0}
 #duelStage>#replayControls{grid-column:1 / -1}
 #duelStage .duel-panel{grid-column:1}
}
#replayControls .abtn-switch{flex:none}
@media(max-width:899px){#replayControls.duel-bar .abtn-switch{grid-column:span 6}#replayControls.duel-bar .arena-skip{grid-column:span 6}}
/* Barra de la mesa libre: más botones, en filas */
#manualBar{flex-wrap:wrap}
#manualBar .duel-bar-turn{flex:1 1 140px}
@media(max-width:899px){
 #manualBar .abtn{flex:1 1 29%}
 #manualBar .abtn-switch{flex:1 1 29%}
 .duel-sel .abtn{flex:0 1 auto}
 .duel-info{padding:4px var(--s2,8px)}
}
/* Lección: leer cualquier carta */
.arena-hint{margin:8px 0 0;font-size:12px;line-height:16px;color:var(--chalk-dim)}
.lesson-view{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0 0 10px;padding:8px 12px;border:1.5px solid #ecf1ea33;border-radius:3px;background:var(--felt);color:var(--chalk)}
.lesson-view-name{flex:1 1 140px;margin:0;font-size:14px;overflow-wrap:anywhere}
.lesson-view-hint{margin:0;font-size:13px;line-height:1.5;color:var(--chalk-dim)}
.lesson-view-btn{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:6px 12px;border:1.5px solid #ecf1ea66;border-radius:3px;background:transparent;color:var(--chalk);font:700 14px/1.15 'Atkinson Hyperlegible',system-ui,sans-serif;cursor:pointer}
.lesson-view-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.lesson-view-btn:focus-visible{outline:2px solid var(--chalk);outline-offset:3px}
@media(hover:hover) and (pointer:fine){.lesson-view-btn:hover{background:#ecf1ea1a}}
.lesson-view{min-height:62px}
@media(max-width:650px){.lesson-view{min-height:91px}.lesson-view-name{flex-basis:100%}.lesson-view-btn{flex:1 1 0;justify-content:center}}
@media(max-width:360px){.lesson-view{min-height:96px}}
/* Vista ampliada con efectos */
.card-preview-info{margin-top:8px;max-height:34vh;overflow:auto;padding:8px 6px 2px;border-top:1px solid var(--line);font-size:13px;line-height:1.45;color:var(--ink);text-align:left}
.card-preview-panel.is-felt .card-preview-info{margin-top:0;padding:10px 12px;border:1px solid #ecf1ea40;border-radius:0 0 6px 6px;background:#0f1a16f5;color:var(--chalk)}
.card-preview-panel.is-felt .card-help>p,.card-preview-panel.is-felt .card-help-primary>p,.card-preview-panel.is-felt .card-help>h3,.card-preview-panel.is-felt .card-quickfacts dt,.card-preview-panel.is-felt .card-quickfacts dd,.card-preview-panel.is-felt .card-preview-info>p,.card-preview-panel.is-felt .card-preview-info>h4{color:var(--chalk)}
.card-preview-info h3{margin:0 0 6px;font-size:13px}
.card-preview-info .card-help{margin:8px 0 0}
.card-preview-info .card-help-primary p{margin:0 0 8px}
.card-preview-info h4{margin:8px 0 4px;font-size:13px}
.card-preview-info p{margin:0 0 6px;overflow-wrap:anywhere}

/* Barajar y Tomar: texto junto a la pila en horizontal; en retrato, un botón redondo sobre la esquina de la pila (sin ocupar alto) */
.duel-pile-act{display:inline-flex;align-items:center;justify-content:center;gap:4px;white-space:nowrap}
.duel-act-icon{flex:none;width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.duel-pile-act{display:flex}
@media(max-aspect-ratio:1/1){
 .duel-stage .duel-pile{position:relative}
 .duel-pile-act{position:absolute;left:-12px;bottom:18px;margin:0;transform:none;width:26px;height:26px;min-height:0;padding:0;border-radius:50%;background:#0f1a16f2}
 .duel-pile-act span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
 .duel-pile-act::before{inset:-9px}
 .duel-stage .duel-prizes{position:relative}
}
.duel-pile-name{white-space:nowrap}

/* Móvil: la barra de la mesa libre en dos filas de cuatro (el escenario necesita el alto) y la información en pocas líneas */
@media(max-width:899px){
 #manualBar{gap:var(--s2,8px)}
 #manualBar .abtn,#manualBar .abtn-switch{flex:1 1 calc(25% - 8px);min-width:0;padding:4px}
 #manualBar #arenaNext{flex:1 1 52%}
 #manualBar .duel-bar-turn{flex:1 1 40%;order:-1;text-align:left}
 #manualBar .abtn-switch,#replayControls .abtn-switch{flex-direction:column;gap:2px;position:relative}
 .duel-stage .abtn-switch .switch-track{display:none}
 .duel-stage .abtn-switch:has(input:checked){border-color:var(--gold);background:var(--gold);color:var(--felt)}
 .duel-stage .abtn-switch:has(input:checked) .abtn-icon{color:var(--felt)}
 .duel-stage .abtn-switch .abtn-icon{display:block}
 .duel-last{-webkit-line-clamp:1}
 .duel-hint{font-size:12px;line-height:15px}
}
@media(max-width:360px){#manualBar .abtn,#manualBar .abtn-switch{font-size:12px;line-height:1.05}}
.duel-stage .duel-pile-name.duel-pile-open,.duel-pile-act{box-sizing:content-box}
/* Zona táctil de 32 px de alto sin cambiar el diseño (padding compensado con margen negativo; un pseudo-elemento contaría como desbordamiento) */
.duel-stage .duel-pile-name.duel-pile-open{padding:6px 8px;margin-top:-2px;margin-bottom:-6px}
/* Más altura reservada a rótulos y botones junto a las pilas (el escenario ahora tiene fila de información) */
.duel[data-interactive]{--hconst:172px}
@media(max-aspect-ratio:1/1){.duel[data-interactive]{--hconst:172px}}
@media(max-width:360px){.duel[data-interactive]{--hconst:188px}}
/* Retrato: el escenario conserva el alto de la mesa (la mesa no baja de ~590 px a 390×844) */
@media(max-width:899px){
 #manualStage,#duelStage{gap:4px}
 #manualStage.is-immersive,#duelStage.is-immersive{gap:4px}
 .duel-info{padding:3px 8px;gap:0}
 #manualBar.duel-bar{gap:6px;padding:5px}
 #manualBar .abtn,#manualBar .abtn-switch{min-height:44px}
}
/* Daño en la Banca: la ficha roja va sobre el borde derecho, sobre el nombre y bajo los PS, para no tapar los PS */
.duel-stage .duel-mon-bench .duel-dmg{top:auto;right:-12px;bottom:26px}
/* Aviso de la moneda: más bajo y centrado en la línea media (lo coloca manual.js) para no tapar el Activo ni las placas */
.duel-notice{padding:4px 18px;font-size:clamp(24px,3.4vw,44px)}

/* ===== Ronda de ajuste: la información va en una columna lateral en escritorio y la mesa conserva su alto en retrato ===== */
@media(min-width:900px){
 #manualStage{grid-template-columns:minmax(0,1fr) 320px;grid-template-rows:minmax(0,1fr) auto;column-gap:8px}
 #manualBoard{grid-column:1;grid-row:1 / 3}
 #manualStage .duel-panel{grid-column:1;grid-row:1}
 #manualInfo{grid-column:2;grid-row:1;min-height:0;overflow:auto;margin-top:calc(var(--s4) + 44px + var(--s2))}
 #manualBar{grid-column:2;grid-row:2;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--s3);padding:var(--s2)}
 #manualBar .duel-bar-turn{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
 #manualBar #arenaNext{grid-column:1 / -1;order:-1}
 #manualBar .abtn,#manualBar .abtn-switch{flex-direction:column;gap:2px;min-width:0;padding:4px 6px;font-size:12px;line-height:1.1;text-align:center}
 #manualBar .abtn-switch .switch-track{display:none}
 #manualBar .abtn-switch .abtn-label{text-align:center}
 #manualBar .abtn-switch:has(input:checked){border-color:var(--gold);background:var(--gold);color:var(--felt)}
 #manualBar .abtn-switch:has(input:checked) .abtn-icon{color:var(--felt)}
 #duelStage>#turnSummary{margin-top:calc(var(--s4) + 44px + var(--s2));grid-row:1 / 4}
}
@media(max-width:899px){#manualInfo,#duelInfo{grid-column:1}}
/* Retrato y pantallas estrechas: la mesa nunca baja de un alto útil; si el resto no cabe, el escenario se desplaza en vertical */
@media(max-width:899px){
 #manualStage.is-immersive{overflow-x:hidden;overflow-y:auto;grid-template-rows:minmax(560px,1fr) auto auto}
 #manualBar.duel-bar,#manualBar{gap:var(--s2,8px)}
}
#manualInfo.has-sel .duel-hint{display:none}

/* Barra de selección: botones en columna (icono sobre el texto), en una sola rejilla que se acomoda al ancho disponible */
.duel-sel-actions{gap:var(--s2,8px)}
.duel-sel-dmg{flex:0 0 auto;gap:var(--s2,8px)}
.duel-sel-conds{display:contents}
.duel-stage .duel-sel .abtn{flex:1 1 84px;flex-direction:column;gap:2px;min-width:0;padding:4px 6px;font-size:12px;line-height:1.1}
.duel-stage .duel-sel .abtn .abtn-icon{width:18px;height:18px}

/* El nombre de la pila es un botón: sin el mínimo de 44 px del sitio (la zona táctil se logra con el relleno) */
.duel-stage .duel-pile-name.duel-pile-open{min-height:0;min-width:0;height:20px}

.duel-stage .duel-pile-name.duel-pile-open{max-width:none}
@media(max-aspect-ratio:1/1){.duel-pile-act{left:-12px;top:0;bottom:auto}}
@media(max-width:360px){#manualBar .abtn,#manualBar .abtn-switch{flex:1 1 29%}#manualBar #arenaNext{flex:1 1 52%}}

.duel-stage .duel-pile-name.duel-pile-open{padding:6px 5px}
@media(max-aspect-ratio:1/1){.duel-stage .duel-piles{column-gap:30px;margin-right:var(--s2)}}

@media(max-aspect-ratio:1/1){.duel-pile-act{left:auto;right:-30px;top:0}}
@media(max-width:360px){.duel-stage .duel-piles{margin-right:24px}}

/* ===== Replay: controles en una rejilla de 6 columnas; en escritorio van en la columna lateral y el tapete usa todo el alto ===== */
#replayControls.duel-bar{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));align-items:stretch;gap:var(--s2);padding:var(--s2)}
#replayControls.duel-bar .abtn,#replayControls.duel-bar .abtn-switch{flex-direction:column;gap:2px;min-width:0;padding:4px 6px;font-size:12px;line-height:1.1;text-align:center}
#replayControls.duel-bar .abtn-switch .switch-track{display:none}
#replayControls.duel-bar .abtn-switch .abtn-label{text-align:center}
#replayControls.duel-bar .abtn-switch:has(input:checked){border-color:var(--gold);background:var(--gold);color:var(--felt)}
#replayControls.duel-bar .abtn-switch:has(input:checked) .abtn-icon{color:var(--felt)}
#replayControls.duel-bar #autoPause,#replayControls.duel-bar #autoStep,#replayControls.duel-bar #autoFinish,#replayControls.duel-bar #soundToggle,#replayControls.duel-bar .abtn-switch,#replayControls.duel-bar #logToggle{grid-column:span 2}
#replayControls.duel-bar .arena-skip{order:2}
#replayControls.duel-bar #replayTurn{grid-column:span 3;order:3;align-self:center}
#replayControls.duel-bar #replayLabel{grid-column:span 1;order:3;min-width:0;padding:var(--s1);white-space:normal;text-align:center;font-size:12px;align-self:center}
#replayControls.duel-bar #logToggle{order:3}
@media(min-width:900px){#replayControls.duel-bar{gap:var(--s3)}}
@media(min-width:900px){
 #duelStage{grid-template-columns:minmax(0,1fr) 320px;grid-template-rows:auto minmax(0,1fr) auto}
 #autoBoard{grid-column:1;grid-row:1 / 4}
 #duelStage .duel-panel{grid-column:1;grid-row:1 / 4}
 #duelInfo{grid-column:2;grid-row:1;margin-top:calc(var(--s4) + 44px + var(--s2))}
 #duelStage>#turnSummary{grid-column:2;grid-row:2;margin-top:0}
 #duelStage>#replayControls{grid-column:2;grid-row:3}
}
@media(max-width:899px){#duelStage.is-immersive{overflow-x:hidden;overflow-y:auto;grid-template-rows:minmax(560px,1fr) auto auto auto}}

@media(max-width:420px){.duel-stage .duel-center{min-width:0}.duel-stage .duel-turn-label{max-width:44cqw;white-space:normal;text-align:center;line-height:15px;padding-block:2px}}
@media(max-aspect-ratio:1/1){.duel-stage .duel-piles .duel-pile:first-child .duel-count{right:-6px;top:-8px;bottom:auto;transform:none}}

.duel-stage .duel-cond-badge{min-height:0;min-width:0;max-width:none}
.duel-stage .duel-badge.duel-extra{min-height:0;min-width:0;padding:0}
@media(max-aspect-ratio:1/1) and (min-width:421px){.duel-stage .duel-lefts{gap:var(--s5)}}

/* Destinos: la pila o el Pokémon completo se realza con contorno y su botón corto vive en el área de la carta; nombres, cantidades y «Robar» quedan siempre legibles */
.duel-pile.is-target,.duel-prizes.is-target{outline:2px dashed var(--gold);outline-offset:4px;border-radius:4px}
.duel-mon.is-target .duel-mon-frame{outline:2px dashed var(--gold);outline-offset:3px;border-radius:4px}
.duel-pile.is-target .duel-count,.duel-prizes.is-target .duel-count{z-index:9}
.duel-stage .duel-stack>.duel-move,.duel-stage .duel-prize-stack>.duel-move{top:auto;bottom:3px;transform:translateX(-50%);width:max-content;min-width:34px;min-height:24px;height:24px;padding:0;display:flex;align-items:center;justify-content:center;gap:4px;line-height:1;background:#0f1a16f2}
.duel-stage .duel-actions{gap:4px}
.duel-stage .duel-actions .duel-move{min-height:28px;height:28px;padding:0 6px;display:flex;align-items:center;justify-content:center;gap:4px;line-height:1}
.duel-stage .duel-pile-draw{position:relative;display:block;width:max-content;margin:8px 0 0 50%;transform:translateX(-50%);min-height:24px;padding:2px 8px;border:1.5px solid var(--gold);border-radius:3px;background:#0f1a16f2;color:var(--gold);font:700 12px/16px 'Atkinson Hyperlegible',system-ui,sans-serif;white-space:nowrap;max-width:none;cursor:pointer}
.duel-pile-draw::before{content:"";position:absolute;inset:-10px -4px}
.duel-pile-draw:focus-visible{outline:2px solid var(--chalk);outline-offset:2px}
@media(hover:hover) and (pointer:fine){.duel-pile-draw:hover{background:#1c2f26}}
/* Banca compacta: el botón cubre la carta completa (transparente, el realce ya la rodea) y su texto va en la franja entre los PS y el nombre */
@media(max-width:899px){.duel-stage .duel-mon-bench .duel-actions .duel-move{position:absolute;inset:0;width:auto;height:auto;min-width:0;min-height:0;padding:0;border:0;border-radius:4px;background:none;animation:none;text-shadow:0 0 3px #000,0 0 3px #000}
 .duel-stage .duel-mon-bench .duel-actions .duel-move::before{content:"";position:absolute;z-index:-1;left:0;right:0;top:50%;height:17px;transform:translateY(-50%);background:#0f1a16f2;border-block:1.5px dashed var(--gold)}}
@media(max-aspect-ratio:1/1) and (max-width:600px){.duel-stage .duel-piles .duel-pile .duel-count,.duel-stage .duel-piles .duel-pile:first-child .duel-count,.duel-stage .duel-lefts .duel-pile .duel-count{top:-16px}.duel-stage .duel-prizes .duel-count{top:-12px}}
@media(max-aspect-ratio:1/1) and (min-width:361px){.duel-pile-act{right:-40px}}
@media(max-aspect-ratio:1/1) and (min-width:601px){.duel-pile-act{right:-36px}}
@media(max-aspect-ratio:1/1) and (max-width:600px) and (min-width:361px){.duel-stage .duel-piles{column-gap:48px;margin-right:0}}
@media(max-width:360px){.duel-stage .duel-pile .duel-pile-act{left:calc(50% + 28px);right:auto;top:calc(100% + 2px)}.duel-stage .duel-stack>.duel-move,.duel-stage .duel-prize-stack>.duel-move{bottom:6px}}
@media(max-width:360px){.duel-stage .duel-piles .duel-pile .duel-count,.duel-stage .duel-piles .duel-pile:first-child .duel-count,.duel-stage .duel-lefts .duel-pile .duel-count,.duel-stage .duel-prizes .duel-count{top:-8px}.duel-pile.is-target .duel-count,.duel-prizes.is-target .duel-count{visibility:hidden}}
@media(max-width:360px){.duel-stage .duel-pile-draw{position:absolute;right:auto;left:50%;top:calc(100% + 2px);margin:0;padding:2px;transform:translateX(-50%)}}
.duel-stage .duel-actions .duel-move .mv-ico{font-size:12px}
@media(max-aspect-ratio:1/1) and (min-width:421px){.duel-stage .duel-lefts{gap:var(--s4)}}
@media(max-aspect-ratio:1/1) and (max-width:600px){.duel-stage .duel-mon-active .duel-dmg{top:-11px}}

/* ===== Jugar contra la IA (etapa 3b): jugables iluminados, mano en franja, ataques, acciones, barra y cartel final ===== */
.duel[data-duel] .duel-card.is-playable:not(.is-selected){box-shadow:0 0 0 2px #f2b705b3,0 0 14px #f2b70577;animation:dlPlayable 2.2s ease-in-out infinite}
.duel[data-duel] .duel-mon.is-playable:not(.is-selected) .duel-mon-frame{filter:drop-shadow(0 0 7px #f2b705bb)}
@keyframes dlPlayable{0%,100%{box-shadow:0 0 0 2px #f2b705b3,0 0 8px #f2b70544}50%{box-shadow:0 0 0 2px #f2b705,0 0 18px #f2b705aa}}
.duel-center{position:relative}
.duel-center>.duel-move{position:static;transform:none;z-index:8}
.duel-center[data-arena-drop].is-drop-over,.duel-center[data-arena-drop].is-drop-ok{border-radius:4px}
.duel-stage .dl-status{-webkit-line-clamp:5;color:var(--chalk)}
.duel-stage .dl-last{-webkit-line-clamp:3;color:var(--gold);font-weight:700}

/* Mano propia: franja bajo el tapete, siempre a la vista. Cartas legibles, desplazables en horizontal y con las jugables resaltadas. Mide --hb para que la mesa se ajuste al alto restante. */
.duel[data-duel]{--hw:68px;--hb:calc(var(--hw) * 1.4 + 32px);display:flex;flex-direction:column}
.duel[data-duel] .duel-mat{position:relative;inset:auto;flex:1 1 0;min-height:0}
.duel-stage .duel[data-duel] .duel-side[data-side=own]{padding-bottom:var(--s2)}
.duel-handbar{position:relative;z-index:3;flex:none;box-sizing:border-box;height:var(--hb);display:flex;flex-direction:column;padding-top:4px;border-top:1.5px solid #ecf1ea40;background:linear-gradient(0deg,#4f8fe024,#0f1a16 70%)}
.duel-handbar-title{display:block;height:16px;padding:0 var(--s3);font-size:12px;line-height:16px;font-weight:700;color:var(--chalk-dim)}
.duel-handbar-cards{flex:1 1 0;min-height:0;display:flex;align-items:flex-start;gap:var(--s2);padding:6px var(--s2);overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;overscroll-behavior-x:contain;scrollbar-width:thin}
.duel-handbar-cards>:first-child{margin-left:auto}
.duel-handbar-cards>:last-child{margin-right:auto}
.duel-handbar .duel-strip-card{flex:none;width:var(--hw);min-width:0;border-radius:6px;scroll-snap-align:center}
.duel-handbar-empty{align-self:center;font-size:13px;color:var(--chalk-dim)}
.duel-handbar.has-playable .duel-strip-card:not(.is-playable):not(.is-selected){filter:brightness(.78)}
.duel[data-interactive] .duel-handbar .duel-strip-card{touch-action:pan-x}
.duel-handbar.is-drop-ok{outline-offset:-3px}
@media(max-aspect-ratio:1/1){.duel[data-duel]{--hw:60px}}
@media(min-width:600px){.duel[data-duel]{--hw:76px}}
@media(max-height:760px){.duel[data-duel]{--hw:50px;--hb:calc(var(--hw) * 1.4 + 20px)}.duel-handbar-title{display:none}}

/* Barra del duelo: ataques y acciones del turno, «Terminar turno» como primario y el ritmo y los ajustes agrupados debajo (icono + etiqueta, nada escondido). */
#dlStage{grid-template-rows:minmax(0,1fr) auto auto}
#dlBoard{grid-row:1;grid-column:1;position:relative;min-height:0;min-width:0}
#dlInfo{grid-row:2;grid-column:1}
#dlBar{grid-row:3;display:flex;flex-direction:column;align-items:stretch;gap:var(--s2)}
.dl-main{display:flex;gap:var(--s2)}
.dl-main .abtn{flex:1 1 0;min-width:0}
.duel-stage #dlBar #dlEnd,.duel-stage #dlBar #dlSetupGo{flex-direction:row;gap:var(--s2);min-height:48px;font-size:15px;font-weight:800}
.dl-tools{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--s2);padding-top:var(--s2);border-top:1px solid #ecf1ea26}
.duel-stage .dl-tools .abtn,.duel-stage .dl-tools .abtn-switch{flex-direction:column;gap:2px;min-width:0;padding:4px 2px;font-size:12px;line-height:1.1;text-align:center}
.dl-tools .abtn-label{hyphens:auto;overflow-wrap:normal}
.dl-tools .abtn-switch .switch-track{display:none}
.dl-tools .abtn-switch:has(input:checked),.dl-tools .abtn[aria-pressed=true]{border-color:var(--gold);background:var(--gold);color:var(--felt)}
.dl-tools .abtn-switch:has(input:checked) .abtn-icon,.dl-tools .abtn[aria-pressed=true] .abtn-icon{color:var(--felt)}
#dlBar .duel-bar-turn{display:none}
.dl-acts{display:flex;flex-wrap:wrap;gap:var(--s2)}
.dl-acts[hidden],.dl-attacks[hidden]{display:none}
.duel-stage .dl-acts .dl-act{flex:1 1 auto;flex-direction:row;min-height:44px;padding:var(--s2) var(--s3);font-size:13px}
.dl-attacks{display:flex;flex-wrap:wrap;gap:var(--s2);align-items:stretch}
.dl-attack-none{margin:0;padding:var(--s1) var(--s2);font-size:12px;line-height:16px;color:var(--chalk-dim)}
#dlBar .dl-attack{flex:1 1 140px;display:flex;flex-direction:column;align-items:stretch;gap:2px;padding:var(--s2) var(--s3);text-align:left;min-height:48px}
.dl-attack-head{display:flex;justify-content:space-between;align-items:baseline;gap:var(--s2);font-size:14px;line-height:1.15}
.dl-attack-dmg{font-family:var(--num);font-size:22px;font-weight:900;line-height:1}
.dl-attack-cost{display:flex;align-items:center;gap:2px;min-height:20px}
.dl-pip-none{font-size:12px;opacity:.85}
.dl-attack-text{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;line-height:15px;font-weight:400;opacity:.95}
.dl-result{position:absolute;inset:0;z-index:70;display:grid;place-items:center;padding:var(--s4);background:#050c09d9}
.dl-result[hidden]{display:none}
.dl-result-card{width:min(440px,100%);padding:var(--s5) var(--s4);border:3px solid var(--gold);border-radius:4px;background:var(--felt);color:var(--chalk);text-align:center;box-shadow:0 14px 40px #000c}
.dl-result-card h3{margin:0 0 var(--s2);font:900 clamp(30px,8vw,48px)/1 var(--num);letter-spacing:.04em;color:var(--gold);text-transform:uppercase}
.dl-result-card p{margin:0 0 var(--s2);font-size:14px;line-height:20px}
.dl-result-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--s2);margin-top:var(--s4)}
.dl-result-actions .abtn{flex:1 1 140px}
@media(min-width:900px){
 #dlStage{grid-template-columns:minmax(0,1fr) 320px;grid-template-rows:minmax(0,1fr) auto;column-gap:8px}
 #dlBoard{grid-column:1;grid-row:1 / 3}
 #dlStage .duel-panel{grid-column:1;grid-row:1}
 #dlInfo{grid-column:2;grid-row:1;min-height:0;overflow:auto;margin-top:calc(var(--s4) + 44px + var(--s2))}
 #dlBar{grid-column:2;grid-row:2;gap:var(--s3)}
 .dl-tools{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:899px){
 #dlStage.is-immersive{overflow:hidden;grid-template-rows:minmax(0,1fr) auto auto}
 #dlInfo.has-sel .dl-status{display:none}
 #dlInfo .duel-sel .abtn-icon{display:none}
 #dlInfo .duel-sel .abtn{min-height:44px}
 #dlInfo .duel-hint{display:none}
 #dlInfo .dl-status{font-size:12px;line-height:16px;-webkit-line-clamp:2}
 #dlInfo .dl-last{font-size:12px;line-height:16px;-webkit-line-clamp:2}
 .dl-tools{gap:var(--s1)}
 #dlBar{gap:var(--s2)}
}
@media(max-height:760px) and (max-width:899px){
 .dl-attack-text{display:none}
 #dlBar .dl-attack{flex-direction:row;align-items:center;justify-content:space-between;min-height:44px;padding:var(--s1) var(--s2)}
 .duel-stage .dl-tools .abtn,.duel-stage .dl-tools .abtn-switch{padding:2px 1px;font-size:12px;letter-spacing:-.02em}
 .dl-tools .abtn-icon{width:16px;height:16px}
 #dlInfo .dl-status{-webkit-line-clamp:1}
 #dlInfo .dl-last{-webkit-line-clamp:1}
}
@media(prefers-reduced-motion:reduce){.duel[data-duel] .duel-card.is-playable:not(.is-selected){animation:none}}
@media(forced-colors:active){.dl-result-card{border:1px solid CanvasText;background:Canvas;color:CanvasText}}
.duel-flags{position:absolute;left:2px;bottom:22px;z-index:6;display:flex;flex-direction:column;gap:2px;pointer-events:none}
.duel-flag{padding:1px 5px;border:1px solid var(--chalk);border-radius:3px;background:#2a1f5c;color:#fff;font-size:12px;font-weight:800;line-height:14px}
/* PS y daño de la Banca: la pastilla nunca pasa del ancho de su carta (ni tapa a la vecina) y la ficha de daño asoma poco */
.duel-stage .duel-mon-bench .duel-hp{left:0;max-width:calc(100% + 4px);padding:2px 4px 6px}
.duel-stage .duel-mon-bench .duel-hp b{font-size:14px}
.duel-stage .duel-mon-bench .duel-dmg{right:-6px}
/* Retomar un duelo */
.duel-retake{border-left:4px solid var(--rare,#f2b705)}
/* Duelo en pantallas muy estrechas: Mazo y Descarte en fila (la columna gastaba alto que la mesa no tiene) */
@media(max-width:360px){
 .duel-stage .duel-piles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));justify-items:center;gap:0;width:100%;margin-right:0}
 .duel-stage .duel-piles .duel-pile{width:calc(var(--w) * .6)}
 .duel-stage .duel-side{padding-left:8px;padding-right:13px}
}
/* La mesa del duelo se dimensiona sobre su propio alto (la franja de la mano ya está descontada en --w): cada lado cuesta ~4,2 w en horizontal y ~4,6 w en retrato, más una parte fija */
.duel[data-duel]{--hconst:104px;--hdiv:8.4;--w:clamp(26px,min(calc((100cqh - var(--hconst) - var(--hb,0px)) / var(--hdiv)),calc((100cqw - 40px - (var(--cols,5) - 1) * 12px) / var(--cols,5))),150px)}
@media(max-aspect-ratio:1/1){.duel[data-duel]{--hdiv:9.2;--hconst:108px}.duel-stage .duel[data-duel] .duel-side[data-side=rival]{padding-top:calc(var(--w) * .62 + 30px)}}
.dl-choices{display:flex;flex-wrap:wrap;gap:var(--s2)}
.dl-choices[hidden]{display:none}
.duel-stage .dl-choices .dl-choice{flex:1 1 120px;flex-direction:row;min-height:48px;font-size:15px;font-weight:800}
/* Barra de selección compacta: nombre y «Quitar selección» en una fila, las jugadas debajo; al seleccionar sustituye al estado (no empuja a la mesa) */
.duel-sel-head{display:flex;align-items:center;justify-content:space-between;gap:var(--s2)}
.duel-sel-head .duel-sel-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.duel-stage .duel-sel .dl-clear{flex:none;flex-direction:row;gap:6px;padding:var(--s1) var(--s2);font-size:12px}
.duel-stage .duel-sel .dl-clear .abtn-icon{display:block;width:16px;height:16px}
.dl-sel-note{margin:0;font-size:12px;line-height:16px;color:var(--chalk-dim)}
@media(max-width:899px){#dlInfo.has-sel .dl-last{display:none}.duel-stage .duel-sel{gap:var(--s1);margin-top:0;padding-top:0;border-top:0}}
/* Presupuesto vertical en móvil: el estado es una línea, los ataques van compactos (el texto del efecto queda en el título, en la lectura del lector de pantalla y en «Ver carta»),
   las acciones del turno comparten fila con «Terminar turno» y, con una carta seleccionada, la selección sustituye a los ataques (se recuperan al quitarla). */
.duel-stage .duel[data-duel] .duel-side[data-side=own]{padding-bottom:14px}
.dl-main{flex-wrap:wrap}
.dl-acts{flex:0 1 auto;flex-wrap:wrap;min-width:0}
.dl-main #dlEnd,.dl-main #dlSetupGo,.dl-main #dlSkip{flex:1 1 150px}
.duel-stage .dl-acts .dl-act{flex:0 1 auto;min-width:0}
@media(max-aspect-ratio:1/1){.duel[data-duel]{--hconst:140px}}
@media(max-aspect-ratio:1/1) and (max-width:360px){.duel[data-duel]{--hconst:162px}}
.duel-stage .duel[data-duel] .duel-side{gap:max(calc(var(--w) * .1),12px)}
@media(max-aspect-ratio:1/1) and (min-width:361px){.duel-stage .duel[data-duel] .duel-piles{margin-right:calc(var(--w) * .1 + 22px)}}
@media(max-width:899px){
 .dl-tools{gap:var(--s2)}
 .dl-attack-text{display:none}
 #dlBar .dl-attack{min-height:44px;padding:var(--s1) var(--s2)}
 #dlStage.has-sel #dlAttacks,#dlStage.has-sel .dl-acts{display:none}
 .duel-stage .duel-sel{gap:var(--s2)}
 .duel-stage .duel-sel .duel-sel-actions{gap:var(--s2)}
 #dlInfo .dl-status,#dlInfo .dl-last{-webkit-line-clamp:1}
}
/* Energías unidas: nunca salen del ancho de la carta (se solapan lo necesario) */
.duel-stage .duel-energies .duel-pip+.duel-pip{margin-left:min(-4px,calc((100% - var(--n,1) * 20px) / max(1,var(--n,1) - 1)))}
@media(max-aspect-ratio:1/1) and (min-width:361px){.duel-stage .duel[data-duel] .duel-piles{margin-right:20px;column-gap:36px}}
/* Cartas extra del mulligan: solo a la Banca */
.duel-handbar .duel-strip-card.is-extra{outline:2px dashed #7fd6a2;outline-offset:1px}
.duel-handbar .duel-strip-card.is-extra::after{content:"Extra";position:absolute;left:2px;top:2px;padding:0 4px;border-radius:3px;background:#0f1a16f2;color:#7fd6a2;font:800 12px/16px 'Atkinson Hyperlegible',system-ui,sans-serif;pointer-events:none}
/* Selector de Energías y cartel de Muerte súbita */
.dl-picker{display:flex;flex-direction:column;gap:var(--s2);padding:var(--s2);border:1.5px solid var(--gold);border-radius:3px;background:#0f1a16}
.dl-picker[hidden]{display:none}
.dl-pick-title,.dl-pick-live{margin:0;font-size:13px;line-height:18px;color:var(--chalk)}
.dl-pick-live{color:var(--chalk-dim);font-size:12px;line-height:16px}
.dl-pick-options,.dl-pick-actions{display:flex;flex-wrap:wrap;gap:var(--s2)}
.duel-stage .dl-pick,.duel-stage .dl-pick-actions .abtn{flex:1 1 auto;flex-direction:row;min-height:44px}
.dl-pick[aria-pressed=true]{border-color:var(--gold)!important;background:var(--gold)!important;color:var(--felt)!important}
.dl-sudden{margin:0 0 var(--s1);padding:var(--s1) var(--s2);border:1.5px solid var(--gold);border-radius:3px;background:#2a1f0a;color:var(--gold);font-size:13px;line-height:18px;font-weight:800}
.dl-sudden[hidden]{display:none}
#dlStage.has-pick #dlAttacks,#dlStage.has-pick .dl-acts,#dlStage.has-pick #dlChoices{display:none}
#dlInfo .dl-last{overflow-wrap:anywhere}
@media(max-width:360px),(max-height:760px) and (max-aspect-ratio:1/1){.duel[data-duel]{--w:clamp(21px,min(calc((100cqh - var(--hconst) - var(--hb,0px)) / var(--hdiv)),calc((100cqw - 40px - (var(--cols,5) - 1) * 12px) / var(--cols,5))),150px)}.duel-stage .duel[data-duel] .duel-side{gap:8px}}
/* Pantallas bajas y estrechas (p. ej. 320×700): la mano en cartas de 44 px, filas de la barra más juntas y ajustes sin icono para que Terminar turno quepa sin desplazar */
@media(max-height:760px) and (max-width:899px){.duel[data-duel]{--hw:44px}#dlBar{gap:var(--s1)}#dlInfo{padding-block:2px}}
@media(max-width:360px){.dl-tools .abtn-icon{display:none}}
@media(max-height:760px) and (max-aspect-ratio:1/1){.duel[data-duel]{--hconst:152px}}
@media(max-height:760px) and (max-width:360px){.duel[data-duel]{--hconst:176px}}
/* Ronda de auditoría del duelo: separaciones de escritorio, holgura de la mesa, capas de PS/daño sobre las Energías y pantallas muy estrechas */
.duel-stage .duel-sel{gap:var(--s2)}
.duel-stage .duel-hp,.duel-stage .duel-dmg{z-index:4}
@media(min-width:900px){.dl-tools,.dl-main,.dl-pick-options,.dl-pick-actions{gap:var(--s3)}.duel-stage .duel-sel{gap:var(--s3)}}
.duel[data-duel]{--hconst:108px}
@media(max-aspect-ratio:1/1){.duel[data-duel]{--hconst:146px}.duel-stage .duel[data-duel] .duel-side[data-side=rival]{padding-top:calc(var(--w) * .62 + 40px)}}
@media(max-aspect-ratio:1/1) and (max-width:360px){.duel[data-duel]{--hconst:176px}}
@media(max-height:760px) and (max-aspect-ratio:1/1){.duel[data-duel]{--hconst:158px}}
@media(max-height:760px) and (max-width:360px){.duel[data-duel]{--hconst:188px}}
@media(max-width:360px){
 .duel-stage .duel-hp .duel-hp-unit{display:none}
 .duel-stage .duel-hp,.duel-stage .duel-mon-bench .duel-hp{padding:1px 3px 5px}
 .duel-stage .duel-hp b,.duel-stage .duel-mon-bench .duel-hp b{font-size:13px}
 .duel-stage .duel-count{min-width:20px;height:20px;font-size:14px}
 .duel-stage .duel-mon-bench .duel-actions .duel-move{inset:0 -8px}
}
/* Tableta vertical: la Banca compacta y los destinos de las pilas más justos, para no tapar cantidades ni al botón de barajar */
@media(min-width:601px) and (max-width:899px){.duel-stage .duel-mon-bench .duel-actions .duel-move{inset:0 -1px;max-width:none}.duel-stage .duel-stack>.duel-move,.duel-stage .duel-prize-stack>.duel-move{min-width:26px;padding:0}.duel-pile.is-target .duel-count,.duel-prizes.is-target .duel-count{visibility:hidden}.duel-pile-act{right:-34px;width:22px;height:22px}}
@media(max-height:760px) and (max-width:899px){#dlBar{gap:var(--s2)}}
.duel[data-duel]{--hconst:118px}
@media(max-aspect-ratio:1/1){.duel[data-duel]{--hconst:146px}}
@media(max-aspect-ratio:1/1) and (max-width:650px){.duel-stage .duel[data-duel] .duel-side[data-side=rival]{padding-top:calc(var(--w) * .62 + 30px)}}
@media(max-aspect-ratio:1/1) and (max-width:360px){.duel[data-duel]{--hconst:176px}}
@media(max-height:760px) and (max-aspect-ratio:1/1){.duel[data-duel]{--hconst:158px}}
@media(max-height:760px) and (max-width:360px){.duel[data-duel]{--hconst:178px}}
@media(max-width:360px){.duel-stage .duel-pile-name.duel-pile-open{padding:4px 2px;margin:0}}
.dl-attacks{flex:none}
#dlBar .dl-attack{flex-shrink:0}
.duel-stage .duel-mon-bench .duel-dmg{z-index:9}
@media(max-width:600px){.duel-stage .duel-mon-bench .duel-pip{width:15px;height:15px}.duel-stage .duel-mon-bench .duel-pip svg{width:9px;height:9px}.duel-stage .duel-mon-bench .duel-energies{bottom:17px}}
@media(max-width:360px){.duel-stage .duel-count{min-width:22px;height:22px;font-size:13px;padding:0 3px}.duel-stage .duel-lefts{margin-left:calc(var(--w) * .1 + 25px)}}
/* Con el selector de Energías abierto (móvil) sustituye a «Terminar turno» y a los ajustes: tiene su propio «Cancelar» y la mesa conserva su tamaño */
@media(max-width:899px){#dlStage.has-pick .dl-main,#dlStage.has-pick .dl-tools,#dlStage.has-pick #dlInfo .dl-last{display:none}}
@media(max-width:600px){.duel-stage .duel-mon-active .duel-hp-unit{display:none}}
/* Elección del motor (Entrenadores): hoja sobre la barra con la carta que la origina, qué elegir y las opciones (cartas, Pokémon de la mesa o texto) */
.dl-pk{position:absolute;left:0;right:0;bottom:0;z-index:60;display:flex;flex-direction:column;gap:var(--s2);max-height:min(74%,620px);padding:var(--s3);border-top:2px solid var(--gold);background:#0f1a16fa;box-shadow:0 -12px 32px #000a;color:var(--chalk)}
.dl-pk[hidden]{display:none}
.dl-pk-head{display:flex;align-items:flex-start;gap:var(--s3);flex:none}
.dl-pk-origin{flex:none;width:52px}
.dl-pk-origin .card-scene{width:100%}
.dl-pk-info{min-width:0;display:flex;flex-direction:column;gap:2px}
.dl-pk-who,.dl-pk-text,.dl-pk-effect,.dl-pk-hint,.dl-pk-live{margin:0}
.dl-pk-who{font-size:13px;line-height:18px;color:var(--chalk-dim)}
.dl-pk-who b{color:var(--chalk)}
.dl-pk-text{font-size:15px;line-height:20px;font-weight:800;color:var(--chalk)}
.dl-pk-effect{max-height:52px;overflow:auto;font-size:12px;line-height:16px;color:var(--chalk-dim)}
.dl-pk-hint{font-size:12px;line-height:16px;color:var(--gold)}
.dl-pk-live{flex:none;font-size:12px;line-height:16px;color:var(--chalk-dim)}
.dl-pk-list{display:flex;flex-wrap:wrap;align-content:flex-start;gap:var(--s2);flex:1 1 auto;min-height:0;overflow:auto;padding:3px;overscroll-behavior:contain}
.dl-opt{position:relative;display:flex;align-items:center;gap:var(--s2);min-width:44px;min-height:44px;padding:6px 10px;border:1.5px solid #ecf1ea66;border-radius:4px;background:#ffffff0d;color:var(--chalk);font:inherit;font-size:13px;line-height:16px;text-align:left;cursor:pointer}
.dl-opt:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.dl-opt-name{font-weight:800;overflow-wrap:break-word;hyphens:auto}
.dl-opt-cap{font-size:12px;line-height:15px;color:var(--chalk-dim);overflow-wrap:anywhere}
.dl-opt-card{flex-direction:column;width:96px;padding:4px;text-align:center;gap:3px}
.dl-opt-card .dl-opt-name{font-size:12px;line-height:14px}
.dl-opt-thumb{position:relative;display:block;width:100%}
.dl-opt-thumb .card-scene{width:100%}
.dl-opt-mon,.dl-opt-text{flex:1 1 150px}
.dl-opt-mon .dl-opt-cap{margin-left:auto;text-align:right}
.dl-opt-tick{display:inline-grid;place-items:center;flex:none;width:22px;height:22px;border-radius:50%;background:var(--gold);color:var(--felt);font:800 14px/1 sans-serif;visibility:hidden}
.dl-opt-card .dl-opt-tick{position:absolute;top:3px;right:3px;z-index:3;box-shadow:0 0 0 2px var(--felt)}
.dl-opt.is-on{border-color:var(--gold);background:#f2b70524;box-shadow:0 0 0 2px var(--gold)}
.dl-opt.is-on .dl-opt-tick{visibility:visible}
.dl-opt:disabled{opacity:.45;cursor:not-allowed}
.dl-pk .dl-pick-actions .abtn{flex:1 1 140px}
.duel-mon.is-picked .duel-mon-frame{outline:3px solid var(--gold);outline-offset:3px;border-radius:4px;box-shadow:0 0 14px 2px #f2b705aa}
@media(max-width:899px){.dl-pk{max-height:min(66%,520px);padding:var(--s2)}.dl-pk-origin{width:40px}.dl-pk-effect{max-height:34px}.dl-opt-card{width:80px}}
@media(max-height:760px) and (max-width:899px){.dl-pk-effect{display:none}.dl-pk-list{max-height:34vh}}
@media(prefers-reduced-motion:reduce){.dl-pk,.dl-opt{transition:none}}
#dlStage.pk-board .duel[data-duel]{bottom:var(--pk-h,0)}

/* Tanda 4: entrada numérica (Tyme), ataque concedido, Fósil Antiguo y Premios boca arriba */
.dl-num{display:flex;align-items:flex-end;gap:var(--s2);flex:none;width:100%;max-width:420px}
.dl-num-field{display:flex;flex-direction:column;gap:2px;flex:1 1 auto;min-width:0}
.dl-num-label{font-size:12px;line-height:16px;color:var(--chalk-dim)}
.dl-num-input{width:100%;min-height:44px;padding:6px 10px;border:1.5px solid #ecf1ea99;border-radius:4px;background:#ffffff14;color:var(--chalk);font:800 20px/1.1 var(--num,inherit);text-align:center}
.dl-num-input:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.dl-num-input[aria-invalid=true]{border-color:#ff8f8f;box-shadow:0 0 0 2px #ff8f8f66}
.duel-stage .dl-num-step{flex:none;width:44px;min-width:44px;min-height:44px;padding:0;font-size:24px;line-height:1}
.dl-attack-by{align-self:flex-start;padding:1px 6px;border:1px solid currentColor;border-radius:3px;font-size:12px;line-height:14px;font-weight:700}
.dl-sel-note{margin:0;font-size:12px;line-height:16px;color:var(--chalk-dim)}
.dl-opt-prize .table-card-back{max-width:60px;margin:0 auto}
.duel-card.duel-prize.is-faceup{z-index:4;outline:2px solid var(--gold);outline-offset:0;padding:0;border:0;background:none;cursor:pointer}
.duel-card.duel-prize.is-faceup .card-scene{width:100%}
@media(max-width:899px){.dl-fossil-note{max-height:48px;overflow:auto}}

/* Auditoría de la mesa libre: Energías, Herramienta y cartas unidas como botones con foco; Energías especiales legibles; PS máximos; Estadio seleccionable */
.duel-stage button.duel-pip{position:relative;min-height:0;min-width:0;padding:0;font-family:inherit}
.duel-stage button.duel-pip:hover,.duel-stage button.duel-pip:active{background:var(--pip);transform:none}
.duel-stage button.duel-pip:focus-visible,.duel-stage button.duel-badge:focus-visible{outline:2px solid var(--chalk);outline-offset:2px;z-index:6}
.duel-pip.is-special{box-shadow:0 0 0 2px var(--gold),0 1px 3px #0009}
.duel-pip-n{position:absolute;right:1px;bottom:1px;min-width:11px;height:11px;padding:0;border-radius:6px 0 6px 0;background:#10223a;color:#fff;font:800 12px/11px var(--num,inherit);text-align:center;pointer-events:none}
.duel-stage button.duel-badge{min-height:0;min-width:0;padding:0;font-family:inherit;cursor:pointer}
.duel-stage button.duel-badge.duel-tool:hover,.duel-stage button.duel-badge.duel-tool:active{background:#3a5c4c;transform:none}
.duel-tool,.duel-attached{z-index:5}
.duel-attached{left:-7px;bottom:-7px;background:#2d3f63}
.duel-stage button.duel-badge.duel-attached:hover,.duel-stage button.duel-badge.duel-attached:active{background:#2d3f63;transform:none}
.duel-badge.is-selected{outline:3px solid var(--gold);outline-offset:2px}
.duel-sel-dmglabel{font-size:12px;line-height:16px;font-weight:700;color:var(--chalk-dim)}
.duel-stadium button.is-selected{outline:3px solid var(--gold);outline-offset:2px}
.duel-pile-role{font-size:12px;font-weight:700;color:var(--gold)}
.duel-pile-info{font-size:12px;color:var(--chalk-dim)}
