/* World Adventure 2.5D battle hand. Cards stay readable DOM controls while sharing the 3D stage. */
.world-adventure-battle{grid-template-rows:auto minmax(570px,1fr)}
.world-adventure-combat{min-height:570px;grid-template-columns:minmax(0,1fr) 254px}
.world-adventure-stage{min-height:570px;grid-template-rows:minmax(570px,1fr);overflow:hidden;perspective:1100px}
.world-adventure-arena{min-height:570px}
.world-adventure-duel{padding-bottom:218px}
.world-adventure-command{position:relative;z-index:12;grid-column:1/-1;grid-row:1;align-self:end;min-width:0;height:224px;padding:0 112px 12px;border:0;background:transparent;pointer-events:none;transform-style:preserve-3d}
.world-adventure-command:before{content:"";position:absolute;z-index:-1;left:7%;right:7%;bottom:-28px;height:164px;border-top:1px solid #6f8d916e;background:#081016dc;box-shadow:0 -22px 50px #0610159c;transform:perspective(700px) rotateX(62deg);transform-origin:center bottom;pointer-events:none}
.world-adventure-command-head{position:relative;z-index:80;width:min(620px,86%);min-height:42px;margin:0 auto -3px;padding:6px 8px 6px 12px;border:1px solid #52717c;background:#101d25e8;box-shadow:0 10px 26px #0009;pointer-events:auto}
.world-adventure-command-head small{color:#a9bec5;font-size:10px}.world-adventure-command-head strong{color:#eef5f6;font-size:12px}.world-adventure-command-head button{height:32px;min-width:116px}
.world-adventure-hand{position:relative;z-index:20;min-height:166px;display:flex;align-items:flex-end;justify-content:center;gap:0;overflow:visible;perspective:900px;pointer-events:auto;touch-action:none}
.world-adventure-card{--wa-accent:#79d7d2;position:relative;flex:0 0 146px;width:146px;height:176px;min-height:0;margin:0 -10px;padding:0;border:2px solid #314d59;border-radius:8px;background:#121d24;color:#edf4f5;box-shadow:0 16px 28px #000b,inset 0 0 0 2px #0b1318,inset 0 0 34px #28424e5c;overflow:hidden;text-align:left;transform-origin:50% 125%;transform:translateY(var(--wa-rise,0)) rotate(var(--wa-angle,0deg)) translateZ(0);transition:transform .2s cubic-bezier(.2,.75,.2,1),border-color .18s ease,box-shadow .18s ease,filter .18s ease;z-index:calc(20 + var(--wa-order,0));cursor:grab;user-select:none;-webkit-user-select:none;touch-action:none}
.world-adventure-card:before{content:"";position:absolute;inset:4px;border:1px solid color-mix(in srgb,var(--wa-accent) 50%,#21333d);border-radius:5px;pointer-events:none}.world-adventure-card:after{content:"";position:absolute;left:22px;right:22px;top:68px;height:1px;background:var(--wa-accent);box-shadow:0 0 12px var(--wa-accent);opacity:.72;pointer-events:none}
.world-adventure-card+.world-adventure-card{margin-left:-8px}
.world-adventure-card:hover,.world-adventure-card:focus-visible,.world-adventure-card.selected{border-color:var(--wa-accent);background:#17262f;box-shadow:0 24px 38px #000d,0 0 0 1px var(--wa-accent),0 0 24px color-mix(in srgb,var(--wa-accent) 42%,transparent);transform:translateY(-25px) rotate(0deg) scale(1.055);z-index:70;outline:0}
.world-adventure-card.dragging{cursor:grabbing;transition:none;transform:translate3d(var(--wa-drag-x,0),var(--wa-drag-y,0),120px) rotate(var(--wa-drag-rotate,0deg)) scale(1.08);z-index:100;filter:brightness(1.1);box-shadow:0 30px 54px #000e,0 0 28px color-mix(in srgb,var(--wa-accent) 58%,transparent)}
.world-adventure-card.locked{border-color:#6a4e45;background:#251d1b;cursor:not-allowed}.world-adventure-card.locked:hover{transform:translateY(var(--wa-rise,0)) rotate(var(--wa-angle,0deg));box-shadow:0 16px 28px #000b}
.world-adventure-card .wa-card-orb{position:absolute;z-index:3;left:9px;top:9px;width:34px;height:34px;border:2px solid #dce9e9;border-radius:50%;display:grid;place-items:center;background:var(--wa-accent);color:#071014;box-shadow:0 3px 10px #000b,0 0 14px color-mix(in srgb,var(--wa-accent) 55%,transparent)}
.world-adventure-card .wa-card-orb svg{width:17px;height:17px;stroke-width:2.5}.world-adventure-card .wa-card-priority{position:absolute;z-index:3;right:8px;top:10px;max-width:78px;color:var(--wa-accent);font:900 8px var(--display);font-style:normal;text-align:right}
.world-adventure-card .wa-card-art{position:absolute;left:9px;right:9px;top:8px;height:65px;border-radius:5px;background:#1d313b;display:grid;place-items:center;overflow:hidden}.world-adventure-card .wa-card-art>svg{width:42px;height:42px;color:var(--wa-accent);filter:drop-shadow(0 0 10px color-mix(in srgb,var(--wa-accent) 60%,transparent))}.world-adventure-card .wa-card-art img{width:74px;height:62px;object-fit:contain;filter:drop-shadow(0 8px 8px #000a)}
.world-adventure-card .wa-card-copy{position:absolute;left:9px;right:9px;top:77px;bottom:9px;padding:8px 7px;border:1px solid #38525c;background:#0d171d;overflow:hidden;text-align:center}.world-adventure-card .wa-card-copy b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#f1f5f4;font:900 12px var(--display)}.world-adventure-card .wa-card-copy small{display:-webkit-box;margin-top:6px;overflow:hidden;-webkit-line-clamp:3;-webkit-box-orient:vertical;color:#afc0c5;font-size:9px;line-height:1.42}
.world-adventure-card.wa-switch-card .wa-card-copy small{-webkit-line-clamp:2}.world-adventure-card .wa-card-hp{display:block;height:4px;margin-top:7px;background:#293b42}.world-adventure-card .wa-card-hp i{display:block;height:100%;background:#72d4a2}
.world-adventure-switches{position:absolute;z-index:75;left:12px;bottom:12px;margin:0;pointer-events:none}.world-adventure-switches>span{padding:5px 7px;border:1px solid #42606b;background:#101d25dd;color:#b6c7cb;font-size:9px}
.world-adventure-deck{position:absolute;z-index:76;right:12px;bottom:10px;width:108px;height:76px;display:grid;grid-template-columns:30px 48px 26px;gap:2px;align-items:end;pointer-events:none;color:#dce9e9}.world-adventure-deck span{letter-spacing:0}.world-adventure-deck strong{font-family:var(--display);font-size:15px;line-height:1}
.wa-deck-pile{position:relative;width:48px;height:66px;transform-origin:center bottom;filter:drop-shadow(0 10px 9px #000b)}.wa-deck-pile:before,.wa-deck-pile:after{content:"";position:absolute;inset:3px;border:1px solid #526e78;border-radius:6px;background:#111d24}.wa-deck-pile:before{transform:translate(-5px,-3px) rotate(-4deg)}.wa-deck-pile:after{transform:translate(-2px,-1px) rotate(-2deg)}.wa-deck-card{position:absolute;z-index:2;inset:3px;display:grid;place-items:center;border:2px solid #d2b45d;border-radius:6px;background:#172630;box-shadow:inset 0 0 0 3px #0c151b,inset 0 0 0 4px #49636d;color:#f3d87e}.wa-deck-card svg{width:20px;height:20px;filter:drop-shadow(0 0 7px #e6bd50)}.wa-deck-pile.empty{filter:grayscale(1) brightness(.55);opacity:.62}.wa-deck-pile.drawing{animation:wa-deck-pulse .5s ease}
.wa-deck-count,.wa-discard-pile{display:grid;justify-items:center;align-content:end;gap:2px;padding-bottom:3px}.wa-deck-count span,.wa-discard-pile span{color:#9fb4ba;font-size:7px}.wa-discard-pile{height:50px;border-bottom:2px solid #694e52;color:#e8a1a1}.wa-discard-pile svg{width:15px;height:15px}.wa-discard-pile strong{font-size:11px}.wa-discard-pile.receiving{animation:wa-discard-receive .48s ease}
.world-adventure-battle.wa-dealing .world-adventure-card,.world-adventure-battle.wa-dealing .world-adventure-team{pointer-events:none}.world-adventure-card.wa-card-entering{opacity:0!important;transform:translateY(22px) rotate(0deg) scale(.82)!important}.world-adventure-card.wa-card-arrived{animation:wa-card-arrive .48s cubic-bezier(.18,.76,.22,1) both}
.wa-draw-flight{position:fixed!important;z-index:2147482600!important;margin:0!important;pointer-events:none!important;transform:none;transform-origin:center!important;transition:transform var(--wa-draw-time,.46s) cubic-bezier(.18,.76,.16,1),opacity var(--wa-draw-time,.46s) ease!important}.wa-draw-flight .wa-deck-card{inset:3px}
@keyframes wa-deck-pulse{0%,100%{transform:none}35%{transform:translateY(-7px) rotate(-3deg)}65%{transform:translateY(-2px) rotate(2deg)}}@keyframes wa-discard-receive{0%,100%{color:#e8a1a1}45%{color:#fff2b0;filter:drop-shadow(0 0 9px #efc45e)}}@keyframes wa-card-arrive{0%{opacity:0;transform:translateY(22px) rotate(0deg) scale(.82)}62%{opacity:1;transform:translateY(calc(var(--wa-rise,0) - 9px)) rotate(0deg) scale(1.04)}100%{opacity:1;transform:translateY(var(--wa-rise,0)) rotate(var(--wa-angle,0deg)) scale(1)}}
.world-adventure-drop-zone{position:relative;z-index:9;grid-column:2;grid-row:1;align-self:start;justify-self:stretch;height:210px;margin:86px 8% 0;border:1px dashed #7acdc66b;border-radius:8px;display:grid;place-items:center;color:#82d9d2;opacity:0;transform:translateY(14px) scale(.96);transition:opacity .16s ease,transform .16s ease,border-color .16s ease,background .16s ease;pointer-events:none}
.world-adventure-drop-zone:before,.world-adventure-drop-zone:after{content:"";position:absolute;width:54px;height:54px;border:1px solid currentColor;border-radius:50%}.world-adventure-drop-zone:after{width:92px;height:92px;opacity:.34}.world-adventure-drop-zone svg{width:22px;height:22px}
.world-adventure-battle.wa-resolving .world-adventure-card,.world-adventure-battle.wa-resolving .world-adventure-team{pointer-events:none}.world-adventure-battle.wa-resolving .world-adventure-card:not(.wa-card-flight){filter:saturate(.55) brightness(.7)}
.wa-card-flight{position:fixed!important;z-index:2147482500!important;margin:0!important;pointer-events:none!important;transform:translate3d(0,0,0);transition:transform var(--wa-flight-time,.4s) cubic-bezier(.2,.72,.16,1),opacity var(--wa-flight-time,.4s) ease,filter var(--wa-flight-time,.4s) ease!important;transform-origin:center!important}
.wa-card-cast{position:absolute;z-index:10;width:44px;height:44px;border:2px solid var(--wa-cast-color,#f0c964);border-radius:50%;pointer-events:none;box-shadow:0 0 22px var(--wa-cast-color,#f0c964);animation:wa-card-cast .48s ease-out both}
@keyframes wa-card-cast{0%{opacity:0;transform:scale(.25)}32%{opacity:1}100%{opacity:0;transform:scale(2.8)}}
.world-adventure-battle.wa-low-fx .world-adventure-card{box-shadow:0 10px 20px #000b}.world-adventure-battle.wa-low-fx .world-adventure-card:before,.world-adventure-battle.wa-low-fx .world-adventure-card:after{box-shadow:none}.world-adventure-battle.wa-low-fx .world-adventure-command:before{box-shadow:none}.world-adventure-battle.wa-low-fx .world-adventure-drop-zone:after{display:none}
@media(max-width:1180px){.world-adventure-command{padding-left:90px;padding-right:90px}.world-adventure-card{flex-basis:136px;width:136px}.world-adventure-combat{grid-template-columns:minmax(0,1fr) 212px}}
@media(max-width:900px){.world-adventure-battle{grid-template-rows:auto minmax(540px,1fr)}.world-adventure-combat{min-height:540px;grid-template-columns:1fr}.world-adventure-stage,.world-adventure-arena{min-height:540px}.world-adventure-command{height:214px;padding:0 60px 10px}.world-adventure-duel{padding-bottom:208px}.world-adventure-log{max-height:160px}.world-adventure-drop-zone{height:205px;margin-top:75px}}
@media(max-width:640px){.world-adventure-battle{grid-template-rows:auto minmax(500px,1fr)}.world-adventure-combat{min-height:500px}.world-adventure-stage,.world-adventure-arena{min-height:500px}.world-adventure-command{height:174px;padding:0 6px 6px}.world-adventure-command:before{left:-5%;right:-5%;height:128px;bottom:-25px}.world-adventure-command-head{width:min(360px,96%);min-height:36px;margin-bottom:-5px;padding:4px 5px 4px 8px}.world-adventure-command-head small{font-size:8px}.world-adventure-command-head strong{font-size:9px}.world-adventure-command-head button{height:29px;min-width:92px;font-size:9px}.world-adventure-hand{min-height:137px;justify-content:center;padding-right:64px;box-sizing:border-box}.world-adventure-card{flex:0 0 108px;width:108px;height:137px;margin:0 -8px;border-radius:7px}.world-adventure-card+.world-adventure-card{margin-left:-6px}.world-adventure-hand[data-card-count="4"] .world-adventure-card+.world-adventure-card{margin-left:-44px}.world-adventure-hand[data-card-count="5"] .world-adventure-card+.world-adventure-card{margin-left:-60px}.world-adventure-card:hover,.world-adventure-card:focus-visible,.world-adventure-card.selected{transform:translateY(-15px) rotate(0) scale(1.035)}.world-adventure-card .wa-card-art{left:6px;right:6px;top:5px;height:48px}.world-adventure-card .wa-card-art>svg{width:29px;height:29px}.world-adventure-card .wa-card-art img{width:54px;height:45px}.world-adventure-card .wa-card-orb{left:5px;top:5px;width:25px;height:25px}.world-adventure-card .wa-card-orb svg{width:13px;height:13px}.world-adventure-card .wa-card-priority{right:5px;top:6px;max-width:61px;font-size:6px}.world-adventure-card:after{left:15px;right:15px;top:52px}.world-adventure-card .wa-card-copy{left:6px;right:6px;top:57px;bottom:6px;padding:6px 4px}.world-adventure-card .wa-card-copy b{font-size:9px}.world-adventure-card .wa-card-copy small{margin-top:4px;font-size:7px;line-height:1.3}.world-adventure-card .wa-card-hp{height:3px;margin-top:4px}.world-adventure-switches{left:5px;bottom:5px}.world-adventure-switches>span{padding:3px 4px;font-size:7px}.world-adventure-deck{right:0;bottom:3px;width:56px;height:58px;display:block}.world-adventure-deck .wa-deck-pile{position:absolute;right:7px;bottom:0;width:38px;height:52px}.world-adventure-deck .wa-deck-count,.world-adventure-deck .wa-discard-pile{position:absolute;z-index:4;bottom:0;width:19px;height:19px;display:grid;place-items:center;padding:0;border:1px solid #6c7f85;border-radius:50%;background:#101d25}.world-adventure-deck .wa-deck-count{right:0;color:#f3d87e}.world-adventure-deck .wa-discard-pile{left:0;border-color:#72545a;color:#e8a1a1}.world-adventure-deck .wa-deck-count span,.world-adventure-deck .wa-discard-pile span,.world-adventure-deck .wa-discard-pile svg{display:none}.world-adventure-deck .wa-deck-count strong,.world-adventure-deck .wa-discard-pile strong{font-size:9px}.world-adventure-duel{padding-bottom:166px}.world-adventure-drop-zone{grid-column:1/-1;width:48%;height:170px;margin:80px auto 0}.world-adventure-log{max-height:140px}.world-adventure-result{inset:102px 0 0}}
@media(prefers-reduced-motion:reduce){.world-adventure-card,.world-adventure-drop-zone,.wa-card-flight,.wa-draw-flight{transition-duration:.01ms!important}.wa-card-cast,.wa-card-arrived,.wa-deck-pile.drawing,.wa-discard-pile.receiving{animation:none!important}}
/* Restore the roster treatment used by the original battle board. */
.world-adventure-card.is-dragging{opacity:.34}
.world-adventure-card.selected .wa-card-orb{animation:wa-card-orb-pulse 1.05s ease-in-out infinite}
.world-adventure-card.selected .wa-card-art{filter:brightness(1.16) saturate(1.12)}
.world-adventure-card.drop-ready{animation:wa-card-ready-pulse .9s ease-in-out infinite alternate}
@keyframes wa-card-orb-pulse{50%{box-shadow:0 3px 10px #000b,0 0 24px color-mix(in srgb,var(--wa-accent) 86%,transparent);transform:scale(1.08)}}
@keyframes wa-card-ready-pulse{from{filter:brightness(1.04) saturate(1.05)}to{filter:brightness(1.2) saturate(1.18)}}

/* Compatibility with the current pointer-based drag controller. */
.world-adventure-card.is-dragging{cursor:grabbing;transition:none;transform:translate3d(0,0,120px) rotate(0deg) scale(1.08);z-index:100;filter:brightness(1.1);box-shadow:0 30px 54px #000e,0 0 28px color-mix(in srgb,var(--wa-accent) 58%,transparent)}
.world-adventure-card.drop-ready{border-color:#f0c964;background:#1d3035;box-shadow:0 0 0 1px #f0c964,0 0 26px #f0c96466;z-index:100}
.world-adventure-top-command{position:absolute;z-index:18;top:82px;left:50%;width:min(620px,calc(100% - 36px));min-height:36px;margin:0;padding:7px 14px;display:flex;align-items:center;justify-content:center;transform:translateX(-50%);border-color:#527c70;background:#101d25ed;box-shadow:0 9px 28px #0009;pointer-events:none;text-align:center}
.world-adventure-top-command small{color:#9db8ad;font-size:9px;text-transform:uppercase;letter-spacing:.08em}.world-adventure-top-command strong{display:block;margin-top:2px;color:#eef5f6;font-size:12px}.world-adventure-top-command.ready{border-color:#dfc75c;box-shadow:0 0 0 1px #dfc75c55,0 0 30px #e4c55a55,0 9px 28px #0009}.world-adventure-top-command.ready strong{color:#fff0a5;text-shadow:0 0 14px #efcf66}.world-adventure-top-command.busy{border-color:#7185c0}.world-adventure-top-command.busy strong{color:#c5d3ff}.world-adventure-top-command.invalid strong{color:#c1d0d2}
.world-adventure-card.dragging.drop-ready{border-color:#f7df76;background:#1d3035;filter:brightness(1.2) saturate(1.18);box-shadow:0 30px 54px #000e,0 0 0 2px #f7df76,0 0 34px #f0c964aa,inset 0 0 28px #f0c96433}
.world-adventure-card.dragging.drop-ready:before{border-color:#ffe58a;box-shadow:0 0 15px #f0c964aa;animation:wa-card-frame-pulse .72s ease-in-out infinite alternate}
.world-adventure-card.dragging.drop-ready:after{height:2px;opacity:1;box-shadow:0 0 18px #ffe58a,0 0 34px #f0c96488}
@keyframes wa-card-frame-pulse{from{inset:4px;opacity:.65}to{inset:2px;opacity:1}}
.world-adventure-drag-ghost{position:fixed;z-index:2147482500;pointer-events:none;opacity:.9;filter:drop-shadow(0 18px 22px #000b);transform-origin:center;will-change:transform;cursor:grabbing}
.world-adventure-drag-ghost svg{pointer-events:none}
.world-adventure-switches{pointer-events:auto}
.world-adventure-switch-toggle{display:inline-grid;place-items:center;width:38px;height:34px;padding:0;border:1px solid #496b69;background:#162925;color:#a7d9d0;cursor:pointer;transition:border-color .16s ease,background .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease}
.world-adventure-switch-toggle svg{width:17px;height:17px}
.world-adventure-switch-toggle span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.world-adventure-switch-toggle:hover:not(:disabled){border-color:#78dcd0;background:#1c3834;color:#d8fff8}
.world-adventure-switch-toggle.active{border-color:#e2c765;background:#2b301e;color:#ffe899;box-shadow:0 0 0 1px #e1c46055,0 0 16px #e4c55a66;animation:worldAdventureSwitchPulse 1.15s ease-in-out infinite}
.world-adventure-switch-toggle.locked,.world-adventure-switch-toggle:disabled{cursor:not-allowed;opacity:.5;animation:none}
@keyframes worldAdventureSwitchPulse{50%{transform:scale(1.04);box-shadow:0 0 0 2px #e1c46033,0 0 22px #e4c55a88}}
.world-adventure-card.dealing{animation:worldAdventureCardDeal var(--deal-duration,300ms) cubic-bezier(.18,.78,.25,1.08) var(--deal-delay,0ms) both}
@keyframes worldAdventureCardDeal{from{opacity:0;transform:translateY(24px) scale(.72) rotate(-2deg)}to{opacity:1;transform:translateY(var(--wa-rise,0)) scale(1) rotate(var(--wa-angle,0deg))}}
@media(max-width:640px){.world-adventure-top-command{top:111px;width:calc(100% - 16px);min-height:30px;padding:4px 8px}.world-adventure-top-command small{font-size:7px}.world-adventure-top-command strong{font-size:9px}}
@media(max-width:640px){.world-adventure-command{height:174px;padding:0 6px 6px}.world-adventure-hand{min-height:137px}.world-adventure-card{flex-basis:108px;width:108px;height:137px;margin:0 -8px}.world-adventure-card+.world-adventure-card{margin-left:-6px}.world-adventure-card .wa-card-art{left:6px;right:6px;top:5px;height:48px}.world-adventure-card .wa-card-art>svg{width:29px;height:29px}.world-adventure-card .wa-card-art img{width:54px;height:45px}.world-adventure-card .wa-card-orb{left:5px;top:5px;width:25px;height:25px}.world-adventure-card .wa-card-orb svg{width:13px;height:13px}.world-adventure-card .wa-card-priority{right:5px;top:6px;max-width:61px;font-size:6px}.world-adventure-card:after{left:15px;right:15px;top:52px}.world-adventure-card .wa-card-copy{left:6px;right:6px;top:57px;bottom:6px;padding:6px 4px}.world-adventure-card .wa-card-copy b{font-size:9px}.world-adventure-card .wa-card-copy small{margin-top:4px;font-size:7px;line-height:1.3}.world-adventure-card .wa-card-hp{height:3px;margin-top:4px}.world-adventure-switches{left:5px;bottom:5px}.world-adventure-deck{right:0;bottom:3px;width:56px;height:58px;display:block}.world-adventure-deck .wa-deck-pile{position:absolute;right:7px;bottom:0;width:38px;height:52px}.world-adventure-deck .wa-deck-card svg{width:15px;height:15px}.world-adventure-deck .wa-deck-count,.world-adventure-deck .wa-discard-pile{position:absolute;z-index:4;bottom:0;width:19px;height:19px;display:grid;place-items:center;padding:0;border:1px solid #6c7f85;border-radius:50%;background:#101d25}.world-adventure-deck .wa-deck-count{right:0;color:#f3d87e}.world-adventure-deck .wa-discard-pile{left:0;border-color:#72545a;color:#e8a1a1}.world-adventure-deck .wa-deck-count span,.world-adventure-deck .wa-discard-pile span,.world-adventure-deck .wa-discard-pile svg{display:none}.world-adventure-deck .wa-deck-count strong,.world-adventure-deck .wa-discard-pile strong{font-size:9px}}
/* Draws use the actual card face so the action is readable on the way to the hand or discard pile. */
.world-adventure-card.wa-draw-flight{position:fixed!important;z-index:2147482600!important;flex:none!important;margin:0!important;pointer-events:none!important;transform-origin:center!important;transition:transform var(--wa-draw-time,.46s) cubic-bezier(.18,.76,.16,1),opacity var(--wa-draw-time,.46s) ease,filter var(--wa-draw-time,.46s) ease!important;will-change:transform,opacity,filter}
.world-adventure-card.wa-overflow-flight{filter:brightness(1.12) saturate(1.08);box-shadow:0 22px 40px #000d,0 0 26px color-mix(in srgb,var(--wa-accent) 52%,transparent)}
