/* Complete appearance layer. Materials only: no button reordering or action ownership.
   Existing background/border colors on choices remain the source of selection semantics. */
body.worlds-skin{--worlds-title:Georgia,'Noto Serif TC','PMingLiU',serif;--worlds-paper:#eee5d3;--worlds-ink:#293d49;--worlds-rim:#a28b63;}
body.worlds-skin button:not(.tile):not(:has(img)):not(.hcard):not(.field-card){
 background-image:linear-gradient(180deg,#ffffff20,#ffffff05 50%,#00000014),url('/assets/worlds/stone.png')!important;
 /* Sample the quiet center: slab cracks must not cross button labels. */
 background-size:100% 100%,135% 180%!important;background-position:center!important;background-repeat:no-repeat!important;background-blend-mode:normal,multiply;
 border-radius:3px;box-shadow:inset 0 1px 0 #ffffff50,inset 0 -1px 0 #0003,0 2px 3px #10233425;
 font-family:var(--worlds-title);text-underline-offset:3px;
}
body.worlds-skin button:disabled{cursor:not-allowed;filter:saturate(.35);}
/* Action groups sit on the panel's existing stone, without a second painted bar.
   Keep sticky positioning and the individual buttons' surfaces/selection colors. */
body.worlds-skin :is(.worlds-action-row,.modal-btns,.prompt-buttons,.ua-result-actions,#hand-pick-modal .hp-header){
 background:transparent!important;border-image:none!important;border:0!important;box-shadow:none!important;
}
body.worlds-skin #hand-pick-modal .hp-header{margin:0 0 6px!important;padding:0 0 10px!important;}
/* Static keeps the underlying original artwork; eco removes continuous portal FX. */
body[data-worlds-motion="static"] :is(.worlds-atmosphere,.lobby-atmosphere),
body[data-worlds-motion="static"] .gateway-motion,
body[data-worlds-motion="eco"] .gateway-motion{display:none!important;}
body.worlds-skin :is(button,input,select,textarea,[role=button],a):focus-visible{outline:3px solid #d5a957;outline-offset:2px;}
body.worlds-skin button:not(:disabled):hover{filter:brightness(1.09);}
body.worlds-skin :is(input[type=checkbox],input[type=radio],input[type=range]){accent-color:#916a2e;}
body.worlds-skin :is(.modal-title,.prompt-title,.waiting-title,.ua-result-body h2,.rv-panel-title){font-family:var(--worlds-title);letter-spacing:1px;}
body.worlds-skin :is(.modal,.prompt-modal,.ua-result-panel){
 background-color:var(--worlds-paper)!important;background-image:linear-gradient(#eee5d3e8,#eee5d3e8),url('/assets/worlds/stone.png')!important;background-size:cover!important;
 color:var(--worlds-ink);border:12px solid transparent!important;border-image:url('/assets/worlds/lobby-stone-frame.png') 210 fill / 12px / 0 stretch!important;
 border-radius:0!important;box-shadow:0 12px 35px #081b3055!important;max-height:calc(100dvh - 24px);overflow-y:auto;box-sizing:border-box;
}
body.worlds-skin :is(#announceModal,#bug-update-modal,#matchHistoryModal,#tournamentHubModal,#tournamentPanelModal,#conquestPanelModal,#cqLeaveModal,#cqSurrenderModal,#soloTestRoundSummaryModal,#soloTestStatsModal,#superPanel,#sb-load-deck-modal,#bugReportModal,#raid-move-prompt-modal,#effect-prompt-modal,#raid-or-direct-modal,#hand-activate-modal,#mainActivateModal,#endTurnModal,#firstPlayerVoteModal,#firstPlayerDecideModal,#firstPlayerWaitingModal,#gameStartModal,#eventRevealModal,#deckRevealModal,#eventCardModal,#extraDrawModal,#defendModal,#selectLifeModal,#snipeChoiceModal,#multiLifeRevealModal,#triggerOrderModal,#lifeRevealModal,#outsideZoneModal,#removeZoneModal,#cardsViewModal,#cardDetailModal,#lifeRedirectModal,#raidLifeModal,#hand-pick-modal,#discardModal,#rv-setup,#gameConfirmModal,#gameInfoModal,#tournamentGameEnd,#conquestGameEnd,#conquestMatchEnd,#matchReviewModal,#sessionReplacedModal,#noContestWaitModal,#apLeftConfirmModal){--b-cream:#eee5d3;--b-mid:#dcd1b8;--b-black:#293d49;--muted:#64645b;--muted2:#666757;--b-border:1px solid #a28b63;--b-font:var(--worlds-title);padding:12px;}
body.worlds-skin :is(#announceModal,#bug-update-modal,#matchHistoryModal,#tournamentHubModal,#tournamentPanelModal,#conquestPanelModal,#cqLeaveModal,#cqSurrenderModal,#soloTestRoundSummaryModal,#soloTestStatsModal,#superPanel,#sb-load-deck-modal,#bugReportModal,#raid-move-prompt-modal,#effect-prompt-modal,#raid-or-direct-modal,#hand-activate-modal,#mainActivateModal,#endTurnModal,#firstPlayerVoteModal,#firstPlayerDecideModal,#firstPlayerWaitingModal,#gameStartModal,#eventRevealModal,#deckRevealModal,#eventCardModal,#extraDrawModal,#defendModal,#selectLifeModal,#snipeChoiceModal,#multiLifeRevealModal,#triggerOrderModal,#lifeRevealModal,#outsideZoneModal,#removeZoneModal,#cardsViewModal,#cardDetailModal,#lifeRedirectModal,#raidLifeModal,#hand-pick-modal,#discardModal,#rv-setup,#gameConfirmModal,#gameInfoModal,#tournamentGameEnd,#conquestGameEnd,#conquestMatchEnd,#matchReviewModal,#sessionReplacedModal,#noContestWaitModal,#apLeftConfirmModal)>div:first-child{
 background:#eee5d3!important;color:#293d49;border:16px solid transparent!important;border-image:url('/assets/worlds/lobby-stone-frame.png') 210 fill / 16px / 0 stretch!important;
 border-radius:0!important;box-shadow:0 12px 35px #081b3055!important;max-height:calc(100dvh - 24px)!important;overflow:auto;box-sizing:border-box;
}
body.worlds-skin :is(#announceModal,#bug-update-modal,#matchHistoryModal,#tournamentHubModal,#tournamentPanelModal,#conquestPanelModal,#cqLeaveModal,#cqSurrenderModal,#soloTestRoundSummaryModal,#soloTestStatsModal,#superPanel,#sb-load-deck-modal,#bugReportModal,#raid-move-prompt-modal,#effect-prompt-modal,#raid-or-direct-modal,#hand-activate-modal,#mainActivateModal,#endTurnModal,#firstPlayerVoteModal,#firstPlayerDecideModal,#firstPlayerWaitingModal,#gameStartModal,#eventRevealModal,#deckRevealModal,#eventCardModal,#extraDrawModal,#defendModal,#selectLifeModal,#snipeChoiceModal,#multiLifeRevealModal,#triggerOrderModal,#lifeRevealModal,#outsideZoneModal,#removeZoneModal,#cardsViewModal,#cardDetailModal,#lifeRedirectModal,#raidLifeModal,#hand-pick-modal,#discardModal,#rv-setup,#gameConfirmModal,#gameInfoModal,#tournamentGameEnd,#conquestGameEnd,#conquestMatchEnd,#matchReviewModal,#sessionReplacedModal,#noContestWaitModal,#apLeftConfirmModal) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),textarea,select){background-color:#f8f1e3!important;color:#293d49!important;border:1px solid #a99572!important;border-radius:3px;max-width:100%;box-sizing:border-box;}
body.worlds-skin :is(#announceModal,#bug-update-modal,#matchHistoryModal,#tournamentHubModal,#tournamentPanelModal,#conquestPanelModal,#cqLeaveModal,#cqSurrenderModal,#soloTestRoundSummaryModal,#soloTestStatsModal,#superPanel,#sb-load-deck-modal,#bugReportModal,#raid-move-prompt-modal,#effect-prompt-modal,#raid-or-direct-modal,#hand-activate-modal,#mainActivateModal,#endTurnModal,#firstPlayerVoteModal,#firstPlayerDecideModal,#firstPlayerWaitingModal,#gameStartModal,#eventRevealModal,#deckRevealModal,#eventCardModal,#extraDrawModal,#defendModal,#selectLifeModal,#snipeChoiceModal,#multiLifeRevealModal,#triggerOrderModal,#lifeRevealModal,#outsideZoneModal,#removeZoneModal,#cardsViewModal,#cardDetailModal,#lifeRedirectModal,#raidLifeModal,#hand-pick-modal,#discardModal,#rv-setup,#gameConfirmModal,#gameInfoModal,#tournamentGameEnd,#conquestGameEnd,#conquestMatchEnd,#matchReviewModal,#sessionReplacedModal,#noContestWaitModal,#apLeftConfirmModal) :is(th,td){border-color:#b3a082!important;}
body.worlds-skin :is(#announceModal,#bug-update-modal,#matchHistoryModal,#tournamentHubModal,#tournamentPanelModal,#conquestPanelModal,#cqLeaveModal,#cqSurrenderModal,#soloTestRoundSummaryModal,#soloTestStatsModal,#superPanel,#sb-load-deck-modal,#bugReportModal,#raid-move-prompt-modal,#effect-prompt-modal,#raid-or-direct-modal,#hand-activate-modal,#mainActivateModal,#endTurnModal,#firstPlayerVoteModal,#firstPlayerDecideModal,#firstPlayerWaitingModal,#gameStartModal,#eventRevealModal,#deckRevealModal,#eventCardModal,#extraDrawModal,#defendModal,#selectLifeModal,#snipeChoiceModal,#multiLifeRevealModal,#triggerOrderModal,#lifeRevealModal,#outsideZoneModal,#removeZoneModal,#cardsViewModal,#cardDetailModal,#lifeRedirectModal,#raidLifeModal,#hand-pick-modal,#discardModal,#rv-setup,#gameConfirmModal,#gameInfoModal,#tournamentGameEnd,#conquestGameEnd,#conquestMatchEnd,#matchReviewModal,#sessionReplacedModal,#noContestWaitModal,#apLeftConfirmModal) :is(.modal-btns,.prompt-buttons){gap:8px;flex-wrap:wrap;}
body.worlds-skin :is(#announceModal,#bug-update-modal,#matchHistoryModal,#tournamentHubModal,#tournamentPanelModal,#conquestPanelModal,#cqLeaveModal,#cqSurrenderModal,#soloTestRoundSummaryModal,#soloTestStatsModal,#superPanel,#sb-load-deck-modal,#bugReportModal,#raid-move-prompt-modal,#effect-prompt-modal,#raid-or-direct-modal,#hand-activate-modal,#mainActivateModal,#endTurnModal,#firstPlayerVoteModal,#firstPlayerDecideModal,#firstPlayerWaitingModal,#gameStartModal,#eventRevealModal,#deckRevealModal,#eventCardModal,#extraDrawModal,#defendModal,#selectLifeModal,#snipeChoiceModal,#multiLifeRevealModal,#triggerOrderModal,#lifeRevealModal,#outsideZoneModal,#removeZoneModal,#cardsViewModal,#cardDetailModal,#lifeRedirectModal,#raidLifeModal,#hand-pick-modal,#discardModal,#rv-setup,#gameConfirmModal,#gameInfoModal,#tournamentGameEnd,#conquestGameEnd,#conquestMatchEnd,#matchReviewModal,#sessionReplacedModal,#noContestWaitModal,#apLeftConfirmModal) :is(.modal-btns,.prompt-buttons)>button{min-height:36px;}
body.worlds-skin :is(#tournament-hub-list,#tp-modal,#cq-modal,#superBody) div[style*="border:2px solid"]{border-width:1px!important;border-radius:3px;background-image:linear-gradient(#eee5d3bb,#eee5d3bb),url('/assets/worlds/stone.png');background-size:cover;}
body.worlds-skin :is(#superBody,.super-card){background-color:#e9dfc9!important;border-color:#a39170!important;}
body.worlds-skin :is(#superPanel,#announceModal,#bug-update-modal)>div>div:first-child{background-color:#293f4e!important;color:#f4e6c6!important;font-family:var(--worlds-title);border-bottom-color:#ac8e59!important;}
body.worlds-skin :is(#superPanel,#soloTestStatsModal)>div>div{flex-shrink:0;}
body.worlds-skin .super-tab{border-color:#a39170!important;}
body.worlds-skin .super-tab.active{box-shadow:inset 0 -3px 0 #e2bd76;}
/* Login is an arrival at the sanctuary; the form stays on a readable stone tablet. */
body.worlds-skin #screen-login{background:linear-gradient(#13283c45,#13283c55),url('/assets/worlds/lobby-sanctuary.png') center/cover;overflow:auto;padding:24px;}
body.worlds-skin #screen-login::before{display:none;}
body.worlds-skin .login-box{background:transparent;box-shadow:0 16px 45px #07182e80;border:0;max-width:920px;}
body.worlds-skin .login-brand-section{background:linear-gradient(#142c4380,#142c43b0),url('/assets/worlds/lobby-gateway.png') center/cover;color:#f5e6c3;border:1px solid #ab9165;}
body.worlds-skin .login-sub,body.worlds-skin .login-logo{font-family:var(--worlds-title);}
body.worlds-skin .login-sub em{color:#e1bc72;}
body.worlds-skin .login-form-section{background:none;border:20px solid transparent;border-image:url('/assets/worlds/lobby-stone-frame.png') 210 fill / 20px / 0 stretch;color:#293d49;padding:32px;}
body.worlds-skin .login-form-title{font-family:var(--worlds-title);color:#293d49;}
body.worlds-skin .login-form-section input{background:#f6eddd;color:#293d49;border:1px solid #a18a62;}
body.worlds-skin .login-form-section .btn-primary{background-color:#294858;color:#f4e4bd;border-color:#b19561;}
/* Small controls retain their existing positions, selected colors, widths and card art. */
body.worlds-skin :is(#quick-msg-menu,#card-status-popup,#game-chat-panel,#game-log-panel,#spectator-chat-panel,#sandbox-panel,#conn-issue-bar,#update-banner,#replay-chrome,#rv-feed,#rv-opp-hand){
 background-image:linear-gradient(#ffffff0a,#0000000a),url('/assets/worlds/stone.png')!important;background-size:cover!important;background-blend-mode:normal,multiply;border-color:#a28b63!important;
}
body.worlds-skin :is(#sandbox-panel,#card-status-popup){box-shadow:0 5px 18px #0d203b70!important;}
body.worlds-skin :is(#game-chat-panel,#game-log-panel,#spectator-chat-panel) :is(input,textarea){border-color:#a99572;border-radius:3px;}
body.worlds-skin :is(.ua-result-header,.ua-result-body,.ua-result-actions,.ua-result-status){border-color:#a28b63;}
body.worlds-skin :is(#rv-title,#rv-end) .rv-title-inner{background:linear-gradient(#152e43df,#152e43df),url('/assets/worlds/stone.png');border-color:#c5a367;color:#f6e7c6;font-family:var(--worlds-title);}
body.worlds-skin :is(#rv-setup,#rv-end) button{min-height:38px;}
body.worlds-skin .rv-opp-cards img{object-fit:contain;}
/* Replay panels have very different aspect ratios: preserve the stone rim
   with nine-slice rendering, and keep all content inside that rim. */
body.worlds-skin.video-mode :is(#rv-opp-hand,#rv-feed){
 background:none!important;border:26px solid transparent!important;
 border-image:url('/assets/worlds/stone.png') 180 fill / 26px / 0 stretch!important;
 padding:8px 10px;box-shadow:none;display:flex;flex-direction:column;
}
body.worlds-skin.video-mode #rv-opp-hand{height:330px;}
body.worlds-skin.video-mode #rv-feed{top:482px;}
body.worlds-skin.video-mode :is(#rv-opp-hand,#rv-feed) .rv-panel-title{
 flex:none;line-height:1.5;margin:0 0 10px;color:#293d49;overflow-wrap:anywhere;
}
body.worlds-skin.video-mode .rv-opp-cards{min-height:0;overflow-y:auto;align-content:flex-start;flex:1;padding:2px;pointer-events:auto;}
body.worlds-skin.video-mode .rv-opp-cards :is(img,.rv-card-ph){flex-shrink:0;}
body.worlds-skin.video-mode .rv-feed-items{min-height:0;flex:1;overflow-y:auto;overflow-wrap:anywhere;padding-right:4px;pointer-events:auto;}
body.worlds-skin :is(#effectSelectBanner,#blockingBanner,#snipeBanner,#waitingTriggerNotice,#waitingOpponentEffectNotice){border-color:#b39a67!important;background-image:linear-gradient(#ffffff08,#0000000b),url('/assets/worlds/stone.png');background-size:cover;background-blend-mode:normal,multiply;}
@media(max-width:999px),(max-height:520px){
 body.worlds-skin :is(#screen-lobby,#screen-deck,#screen-deck-editor){background:linear-gradient(#172c4099,#172c4099),url('/assets/worlds/lobby-sanctuary.png') center/cover;}
 body.worlds-skin :is(.modal,.prompt-modal,.ua-result-panel){min-width:0!important;max-width:calc(100vw - 16px)!important;border-width:8px!important;border-image-width:8px!important;max-height:calc(100dvh - 16px)!important;}
 body.worlds-skin :is(#announceModal,#bug-update-modal,#matchHistoryModal,#tournamentHubModal,#tournamentPanelModal,#conquestPanelModal,#cqLeaveModal,#cqSurrenderModal,#soloTestRoundSummaryModal,#soloTestStatsModal,#superPanel,#sb-load-deck-modal,#bugReportModal,#raid-move-prompt-modal,#effect-prompt-modal,#raid-or-direct-modal,#hand-activate-modal,#mainActivateModal,#endTurnModal,#firstPlayerVoteModal,#firstPlayerDecideModal,#firstPlayerWaitingModal,#gameStartModal,#eventRevealModal,#deckRevealModal,#eventCardModal,#extraDrawModal,#defendModal,#selectLifeModal,#snipeChoiceModal,#multiLifeRevealModal,#triggerOrderModal,#lifeRevealModal,#outsideZoneModal,#removeZoneModal,#cardsViewModal,#cardDetailModal,#lifeRedirectModal,#raidLifeModal,#hand-pick-modal,#discardModal,#rv-setup,#gameConfirmModal,#gameInfoModal,#tournamentGameEnd,#conquestGameEnd,#conquestMatchEnd,#matchReviewModal,#sessionReplacedModal,#noContestWaitModal,#apLeftConfirmModal){padding:8px!important;}
 body.worlds-skin :is(#announceModal,#bug-update-modal,#matchHistoryModal,#tournamentHubModal,#tournamentPanelModal,#conquestPanelModal,#cqLeaveModal,#cqSurrenderModal,#soloTestRoundSummaryModal,#soloTestStatsModal,#superPanel,#sb-load-deck-modal,#bugReportModal,#raid-move-prompt-modal,#effect-prompt-modal,#raid-or-direct-modal,#hand-activate-modal,#mainActivateModal,#endTurnModal,#firstPlayerVoteModal,#firstPlayerDecideModal,#firstPlayerWaitingModal,#gameStartModal,#eventRevealModal,#deckRevealModal,#eventCardModal,#extraDrawModal,#defendModal,#selectLifeModal,#snipeChoiceModal,#multiLifeRevealModal,#triggerOrderModal,#lifeRevealModal,#outsideZoneModal,#removeZoneModal,#cardsViewModal,#cardDetailModal,#lifeRedirectModal,#raidLifeModal,#hand-pick-modal,#discardModal,#rv-setup,#gameConfirmModal,#gameInfoModal,#tournamentGameEnd,#conquestGameEnd,#conquestMatchEnd,#matchReviewModal,#sessionReplacedModal,#noContestWaitModal,#apLeftConfirmModal)>div:first-child{min-width:0!important;max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important;border-width:8px!important;border-image-width:8px!important;}
 body.worlds-skin #screen-login{padding:12px;}
 body.worlds-skin .login-form-section{padding:18px;border-width:12px;border-image-width:12px;}
 body.worlds-skin :is(#superPanel,#soloTestStatsModal)>div{width:calc(100vw - 16px)!important;}
 body.worlds-skin #superPanel .super-tab{padding:8px 3px;font-size:12px;}
 body.worlds-skin .rv-row{flex-wrap:wrap;}
 body.worlds-skin .rv-row select{min-width:0;width:100%;}
 body.worlds-skin #sandbox-panel{max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px)!important;}
 body.worlds-skin :is(.lobby-stats,.lobby-tools,.lobby-chat,.lobby-online,.deck-header,.editor-header){background-image:linear-gradient(#eee5d3e8,#eee5d3e8),url('/assets/worlds/stone.png');background-size:cover;border-color:#a28b63;}
}
@media(prefers-reduced-motion:reduce){body.worlds-skin button{transition:none;}}

@media(max-width:999px),(max-height:520px){
 body.worlds-skin :is(#settingsModal,#nickname-modal,#invite-popup,#match-setup-modal,#createRoomModal,#conquestCountModal,#roomListModal,#roomPanelModal,#waitingModal,#waitOppModal,#resumeGamePrompt,#vsBotModal,#soloDeckSelectModal,#soloTestHubModal,#soloTestDeckPickerModal,#deckCoverModal,#startGameModal,#card-detail-modal,#ap-setup-modal,#deck-view-modal,#deck-view-card-modal,#deck-import-modal,#deck-export-modal,#deck-pick-modal){padding:8px!important;--b-cream:#eee5d3;--b-black:#293d49;--muted:#65645b;--b-border:1px solid #a28b63;}
 body.worlds-skin :is(#settingsModal,#nickname-modal,#invite-popup,#match-setup-modal,#createRoomModal,#conquestCountModal,#roomListModal,#roomPanelModal,#waitingModal,#waitOppModal,#resumeGamePrompt,#vsBotModal,#soloDeckSelectModal,#soloTestHubModal,#soloTestDeckPickerModal,#deckCoverModal,#startGameModal,#card-detail-modal,#ap-setup-modal,#deck-view-modal,#deck-view-card-modal,#deck-import-modal,#deck-export-modal,#deck-pick-modal)>div:first-child{background:#eee5d3!important;border:8px solid transparent!important;border-image:url('/assets/worlds/lobby-stone-frame.png') 210 fill / 8px / 0 stretch!important;min-width:0!important;max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important;overflow:auto;box-sizing:border-box;border-radius:0!important;}
 body.worlds-skin :is(#vsBotModal,#soloDeckSelectModal)>div>div:nth-child(2){min-height:160px;overflow:auto!important;}
 body.worlds-skin :is(#vsBotModal,#soloDeckSelectModal)>div>div{flex-shrink:0;}
 body.worlds-skin #emoji-picker-menu{background:#eee5d3!important;border-color:#a28b63!important;}
 body.worlds-skin #screen-game{background:linear-gradient(#162b4090,#162b4090),url('/assets/worlds/backdrop.png') center/cover;}
 body.worlds-skin #screen-game :is(.hf-my,.hf-opp){background-image:linear-gradient(#ffffff10,#00000010),url('/assets/worlds/stone.png');background-size:cover;background-blend-mode:normal,multiply;}
}
body.worlds-skin #bugReportModal{animation:worlds-preparation-in .25s ease-out!important;}
body.worlds-skin #toast{font-family:var(--worlds-title);border-color:#ae9264;}

body.worlds-skin .login-sub{color:#f4e5c4;text-shadow:0 2px 3px #102334;}
body.worlds-skin .login-form-section :is(.form-label,.login-toggle){color:#5c5f55;}
body.worlds-skin .login-form-section a{color:#785b28;}
body.worlds-skin #screen-login>div:last-child:not(.login-box){color:#f4e6c9;text-shadow:0 1px 3px #000;}

@media(max-width:999px),(max-height:520px){
 body.worlds-skin :is(#screen-lobby,#screen-deck,#screen-deck-editor,#library-modal){--b-cream:#eee5d3;--b-mid:#ded2b9;--b-black:#293d49;--muted:#666558;--muted2:#666558;--b-border:1px solid #a28b63;}
 body.worlds-skin #screen-lobby .lobby-header{background:#223d50;color:#f3e5c5;border-color:#ac9162;}
 body.worlds-skin #screen-lobby .user-info{flex-wrap:wrap;gap:4px;}
 body.worlds-skin #screen-lobby .lobby-logo{font-family:var(--worlds-title);color:#f3e5c5;}
 body.worlds-skin #screen-lobby :is(.lobby-left,.lobby-right){background:transparent;}
 body.worlds-skin #screen-lobby :is(.card-sm,.lobby-chat-box){background-image:linear-gradient(#eee5d3d9,#eee5d3d9),url('/assets/worlds/stone.png');background-size:cover;border:8px solid transparent;border-image:url('/assets/worlds/lobby-stone-frame.png') 210 fill / 8px / 0 stretch;}
 body.worlds-skin #screen-lobby .tile{background-image:linear-gradient(#20384980,#20384980),url('/assets/worlds/stone.png');background-size:cover;border-color:#a99062;color:#f4e7c7;}
 body.worlds-skin #screen-lobby .tile-big{background-image:linear-gradient(#14293d50,#14293d50),url('/assets/worlds/lobby-gateway.png');background-position:center;background-size:cover;text-shadow:0 2px 3px #102334;}
 body.worlds-skin :is(#library-modal,.lcd-box){border:8px solid transparent;border-image:url('/assets/worlds/lobby-stone-frame.png') 210 fill / 8px / 0 stretch;}
 body.worlds-skin :is(#lib-series-gate,.lib-toolbar,.lib-header,.lcd-info-col,.editor-left,.editor-right,#deck-list){background-color:#eee5d3;border-color:#a28b63;}
 body.worlds-skin .lib-gate-card{background-image:linear-gradient(#eee5d3d9,#eee5d3d9),url('/assets/worlds/stone.png');background-size:cover;border-color:#a28b63;}
}

body.worlds-skin .btn-primary{background-color:#294858;color:#f4e6c5;border-color:#b09869;}
body.worlds-skin button:is([style*="background: rgb(0, 0, 0);"],[style*="background:#000;"],[style*="background: #000;"]){background-color:#294858!important;color:#f4e6c5!important;border-color:#b09869!important;}
body.worlds-skin button:is([style*="border: 2px solid rgb(0, 0, 0);"],[style*="border:2px solid #000;"]){border-color:#a18c69!important;}
body.worlds-skin :is(#soloTestStatsModal,#soloTestRoundSummaryModal)>div div[style*="border:2px solid #000"]{border:1px solid #a99472!important;background:#e4d9c3;}
body.worlds-skin :is(#soloTestStatsModal,#soloTestRoundSummaryModal)>div>div:first-child{border-bottom-color:#aa956e!important;font-family:var(--worlds-title)!important;}

body.worlds-skin #soloTestStatsModal table{min-width:620px;}
body.worlds-ui :is(.overlay,#effect-prompt-modal,#hand-pick-modal,#raid-or-direct-modal,#hand-activate-modal) img{object-fit:contain!important;}
body.worlds-skin :is(.mbtn-no,.btn-secondary){border-color:#a28b63;}

body.worlds-skin :is(#rv-title,#rv-end){background:linear-gradient(#122b42a8,#122b42b8),url('/assets/worlds/backdrop.png') center/cover!important;}
body.worlds-skin :is(#rv-title,#rv-end) .rv-title-inner{padding:32px;border:1px solid #bfa16c;box-shadow:0 10px 30px #061a2a70;}
body.worlds-skin #tt{background:linear-gradient(#1c344bef,#1c344bef),url('/assets/worlds/stone.png');border-color:#a28b63;color:#f1e5c9;}
body.worlds-skin #tt :is(#tt-name,#tt-eff){color:#f1e5c9;}
body.worlds-skin #tt :is(.tt-sl,.tt-stat){color:#c2c8ca;}
body.worlds-skin #update-banner{flex-wrap:wrap;}
body.worlds-skin #sb-load-deck-modal>div>div:first-child{color:#2e536b!important;font-family:var(--worlds-title);}

body.worlds-skin #mulliganModal{background:linear-gradient(#152a3ded,#142a3ded),url('/assets/worlds/backdrop.png') center/cover!important;overflow-y:auto;}
body.worlds-skin #mulliganModal>div:first-child{font-family:var(--worlds-title);color:#efd49e!important;}
body.worlds-skin :is(.ua-hand-feedback,#ua-cancel-hint){border-color:#b69b67;background-image:linear-gradient(#ffffff08,#0000000a),url('/assets/worlds/stone.png');background-size:cover;background-blend-mode:normal,multiply;}

body.worlds-skin :is(.deck-reorder-card,.deck-reorder-ghost) img{object-fit:contain!important;}

@media(max-width:999px),(max-height:520px){
 body.worlds-skin #screen-lobby :is(.lobby-records,.lobby-online,.lobby-chat,.tile-sm){background:none!important;border:12px solid transparent!important;border-image:url('/assets/worlds/lobby-stone-frame.png') 210 fill / 12px / 0 stretch!important;color:#293d49;box-shadow:0 4px 12px #0f24374a;}
 body.worlds-skin #screen-lobby .lobby-records>div:nth-child(2){border:0!important;}
 body.worlds-skin #screen-lobby .stat-box{background:transparent;border-color:#a18a6650;}
 body.worlds-skin #screen-lobby .section-title{color:#293d49;font-family:var(--worlds-title);border-bottom:1px solid #a28b6380;font-size:17px;letter-spacing:1px;}
 body.worlds-skin #screen-lobby .tile-sm{color:#293d49;text-shadow:0 1px #fff8;font-family:var(--worlds-title);}
 body.worlds-skin #screen-lobby .tile-big{font-family:var(--worlds-title);}
}

body.worlds-skin :is(#rv-title,#rv-end) .rv-title-inner{max-width:94vw;max-height:94dvh;overflow:auto;box-sizing:border-box;}
body.worlds-skin .rv-title-split{gap:clamp(16px,4vw,72px);}
body.worlds-skin :is(#rv-title,#rv-end) :is(.rv-main-title,.rv-winner){font-size:clamp(32px,6vw,96px)!important;font-family:var(--worlds-title);}
body.worlds-skin :is(#rv-title,#rv-end) .rv-players{font-size:clamp(20px,3.5vw,52px)!important;gap:20px;flex-wrap:wrap;}
body.worlds-skin .rv-logo-hero{max-width:30vw;object-fit:contain;}
@media(max-width:700px){body.worlds-skin .rv-title-split{flex-direction:column;padding:16px;}body.worlds-skin .rv-logo-hero{height:120px;max-height:24vh;max-width:100%;}body.worlds-skin :is(#rv-title,#rv-end) .rv-players em{font-size:24px;}body.worlds-skin :is(#rv-title,#rv-end) .rv-date{margin-top:12px;font-size:14px;}}

body.worlds-skin :is(#rv-title,#rv-end) .rv-brand{color:#dec48e;font-family:var(--worlds-title);font-size:clamp(14px,2vw,22px);letter-spacing:3px;white-space:nowrap;text-shadow:0 1px 3px #061927;}
body.worlds-skin :is(#rv-title,#rv-end) .rv-main-title{color:#f4e6c6;text-shadow:0 2px 4px #061927;letter-spacing:2px;line-height:1.3;}
body.worlds-skin :is(#rv-title,#rv-end) :is(.rv-date,.rv-end-hint){color:#d1d6d5;text-shadow:0 1px 3px #061927;}
body.worlds-skin .rv-title-text{min-width:0;}
@media(max-width:700px){body.worlds-skin .rv-title-text{text-align:center;}body.worlds-skin #rv-title .rv-players{justify-content:center;}}

/* Native scrollbars: warm metal thumb in a recessed stone channel.
   Keep wheel, touch and keyboard scrolling owned by the browser. */
body.worlds-skin,body.worlds-skin *{
 --worlds-scroll-thumb:#9a8056;--worlds-scroll-track:#ded4bf;
 scrollbar-color:var(--worlds-scroll-thumb) var(--worlds-scroll-track)!important;
 scrollbar-width:thin!important;
}
body.worlds-skin #screen-game,body.worlds-skin #screen-game *{
 --worlds-scroll-thumb:#b39a70;--worlds-scroll-track:#263b46;
}
@supports selector(::-webkit-scrollbar){
 body.worlds-skin,body.worlds-skin *{scrollbar-color:auto!important;scrollbar-width:auto!important;}
 body.worlds-skin::-webkit-scrollbar,body.worlds-skin *::-webkit-scrollbar{width:11px;height:11px;}
 body.worlds-skin::-webkit-scrollbar-track,body.worlds-skin *::-webkit-scrollbar-track{background:var(--worlds-scroll-track);border-radius:6px;box-shadow:inset 0 0 3px #40362735;}
 body.worlds-skin::-webkit-scrollbar-thumb,body.worlds-skin *::-webkit-scrollbar-thumb{background:linear-gradient(90deg,#ffffff20,transparent 55%,#00000018),var(--worlds-scroll-thumb);border:2px solid var(--worlds-scroll-track);border-radius:6px;min-height:36px;}
 body.worlds-skin::-webkit-scrollbar-thumb:hover,body.worlds-skin *::-webkit-scrollbar-thumb:hover{background:#ad8c52;border-color:var(--worlds-scroll-track);}
 body.worlds-skin::-webkit-scrollbar-corner,body.worlds-skin *::-webkit-scrollbar-corner{background:var(--worlds-scroll-track);}
}
@media(forced-colors:active){
 body.worlds-skin,body.worlds-skin *{scrollbar-color:auto!important;scrollbar-width:auto!important;}
}

/* Closeout: quiet, inset writing surfaces on all collection/preparation sizes. */
body.worlds-skin :is(#library-modal,#screen-deck-editor,#screen-deck,#settingsModal,#nickname-modal,#match-setup-modal,#createRoomModal,#roomPanelModal) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),select,textarea){
 background-color:#f4edde!important;color:#293d48!important;border:1px solid #998362!important;border-radius:3px;
 font-family:var(--worlds-title);box-shadow:inset 0 1px 3px #51412b25;
}
body.worlds-skin :is(#library-modal,#screen-deck-editor,#settingsModal,#nickname-modal) input::placeholder{color:#716e61;opacity:1;}
/* Sandbox: a dark stone workbench. Existing red/green/player state colors remain. */
body.worlds-skin #sandbox-panel{
 background-color:#243b46!important;background-image:linear-gradient(#233b46eb,#233b46eb),url('/assets/worlds/stone.png')!important;
 background-size:100% 100%,135% 180%!important;border-color:#ab9061!important;border-radius:4px!important;
 font-family:var(--worlds-title)!important;color:#ecdfc5;
}
body.worlds-skin #sandbox-panel>div:first-child{border-bottom-color:#ad936577!important;}
body.worlds-skin #sandbox-panel>div:first-child span{color:#ebcd95!important;}
body.worlds-skin #sb-panel-body>div{border-color:#b09b7050!important;border-radius:3px!important;background:#152c3540;}
body.worlds-skin #sb-panel-body>div>div:first-child{color:#d4c4a5!important;}
body.worlds-skin #sb-panel-body :is(span[style*="color:#888"],span[style*="color:#aaa"],span[style*="color:#555"],div[style*="color:#555"],div[style*="color:#666"]){color:#c2bba9!important;}
body.worlds-skin #sb-panel-body :is(input,select){background:#192e38!important;color:#f2e4ca!important;border:1px solid #9e895e!important;border-radius:3px!important;font-family:var(--worlds-title);box-shadow:inset 0 1px 3px #081a2860;}
body.worlds-skin #sb-panel-body input::placeholder{color:#b9b5a7;opacity:1;}
body.worlds-skin #sb-log{color:#d4d9d5!important;}
body.worlds-skin #sandbox-panel button{border-radius:3px!important;text-shadow:0 1px 1px #071923;}
/* Rare attack fallback: preserve warning red and pointer transparency. */
body.worlds-skin #attackingBanner{
 background-color:#783e33!important;background-image:linear-gradient(#ffffff0c,#00000018),url('/assets/worlds/stone.png')!important;
 background-size:100% 100%,135% 180%;background-position:center;background-blend-mode:normal,multiply;
 border:1px solid #d2a069!important;border-radius:3px!important;color:#fff0d9!important;
 box-shadow:inset 0 1px #f6d8a536,0 4px 14px #14233070;font-family:var(--worlds-title);text-shadow:0 1px 2px #381911;
 width:max-content;max-width:calc(100vw - 32px);box-sizing:border-box;overflow-wrap:anywhere;text-align:center;
}

/* Mobile gateway: use the full alpha silhouette, not a cropped rectangular tile. */
@media(max-width:999px),(max-height:520px){
 body.worlds-skin #screen-lobby .tile-big{position:relative;isolation:isolate;height:clamp(210px,65vw,290px);padding:0;border:0;background:transparent!important;box-shadow:none;overflow:visible;}
 body.worlds-skin #screen-lobby .tile-big::before{content:'';position:absolute;inset:0;z-index:-1;background:url('/assets/worlds/lobby-gateway-clean.png') center bottom/contain no-repeat;filter:drop-shadow(0 5px 4px #10233465);pointer-events:none;}
 body.worlds-skin #screen-lobby .tile-big .tile-icon{display:none;}
 body.worlds-skin #screen-lobby .tile-big>div:last-child{position:absolute;top:65%;left:50%;transform:translate(-50%,-50%);white-space:nowrap;font-size:26px;letter-spacing:3px;color:#193448;text-shadow:0 1px 2px #fff,0 0 10px #eef9ff;font-family:var(--worlds-title);}
 body.worlds-skin #screen-lobby .tile-big:focus-visible{outline:2px solid #e4c481;outline-offset:3px;}
}

/* Mobile series tiles share the stone frame and never inherit the legacy red fill. */
@media(max-width:999px),(max-height:520px){
 body.worlds-skin #library-modal .lib-gate-card{
  background:none;color:#293d49;border:12px solid transparent;
  border-image:url('/assets/worlds/lobby-stone-frame.png') 210 fill / 12px / 0 stretch;
  padding:8px 6px;min-width:0;min-height:96px;white-space:normal;overflow-wrap:anywhere;
  font-family:var(--worlds-title);font-size:16px!important;letter-spacing:1px;line-height:1.4;
  box-shadow:0 2px 4px #302b2530;
 }
 body.worlds-skin #library-modal .lib-gate-card.all{background:none;color:#293d49;border-color:transparent;font-size:22px!important;letter-spacing:3px;}
 body.worlds-skin #library-modal .lib-gate-card:hover,
 body.worlds-skin #library-modal .lib-gate-card.all:hover{background:none;color:#172c3e;border-color:transparent;filter:brightness(1.06);}
 body.worlds-skin #library-modal .lib-gate-card:active{filter:brightness(.96);}
}
/* Narrow deck choices need a dedicated name line, rather than an ellipsis
   competing with series/count metadata. Preserve the existing selection flow. */
@media (max-width:600px) {
  body.worlds-skin #vsBotModal button[data-deck-id]{
    flex-direction:column;align-items:flex-start !important;
    gap:4px !important;padding:9px 8px !important;flex-shrink:0;
  }
  body.worlds-skin #vsBotModal button[data-deck-id]>span:first-child{
    white-space:normal !important;overflow:visible !important;
    overflow-wrap:anywhere;text-overflow:clip !important;line-height:1.45;
  }
  body.worlds-skin #vsBotModal button[data-deck-id]>span:last-child{
    white-space:normal;overflow-wrap:anywhere;line-height:1.3;
  }
}

/* Legible gameplay controls: pair ink and face, with a quiet stone texture.
   Keep these rules after the shared material layer so inline legacy light ink
   cannot land on an opaque pale stone image. No layout/action changes. */
body.worlds-skin :is(#screen-game .abtn,#replay-chrome button,#spectator-banner button,#screen-game button[onclick="sendGameChat()"],#extraDrawBtn){
 --ua-control-face:#e6dcc7;--ua-control-veil:#e6dcc7f5;--ua-control-ink:#243b46;
 background-color:var(--ua-control-face)!important;
 background-image:linear-gradient(var(--ua-control-veil),var(--ua-control-veil)),url('/assets/worlds/stone.png')!important;
 background-blend-mode:normal,multiply!important;
 color:var(--ua-control-ink)!important;border-color:#a28b63!important;text-shadow:none;
}
body.worlds-skin #screen-game .abtn[onclick="nextPhase()"]{
 --ua-control-face:#294858;--ua-control-veil:#294858f5;--ua-control-ink:#fff2d5;
}
body.worlds-skin :is(#solo-switch-btn,#replay-view,#spectator-banner .sb-switch):not(#_){
 --ua-control-face:#243f59;--ua-control-veil:#243f59f5;--ua-control-ink:#d9edff;
}
body.worlds-skin #spectator-banner button:not(.sb-switch){
 --ua-control-face:#e4bc58;--ua-control-veil:#e4bc58f5;--ua-control-ink:#24313b;
}
body.worlds-skin :is(#replay-play,#screen-game .abtn.pri,#screen-game button[onclick="sendGameChat()"],#extraDrawBtn){
 --ua-control-face:#a52d1d;--ua-control-veil:#a52d1df5;--ua-control-ink:#fff6e8;
}
/* Existing choice backgrounds/borders carry selection semantics. Retain them,
   but remove the opaque stone image that can obscure their ink or state. */
body.worlds-skin :is(.mbtn,.choice-btn):not(#_){
 background-image:linear-gradient(#ffffff08,#00000008)!important;
 background-blend-mode:normal!important;
}
body.worlds-skin :is(.modal,.prompt-modal,.ua-result-panel){--muted:#4c514a;--muted2:#4c514a;}
body.worlds-skin :is(.modal,.prompt-modal,.ua-result-panel) :is(.modal-sub,.prompt-sub){color:#4c514a!important;}
/* These two legacy solid colors also need readable small text without skin. */
#replay-chrome #replay-play,#screen-game button[onclick="sendGameChat()"],#extraDrawBtn{background-color:#a52d1d!important;}
#spectator-banner .sb-vs b.sb-turn{background:#23763e;box-shadow:0 0 6px #23763e80;}
body:not(.worlds-skin) :is(#screen-game .abtn,.mbtn-yes):hover:not(:disabled):not(.dim){background-color:#a52d1d;color:#fff6e8;border-color:#a52d1d;}
body:not(.worlds-skin) :is(.modal,.prompt-modal) :is(.modal-sub,.prompt-sub){color:#555;}
/* Hover/focus use the rim, not a brightness filter that washes out small text. */
body.worlds-skin :is(#screen-game .abtn,#replay-chrome button,#spectator-banner button,#screen-game button[onclick="sendGameChat()"],#extraDrawBtn,.mbtn,.choice-btn):hover:not(:disabled):not(.dim){
 filter:none!important;box-shadow:inset 0 0 0 1px #b58b43,0 2px 4px #10233455;
}
body.worlds-skin .mbtn-yes:hover:not(:disabled){background-color:#a52d1d!important;color:#fff6e8!important;border-color:#a52d1d!important;}
body.worlds-skin :is(#screen-game .abtn,#replay-chrome button,#spectator-banner button,#screen-game button[onclick="sendGameChat()"],#extraDrawBtn,.mbtn,.choice-btn):focus-visible{
 outline:3px solid #e8bd61;outline-offset:2px;filter:none!important;
}
/* Disabled labels stay readable; the subdued face and dashed rim identify
   unavailable actions. Existing :disabled/.dim interaction rules still apply. */
body.worlds-skin :is(#screen-game .abtn,#replay-chrome button,#spectator-banner button,#screen-game button[onclick="sendGameChat()"],#extraDrawBtn):is(:disabled,.dim):not(#_){
 --ua-control-face:#c8c1b3;--ua-control-veil:#c8c1b3f5;--ua-control-ink:#454942;
 opacity:1!important;filter:none!important;border-style:dashed!important;box-shadow:none;cursor:not-allowed!important;
}

/* 📱 手機版改用依實際顯示尺寸產生的縮圖（scripts/convert_worlds_assets_webp.js 的 MOBILE_VARIANTS）。
   斷點同 app.css 的手機版面（max-width:600px）。登入頁圖片約 1.36MB → 0.43MB（PageSpeed 手機 LCP）。
   🔴 石框縮圖是原圖一半，切片 210 → 105；border-image 簡寫會重設寬度，故一併寫回 12px（同上方 999px 區塊）。 */
@media(max-width:600px){
 body.worlds-skin .login-brand-section{background-image:linear-gradient(#142c4380,#142c43b0),url('/assets/worlds/lobby-gateway-m.png');}
 body.worlds-skin .login-form-section{border-image:url('/assets/worlds/lobby-stone-frame-m.png') 105 fill / 12px / 0 stretch;}
 body.worlds-skin button:not(.tile):not(:has(img)):not(.hcard):not(.field-card){background-image:linear-gradient(180deg,#ffffff20,#ffffff05 50%,#00000014),url('/assets/worlds/stone-m.png')!important;}
}
/* 全版背景的手機縮圖是「中央裁切」（640×941，保留原解析度），只在夠直的畫面用：更寬時 cover 會把裁切圖放大變糊。 */
@media(max-width:600px) and (max-aspect-ratio:2/3){
 body.worlds-skin #screen-login{background-image:linear-gradient(#13283c45,#13283c55),url('/assets/worlds/lobby-sanctuary-m.png');}
 body.worlds-skin :is(#screen-lobby,#screen-deck,#screen-deck-editor){background-image:linear-gradient(#172c4099,#172c4099),url('/assets/worlds/lobby-sanctuary-m.png');}
}
