/* Two opposing card rows. Only new duels use these rules and this table. */
.tb-deck-choices{grid-template-columns:repeat(4,minmax(0,1fr))}
.tb-resume{display:grid;gap:10px}
.tb-resume p,.tb-resume small{margin:0}
.tb-resume small{line-height:1.6;opacity:.8}
.tb-duel.tb-playing .tb-arena{grid-template-rows:58px minmax(0,1fr) 58px;gap:10px;padding:12px clamp(14px,2.4vw,36px)}
.tb-duel .tb-commander .tb-castle{height:52px;border-radius:24px 24px 16px 16px}
.tb-duel .tb-commander-banner .tb-guide-avatar{width:44px;height:44px;border:2px solid #dbb47a;border-radius:50%;object-fit:cover}
.tb-duel .tb-commander .tb-health strong{font-size:29px}
.tb-duel .tb-battle-surface{position:relative;display:block;padding:12px 6px;background:none;border:0}
.tb-duel.tb-playing .tb-board{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:36px 12px;height:100%;padding:0;margin:0;isolation:isolate}
.tb-duel .tb-duel-divider{position:absolute;inset:calc(50% - 13px) 0 auto;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:15px;pointer-events:none;color:#edd9ae;font-size:9px;letter-spacing:1.2px;text-shadow:0 2px 4px #000}
.tb-duel-divider>span:first-child{text-align:right;color:#efb5ad}
.tb-duel-divider>span:last-child{color:#a4dded}
.tb-duel-divider i{width:60px;height:1px;background:linear-gradient(90deg,transparent,#e6c27c,transparent)}
.tb-duel.tb-playing .tb-cell{background:none!important;border-color:transparent;border-radius:36% 36% 20% 20%;box-shadow:none;min-height:0}
.tb-duel.tb-playing .tb-cell.tb-empty{border:1px dashed #ddd0ae40;background:#141d2626!important}
.tb-duel.tb-playing .tb-cell[data-zone="enemy"].tb-empty{opacity:.25}
.tb-duel.tb-playing .tb-cell.tb-target{border-color:#e9d58dbb;background:#e9c97e18!important;box-shadow:inset 0 0 20px #e7c78420}
.tb-duel.tb-playing .tb-unit-card{width:auto;aspect-ratio:3/4;height:calc(100% - 18px);max-height:180px;max-width:calc(100% - 16px);min-height:48px;top:calc(50% + 1px);border-radius:44% 44% 30% 30%;border-width:3px}
.tb-duel.tb-playing .tb-unit-owner{top:0;font-size:9px;padding:2px 6px}
.tb-duel.tb-playing .tb-unit-name{bottom:13px;font-size:10px}
.tb-duel.tb-playing .tb-unit-stats{left:-10px;right:-10px;bottom:-6px}
.tb-duel.tb-playing .tb-unit-stats b{width:30px;height:30px;font-size:20px}
.tb-duel.tb-playing .tb-unit-state{right:auto;left:50%;top:-5px;transform:translate(-50%,-100%);font-size:8px;padding:2px 4px}
.tb-duel.tb-playing .tb-unit-state.tb-ready{display:none}
.tb-duel.tb-playing .tb-target-label{left:50%;right:auto;top:auto;bottom:0;transform:translateX(-50%);font-size:10px;max-width:none;white-space:nowrap;padding:3px 8px}
.tb-duel .tb-command-crystals{gap:6px}
.tb-duel .tb-command-crystals>span{gap:3px}
.tb-duel .tb-command-crystals i{width:12px;height:20px}
@media(max-width:1100px){
 .tb-duel.tb-playing .tb-board{gap:32px 9px}
 .tb-duel .tb-commander{grid-template-columns:minmax(0,1fr) minmax(160px,220px) minmax(0,1fr)}
 .tb-duel .tb-command-crystals{flex-direction:column;gap:2px}
 .tb-duel.tb-playing .tb-unit-owner{font-size:8px;padding-inline:4px}
}
@media(max-width:760px){
 .tb-deck-choices{grid-template-columns:repeat(2,minmax(0,1fr))}
 .tb-duel.tb-playing .tb-arena{grid-template-rows:42px minmax(0,1fr) 42px;padding:5px 7px 8px;gap:4px}
 .tb-duel .tb-commander{grid-template-columns:minmax(0,1fr) minmax(138px,170px) minmax(0,1fr);gap:4px}
 .tb-duel .tb-commander .tb-castle{height:40px;padding-inline:6px}
 .tb-duel .tb-commander-banner .tb-guide-avatar{width:28px;height:28px}
 .tb-duel .tb-commander .tb-health strong{font-size:21px}
 .tb-duel .tb-commander .tb-health{min-width:54px}
 .tb-duel .tb-commander .tb-health-track{width:54px}
 .tb-duel .tb-battle-surface{padding:8px 0}
 .tb-duel.tb-playing .tb-board{gap:26px 5px}
 .tb-duel .tb-duel-divider{font-size:6px;letter-spacing:0;gap:5px;inset:calc(50% - 6px) 0 auto;white-space:nowrap}
 .tb-duel-divider i{width:15px}
 .tb-duel.tb-playing .tb-unit-card{width:calc(100% - 7px);height:min(calc(100% - 15px),88px);max-width:none;border-width:2px;min-height:30px}
 .tb-duel.tb-playing .tb-unit-owner{font-size:6px;gap:1px;padding:1px 2px;top:-4px}
 .tb-duel.tb-playing .tb-unit-owner .tb-icon{display:none}
 .tb-duel.tb-playing .tb-unit-name{font-size:7px;bottom:11px}
 .tb-duel.tb-playing .tb-unit-stats{left:-5px;right:-5px;bottom:-5px}
 .tb-duel.tb-playing .tb-unit-stats b{width:20px;height:20px;font-size:14px;border-width:1px}
 .tb-duel.tb-playing .tb-unit-state{display:none}
 .tb-duel.tb-playing .tb-target-label{font-size:7px;padding:2px 4px;bottom:-6px}
 .tb-duel .tb-command-crystals i{width:8px;height:14px}
 .tb-duel .tb-command-crystals>span{gap:2px}
 .tb-duel .tb-command-crystals small{font-size:8px}
}
@media(prefers-reduced-motion:reduce){.tb-duel .tb-unit-card{animation:none}}

/* The table is the play area: no lane captions or permanently visible slots. */
.tb-duel.tb-playing{grid-template-rows:minmax(0,1fr);padding-block:7px;min-height:570px}
.tb-duel.tb-playing .tb-layout{grid-row:1}
.tb-duel.tb-playing .tb-arena{grid-template-rows:88px minmax(0,1fr) 48px;gap:8px;padding:9px 24px 12px}
.tb-duel .tb-commander{grid-template-columns:1fr minmax(180px,250px) 1fr}
.tb-duel .tb-commander>.tb-castle{grid-column:2;justify-self:center;width:100%;overflow:visible}
.tb-duel .tb-commander>.tb-enemy-hand,.tb-duel .tb-commander>.tb-command-crystals{grid-column:3}
.tb-duel .tb-commander.is-enemy .tb-castle{height:76px;padding-left:8px;background:linear-gradient(90deg,#211b1bdd,#452a29d9);border:1px solid #e0b780aa;border-radius:38px 17px 17px 38px;box-shadow:0 4px 18px #0009}
.tb-hero-portrait{width:86px;height:86px;object-fit:cover;object-position:center 12%;border-radius:50%;border:3px solid #d2b480;box-shadow:0 0 0 4px #171d29,0 4px 18px #0008;flex-shrink:0}
.tb-duel .tb-commander.is-player .tb-castle{height:43px}
.tb-duel .tb-commander.is-enemy .tb-castle-label{font-size:15px}
.tb-duel .tb-commander .tb-health{min-width:60px;margin-left:auto}
.tb-duel .tb-commander .tb-health-track{width:60px}
.tb-duel .tb-commander .tb-health strong{font-size:25px}
.tb-duel .tb-battle-surface{margin-right:66px;padding:6px 0 8px;overflow:visible}
.tb-duel.tb-playing .tb-board{grid-template-columns:repeat(var(--tb-columns,6),minmax(0,1fr));gap:35px 12px}
.tb-duel.tb-playing .tb-cell.tb-empty{border-color:transparent;background:none!important;opacity:1}
.tb-duel.tb-playing .tb-cell.tb-empty::before,.tb-duel.tb-playing .tb-cell.tb-empty::after{display:none}
.tb-duel.tb-playing .tb-cell.tb-target{border:1px solid #e9d58b85;background:#e9c97e12!important;box-shadow:inset 0 0 20px #e7c78420}
.tb-duel.tb-playing .tb-unit-card{height:calc(100% - 18px);max-height:190px;max-width:calc(100% - 8px);top:50%;border-radius:44% 44% 30% 30%}
.tb-duel.tb-playing .tb-unit-name{top:auto;left:3px;right:3px;bottom:18px;font-size:10px;line-height:1.2}
.tb-duel.tb-playing .tb-unit-stats{bottom:-7px;left:-8px;right:-8px}
.tb-duel.tb-playing .tb-unit-stats b{width:28px;height:28px;font-size:19px}
.tb-duel .tb-unit-card.tb-guard-card{border-radius:20% 20% 40% 40%;outline:2px solid #c7dbeb;outline-offset:3px;box-shadow:0 0 16px #c4dbea55}
.tb-role-badge{position:absolute;z-index:4;left:50%;top:-10px;transform:translateX(-50%);width:25px;height:27px;display:grid;place-items:center;color:#f4dfb1;background:#28313a;border:1px solid #b7a47e;border-radius:50%;filter:drop-shadow(0 2px 3px #000)}
.tb-role-badge.is-guard{width:30px;height:33px;clip-path:polygon(50% 0,100% 18%,92% 70%,50% 100%,8% 70%,0 18%);border:0;background:linear-gradient(130deg,#edf6fc,#83a0b7);color:#243e51;border-radius:0}
.tb-role-badge .tb-icon{width:17px;height:17px;stroke-width:2}
.tb-table-turn{position:absolute;z-index:5;right:10px;top:50%;transform:translateY(-50%);width:80px;text-align:center}
.tb-table-turn>small{display:block;font-size:9px;letter-spacing:.5px;color:#ecd2a1;text-shadow:0 2px 4px #000;margin-bottom:7px}
.tb-table-turn .tb-end{width:100%;min-width:0;min-height:69px;padding:9px 4px;display:grid;place-content:center;gap:6px;border:2px solid #e4c183;border-radius:13px;background:linear-gradient(#e4c38a,#ac8351);box-shadow:inset 0 0 0 2px #5a402a55,0 5px 0 #5b4230,0 8px 17px #0009;white-space:normal}
.tb-table-turn .tb-end strong{font-size:12px;line-height:1.3}
.tb-table-turn .tb-end small{font-size:9px;opacity:.8}
.tb-table-turn .tb-end.all-done:not(:disabled){background:linear-gradient(#c0db9e,#76995e);border-color:#d9edbd}
.tb-table-turn .tb-end:disabled{opacity:.7;filter:saturate(.2)}
.tb-match-stake{font-size:10px;color:#e4c389}
.tb-sidebar:has(.tb-match-stake){grid-template-rows:28px 16px 90px minmax(80px,1.2fr) minmax(70px,1fr) 20px 24px}
.tb-draw-choice{position:absolute;inset:0;z-index:12;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:20px;background:#0b1429dc;backdrop-filter:blur(8px);border-radius:inherit;text-align:center}
.tb-draw-choice header>small{font-size:10px;letter-spacing:3px;color:#dfc68c}
.tb-draw-choice h2{font:25px/1.35 MaruBuri,serif;margin:9px 0;color:#fff2d8}
.tb-draw-choice header p{margin:0;color:#c5c9d6;font-size:12px}
.tb-choice-list{display:flex;align-items:stretch;justify-content:center;gap:16px;width:100%;max-width:680px;min-height:0}
.tb-choice-card,.tb-play-card{position:relative;border:1px solid #bfa571;border-radius:14px;background:#182033;color:#f6e6c6;overflow:hidden;box-shadow:0 10px 24px #0008;text-align:left}
.tb-choice-card{font:inherit;flex:1;display:flex;flex-direction:column;justify-content:flex-start;min-width:0;max-width:196px;padding:0;cursor:pointer;transition:transform .2s,border-color .2s,box-shadow .2s}
.tb-choice-card:hover,.tb-choice-card:focus-visible{transform:translateY(-7px);border-color:#ffe7ab;outline:2px solid #e6c98a;outline-offset:3px;box-shadow:0 4px 30px #e8c98645}
.tb-choice-card:disabled{cursor:wait;opacity:.6}
.tb-choice-card>img{width:100%;height:clamp(100px,18dvh,172px);object-fit:cover;object-position:center 34%;display:block}
.tb-choice-card>div,.tb-play-card>div{padding:13px 12px}
.tb-choice-card strong,.tb-play-card strong{display:block;font-size:16px;line-height:1.3;margin-bottom:8px}
.tb-choice-card small,.tb-play-card small{font-size:10px;color:#e6c68f;line-height:1.6;display:block}
.tb-choice-card .tb-icon,.tb-play-card .tb-icon{display:inline-block;width:12px;height:12px;vertical-align:middle}
.tb-choice-card p,.tb-play-card p{font-size:11px;line-height:1.65;color:#c9cbd4;margin:9px 0 0}
.tb-choice-cost{position:absolute;top:8px;left:8px;display:grid;place-items:center;width:30px;height:33px;background:linear-gradient(#6499c7,#214364);border:2px solid #c2ddf3;border-radius:45%;font:bold 21px Georgia;color:white;box-shadow:0 2px 8px #0009}
.tb-play-reveal{position:fixed;inset:0;z-index:1500;display:flex;align-items:center;justify-content:center;pointer-events:none;background:radial-gradient(ellipse at center,#eec77b18,transparent 50%)}
.tb-play-card{width:200px;flex-shrink:0;animation:tb-card-arrives .22s ease-out both;outline:1px solid #f6d492;outline-offset:4px}
.tb-play-card.is-enemy{outline-color:#efaaa2}
.tb-play-card>img{width:100%;height:230px;object-fit:cover;object-position:center 30%;display:block}
@keyframes tb-card-arrives{from{opacity:0;scale:.8;rotate:-5deg}to{opacity:1;scale:1;rotate:0deg}}
@media(max-width:1020px){
 .tb-duel.tb-playing .tb-arena{padding-inline:14px}
 .tb-duel .tb-battle-surface{margin-right:51px}
 .tb-table-turn{width:64px;right:6px}
 .tb-table-turn .tb-end strong{font-size:11px}
 .tb-duel.tb-playing .tb-board{gap:30px 8px}
 .tb-duel.tb-playing .tb-unit-stats b{width:24px;height:24px;font-size:17px}
}
@media(max-width:760px){
 .tb-duel.tb-playing{grid-template-rows:minmax(0,1fr);min-height:640px;padding:5px 6px}
 .tb-duel.tb-playing .tb-layout{grid-template-rows:26px 40px minmax(0,1fr) 16px clamp(78px,11dvh,96px) 27px 42px}
 .tb-duel.tb-playing .tb-arena{grid-template-rows:65px minmax(0,1fr) 36px;padding:5px 7px 8px;gap:4px}
 .tb-duel .tb-commander{grid-template-columns:1fr minmax(155px,190px) 1fr;gap:3px}
 .tb-duel .tb-commander.is-enemy .tb-castle{height:56px;padding-left:4px;gap:7px}
 .tb-hero-portrait{width:62px;height:62px;border-width:2px}
 .tb-duel .tb-commander.is-enemy .tb-castle-label{font-size:12px}
 .tb-duel .tb-commander.is-player .tb-castle{height:32px}
 .tb-duel .tb-commander .tb-health{min-width:45px}
 .tb-duel .tb-commander .tb-health-track{width:45px}
 .tb-duel .tb-commander .tb-health strong{font-size:20px}
 .tb-duel .tb-battle-surface{margin-right:0;padding:4px 0}
 .tb-duel.tb-playing .tb-board{gap:44px 5px}
 .tb-duel.tb-playing .tb-unit-card{height:min(calc(100% - 8px),100px);width:calc(100% - 5px);max-width:72px;border-width:2px;min-height:30px}
 .tb-duel.tb-playing .tb-unit-name{font-size:7px;bottom:11px;left:0;right:0}
 .tb-duel.tb-playing .tb-unit-stats{left:-5px;right:-5px;bottom:-5px}
 .tb-duel.tb-playing .tb-unit-stats b{width:19px;height:19px;font-size:13px;border-width:1px}
 .tb-role-badge{width:18px;height:19px;top:-8px}
 .tb-role-badge.is-guard{width:22px;height:24px}
 .tb-role-badge .tb-icon{width:13px;height:13px}
 .tb-duel .tb-unit-card.tb-guard-card{outline-width:1px;outline-offset:2px}
 .tb-table-turn{top:calc(50% + 16px);right:8px;width:68px}
 .tb-table-turn>small{display:none}
 .tb-table-turn .tb-end{min-height:32px;padding:5px 3px;border-width:1px;border-radius:8px;gap:0}
 .tb-table-turn .tb-end strong{font-size:10px}
 .tb-table-turn .tb-end small{display:none}
 .tb-draw-choice{gap:12px;padding:12px 7px}
 .tb-draw-choice h2{font-size:18px;margin:6px 0}
 .tb-draw-choice header p{font-size:10px}
 .tb-draw-choice header>small{font-size:8px;letter-spacing:1px}
 .tb-choice-list{gap:7px}
 .tb-choice-card{border-radius:8px}
 .tb-choice-card>img{height:88px}
 .tb-choice-card>div{padding:8px 6px}
 .tb-choice-card strong{font-size:11px;margin-bottom:5px}
 .tb-choice-card small{font-size:8px;line-height:1.5}
 .tb-choice-card p{font-size:9px;line-height:1.5;margin-top:5px}
 .tb-choice-cost{width:24px;height:27px;font-size:17px;top:4px;left:4px}
 .tb-match-stake{display:none}
}
@media(prefers-reduced-motion:reduce){.tb-choice-card{transition:none}.tb-play-card{animation:none}.tb-choice-card:hover{transform:none}}
