/* A single physical arena, with proportional cards at 1440p. */
.table-active #play-view{background:#102e46 url('assets/arena/anime-sea.svg') center/cover no-repeat;color:#e9f1f5}
.table-active #match-table{color:#e9f1f5;padding:0 1.1vw 8px;grid-template-rows:52px minmax(0,1fr) 18px;background:linear-gradient(90deg,#02091488,transparent 30% 70%,#02091488)}
.table-active .table-topbar h2{color:#f6deb0;font-size:20px!important}.table-topbar small{color:#91a7b7}.table-active .table-topbar button{color:#d9e4ee;background:#0b1b29;border-color:#446074}.table-active .table-mode{color:#b7c6d2}
.table-active .table-layout{grid-template-columns:minmax(220px,16fr) minmax(0,65fr) minmax(260px,19fr);gap:1.2vw}
.table-active .table-board{background:transparent;border:0;border-radius:0;box-shadow:none;grid-template-rows:minmax(0,1fr) 42px minmax(0,1fr);overflow:visible}
.table-active .auto-player,.table-active .table-player.own,.table-active .auto-player.opponent{background:linear-gradient(0deg,#09283b35,transparent);color:#e9eff5;padding:12px 20px;border:0;gap:12px}
.table-active .auto-player.opponent{background:linear-gradient(180deg,#57352230,transparent)}
.table-active .auto-player .table-player-heading{min-height:28px;flex-basis:28px;margin:0;border-bottom:1px solid #b8945540;padding-bottom:8px}
.table-active .auto-player .table-player-heading strong{font-size:clamp(12px,1vw,23px);letter-spacing:.04em;color:#f1dab1}.table-active .auto-player .table-player-heading>span{font-size:clamp(10px,.8vw,18px);opacity:1;color:#b6cbd9}
.table-active .auto-public{grid-template-columns:minmax(0,1fr) clamp(75px,8vw,190px) minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,1fr);gap:16px 24px}
.table-active .auto-characters{border:0;border-bottom:1px solid #d5b87c3d;background:radial-gradient(ellipse at center,#4ac6e012,transparent 70%);border-radius:0;padding:12px 0 8px;gap:clamp(12px,2vw,48px);justify-content:center}
.table-active .auto-characters .table-card,.table-active .auto-characters .table-slot{max-height:none;height:100%;max-width:17%;width:auto;flex:0 1 auto}
.table-active .auto-leader .table-card{max-height:none;height:100%;width:auto;max-width:100%}.table-active .auto-leader{filter:drop-shadow(0 0 20px #e3b85633)}
.table-active .auto-leader>small{position:absolute;left:50%;top:auto;bottom:-15px;transform:translateX(-50%);color:#e6c27e;font-size:10px;letter-spacing:.2em}
.table-active .zone-caption,.table-active .opponent .zone-caption{background:none;color:#b6c6d5;top:-5px;left:0;font-size:10px;letter-spacing:.23em}
.table-active .table-slot{border:1px solid #ccab6255;background:linear-gradient(145deg,#adc2d008,#02080f33);border-radius:9px;box-shadow:inset 0 0 20px #0003}.table-active .table-slot:after{content:'◇';color:#b9965155;font-size:30px}
.table-active .table-card{background:#06121c;border:1px solid #bfa66c77;box-shadow:0 10px 14px #0009;border-radius:7px}.table-active .table-card b{font-size:clamp(10px,.75vw,17px)!important;color:#fff3d2;background:linear-gradient(90deg,#10212ff5,#233d4bf5);border-color:#d1b47977;padding:5px 0;text-shadow:0 1px 3px #000}
.table-active .table-card.selected{outline:2px solid #ffdb80!important;box-shadow:0 0 20px #e3b85655,0 10px 14px #0009}.table-active .table-card.legal{border-color:#70dcec;box-shadow:0 0 0 1px #70dcec77,0 10px 14px #0009}.table-active .table-card:hover{box-shadow:0 0 0 2px #f4d189,0 0 24px #efc96655}
.table-active .auto-resources{max-width:none;display:flex;align-items:center;gap:18px}.table-active .auto-don{flex:1;min-width:0}.table-active .auto-don>span{font-size:clamp(10px,.72vw,17px);color:#b9cedb;display:block}.table-active .auto-don>span strong{font-size:clamp(20px,1.8vw,38px);color:#fff3d1}
.table-active .auto-don>div{padding:12px 5px;min-height:45px;align-items:center}
.table-active #match-table .don-card{width:clamp(25px,3.2vw,78px);height:clamp(35px,4.5vw,109px);margin-right:clamp(-53px,-2.1vw,-15px);border:1px solid #b8c8d2;background:#fff;padding:0;box-shadow:2px 4px 8px #0009;border-radius:4px;position:relative;opacity:1}
.table-active .don-card img{display:block;width:100%;height:100%;object-fit:contain;border-radius:3px}.table-active #match-table .don-card.picked{transform:translateY(-8px);border-color:#ffc85d;box-shadow:0 0 0 2px #e8b951,0 0 18px #ffc85d55}.table-active #match-table .don-card.rested{transform:rotate(90deg) scale(.72);opacity:.7;margin-left:8px}
.table-active .auto-stage{height:clamp(45px,6vw,145px);flex:0 0 auto;margin:0}.table-active .auto-stage .table-card{height:100%!important;width:auto;aspect-ratio:63/88}.table-active .stage-placeholder{height:100%;display:grid;place-items:center;padding:6px;border-color:#aeb6b755;color:#afbac4;font-size:10px}
.table-active .auto-piles{grid-template-columns:minmax(0,1.65fr) minmax(0,1fr) minmax(0,1fr);gap:clamp(8px,1.2vw,28px);width:100%;align-items:center;justify-items:center}
.table-active .auto-piles img{width:clamp(27px,4vw,98px);height:clamp(38px,5.6vw,137px);object-fit:contain;filter:drop-shadow(3px 5px 0 #050e18) drop-shadow(0 5px 6px #0009)}
.table-active .life-stack{white-space:nowrap;text-align:center;min-width:0}.table-active .life-stack img{margin-right:clamp(-63px,-2.6vw,-17px)}.table-active .life-stack img:last-of-type{margin-right:0}
.table-active .auto-piles strong{display:block;font-size:clamp(11px,1vw,23px);font-weight:700;letter-spacing:.1em;color:#f6deb1;white-space:nowrap;margin-top:12px;text-align:center}
.table-active .auto-piles .trash-stack{grid-column:auto;padding:0;background:none;color:#f6deb1;border:0;box-shadow:none;display:block}.table-active .empty-trash{display:grid;place-items:center;width:clamp(27px,4vw,98px);height:clamp(38px,5.6vw,137px);border:1px solid #b3c9d266;border-radius:5px;color:#7893a8;font-size:clamp(20px,2vw,45px);background:#09142166}
.table-active .table-turn-line{border:1px solid #b8974f55;border-left:0;border-right:0;background:linear-gradient(90deg,transparent,#132b39d9,transparent);color:#ffdea2;box-shadow:0 0 24px #45c9ed15}.table-active .table-turn-indicator{font-size:clamp(12px,1vw,22px);color:#f5dfb7;letter-spacing:.09em}.table-active .turn-dot{background:#65e0f5;box-shadow:0 0 14px #65e0f5;width:8px;height:8px}.table-active .turn-number{font-size:clamp(10px,.7vw,16px);color:#b1c4d0}
.table-active .table-sidebar{grid-template-rows:16% minmax(100px,1fr) 42%;gap:18px}.table-active .opponent-cards,.table-active .table-hand,.table-active .table-communication{background:linear-gradient(150deg,#0c1e2ee8,#08121ccb);border:1px solid #8e795344;border-radius:10px;color:#d4e0e9;box-shadow:0 12px 30px #0003}
.table-active .opponent-cards{padding:15px}.table-active .concealed-fan{height:calc(100% - 35px);padding-top:12px}.table-active .concealed-fan img{max-width:25%;margin-left:-10%;filter:drop-shadow(2px 5px 4px #0008)}.table-active .concealed-fan img:first-child{margin-left:0}
.table-active .table-hand-heading,.table-active .opponent-cards .table-hand-heading{color:#c8d8e2;font-size:clamp(10px,.72vw,16px);letter-spacing:.09em}.table-active .table-hand-heading button{background:#193443;color:#f8ddb0;border-color:#927b4a}
.table-active .table-hand-cards{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:12px 8px}.table-active .table-hand-cards .table-card{max-height:100%;max-width:100%}
.table-active .table-events{font-size:clamp(11px,.8vw,17px);padding:14px}.table-active .table-events li{color:#a8bccb;border-color:#5e798733}.table-active .table-events li:first-child{color:#f0dfbb}.table-active .table-events li strong{font-size:clamp(10px,.65vw,14px);color:#7199b1}.table-active .table-rail-tabs button{color:#b8cddd;background:transparent;font-size:clamp(11px,.8vw,17px)!important}.table-active .table-rail-tabs button.active{color:#f9dda3;border-color:#ddb467}
.table-active .table-rail{gap:16px}.table-active .table-detail{background:linear-gradient(160deg,#162a3be6,#07111ce8);border:1px solid #ac8f5344;border-radius:12px;padding:18px;gap:12px;box-shadow:0 16px 35px #0005}.table-active .table-art-button img{filter:drop-shadow(0 12px 16px #0009)}.table-active .table-detail h3{font-size:clamp(16px,1.15vw,27px);color:#f4dfb9}.table-active .table-detail p{font-size:clamp(11px,.8vw,17px);color:#a5bccb}.table-active .table-detail>button:not(.table-art-button){color:#e6c791;font-size:clamp(11px,.8vw,17px)}
.table-active #table-actions{background:#091724df;border:1px solid #9e895c55;padding:18px;border-radius:10px}.table-active #table-actions h3{font-size:clamp(14px,1vw,23px);color:#f7e1b4}.table-active .table-hint{color:#a4b8c8;font-size:clamp(11px,.8vw,17px)}
.table-active #match-table .button{min-height:42px;font-size:clamp(12px,.85vw,20px)!important;padding:10px 14px!important;background:linear-gradient(135deg,#213f53,#152c3d);color:#e4edf4;border:1px solid #6b8ea0;border-radius:7px}.table-active #match-table .button:hover{border-color:#efc16b;box-shadow:0 0 16px #d5a75030}.table-active .auto-prompt{background:linear-gradient(130deg,#214457e8,#102c3ef0);border:1px solid #6ba3b799;padding:18px;box-shadow:0 8px 30px #0004}.table-active .auto-prompt h3{font-size:clamp(16px,1.1vw,26px);color:#f5e3be}.table-active .auto-prompt p{font-size:clamp(12px,.85vw,19px);color:#c0d3e0}.table-active #match-table .auto-prompt>.button{background:linear-gradient(135deg,#fae4ad,#c89b4f)!important;color:#172a37!important;border-color:#ffda8e!important;font-weight:750;box-shadow:0 4px 18px #dcad5f33}.table-active .battle-power b{font-size:clamp(26px,2.3vw,50px)}.table-active .battle-power span{font-size:12px}
.match-result{position:fixed;inset:72px 0 0;z-index:100;display:grid;place-items:center;overflow:hidden;background:radial-gradient(ellipse,#071521c9,#020811ed);--result:#57f6e7;--result-other:#d9b756;animation:result-enter .7s ease-out both}.match-result.defeat{--result:#ff527f;--result-other:#bc65f6}.result-content{text-align:center;z-index:1;width:100%;padding:30px}.result-content>p{letter-spacing:.45em;font-size:clamp(12px,1.1vw,24px);color:#d2e4eb;margin-bottom:30px}.table-active #match-table .result-content h2{font-size:clamp(40px,5.8vw,145px)!important;line-height:1.15;font-weight:900;letter-spacing:-.03em;color:#f0fffc;text-shadow:0 0 8px var(--result),0 0 30px var(--result),0 0 80px var(--result);margin:0}.result-content strong{color:#c5d8e6;font-size:clamp(16px,1.2vw,26px);font-weight:400}.result-rule{display:block;width:40%;height:2px;margin:45px auto;background:linear-gradient(90deg,transparent,var(--result),transparent);box-shadow:0 0 20px var(--result)}.result-orbit{position:absolute;width:70vmin;height:70vmin;border:1px solid var(--result);border-radius:50%;opacity:.3;box-shadow:0 0 70px var(--result),inset 0 0 70px var(--result);animation:result-ring 1.4s ease-out both}.result-orbit:after{content:'';position:absolute;inset:-8%;border:1px dashed var(--result-other);border-radius:50%}@keyframes result-enter{from{opacity:0}to{opacity:1}}@keyframes result-ring{from{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:.3}}
@media(max-width:1600px){.table-active .table-layout{grid-template-columns:minmax(180px,18fr) minmax(0,62fr) minmax(210px,20fr);gap:10px}.table-active .auto-player{padding:8px;gap:8px}.table-active .auto-public{gap:10px}.table-active .auto-resources{gap:8px}.table-active .auto-stage{height:50px}.table-active .auto-piles{gap:8px}.table-active .auto-piles strong{margin-top:7px}.table-active .table-detail,.table-active #table-actions,.table-active .auto-prompt{padding:10px}.table-active .table-rail{gap:8px}.table-active #match-table .button{min-height:32px;padding:6px 8px!important}.table-active .table-sidebar{gap:10px;grid-template-rows:16% minmax(60px,1fr) 43%}.table-active .table-hand-cards{gap:8px 5px}.table-active .auto-leader>small{font-size:8px;bottom:-12px}}
@media(max-width:1000px){.table-active .table-layout{grid-template-columns:170px minmax(0,1fr) 190px}.table-active .auto-public{grid-template-columns:minmax(0,1fr) 55px minmax(0,1fr)}.table-active .auto-stage{display:none}.table-active .auto-piles img,.table-active .empty-trash{width:23px;height:32px}.table-active .life-stack img{margin-right:-17px}.table-active .auto-piles strong{font-size:8px}.table-active .auto-don>span{font-size:8px}.table-active .auto-don>span strong{font-size:18px}.table-active .table-card b{font-size:8px!important}.table-active .auto-piles{gap:3px}.table-active .auto-characters{gap:8px}}
@media(max-width:850px){.table-active .table-layout{grid-template-columns:minmax(0,1fr) 185px}.table-active .table-hand-cards{display:flex}.table-active .table-sidebar{display:flex}.table-active .auto-player .table-player-heading strong{font-size:11px}.table-active .auto-player .table-player-heading>span{font-size:9px}.table-active .table-hand-cards .table-card{max-width:13%}.table-active .table-turn-indicator{font-size:10px}}
.table-active .auto-leader>small{writing-mode:horizontal-tb}
.table-active .concealed-fan{height:clamp(40px,10vh,145px);padding-top:6px}
/* Flat ocean tones keep the illustration behind the cards. */
.table-active #match-table{background:linear-gradient(90deg,#0a1d3038,transparent 30% 70%,#0a1d3038)}
.table-active .auto-player,.table-active .table-player.own,.table-active .auto-player.opponent{background:transparent}
.table-active .auto-characters{background:none;border-bottom-color:#79b6c32b}
.table-active .table-slot{background:#15374a33;border-color:#8ab6c33b;box-shadow:none}
.table-active .table-slot:after{color:#8ab6c333}
.table-active .table-detail,.table-active .opponent-cards,.table-active .table-hand,.table-active .table-communication,.table-active #table-actions{background:#102a40e8;border-color:#638f9e40;box-shadow:none}
.table-active .auto-leader{filter:none}
.table-active .table-turn-line{background:linear-gradient(90deg,transparent,#23617677,transparent);box-shadow:none;border-color:#69b3c83d}
/* The source back is square with white side gutters. Cover crops only those
   gutters; the fixed 63:88 frame preserves the printed card's proportions. */
.table-active img[src="assets/products/card-back-blue.png"]{object-fit:cover;object-position:center;aspect-ratio:63/88;clip-path:inset(1px round 5%);border:0;background:transparent}
.table-active .concealed-fan img{width:auto;max-width:none;aspect-ratio:63/88;flex:0 0 auto}
.table-active #match-table .don-card{width:clamp(27px,4vw,98px);height:clamp(38px,5.6vw,137px);margin-right:clamp(-65px,-2.65vw,-18px);background:transparent;border:0;box-shadow:2px 4px 7px #0006}
.table-active .don-card img{border:0;border-radius:5%;object-fit:cover;aspect-ratio:63/88}
.table-active #match-table .don-card:last-child{margin-right:0}
.table-active #match-table .don-card.picked{outline:2px solid #e8b951;outline-offset:1px;box-shadow:0 0 18px #ffc85d44}
.table-active .don-card:hover{z-index:2}
@media(max-width:1000px){.table-active #match-table .don-card{width:23px;height:32px;margin-right:-17px}}
@media(prefers-reduced-motion:reduce){.match-result,.result-orbit{animation:none}}
/* Dedicated vertical pile rail: Life, deck, trash, in the same order on both sides. */
.table-active .auto-public{grid-template-columns:minmax(0,1fr) clamp(70px,7vw,175px) minmax(0,.8fr) clamp(58px,6vw,150px)}
.table-active .auto-characters{grid-column:1/4}
.table-active .auto-player .auto-piles{grid-column:4;grid-row:1/-1;display:flex;flex-direction:column;justify-content:space-evenly;align-items:center;align-self:stretch;gap:6px;height:100%;border-left:1px solid #79b6c32b;padding-left:8px;--pile-height:clamp(32px,8.1vh,116px);--pile-width:calc(var(--pile-height)*.7159)}
.table-active .auto-piles img,.table-active .auto-piles .empty-trash{width:var(--pile-width);height:var(--pile-height)}
.table-active .life-stack{display:grid;grid-template-columns:var(--pile-width);grid-template-rows:var(--pile-height) auto;justify-content:center}
.table-active .life-stack img{grid-column:1;grid-row:1;margin:0!important;transform:translateX(calc(var(--life-index)*3px - 6px));}
.table-active .life-stack strong{grid-column:1;grid-row:2}
.table-active .auto-piles strong{margin-top:4px;font-size:clamp(9px,.65vw,16px);letter-spacing:.06em}
.table-active .auto-resources{gap:10px}.table-active .auto-don>span{white-space:nowrap}.table-active .auto-don small{color:#88a7bb;font-size:.8em}
.table-active .zone-caption,.table-active .auto-leader>small{display:none}
/* Small, signed overlays stay upright even when a card rests. */
.table-active .table-card>.card-modifiers{display:flex;position:absolute;right:-5px;top:5px;flex-direction:column;align-items:flex-end;gap:4px;z-index:4;margin:0;min-height:0;overflow:visible;pointer-events:none}
.card-modifier{display:flex;align-items:center;gap:4px;font:700 clamp(10px,.7vw,17px)/1.2 system-ui,sans-serif;padding:4px 6px;border-radius:6px;box-shadow:0 3px 8px #0008;white-space:nowrap;border:1px solid;pointer-events:auto}
.card-modifier em{font-style:normal;font-size:.8em;opacity:.8}.card-modifier.positive{color:#8effbb;background:#07392df2;border-color:#35cf87}.card-modifier.negative{color:#ffabb7;background:#4d1422f2;border-color:#f56578}
.table-active .table-hint:empty{display:none}.table-active .table-detail>p:not(.table-stats){display:none}
.table-active .table-card-actions{display:flex;flex-direction:column;align-items:stretch;gap:8px}
.table-active .table-card-actions select{width:100%;max-width:none;background:#142f43;color:#e2edf4;border:1px solid #62879c;border-radius:6px;padding:8px;font:inherit}
.table-active #match-table .confirm-card-action{background:linear-gradient(130deg,#347e88,#245c74);border-color:#72c9c8;font-weight:700}
.table-active .table-rail #table-actions{order:2}.table-active .table-rail .auto-prompt{order:3;margin-top:auto}
.table-active .turn-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px}.table-active .turn-controls .button{margin:0!important}
@media(max-width:1600px){.table-active .auto-public{gap:8px;grid-template-columns:minmax(0,1fr) 70px minmax(0,.5fr) 60px}.table-active .auto-stage{height:38px}.table-active .auto-don small{display:none}.card-modifier{padding:2px 4px;gap:2px}}
@media(max-width:1000px){.table-active .auto-public{grid-template-columns:minmax(0,1fr) 50px minmax(0,.5fr) 42px}.table-active .auto-player .auto-piles{padding-left:4px;--pile-height:clamp(28px,7vh,65px)}.table-active .turn-controls{grid-template-columns:1fr}}
.table-active .auto-player .auto-piles{--pile-height:clamp(26px,calc((100dvh - 460px)/6),116px)}
.table-active .life-stack{padding:0}.table-active .auto-piles strong{position:static;line-height:1.2}
.table-active .table-card.attack-chosen{outline:3px solid #ff868e!important;box-shadow:0 0 20px #fa627d66}
.table-active .battle-power{display:grid;grid-template-columns:1fr 1fr;gap:4px;text-align:center}
.table-active .battle-power b:first-child{grid-column:1;grid-row:1}.table-active .battle-power b:last-child{grid-column:2;grid-row:1}
.table-active .battle-power span{grid-column:1/-1;grid-row:2;font-size:11px}
