@import './duel-living.css';
@import './card-presentation.css';
/* The AI preference is a game setting, committed only after a saved worker reply. */
.duel .duel-top{flex-wrap:wrap}
.duel-analysis-mode-label{display:flex;align-items:center;gap:6px;flex:0 0 auto;font:calc(10px * var(--game-text-scale,1))/1.3 system-ui,sans-serif;white-space:nowrap}
.duel-analysis-mode{font:inherit;min-height:28px;padding:3px 6px;color:var(--ink);background:#17261e;border:1px solid #697052;border-radius:4px}
.duel-analysis-mode:disabled{opacity:.5;cursor:wait}
.duel-card-detail{max-height:calc(100vh - 140px);overflow:auto;box-sizing:border-box}.duel-card-detail>button{float:right;padding:.5rem 1rem;cursor:pointer}.duel-card-detail h2{font-size:1.15rem;margin:.4rem 5rem .7rem 0}.duel-card-detail>img{display:block;width:min(280px,100%);max-height:43vh;object-fit:contain;margin:auto}.duel-card-detail p{line-height:1.45;white-space:pre-line}
/* Fixed board with local overflow only. The left column reserves inspection
   space; the external detail node never covers either battlefield. */
.duel{--gold:#d4b779;--ink:#f2ead5;--edge:#8c7752;--info:236px;position:fixed;inset:10px;z-index:30;display:grid;grid-template-columns:var(--info) minmax(0,1fr);grid-template-rows:0 minmax(0,1fr) 132px minmax(72px,max-content);overflow:hidden;color:var(--ink);background:#171c18;border:1px solid var(--edge);border-radius:11px;box-shadow:0 20px 80px #000c;font:calc(13px * var(--game-text-scale, 1))/1.35 system-ui,sans-serif}
.duel[hidden]{display:none}.duel,.duel *{box-sizing:border-box}.duel h2,.duel h3,.duel h4{margin:0}.duel button{font:inherit;cursor:pointer;color:inherit;background:#25332a;border:1px solid #7c7957;border-radius:5px;padding:5px 10px;min-height:28px}.duel button:disabled{cursor:default;opacity:.5}.duel button:focus-visible,.duel summary:focus-visible,.duel select:focus-visible,.duel input:focus-visible{outline:3px solid #ffe4a3;outline-offset:2px;z-index:5}.duel [hidden]{display:none!important}
.duel .duel-top{grid-column:1/-1;display:flex;align-items:center;gap:14px;padding:7px 14px;min-height:44px;border-bottom:1px solid #665f43;background:linear-gradient(90deg,#151e1b,#20291f);overflow:hidden;flex:none}.duel .duel-top h2{font:600 calc(18px * var(--game-text-scale, 1)) Georgia,serif;color:#eee1b5;white-space:nowrap}.duel-turn{white-space:nowrap;font-size:calc(11px * var(--game-text-scale, 1));padding:3px 8px;border:1px solid #5d6248;border-radius:12px;color:#d1d4bd}.duel-phase{font-size:calc(11px * var(--game-text-scale, 1));color:#adbba6;white-space:nowrap}.duel .duel-top .game-language{display:flex;align-items:center;gap:6px;margin-left:auto;font-size:calc(10px * var(--game-text-scale, 1));white-space:nowrap}.duel .duel-top .game-language select{font:inherit;max-width:98px;min-height:27px;padding:3px;background:#17261e;color:var(--ink);border:1px solid #697052;border-radius:4px}.duel .duel-top .duel-save{font-size:calc(11px * var(--game-text-scale, 1));white-space:nowrap;min-height:28px;margin-left:0;padding:4px 9px}
.duel-information{grid-column:1;grid-row:2/5;display:grid;grid-template-rows:166px minmax(0,1fr) 144px;min-height:0;background:linear-gradient(90deg,#20271f,#151c17);border-right:1px solid #9b8357;overflow:hidden}.duel-identity{padding:9px 11px;min-height:0;position:relative;overflow:auto;scrollbar-width:thin}.duel-enemy-identity{border-bottom:1px solid #696249;background:linear-gradient(140deg,#263f34,#1e2a23)}.duel-own-identity{border-top:1px solid #9e7954;background:linear-gradient(140deg,#4c382a,#2c281e)}.duel .duel-player-header{display:flex;align-items:center;gap:8px;min-height:29px;background:none;padding:0}.duel .duel-player-name{font-size:calc(12px * var(--game-text-scale, 1));font-weight:650}.duel .duel-player-name:is(button){border-color:#bbaa70;padding:3px 8px}.duel-life{margin-left:auto;font:600 calc(23px * var(--game-text-scale, 1))/1 Georgia,serif;color:#ffe5a2;white-space:nowrap;font-variant-numeric:tabular-nums}.duel-poison{font-size:calc(10px * var(--game-text-scale, 1));color:#bfd68d}.duel-hand-count{font-size:calc(10px * var(--game-text-scale, 1));color:#c4cbb3;display:block;margin-top:4px}
.duel-mana{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin:5px 0 6px}.duel-mana .duel-mana-value{display:grid;place-items:center;min-width:24px;min-height:24px;padding:1px;border:1px solid #abb59b77;border-radius:50%;font-size:calc(11px * var(--game-text-scale, 1));font-weight:700;background:#b4afa0;color:#171d18;box-shadow:inset 0 0 0 3px #0001}.duel-mana .mana-1{background:#35353b;color:#f2ede2}.duel-mana .mana-2{background:#83bbd4;color:#172f42}.duel-mana .mana-3{background:#91b184;color:#16351c}.duel-mana .mana-4{background:#d1896e;color:#401d16}.duel-mana .mana-5{background:#e7ddb5;color:#443f20}.duel .duel-mana-extra{font-size:calc(9px * var(--game-text-scale, 1));padding:2px 5px}.duel-mana button{box-shadow:0 0 0 1px #ead69566}
.duel-piles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;align-items:start}.duel-library,.duel-pile{min-width:0;position:relative;border:1px solid #83745355;border-radius:4px;background:#121a1588}.duel-pile summary{list-style:none;cursor:pointer;min-height:59px;padding:3px 3px 25px;position:relative}.duel-pile summary::-webkit-details-marker{display:none}.duel-pile[open]{grid-column:span 2}.duel-pile[open] summary{min-height:40px}.duel-pile summary:after{content:'▾';position:absolute;right:3px;top:2px;font-size:calc(10px * var(--game-text-scale, 1));color:#e9d9ae}.duel-library{min-height:59px;padding:3px 3px 25px}.duel-library-back{display:block;width:22px;height:29px;border:1px solid #c4a46c;border-radius:3px;background:radial-gradient(ellipse,#8d653a 15%,#273f39 22%,#302d26 35%,#806342 50%,#261f1b 80%);box-shadow:2px 1px #181a15,3px 2px #9b8255}.duel-pile-preview{display:block;width:22px;height:29px;object-fit:cover;border:1px solid #b69d69;border-radius:2px;margin-top:1px}.duel-pile-label{font-size:calc(9px * var(--game-text-scale, 1));white-space:nowrap;color:#d1d7c2;position:absolute;left:3px;bottom:4px}.duel-zone-count{font:600 calc(11px * var(--game-text-scale, 1))/1.1 system-ui;position:absolute;right:3px;bottom:5px;color:#f0d79a;padding-left:3px;background:#19231be6}.duel-pile-list{max-height:104px;overflow:auto;display:flex;flex-direction:column;gap:4px;padding:4px}.duel .duel-public-card{font-size:calc(10px * var(--game-text-scale, 1));text-align:left;padding:4px;min-height:26px;background:#263b2c;border-color:#786e4b;overflow-wrap:anywhere}
.duel-opponent-hand{margin:0!important;position:absolute;right:9px;bottom:7px}.duel-opponent-hand h4{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.duel .duel-opponent-hand .duel-card-row{gap:2px;min-height:0;padding:0;max-width:104px}.duel .duel-opponent-hand .duel-card{width:10px;height:15px;flex:none}.duel .duel-opponent-hand .duel-card-face{height:15px;min-height:0;border-radius:2px;outline-offset:0}.duel-opponent-hand .duel-card-name{display:none}
.duel-inspection-placeholder{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px;text-align:center;padding:22px;color:#9da993;min-height:0;background:radial-gradient(ellipse at center,#293627,#161f19 75%);border:7px solid #19221b;box-shadow:inset 0 0 0 1px #73624355}.duel-inspection-placeholder h3{font:calc(17px * var(--game-text-scale, 1)) Georgia,serif;color:#d9c699}.duel-inspection-placeholder p{font-size:calc(12px * var(--game-text-scale, 1));line-height:1.6;max-width:180px;margin:0}.duel-inspection-mark{font-size:calc(52px * var(--game-text-scale, 1));color:#97825955}
.duel .duel-arena{grid-column:2;grid-row:2;display:grid;grid-template-rows:1fr 1fr;min-height:0;overflow:hidden;background:#23362c}.duel .duel-player{display:grid;grid-template-columns:68px minmax(0,1fr);min-height:0;padding:0;overflow:hidden}.duel-opponent{background:radial-gradient(ellipse at 45% 50%,#3c6652 0,#243e33 75%);border-bottom:2px solid #b19965}.duel-self{background:radial-gradient(ellipse at 45% 50%,#8b5840 0,#553b2b 85%)}.duel-field{grid-row:1;grid-column:2;display:flex;flex-direction:column;gap:3px;min-height:0;min-width:0;padding:6px 12px;overflow:auto;scrollbar-width:thin;scrollbar-color:#b59b6b55 transparent}.duel .duel-field .duel-zone{flex:1;min-height:0}.duel .duel-field .duel-stack{flex:0 0 58px;min-height:58px;border-top:1px solid #d9b66a66}.duel-zone h4{font-size:calc(9px * var(--game-text-scale, 1));letter-spacing:.08em;text-transform:uppercase;color:#d6d9bb;margin:0;font-weight:550}.duel .duel-zone .duel-card-row{display:flex;flex-wrap:nowrap;gap:9px;align-items:flex-start;min-height:0;padding:4px 3px 3px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:#baab7f66 transparent}.duel-empty{font-size:calc(11px * var(--game-text-scale, 1));color:#b2bba4;margin:8px 1px}.duel-card{width:78px;flex:0 0 78px;position:relative;transition:transform 100ms;min-width:0}.duel .duel-card-face{position:relative;display:block;width:100%;height:80px;min-height:0;min-width:0;padding:0;overflow:hidden;border:1px solid #9d936b;border-radius:4px;background:#171e16;box-shadow:0 3px 8px #0005}.duel-card-title{display:block;min-height:23px;height:23px;overflow:hidden;text-align:left;padding:3px 14px 2px 4px;font:600 calc(9px * var(--game-text-scale, 1))/1.05 Georgia,serif;color:#f8e8bc;background:#354331}.duel-card-face img{display:block;width:100%;height:45px;object-fit:cover}.duel-card-type{display:block;padding:2px 3px;text-align:left;font:calc(8px * var(--game-text-scale, 1))/1.1 system-ui;color:#e1e5cf;background:#283624;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.duel-card-name{font:600 calc(11px * var(--game-text-scale, 1))/1.2 Georgia,serif;display:block;padding:6px}.duel-card-caption{font-size:calc(9px * var(--game-text-scale, 1));line-height:1.2;color:#eee9d3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}.duel-card-stats{position:absolute;bottom:15px;right:3px;z-index:1;padding:1px 4px;font:700 calc(10px * var(--game-text-scale, 1))/1.2 system-ui;color:#fff4c7;border:1px solid #bca267;border-radius:3px;background:#142018eb}.duel-card-state{display:block;font-size:calc(8px * var(--game-text-scale, 1));color:#ffe2aa;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.duel .duel-card-info{position:absolute;top:3px;right:3px;z-index:2;padding:0;min-height:0;width:16px;height:16px;border-radius:50%;background:#16251eef;font:700 calc(11px * var(--game-text-scale, 1))/calc(14px * var(--game-text-scale, 1)) Georgia;border-color:#bfbb8a}.duel-card.tapped .duel-card-face{transform:rotate(5deg);transform-origin:center}.duel-card.selectable .duel-card-face{outline:2px solid #f5d58c;outline-offset:1px;box-shadow:0 0 12px #dfbf6166}.duel-card.selectable:hover,.duel-card.selectable:focus-within{transform:translateY(-2px)}.duel-card.attacking .duel-card-face{border-color:#ffbb89}.duel-card.blocking .duel-card-face{border-color:#afd8ed}.duel-card.card-back .duel-card-face{background:repeating-linear-gradient(45deg,#332b20,#332b20 3px,#6b563b 3px,#6b563b 5px);border-color:#a58d5d}
.duel .duel-lands .duel-card{width:100px;flex-basis:100px}.duel .duel-lands .duel-card-face{height:49px}.duel-lands .duel-card-face img{height:26px}.duel-lands .duel-card-type,.duel-lands .duel-card-caption{display:none}.duel .duel-stack .duel-card{width:110px;flex-basis:110px}.duel .duel-stack .duel-card-face{height:36px}.duel-stack .duel-card-face img,.duel-stack .duel-card-type,.duel-stack .duel-card-caption{display:none}.duel-stack .duel-card-title{height:auto;font-size:calc(10px * var(--game-text-scale, 1))}
.duel>.duel-hand{grid-column:2;grid-row:3;min-width:0;min-height:0;margin:0;padding:7px 14px 4px;background:linear-gradient(180deg,#292b20,#1d241b);border-top:1px solid #b09661}.duel>.duel-hand h4{color:#e7cc8d;font-size:calc(10px * var(--game-text-scale, 1))}.duel .duel-hand .duel-card{width:100px;flex-basis:100px}.duel .duel-hand .duel-card-face{height:92px}.duel-hand .duel-card-title{font-size:calc(10px * var(--game-text-scale, 1));min-height:26px;height:26px;padding-right:18px}.duel-hand .duel-card-face img{height:47px}.duel-hand .duel-card-type{font-size:calc(9px * var(--game-text-scale, 1))}.duel-hand .duel-card-caption{font-size:calc(10px * var(--game-text-scale, 1))}.duel .duel-hand .duel-card-row{padding-bottom:5px;gap:9px}.duel-hand .duel-card-stats{bottom:16px}
.duel-phase-track{grid-row:1;grid-column:1;display:flex;flex-direction:column;min-height:0;overflow:hidden;border-right:1px solid #c7ac6e88;padding:4px 5px;background:#1d2825}.duel-enemy-phases{background:linear-gradient(90deg,#543a45,#382c34)}.duel-own-phases{background:linear-gradient(90deg,#2a3e58,#202d43)}.duel-phase-owner{font-size:calc(8px * var(--game-text-scale, 1));text-align:center;color:#ceccb7;line-height:12px;height:12px;white-space:nowrap}.duel-phase-steps{flex:1;min-height:0;display:grid;grid-template-rows:repeat(8,minmax(0,1fr));list-style:none;padding:0;margin:0;gap:1px}.duel-phase-step{display:flex;align-items:center;gap:4px;font-size:calc(7px * var(--game-text-scale, 1));line-height:1.05;color:#c4c0bd;min-height:0;border-radius:3px;padding:1px}.duel-phase-symbol{flex:none;display:grid;place-items:center;width:20px;height:20px;border:1px solid #d0b9b044;border-radius:4px;background:#151b1b44}.duel-phase-symbol svg{width:15px;height:15px}.duel-phase-name{max-width:29px;overflow-wrap:normal}.duel-phase-step.current{color:#ffe7b0;background:#d4b77924;box-shadow:inset 0 0 0 1px #efc969}.duel-phase-step.current .duel-phase-symbol{background:#e4c07b;color:#16221a;border-color:#ffe3a5}.duel-phase-step.passed{color:#d5cfb1}.duel-phase-track:not(.active-turn) .duel-phase-steps{opacity:.68}.duel-phase-guide{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.duel .duel-actions{grid-column:2;grid-row:4;display:flex;gap:7px;align-items:center;align-content:center;flex-wrap:wrap;min-height:72px;max-height:155px;overflow:auto;padding:8px 14px;background:#121e17;border-top:1px solid #a68a58;box-shadow:0 -6px 18px #0002;z-index:2;flex:none}.duel-prompt{font-size:calc(12px * var(--game-text-scale, 1));line-height:1.4;flex:1 1 280px;margin:0;max-height:90px;overflow:auto;color:#eee8d1}.duel .duel-action{min-height:34px;font-size:calc(12px * var(--game-text-scale, 1));font-weight:600;background:#d4b779;border-color:#f1d598;color:#20251a}.duel-amount-input,.duel-word-input{display:inline-flex;align-items:center;gap:5px;font-size:calc(11px * var(--game-text-scale, 1));margin:0}.duel-amount-input input,.duel-word-input select{width:72px;padding:5px;border:1px solid #a29468;border-radius:4px;color:#f2ecd8;background:#1d2922;font:inherit;min-height:30px}.duel-word-input select{width:auto;max-width:110px}
/* Higher specificity than campaign-duel.css, which follows this stylesheet. */
#campaign-duel-detail.duel-card-detail{position:fixed;inset:184px auto 162px 19px;width:218px;max-height:none;z-index:50;overflow:auto;box-sizing:border-box;padding:10px;background:#1b281d;color:#f2ead5;border:1px solid #9b8456;border-radius:4px;box-shadow:inset 0 0 28px #0b150f;scrollbar-width:thin;font:calc(12px * var(--game-text-scale, 1))/1.5 system-ui}#campaign-duel-detail.duel-card-detail[hidden]{display:none}#campaign-duel-detail.duel-card-detail>button{float:right;min-height:26px;padding:3px 8px;background:#35432c;color:#f2ead5;border:1px solid #8e805b;border-radius:3px;font:calc(11px * var(--game-text-scale, 1)) system-ui;cursor:pointer}#campaign-duel-detail.duel-card-detail h2{font:600 calc(16px * var(--game-text-scale, 1))/1.2 Georgia,serif;margin:2px 48px 10px 0;color:#f1db9f}#campaign-duel-detail.duel-card-detail>img{display:block;width:100%;max-height:160px;object-fit:contain;margin:0 auto 10px}#campaign-duel-detail.duel-card-detail p{font:calc(12px * var(--game-text-scale, 1))/1.5 system-ui;margin:9px 0;white-space:pre-line}
@media(min-height:850px) and (min-width:1000px){.duel{grid-template-rows:0 minmax(0,1fr) 150px minmax(80px,max-content)}.duel .duel-card{width:95px;flex-basis:95px}.duel .duel-card-face{height:110px}.duel-card-face img{height:72px}.duel .duel-hand .duel-card{width:112px;flex-basis:112px}.duel .duel-hand .duel-card-face{height:111px}.duel-hand .duel-card-face img{height:67px}.duel-phase-step{font-size:calc(8px * var(--game-text-scale, 1))}.duel-phase-symbol{width:23px;height:23px}.duel-phase-symbol svg{width:18px;height:18px}#campaign-duel-detail.duel-card-detail{top:184px}#campaign-duel-detail.duel-card-detail>img{max-height:220px}}
@media(max-width:900px){.duel{--info:196px;inset:5px;grid-template-rows:0 minmax(0,1fr) 126px minmax(76px,max-content)}.duel-information{grid-template-rows:166px minmax(0,1fr) 144px}.duel-identity{padding:7px}.duel .duel-top h2{font-size:calc(15px * var(--game-text-scale, 1))}.duel-phase{display:none}.duel-field{padding:5px 7px}.duel .duel-player{grid-template-columns:60px minmax(0,1fr)}.duel .duel-actions{padding:7px;gap:6px}.duel-prompt{flex-basis:200px}.duel .duel-mana-value{min-width:22px;min-height:22px}.duel-mana{gap:4px}.duel .duel-hand .duel-card{width:88px;flex-basis:88px}.duel-phase-track{padding:4px 2px}#campaign-duel-detail.duel-card-detail{left:12px;width:182px;top:179px;bottom:156px}}
@media(max-width:640px){.duel{inset:3px;--info:0px;grid-template-columns:minmax(0,1fr);grid-template-rows:0 minmax(0,1fr) 116px minmax(92px,max-content);border-radius:7px}.duel .duel-top{grid-column:1;padding:5px 8px;gap:5px;min-height:42px}.duel .duel-top h2{font-size:calc(13px * var(--game-text-scale, 1))}.duel-turn{font-size:calc(9px * var(--game-text-scale, 1));padding:2px 5px}.duel .duel-top .game-language>span{display:none}.duel .duel-top .game-language select{width:68px;font-size:calc(10px * var(--game-text-scale, 1))}.duel .duel-top .duel-save{font-size:calc(10px * var(--game-text-scale, 1));padding:3px 5px}.duel-information{grid-column:1;grid-row:2;display:contents}.duel-inspection-placeholder{display:none}.duel-identity{position:absolute;left:7px;width:118px;max-height:50px;overflow:auto;z-index:1;background:#1b2c24e8;border:1px solid #9b87576b;border-radius:4px;padding:4px}.duel-enemy-identity{top:47px}.duel-own-identity{top:calc(50% - 53px)}.duel .duel-player-header{min-height:23px;gap:3px}.duel .duel-player-name{font-size:calc(10px * var(--game-text-scale, 1))}.duel-life{font-size:calc(17px * var(--game-text-scale, 1))}.duel-mana{gap:2px;margin:3px 0}.duel-mana .duel-mana-value{min-width:16px;min-height:16px;font-size:calc(9px * var(--game-text-scale, 1))}.duel-hand-count{font-size:calc(8px * var(--game-text-scale, 1))}.duel-piles{gap:3px}.duel-pile-label{font-size:calc(8px * var(--game-text-scale, 1))}.duel-zone-count{font-size:calc(9px * var(--game-text-scale, 1))}.duel-opponent-hand{display:none}.duel .duel-arena{grid-column:1;grid-row:2}.duel .duel-player{grid-template-columns:49px minmax(0,1fr);overflow:hidden}.duel-field{padding:5px 5px 5px 3px}.duel .duel-field .duel-zone{min-height:68px}.duel .duel-lands .duel-card{width:85px;flex-basis:85px}.duel .duel-field .duel-zone:first-child{padding-left:124px;min-height:56px}.duel .duel-field .duel-zone:first-child .duel-card{width:66px;flex-basis:66px}.duel-phase-step{font-size:calc(6px * var(--game-text-scale, 1));gap:2px;padding:0}.duel-phase-symbol{width:17px;height:17px}.duel-phase-symbol svg{width:13px;height:13px}.duel-phase-owner{font-size:calc(6px * var(--game-text-scale, 1))}.duel-phase-name{max-width:25px}.duel>.duel-hand{grid-column:1;grid-row:3;padding:5px 7px}.duel .duel-hand .duel-card{width:82px;flex-basis:82px}.duel .duel-hand .duel-card-face{height:82px}.duel-hand .duel-card-title{font-size:calc(9px * var(--game-text-scale, 1));height:24px;min-height:24px}.duel-hand .duel-card-face img{height:39px}.duel-hand .duel-card-caption{font-size:calc(9px * var(--game-text-scale, 1))}.duel .duel-actions{grid-column:1;grid-row:4;max-height:142px;min-height:92px;align-content:start}.duel-prompt{flex:1 1 100%;font-size:calc(11px * var(--game-text-scale, 1));max-height:44px}.duel .duel-action{min-height:30px;font-size:calc(11px * var(--game-text-scale, 1));padding:4px 8px}.duel-amount-input,.duel-word-input{font-size:calc(10px * var(--game-text-scale, 1))}.duel-amount-input input{width:52px}.duel-word-input select{max-width:75px}body:has(#campaign-duel-detail.duel-card-detail:not([hidden])) .duel{bottom:43vh}#campaign-duel-detail.duel-card-detail{inset:auto 3px 3px 3px;width:auto;height:calc(43vh - 6px);max-height:none;padding:12px;z-index:50}#campaign-duel-detail.duel-card-detail>img{float:left;width:100px;max-height:140px;margin:0 12px 8px 0}#campaign-duel-detail.duel-card-detail p{font-size:calc(12px * var(--game-text-scale, 1))}#campaign-duel-detail.duel-card-detail h2{font-size:calc(17px * var(--game-text-scale, 1))}}
@media(prefers-reduced-motion:reduce){.duel-card{transition:none}.duel-card.selectable:hover,.duel-card.selectable:focus-within{transform:none}}

/* Presentation controls stay usable without expanding the board or clipping notices. */
.duel .duel-top{overflow:visible}.duel .campaign-duel-presentation{font-size:calc(10px * var(--game-text-scale, 1));gap:5px}.duel .campaign-duel-presentation button{font-size:calc(10px * var(--game-text-scale, 1));white-space:nowrap}.duel .campaign-duel-notices{font-size:calc(10px * var(--game-text-scale, 1))}.duel .campaign-duel-notices>summary{padding:5px 7px}.duel .campaign-duel-notice-content{position:fixed;top:60px;right:20px;z-index:65}
@media(max-width:640px){.duel{grid-template-rows:0 112px minmax(110px,1fr) 116px minmax(92px,max-content)}.duel .duel-top{min-height:74px;align-content:center;flex-wrap:wrap}.duel .campaign-duel-presentation{flex:1 1 100%;justify-content:flex-end;height:25px}.duel .campaign-duel-notice-content{top:82px;right:8px}.duel-information{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:112px;grid-column:1;grid-row:2;min-width:0;border:0}.duel-identity{position:relative;inset:auto;width:auto;max-height:none;height:112px;overflow:auto;border-radius:0}.duel-own-identity,.duel-enemy-identity{top:auto}.duel-inspection-placeholder{display:none}.duel .duel-arena{grid-row:3;grid-template-rows:repeat(2,minmax(0,1fr));overflow:auto}.duel .duel-field .duel-zone:first-child{padding-left:0;min-height:56px}.duel>.duel-hand{grid-row:4}.duel .duel-actions{grid-row:5}body:has(#campaign-duel-detail.duel-card-detail:not([hidden])) .duel{bottom:37vh;grid-template-rows:0 0 minmax(60px,1fr) 76px minmax(144px,max-content)}body:has(#campaign-duel-detail.duel-card-detail:not([hidden])) .duel-information{visibility:hidden}body:has(#campaign-duel-detail.duel-card-detail:not([hidden])) .duel>.duel-hand{overflow:auto}#campaign-duel-detail.duel-card-detail{height:calc(37vh - 6px)}}

/* Fixed card heights never spill into another native zone when the action form grows. */
.duel .duel-field .duel-front{flex:1 0 112px;min-height:112px}.duel .duel-field .duel-lands{flex:0 0 70px;min-height:70px}
@media(max-width:640px){.duel .duel-field .duel-front{flex-basis:112px;min-height:112px}.duel .duel-field .duel-lands{flex-basis:70px;min-height:70px}.duel-phase-symbol{width:14px;height:14px}.duel-phase-symbol svg{width:11px;height:11px}}

.duel-mana .duel-mana-value{display:inline-flex;justify-content:center;gap:2px;min-width:28px;font-size:calc(10px * var(--game-text-scale, 1))}.duel-mana-value>svg{width:11px;height:11px;flex:none}@media(max-width:640px){.duel-mana .duel-mana-value{min-width:24px;font-size:calc(9px * var(--game-text-scale, 1));gap:1px}.duel-mana-value>svg{width:10px;height:10px}}

/* Native phase-out stays on its original battlefield, without changing targets. */
.duel-card.phased-out .duel-card-face{border-style:dashed;border-color:#b8cbd1}.duel-card.phased-out .duel-card-face>img{filter:grayscale(.9)}.duel-card.phased-out .duel-card-state{color:#f1ead4;background:#24343a;border-bottom:1px dashed #b8cbd1}

/* Read-only inspector facts precede the artwork, including on narrow screens. */
.duel-card-detail .duel-detail-facts{display:grid;gap:10px;clear:both;margin:0 0 12px;padding:10px;background:#132720;border:1px solid #61764d;border-radius:8px;color:#f2e8c8}
.duel-card-detail .duel-detail-facts h3{font:600 calc(12px * var(--game-text-scale, 1))/1.35 system-ui,sans-serif;text-transform:uppercase;letter-spacing:.04em;color:#c8d7b9;margin:0 0 7px}
.duel-detail-symbols{display:flex;flex-wrap:wrap;gap:5px;align-items:center;min-height:29px}
.duel-cost-symbol{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;position:relative;border:1px solid #b7b29b;border-radius:50%;background:#d0c9b2;color:#151e18;box-shadow:inset 0 1px 2px #fff6;font:bold calc(17px * var(--game-text-scale, 1))/1 system-ui,sans-serif;flex:0 0 auto}
.duel-cost-symbol svg{width:22px;height:22px}.duel-cost-symbol.cost-preta{background:#a99cbd;color:#20142b}.duel-cost-symbol.cost-azul{background:#a7d4e8;color:#153447}.duel-cost-symbol.cost-verde{background:#a7cba4;color:#1b3b1f}.duel-cost-symbol.cost-vermelha{background:#e7a080;color:#5b1e10}.duel-cost-symbol.cost-branca{background:#f7edbd;color:#4a3c1c}
.duel-detail-stat-row{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:5px 0}.duel-detail-stat-label{font:calc(13px * var(--game-text-scale, 1))/1.35 system-ui,sans-serif}.duel-detail-stat-values{font:700 calc(23px * var(--game-text-scale, 1))/1.2 system-ui,sans-serif;white-space:nowrap;color:#ffe0a2}
.duel-card-detail .duel-detail-note{font:calc(11px * var(--game-text-scale, 1))/1.4 system-ui,sans-serif;color:#b9c8b5;margin:6px 0 0}.duel-detail-unavailable{font:calc(13px * var(--game-text-scale, 1))/1.4 system-ui,sans-serif}
.duel-detail-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:600px){.duel-card-detail .duel-detail-facts{grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:8px;padding:8px}.duel-detail-stat-row{flex-wrap:wrap;gap:2px}.duel-detail-stat-values{font-size:calc(20px * var(--game-text-scale, 1))}.duel-detail-stat-label{font-size:calc(12px * var(--game-text-scale, 1))}.duel-card-detail .duel-detail-facts h3{font-size:calc(10px * var(--game-text-scale, 1))}.duel-cost-symbol{width:27px;height:27px}}

/* More inspection space at common desktop widths; retain wide-screen rules. */
@media(min-width:1320px) and (max-width:1599px){.duel{--info:280px}#campaign-duel-detail.duel-card-detail{width:262px}}

/* Existing native decisions remain explicit; the confirmation stays easy to find. */
.duel-phase-track{overflow-y:auto;scrollbar-width:thin;scrollbar-color:#c8ae72 #1d2825}.duel-phase-steps{flex:none;min-height:176px;grid-template-rows:repeat(8,minmax(22px,1fr))}.duel-phase-track:focus-visible{outline:2px solid #ffe4a3;outline-offset:-3px}
.duel .duel-actions{display:grid;grid-template-columns:minmax(0,1fr) 190px;gap:8px 14px;min-height:104px;max-height:240px;padding:10px 14px;border-top:2px solid #c7a466;align-items:center;overflow:hidden}
.duel-decision-copy{grid-column:1;grid-row:1;max-height:140px;overflow:auto}.duel-choice-controls{grid-column:1;grid-row:2;display:flex;flex-wrap:wrap;align-items:center;gap:8px;max-height:72px;overflow:auto;min-width:0}.duel-confirm-controls{grid-column:2;grid-row:1/3;align-self:center}.duel-choice-controls:empty,.duel-confirm-controls:empty{display:none}.duel-actions:not(:has(.duel-confirm-controls:not(:empty))){grid-template-columns:minmax(0,1fr)}
.duel-decision-copy{flex:1 1 270px;min-width:0}.duel-decision-title{display:block;margin:0 0 3px;color:#ffe5a3;font:700 calc(13px * var(--game-text-scale,1))/1.3 system-ui}
.duel .duel-decision-copy .duel-prompt{margin:0;max-height:78px;font-size:calc(13px * var(--game-text-scale,1));overflow-wrap:anywhere}
.duel-decision-help{margin:5px 0 0;color:#d0d9c9;font:calc(11px * var(--game-text-scale,1))/1.4 system-ui;overflow-wrap:anywhere}
.duel .duel-action{min-height:44px;max-width:100%;padding:10px 14px;font-size:calc(13px * var(--game-text-scale,1));line-height:1.25;white-space:normal;overflow-wrap:anywhere;flex:0 1 auto;background:#263d30;color:#f4ecd5;border-color:#a69a72}
.duel .duel-action-primary,#campaign-duel-status .duel-recovery{width:190px;min-height:48px;flex:0 0 auto;padding:11px 18px;border:2px solid #ffe1a1;background:#e8c477;color:#18231a;box-shadow:0 2px 0 #7b6032,0 0 0 3px #d4b77926;font:750 calc(15px * var(--game-text-scale,1))/1.2 system-ui;border-radius:6px;cursor:pointer}
.duel .duel-action-primary:not(:disabled):hover,#campaign-duel-status .duel-recovery:not(:disabled):hover{background:#ffdfa0}
.duel .duel-action-primary:focus-visible,#campaign-duel-status .duel-recovery:focus-visible{outline:3px solid #fff7d7;outline-offset:4px}
.duel .duel-action-primary:disabled,#campaign-duel-status .duel-recovery:disabled{opacity:.55;cursor:default}
.duel .duel-actions[data-state="error"]{border-top-color:#f3b888;background:#2a211a}.duel .duel-actions[data-state="error"] .duel-prompt{color:#ffe4ce}
#campaign-duel-status{overflow-wrap:anywhere;max-height:70vh;overflow:auto}#campaign-duel-status .duel-recovery{max-width:100%}
@media(max-width:900px){.duel .duel-actions{padding:9px;gap:8px}.duel-decision-copy{flex-basis:220px}}
@media(max-width:640px){.duel .duel-actions{grid-template-columns:minmax(0,1fr) 170px;min-height:144px;max-height:240px;align-content:start;gap:8px}.duel-decision-copy{grid-column:1/-1;grid-row:1;flex:1 1 100%}.duel-choice-controls{grid-row:2;max-height:64px}.duel-confirm-controls{grid-row:2;grid-column:2}.duel-actions:not(:has(.duel-confirm-controls:not(:empty))) .duel-choice-controls{grid-column:1/-1}.duel .duel-decision-copy .duel-prompt{max-height:58px}.duel .duel-action-primary{width:170px;margin-left:auto}.duel .duel-action{min-height:44px}.duel-decision-title{font-size:calc(12px * var(--game-text-scale,1))}.duel-decision-help{font-size:calc(10px * var(--game-text-scale,1))}#campaign-duel-status{inset:18% 5%;padding:20px}}

/* Inspection is passive. Native card choices have a separate explicit action. */
.duel-tools{position:absolute;left:9px;top:9px;z-index:6;min-width:0}.duel-tools:empty{display:none}.duel-tools>button{width:44px;height:44px;min-height:44px;padding:0}
.duel-enemy-identity .duel-player-header{padding-left:44px;min-height:44px}.duel-turn-indicator{display:block;font:calc(10px * var(--game-text-scale,1))/1.2 system-ui;color:#d7d3b9;text-align:right;margin:0 0 3px}
.duel-card-title{padding-right:4px}.duel-card.inspected .duel-card-face{outline:2px solid #f8e4ae;outline-offset:2px}.duel-card:not(.card-back) .duel-card-face:not(:disabled){cursor:zoom-in}.duel-card.card-back .duel-card-face:disabled{opacity:1}
.duel-card-selection,.duel-concealed-choices{display:flex;align-items:center;gap:7px;min-width:0;max-width:100%;flex-wrap:wrap}.duel-selected-name{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#f6e5bb;font-weight:650}.duel .duel-select-card{border-color:#ddc893;background:#304b39}
.duel-concealed-choices label{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:calc(11px * var(--game-text-scale,1))}.duel-concealed-choices select{min-height:44px;max-width:150px;padding:5px;color:#f2ead5;background:#172a20;border:1px solid #a49773;border-radius:4px;font:inherit}
.duel-card-detail .card-inspector-close{font-size:24px;min-width:44px;min-height:44px;line-height:1;padding:0}.duel-card-detail:not(dialog){scrollbar-gutter:stable}
@media(max-width:640px){.duel-tools{left:7px;top:7px}.duel-tools>button{width:44px;height:44px;min-height:44px}.duel-enemy-identity .duel-player-header{padding-left:44px;min-height:44px}.duel-turn-indicator{font-size:calc(9px * var(--game-text-scale,1))}.duel-concealed-choices{flex-wrap:nowrap;align-items:stretch;gap:4px}.duel-concealed-choices label{font-size:calc(10px * var(--game-text-scale,1))}.duel-concealed-choices select{width:72px;max-width:100%;font-size:calc(11px * var(--game-text-scale,1))}.duel-concealed-choices .duel-action{padding:5px;min-width:70px}.duel-card-selection{align-items:stretch}.duel-selected-name{max-width:100%;font-size:calc(11px * var(--game-text-scale,1))}}

.duel-choice-controls:not(:has(> :not([hidden]))){display:none}

@media(max-width:640px){.duel-card-selection .duel-selected-name{display:none}.duel .duel-select-card{white-space:nowrap;overflow-wrap:normal}.duel-concealed-choices{width:100%}.duel-concealed-choices label{min-width:0;flex:1}.duel-concealed-choices select{width:100%;min-width:0}.duel-concealed-choices .duel-action{flex:none;white-space:nowrap;overflow-wrap:normal;min-width:0}}

/* One click chooses an offered card; the separate information button only reads. */
.duel .duel-card-info{width:24px;height:24px;min-width:24px;min-height:24px;top:2px;right:2px;padding:0;font:700 15px/22px Georgia,serif;color:#f8e8bc;cursor:help}
.duel .duel-card-title{padding-right:29px}
.duel .duel-card.selectable .duel-card-face:not(:disabled){cursor:pointer}
.duel .duel-card-info:focus-visible{outline:2px solid #f5d58c;outline-offset:2px}
@media(pointer:coarse){.duel .duel-card-info{width:32px;height:32px;min-width:32px;min-height:32px;line-height:30px}.duel .duel-card-title{padding-right:36px}}

/* Native Generic676 is an effect marker, not a printed card. Keep its offered action. */
.duel .duel-card.duel-effect-marker{width:104px;flex:0 0 104px;align-self:flex-start}
.duel .duel-effect-marker .duel-card-face{height:auto;min-height:74px;padding:30px 8px 10px;border-style:dashed;border-radius:14px;background:linear-gradient(145deg,#304939,#182b22);box-shadow:none}
.duel .duel-effect-icon{position:absolute;top:5px;left:10px;color:#f2d98e;font:22px/24px Georgia,serif}
.duel .duel-effect-label{display:block;font:600 calc(12px * var(--game-text-scale,1))/1.3 system-ui;text-align:left;color:#f5e6bd;overflow-wrap:anywhere}
.duel .duel-effect-marker .duel-card-caption{display:none}
.duel-effect-detail{padding:16px;border:1px dashed #b6a276;border-radius:12px;background:#1b2e24;color:#eee4c4}
.duel-effect-detail h3{margin-top:0;font:600 calc(20px * var(--game-text-scale,1))/1.25 Georgia,serif}.duel-effect-detail p{line-height:1.5}
@media(pointer:coarse){.duel .duel-effect-marker .duel-card-face{padding-top:38px}}

/* Opening exchange: card clicks only mark; confirmation submits one decision. */
.duel .duel-card.opening-selectable .duel-card-face:not(:disabled){cursor:pointer;border-color:#c8ae72}
.duel .duel-card.opening-selected .duel-card-face{outline:3px solid #ffe1a1;outline-offset:2px;box-shadow:0 0 0 6px #d4b77933}
.duel-opening-badge{position:absolute;top:35px;left:4px;z-index:6;padding:3px 6px;border-radius:4px;background:#f0d18a;color:#16281c;font:750 11px/1.2 system-ui;pointer-events:none}
.duel-opening-badge[hidden]{display:none}
.duel-opening-selection-status{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font:600 calc(12px * var(--game-text-scale,1))/1.3 system-ui;color:#ffe5a3}
.duel-opening-rule{flex-basis:100%;font-size:calc(10px * var(--game-text-scale,1));font-weight:400;color:#d0d9c9}
.duel:has(.opening-selectable) .duel-choice-controls{max-height:110px}
@media(max-width:640px){.duel:has(.opening-selectable) .duel-actions{grid-template-columns:minmax(0,1fr);min-height:240px;max-height:300px;gap:7px}.duel:has(.opening-selectable) .duel-decision-copy{grid-column:1;grid-row:1;max-height:90px}.duel:has(.opening-selectable) .duel-choice-controls{grid-column:1;grid-row:2;max-height:none;overflow:visible}.duel-opening-selection-status{flex-basis:100%}.duel:has(.opening-selectable) .duel-confirm-controls{grid-column:1;grid-row:3}.duel:has(.opening-selectable) .duel-action-primary{width:100%;min-height:44px}.duel:has(.opening-selectable) .duel-choice-controls>.duel-action{flex:1;min-height:44px;padding:7px}.duel-opening-rule{max-width:none}}

/* Poison counter: display only. Append after the existing duel CSS.
 * The host header must wrap; the pill itself never compresses its number.
 */
.duel .duel-poison-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(4px * var(--game-text-scale, 1));
  flex: 0 0 auto;
  inline-size: max-content;
  min-inline-size: max-content;
  max-inline-size: none;
  box-sizing: border-box;
  padding: calc(3px * var(--game-text-scale, 1)) calc(6px * var(--game-text-scale, 1));
  border: 1px solid #839354;
  border-radius: 999px;
  background: #183026;
  color: #dce9b2;
  box-shadow: inset 0 1px 0 #d6c17a1c;
  line-height: 1;
  white-space: nowrap;
}
.duel .duel-poison-pill__icon {
  display: block;
  flex: 0 0 auto;
  inline-size: calc(17px * var(--game-text-scale, 1));
  block-size: calc(17px * var(--game-text-scale, 1));
  color: #b9d77d;
  overflow: visible;
}
.duel .duel-poison-pill__count {
  flex: 0 0 auto;
  color: #fff0bf;
  font: 750 calc(15px * var(--game-text-scale, 1))/1 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.duel .duel-poison-pill__label {
  flex: 0 0 auto;
  color: #dce9b2;
  font: 650 calc(9px * var(--game-text-scale, 1))/1.15 system-ui, sans-serif;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.duel .duel-poison-pill[data-poison-state="limit"] {
  background: #38251e;
  border-color: #c49558;
  color: #ffe0aa;
}
.duel .duel-poison-pill[data-poison-state="limit"] .duel-poison-pill__icon,
.duel .duel-poison-pill[data-poison-state="limit"] .duel-poison-pill__label { color: #ffd09e; }
.duel .duel-poison-pill[data-poison-state="clear"] { border-color: #526b54; }

/* Integration constraint for Root's header fix, not a stand-alone solution to
 * the entire sidebar layout: allow the complete badge to wrap to another row.
 * Do not add overflow:hidden, fixed width or text-overflow on the badge.
 */
.duel .duel-player-header:has(.duel-poison-pill) { flex-wrap: wrap; }
.duel .duel-player-header:has(.duel-poison-pill) .duel-life { flex-shrink: 0; }

/* The inspector is docked to its real grid slot by duel-inspection-layout. */
.duel .duel-identity{min-width:0}
.duel .duel-player-header{min-width:0;max-width:100%;flex-wrap:wrap;row-gap:5px}
.duel .duel-player-header .duel-player-name{min-width:0;overflow-wrap:anywhere}
.duel .duel-player-header .duel-life{flex:0 0 auto}
.duel .duel-player-header .duel-poison-pill{margin-left:auto}
#campaign-duel-detail.duel-card-detail{min-width:0;overflow-x:hidden;overflow-y:auto;overflow-wrap:anywhere;overscroll-behavior:contain}
#campaign-duel-detail.duel-card-detail .card-sheet{max-width:100%;min-width:0;box-sizing:border-box}
#campaign-duel-detail.duel-card-detail .card-inspector-close{float:none;display:block;min-width:32px;min-height:32px;margin:0 0 6px auto;padding:2px 7px;position:relative;z-index:1}
@media(min-width:641px){
 #campaign-duel .duel-information{grid-template-rows:clamp(182px,calc(194px * var(--game-text-scale,1)),270px) minmax(0,1fr) clamp(160px,calc(174px * var(--game-text-scale,1)),248px)}
 #campaign-duel-detail.duel-card-detail[data-inspection-dock="sidebar"]{padding:9px;border-radius:8px}
}
@media(min-width:641px) and (max-height:720px){
 #campaign-duel .duel-information{grid-template-rows:minmax(154px,25%) minmax(100px,1fr) minmax(132px,24%)}
}
@media(max-width:640px){
 .duel .duel-enemy-identity .duel-player-header{padding-left:0}
 .duel .duel-enemy-identity .duel-player-name{padding-left:44px}
 .duel .duel-player-header .duel-poison-pill{margin-left:0}
 .duel .duel-player-header .duel-life{margin-left:auto}
 #campaign-duel-detail.duel-card-detail .card-inspector-close{position:sticky;top:0;background:#253d31}
}
