/* Screen/pane flags (worlds-screen-*, *-pane, .rp-deck-row) replace :has(); `#_` never matches and only keeps the original :has(#id) specificity. */
/* Complete desktop skin. No state/action ownership, no DOM reparenting. */
.worlds-resource-surface{display:none}
@media(min-width:1000px) and (min-height:521px){
 #screen-game.worlds-desktop .game-outer-wrap{
  position:relative;isolation:isolate;grid-template-columns:272px minmax(0,1fr) 510px;
  column-gap:16px;padding:0 12px;
 }
 #screen-game.worlds-desktop :is(#left-panel,#right-panel,.field-wrap){display:contents}
 /* 階段列對齊盤面中心：盤面夾在 272px 左欄與 510px 右欄間，中心比視窗中心偏左 (510-272)/2=119px */
 #screen-game.worlds-desktop .phase-bar{left:calc(50% - 119px)}
 #screen-game.worlds-desktop .field-main{
  grid-column:2;grid-row:1;width:100%;max-width:100%;margin:0;overflow:visible;
 }
 #screen-game.worlds-desktop #card-preview-content{
  right:12px!important;top:12px!important;bottom:84px;width:510px!important;
 }
 #screen-game.worlds-desktop .worlds-resource-surface{
  display:block;position:absolute;left:12px;width:272px;top:12px;height:420px;
  z-index:-1;pointer-events:none;border-radius:5px;
  background:url('/assets/worlds/stone.png') center/112% 140%;
 }
 #screen-game.worlds-desktop .worlds-resource-opp{background-color:#253744;background-blend-mode:multiply}
 #screen-game.worlds-desktop .worlds-resource-my{top:455px;height:500px}
 #screen-game.worlds-desktop .worlds-resource-surface h2{
  margin:16px 20px;font:700 19px/1.5 'PMingLiU','Noto Serif TC',serif;
  color:#30352e;text-shadow:0 1px #fff8e8;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
 }
 #screen-game.worlds-desktop .worlds-resource-opp h2{color:#f6edda;text-shadow:0 1px #14212d}
 #screen-game.worlds-desktop #left-panel>div:not(.life-grid):not(.zone-lbl){display:none}
 #screen-game.worlds-desktop #right-panel>:is(.zone-lbl,.rp-divider){display:none!important}
 #screen-game.worlds-desktop #left-panel>.zone-lbl{
  position:absolute;left:32px;top:60px;font-size:12px;letter-spacing:1px;color:#ece5d3;
 }
 #screen-game.worlds-desktop #left-panel>.zone-lbl:nth-of-type(4){top:503px;color:#4e5149}
 #screen-game.worlds-desktop .life-grid{
  position:absolute;left:30px;top:84px;width:236px;margin:0;
  grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;
 }
 #screen-game.worlds-desktop #my-life{top:527px}
 #screen-game.worlds-desktop .life-c{width:100%;height:42px;border-width:1px;border-radius:2px}
 #screen-game.worlds-desktop :is(.worlds-ap-tools,.worlds-opp-tools){display:contents!important}
 #screen-game.worlds-desktop :is(.worlds-my-ap,.worlds-opp-ap){
  position:absolute;left:30px;top:148px;background:transparent!important;border:0!important;
  padding:0!important;align-items:flex-start!important;
 }
 #screen-game.worlds-desktop .worlds-my-ap{top:591px}
 #screen-game.worlds-desktop .worlds-opp-ap>div:first-child{color:#f3ead8!important}
 #screen-game.worlds-desktop .ap-row{justify-content:flex-start}
 #screen-game.worlds-desktop .ap-c{width:64px;height:86px;border-width:1px;border-radius:3px}
 #screen-game.worlds-desktop .ap-c.mini{width:64px;height:86px}
 #screen-game.worlds-desktop .worlds-opp-hand{
  position:absolute;left:30px;top:265px;align-items:center!important;flex-direction:row!important;
  gap:12px!important;background:#172d3de8!important;border:1px solid #9b9d89!important;
  color:#ffdf85;padding:6px 12px!important;border-radius:4px;
 }
 #screen-game.worlds-desktop .worlds-opp-hand>div{color:#ffdf85!important}
 #screen-game.worlds-desktop #opp-hand-count{font-size:32px!important;min-width:32px!important}
 #screen-game.worlds-desktop :is(.worlds-energy-box,#my-event-counter-box){
  top:708px!important;bottom:auto!important;left:30px!important;max-width:140px;
  background:transparent!important;border:0!important;padding:0!important;
 }
 #screen-game.worlds-desktop #my-event-counter-box{left:176px!important;max-width:90px}
 #screen-game.worlds-desktop #my-energy-counter{font-size:14px!important}
 #screen-game.worlds-desktop #my-energy-counter>span{white-space:nowrap;text-shadow:0 1px 1px #182c36,0 0 2px #182c36}
 #screen-game.worlds-desktop #my-event-counter{min-width:0}
 #screen-game.worlds-desktop #my-event-counter>div{width:90px;min-width:0}
 #screen-game.worlds-desktop #my-event-counter>div>div:last-child{flex-wrap:wrap}
 #screen-game.worlds-desktop #right-panel .mini-stack{
  position:absolute;top:335px;left:30px;width:70px;height:70px;margin:0;
  border:1px solid #92947e;border-radius:4px;font-size:28px;padding-top:16px;
  background:#f0e6cf;color:#303e42;box-shadow:0 2px 2px #152b3f55;
 }
 #screen-game.worlds-desktop #right-panel .mini-stack::before{
  content:attr(data-worlds-label);position:absolute;top:5px;left:0;right:0;
  font:700 12px/1.4 'Microsoft JhengHei',sans-serif;text-align:center;
 }
 #screen-game.worlds-desktop #right-panel :is(#opp-out-cnt,#my-out-cnt){left:112px}
 #screen-game.worlds-desktop #right-panel :is(#opp-removed-cnt,#my-removed-cnt){left:194px}
 #screen-game.worlds-desktop #right-panel :is(#my-deck-cnt,#my-out-cnt,#my-removed-cnt){top:818px}
 #screen-game.worlds-desktop #right-panel #my-removezone-cnt{top:899px;left:194px;height:55px}
 #screen-game.worlds-desktop #right-panel #my-removezone-cnt{padding-top:22px;font-size:24px}
 #screen-game.worlds-desktop #right-panel #my-removezone-cnt::before{
  content:'移除區\A本回合可用';white-space:pre-line;font-size:9px;line-height:1.1;top:3px;color:#594a25;
 }
 #screen-game.worlds-desktop #extraDrawBtn{
  position:absolute;top:899px;left:30px;width:150px!important;font-size:13px!important;text-wrap:balance;
 }
 #screen-game.worlds-desktop :is(#game-chat-toggle,#game-log-toggle,#quick-msg-toggle){
  position:absolute!important;bottom:16px;left:20px;width:80px!important;margin:0!important;
  padding:9px 3px!important;height:44px;font-size:12px!important;letter-spacing:0!important;white-space:nowrap;
  background:#eee4cd!important;border:1px solid #a39a83!important;color:#30404a!important;
  border-radius:4px;box-shadow:0 2px 3px #122b3b66;
 }
 #screen-game.worlds-desktop #game-log-toggle{left:106px}
 #screen-game.worlds-desktop #quick-msg-toggle{left:192px}
 #screen-game.worlds-desktop .rp-actions{
  position:absolute;right:12px;bottom:16px;width:510px;margin:0;padding:0;
  display:flex;flex-direction:row;gap:12px;background:transparent;border:0;
 }
 #screen-game.worlds-desktop .rp-actions .abtn{flex:1;width:auto;font-size:18px;min-height:46px;margin:0}
 #screen-game.worlds-desktop .abtn{
  border:1px solid #a5b3b6;border-radius:4px;background:#eee4cd;color:#30434c;
  box-shadow:0 2px 4px #142c3e55;
 }
 #screen-game.worlds-desktop .rp-actions .abtn:first-child{
  background:linear-gradient(#6bacc4,#296888);color:#fff8e6;
 }
 #screen-game.worlds-desktop .hand-wrap{
  background:url('/assets/worlds/stone.png') center/112% 140%;border-top:var(--b-border);border-color:transparent;
  border-radius:4px;position:relative;
 }
 #screen-game.worlds-desktop .hand-lbl{
  display:block;position:absolute;left:14px;top:12px;color:#3f4d4e;font-size:13px;
 }
 #screen-game.worlds-desktop #hand-tray-btn{
  position:absolute;left:310px;bottom:18px;background:#ede3cc!important;
  border:1px solid #a59c86!important;color:#354651!important;font-size:13px!important;
 }
 #screen-game.worlds-desktop .hcard{border-radius:5% / 3.5%;border-color:#101114}
 #screen-game.worlds-desktop :is(.hcard,.tcard,.hp-card) img{object-fit:contain}
 #screen-game.worlds-desktop .ap-c img{object-fit:contain!important}
 #screen-game.worlds-desktop .zone-tag{writing-mode:vertical-rl;width:32px;margin-right:8px;letter-spacing:3px}
 #screen-game.worlds-desktop .zone-spacer{width:32px}
 #screen-game.worlds-desktop .game-header{background:#152738df;border-color:#a5b2ad}
 #screen-game.worlds-desktop .phase-btn.active{background:linear-gradient(#7cb3c8,#2c678a);color:#fff}
 #screen-game.worlds-desktop :is(#game-chat-panel,#game-log-panel){
  left:300px!important;bottom:170px!important;width:430px!important;
  background:#f0e7d3!important;border:1px solid #a19882!important;
  box-shadow:0 8px 24px #10293a66!important;border-radius:6px;
 }
 #screen-game.worlds-desktop :is(#game-chat-panel,#game-log-panel)>div:first-child{background:#284858!important}
 #screen-game.worlds-desktop :is(#game-chat-log,#game-log-list){background:#f5eddd!important;color:#263d48}
 #screen-game.worlds-desktop .hand-tray{background:#193245f5;border-color:#adbbbc}
 #screen-game.worlds-desktop .tray-hint{color:#e0e9eb}
 #screen-game.worlds-desktop .tray-hint kbd{
  color:#fff3d9;border-color:#8da5af;background:#132a3a;
 }
 /* Replay controls use the reader column; keep the battlefield and hand metrics intact. */
 #screen-game.worlds-desktop:has(#replay-chrome) #card-preview-content{bottom:332px}
 #screen-game.worlds-desktop #replay-chrome{
  position:absolute;right:calc(12px * var(--game-scale,1));
  bottom:calc(16px * var(--game-scale,1));
  width:510px;height:300px;z-index:9600;
  transform:scale(var(--game-scale,1));transform-origin:bottom right;
 }
 #screen-game.worlds-desktop #replay-chrome>div{
  position:static!important;width:100%;height:100%;box-sizing:border-box;
  overflow:auto;align-content:flex-start;background:#193245!important;
  border:1px solid #adbbbc!important;border-radius:5px;
 }
 #screen-game.worlds-desktop #replay-title{flex-basis:100%;overflow-wrap:anywhere}
 #screen-game.worlds-desktop #replay-chrome button{white-space:nowrap}

 /* Body-level gameplay prompts share materials; their decision colors and handlers stay intact. */
 body.worlds-ui.worlds-screen-game:not(#_) :is(.modal,.prompt-modal){
  background:#f4ecdb!important;color:#30404a;border-color:#aca38c!important;
  border-radius:6px;box-shadow:0 12px 40px #10253688!important;max-height:85vh;overflow-y:auto;
 }
 body.worlds-ui.worlds-screen-game:not(#_) :is(.modal-title,.prompt-title){
  color:#30404a;font-family:'PMingLiU','Noto Serif TC',serif;
 }
 body.worlds-ui.worlds-screen-game:not(#_) :is(.mbtn,.choice-btn){border-radius:4px;box-shadow:0 2px 3px #132e4044}
 body.worlds-ui.worlds-screen-game:not(#_) :is(.modal,.prompt-modal,#effect-prompt-modal) img{object-fit:contain!important}
 body.worlds-ui.worlds-screen-game:not(#_) :is(#effect-prompt-modal,#raid-or-direct-modal,#hand-activate-modal)>div{
  background:#f4ecdb!important;color:#30404a;border-color:#aca38c!important;border-radius:6px;
 }
 body.worlds-ui.worlds-screen-game:not(#_) :is(#quick-msg-menu,#gameConfirmModal .modal,#gameInfoModal .modal){
  background:#f4ecdb!important;border-color:#aca38c!important;color:#30404a;
 }
 body.worlds-ui.worlds-screen-game:not(#_) :is(#card-status-popup,#effectSelectBanner,#snipeBanner){
  background:#1d394bf5!important;border-color:#b5b9a7!important;color:#f4ebd7!important;
  border-radius:5px;box-shadow:0 6px 18px #10273966;
 }
 body.worlds-ui.worlds-screen-game:not(#_) :is(#effectSelectBanner,#blockingBanner,#snipeBanner){
  max-width:90vw;flex-wrap:wrap;line-height:1.6;border-radius:5px;
 }
 body.worlds-ui.worlds-screen-game:not(#_) #mulliganModal{
  background:linear-gradient(#152a3deF,#142a3ded),url('/assets/worlds/backdrop.png') center/cover!important;
 }
 body.worlds-ui.worlds-screen-game:not(#_) #mulliganModal img{object-fit:contain!important}
 body.worlds-ui.worlds-screen-game:not(#_) #raidOrDirect-raid{background:var(--b-red);color:#fff8e8}
 body.worlds-ui.worlds-screen-game:not(#_) :is(#spectator-banner,.scp-head){background:#183448f5;border-color:#b8b79d}
 body.worlds-ui.worlds-screen-game:not(#_) #spectator-banner{
  left:50%;right:auto;top:0;
  width:var(--worlds-stage-width,1920px);height:48px;box-sizing:border-box;
  transform:translateX(-50%) scale(var(--worlds-game-scale,1));transform-origin:top center;
 }
 body.worlds-ui.worlds-screen-game:not(#_) #spectator-chat-panel{background:#f3ead7;border-color:#a49c87;border-radius:5px}
 body.worlds-ui.worlds-screen-game:not(#_) #spectator-chat-panel .scp-input input{min-width:0}
 body.worlds-ui.worlds-screen-game:not(#_) #spectator-chat-panel .scp-input button{flex-shrink:0;white-space:nowrap}
}
