/* V5 card table. The finish is drawn from the game's engraved metal totems. */
[hidden]{display:none!important}
:root{--felt:#132923;--edge:#635334;--paper:#eee6d4}
.topbar{height:66px;background:#151712;border-bottom-color:#574830}
.brand-mark{color:#dfb957}.left-panel,.right-panel{background:#191c18}
.table-wrap{padding:14px 20px 8px}
.match-label{margin-bottom:8px}
.table{
 background-color:var(--felt);
 background-image:radial-gradient(ellipse at 51% 49%,#30514566,transparent 61%),repeating-linear-gradient(35deg,#e6ead405 0 1px,transparent 1px 4px),repeating-linear-gradient(-40deg,#020b0745 0 1px,transparent 1px 5px);
 border:1px solid #857048;border-radius:15px;
 box-shadow:inset 0 0 0 3px #151c16,inset 0 0 0 4px #877a4d7d,inset 0 0 45px #07140eb3,0 3px 10px #0005;
 padding:11px 14px;
}
.table:before{
 content:'';top:50%;left:50%;transform:translate(-50%,-50%) rotate(-7deg);width:280px;aspect-ratio:1;height:auto;
 background:url('assets/totem-consensus.webp') center/cover;mix-blend-mode:luminosity;opacity:.18;
 mask-image:radial-gradient(ellipse,#000 14%,#000a 44%,transparent 70%);
}
.hero-row,.player-row{min-height:42px;padding:6px 1px}
.enemy-hand{height:28px;margin-top:0}.enemy-hand .card-back{height:27px;width:21px;font-size:17px;background:#242724;border:1px solid #b09a66}
.battle-row{min-height:100px;padding:4px 0;gap:7px}
.unit,.slot{min-height:94px}
.slot{display:flex;align-items:center;justify-content:center;background:#0a1b1645;border:1px solid #c6aa683b;border-radius:6px;box-shadow:inset 0 0 12px #0715115c}
.slot:first-child,.slot:last-child{border-color:#b8a67960}
.slot>span:first-child{font:22px Georgia,serif;color:#9b9e7d7a}
.slot .slot-caption{bottom:12px;color:#c7cbb084;letter-spacing:.08em}
.unit{border:1px solid #ac8b4b;background:#20241e;padding:3px;box-shadow:0 2px 4px #0008}
.unit .card-art{height:48px;min-height:44px}.unit .unit-name{margin:1px 0 0;line-height:17px}.unit-stats{margin-top:1px}
.unit .unit-label:empty{display:none}
.unit.ready{border-color:#96d0aa}
.battle-divider{padding:4px 0}.battle-divider .line{background:#a18b567e}
.turn-indicator b{color:#ffdc86}.turn-indicator small{color:#c1c7aa}
.hero-row,.player-row{color:#ecebd9}.hero-identity small,.resource-mini small{color:#c4c9ae}
.coach{margin-top:6px;min-height:0;background:transparent;border:0;border-left:2px solid #ad9458;border-radius:0;color:#e0d9c1;padding:2px 9px;line-height:1.6}
.resonance-bar{padding-top:7px;gap:5px}
.resonance-bar>span{padding:4px 8px;background:#1c211c}
.hand-heading{margin-top:9px}.hand{padding:10px 0 6px;align-items:stretch;min-height:205px}
.hand .card{min-height:196px;background:#22251e}
.hand .card-art{height:83px}.hand .card-body{padding:4px 6px}
.hand .card-text{font-size:12px;line-height:1.45}.hand .card-stats{margin-top:auto}
.card-cost{color:#21190a;background:#f0c86c}.card.unaffordable{opacity:.69}
.detail-default{padding:0 3px 14px}.detail-default img{width:100%;height:120px;object-fit:cover;object-position:center 46%;border-block:1px solid #615239}
.detail-default h2{margin:10px 0;line-height:1.45}
#read-result{margin-top:8px}
.opening-decks{margin:12px 0 2px;padding:0;border:0;display:flex;gap:7px}
.opening-decks legend{font-size:12px;color:#d2c5ad;margin-bottom:5px}.opening-decks label{position:relative;flex:1;cursor:pointer}
.opening-decks input{position:absolute;opacity:0}
.opening-decks span{display:flex;align-items:baseline;justify-content:center;gap:8px;padding:7px 5px;background:#20271f;color:#d3cfbd;border:1px solid #5f624c;border-radius:5px;line-height:1.5}
.opening-decks b{font-size:14px}.opening-decks small{font-size:12px}
.opening-decks input:checked+span{border-color:#e4ba61;background:#3c3320;color:#ffe9ab;box-shadow:inset 0 -2px #d9b45f}
.opening-decks input:focus-visible+span{outline:2px solid #f3e5b4;outline-offset:2px}
#opening{background:#1b211b;border:1px solid #af925b;box-shadow:inset 0 0 0 4px #111611,0 12px 90px #0009}
#opening>.section-kicker{font-size:12px;color:#e6c478;margin:0 0 6px}
#opening h2{margin:0 0 5px}#opening>p{margin:0;color:#d3d0be}
.opening-cards{margin:10px 0}.opening-footer{margin-top:9px}
.end-stats{display:flex;gap:8px}.end-stats>div{flex:1;padding:8px 4px;border-block:1px solid #6a5b3f}
.end-stats dt{font-size:12px;color:#c2b8a1}.end-stats dd{margin:5px 0 0;font:600 17px Georgia,serif;color:#edd08a}
.end-recent{padding:0 0 0 1.4em;margin:12px 0 20px;text-align:left;color:#c6c6b4;font-size:13px}
@media(min-width:1100px){
 .left-panel,.right-panel{padding-top:20px}.left-panel .intro{margin-bottom:14px}
 .leader-panel{margin-top:16px}.left-panel h1{font-family:'STZhongsong','Microsoft YaHei',serif;font-size:26px}
}
@media(max-width:760px){
 .topbar{height:auto;min-height:78px;padding:5px 12px 0;gap:2px}.topbar nav .nav{min-height:34px;padding:4px 3px}
 .table-wrap{padding:8px 8px 12px}.table{border-radius:9px;padding:8px}
 .match-label{margin-bottom:5px}.match-label button{margin:0;min-height:32px}
 .table:before{width:165px}.battle-row{min-height:76px;gap:4px;padding:3px 0}
 .unit,.slot{min-height:72px}.unit .card-art{height:33px;min-height:30px}.unit .unit-name{font-size:10px;line-height:14px}.unit-stats{font-size:12px}
 .unit:not(.ready) .unit-stats:after{display:none}.slot .slot-caption{font-size:9px;bottom:6px}
 .enemy-hand{height:17px}.enemy-hand .card-back{height:18px;width:15px;font-size:12px}
 .hero-row,.player-row{padding:3px 0;min-height:36px}.battle-divider{padding:3px 0}.turn-indicator small{display:none}
 .battle-divider .end-turn{min-height:36px}.hero-identity small{font-size:10px}
 .resonance-bar{padding-top:5px}.resonance-bar>span{padding:4px 3px}
 .coach{font-size:12px;margin-top:5px}.hand{min-height:190px;gap:7px;padding:8px 2px 5px;scroll-padding-inline:3px;scroll-snap-type:x proximity}
 .hand .card{min-height:190px;min-width:123px;flex-basis:123px;scroll-snap-align:start}
 .hand .card-art{height:76px}.hand-heading{margin-top:7px}
 .action-bar:not([hidden]){position:sticky;bottom:0;padding:8px 10px;background:#21271f;border-color:#ac8c4d}
 .action-bar p{margin:0;line-height:1.5}.action-buttons{margin-top:4px}.action-buttons .primary,.action-buttons .secondary{min-height:40px}
 #opening{padding:16px 12px;max-height:min(96dvh,820px)}.opening-decks{gap:4px}
 .opening-decks span{flex-direction:column;align-items:center;gap:0;min-height:42px;padding:4px 2px}.opening-decks b{font-size:13px}.opening-decks small{font-size:11px}
 .opening-cards{margin:6px 0;padding:5px 2px 7px}.opening-card{flex-basis:120px;min-width:120px}.opening-card>.card{height:220px;min-height:220px}
 .opening-card .card-art{height:89px}.opening-footer .primary{margin-top:6px}
}
@media(max-height:680px){#opening{max-height:95dvh;overflow-y:auto}}
/* Uniform crops for every original. A square atlas tile must never stretch to fill a strip. */
.card .card-art,.unit .card-art,.detail-box .card-art,#card-modal .card-art{background-image:none}
.card-art>img,.card-art>svg{display:block;position:absolute;inset:0;width:100%;height:100%}
.card-art>img{object-fit:cover}
#card-modal .card-art.individual img{object-fit:contain}
.table{container-type:inline-size}
.unit .unit-label{pointer-events:none}
@container (min-width:690px){
 .battle-row .unit{
  display:grid;grid-template-columns:minmax(0,1.18fr) minmax(0,.82fr);grid-template-rows:minmax(0,1fr) auto;
  align-content:center;column-gap:5px;padding:4px;min-height:94px;text-align:left;
 }
 .unit .card-art{align-self:stretch;grid-column:1;grid-row:1 / -1;height:auto;min-height:78px;border-radius:4px}
 .unit .unit-name{grid-column:2;grid-row:1;white-space:normal;overflow-wrap:anywhere;align-self:end;line-height:1.2;margin:0 0 5px}
 .unit .unit-stats{grid-column:2;grid-row:2;line-height:1.35;font-size:14px;gap:4px;justify-content:space-between;margin:0}
 .unit .unit-stats .stat-atk:before{content:'⚔';font-size:9px;margin-right:1px}
 .unit .unit-stats .stat-hp:before{content:'♥';font-size:9px;margin-right:1px}
 .unit .unit-label{left:57%;right:auto;top:4px;padding:0;background:transparent;color:#c8d7a9;font-size:10px}
 .unit:not(.ready) .unit-stats:after{display:none}
}
@container (max-width:689px){
 .unit .card-art{height:48px;min-height:44px;flex:none}
 .battle-row .unit{min-height:88px}
 .unit .unit-label{left:auto;right:2px;top:auto;bottom:3px;max-width:70%;font-size:8px;padding:0 1px;background:#20241e;color:#d7cdab;line-height:1}
 .unit .unit-label:not(:empty){left:50%;right:auto;transform:translateX(-50%)}
 .unit:not(.ready) .unit-stats:after{display:none}
}
