#card111-zoom{position:fixed;z-index:10050;pointer-events:none;filter:drop-shadow(0 12px 20px #000b)}
#card111-zoom img{width:100%;height:100%;object-fit:contain;border-radius:12px}
#mobileChatToggle,.chat111-close{display:none}
.skin111-dialog{box-sizing:border-box;width:min(700px,94vw);max-height:92dvh;padding:18px;background:#121e28;color:#f5e8cf;border:1px solid #bda16b;border-radius:12px;overflow:auto;text-align:center}
.skin111-dialog::backdrop{background:#000c}
.skin111-dialog>img{display:block;width:100%;height:min(67dvh,720px);object-fit:contain;background:#0b141c}
.skin111-dialog>button{float:right;font-size:28px;min-width:44px;min-height:44px;background:#263c4b;color:white;border:1px solid #bda16b;border-radius:8px;margin-bottom:8px}
.skin111-dialog h2{font-size:clamp(18px,4vw,26px)}
@media(max-width:900px){
body:not(.is-setup) .reference-hud #mobileChatToggle:not([hidden]){display:inline-flex;position:relative;inset:auto;align-items:center;justify-content:center;flex:0 0 48px;width:48px;min-width:48px;max-width:48px;height:48px;min-height:48px;padding:0;border-radius:50%;font:24px/1 Georgia,serif;background:#152b3b;color:#ffe4a5;border:1px solid #bda16b;overflow:visible}
.chat111-unread{position:absolute;right:-3px;top:-3px;max-width:44px;padding:2px 4px;border-radius:10px;background:#ffe4a5;color:#152b3b;font:700 10px/1.2 sans-serif;overflow:hidden}
body.chat111-open #inGameChat.chat111-drawer:not([hidden]){display:block!important;position:fixed!important;inset:auto 12px calc(env(safe-area-inset-bottom,0px) + 76px)!important;box-sizing:border-box;width:auto!important;max-height:min(70dvh,calc(100dvh - 100px));overflow:auto;z-index:830;background:#101e2bf5;padding:14px;border:1px solid #bda16b;border-radius:12px;margin:0;box-shadow:0 10px 50px #000c}
.chat111-close{display:block;min-height:44px;margin-bottom:10px}
#inGameChat.chat111-drawer .room-chat-feed{height:min(30dvh,230px);overflow:auto}
#inGameChat.chat111-drawer .room-chat-compose{display:flex;gap:8px}
#inGameChat.chat111-drawer .room-chat-compose input{min-width:0;flex:1}

}
/* v112: preserve native buttons/handlers and the desktop HUD composition. */
.table-secondary-actions,.table-secondary-panel{display:contents}
.table-secondary-actions>summary{display:none}
.reference-hud .table-secondary-panel>button[hidden],.table-secondary-actions:not(:has(button:not([hidden]))){display:none!important}
@media(max-width:900px){
body:not(.is-setup) .reference-hud .turn-actions{position:relative;display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:center;gap:8px;min-width:0;overflow:visible}
body:not(.is-setup) .reference-hud .turn-actions::before{display:none}
body:not(.is-setup) .reference-hud .turn-actions>button:not(#mobileChatToggle){position:relative;flex:1 1 0;width:auto;min-width:0;max-width:none;height:48px;min-height:48px;padding:6px 12px;font-size:14px;white-space:normal}
body:not(.is-setup) .reference-hud .turn-actions>button[hidden]{display:none!important}
.table-secondary-actions{display:block;flex:0 0 76px;min-width:0}
.table-secondary-actions>summary{display:flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;height:48px;min-height:48px;padding:6px 8px;list-style:none;border:1px solid #bda16b80;border-radius:12px;background:#101e2b;color:#f4e1b9;font:14px/1.2 Georgia,serif;cursor:pointer}
.table-secondary-actions>summary::-webkit-details-marker{display:none}
.table-secondary-actions:not([open])>.table-secondary-panel{display:none}
.table-secondary-actions[open]>.table-secondary-panel{display:flex;flex-direction:column;gap:10px;position:fixed;z-index:825;right:max(12px,env(safe-area-inset-right,0px));bottom:calc(76px + env(safe-area-inset-bottom,0px));width:min(260px,calc(100vw - 24px));box-sizing:border-box;max-height:calc(100dvh - 100px);padding:14px;overflow:auto;border:1px solid #bda16b;border-radius:12px;background:#101e2b;box-shadow:0 8px 32px #000b}
body:not(.is-setup) .reference-hud .table-secondary-panel>button{position:static;flex:none;width:100%;min-width:0;max-width:none;height:auto;min-height:48px;padding:10px 12px;font:14px/1.3 Georgia,serif;white-space:normal}
.table-secondary-actions>summary:focus-visible,#mobileChatToggle:focus-visible{outline:2px solid #84dcde;outline-offset:2px}
}
@media(max-width:820px) and (orientation:portrait){
/* Three disjoint rows: hint, bounded fan, action rail. Rotated cards cannot bleed into actions. */
body:not(.is-setup) .controls.reference-hud{height:calc(236px + env(safe-area-inset-bottom,0px));display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:28px minmax(0,1fr) 52px;grid-template-areas:'hint' 'hand' 'action';gap:6px;padding:4px max(10px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px))}
body:not(.is-setup) .reference-hud #actionHint{grid-area:hint;min-width:0}
body:not(.is-setup) .reference-hud .hud-hand-frame{grid-area:hand;display:block;min-width:0;min-height:0;overflow:hidden}
body:not(.is-setup) .reference-hud #hand{position:relative;box-sizing:border-box;width:100%;height:100%;min-height:0;padding:14px 22px 22px;overflow-x:auto;overflow-y:hidden;justify-content:safe center}
body:not(.is-setup) .reference-hud .turn-actions{grid-area:action;width:100%;height:52px;min-height:0}
}
@media(min-width:821px) and (max-width:900px){
body:not(.is-setup) .reference-hud .turn-actions{flex-direction:column;justify-content:center}
body:not(.is-setup) .reference-hud .turn-actions>button:not(#mobileChatToggle){flex:0 0 48px;width:100%}
body:not(.is-setup) .reference-hud .table-secondary-actions{flex:0 0 48px;width:100%}
body:not(.is-setup) .reference-hud #mobileChatToggle:not([hidden]){flex-basis:44px;width:44px;min-width:44px;height:44px;min-height:44px}
}
@media(orientation:landscape) and (max-height:600px) and (min-width:821px) and (max-width:900px){
/* 128px landscape rail: two rows without adding height to the board. */
body:not(.is-setup) .controls.reference-hud{grid-template-columns:minmax(0,1fr) 140px minmax(160px,210px)}
body:not(.is-setup) .reference-hud .turn-actions{display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:48px 48px;gap:8px}
body:not(.is-setup) .reference-hud #endTurnBtn{grid-column:1/-1}
}
@media(hover:none),(pointer:coarse){.hand-slot,.center-slot{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}#card111-zoom:not([data-touch-preview]){display:none!important}}

/* Close only the compact menu; never touch the live media session. */
#tableSecondaryActions .voice-panel-heading{position:sticky;top:0;z-index:5;display:flex;flex:none;align-items:center;justify-content:space-between;gap:8px;min-height:44px;min-width:0;background:#101e2b;border-bottom:1px solid #bda16b55;color:#eee4cc;font:600 12px/1.3 system-ui,sans-serif}
#tableSecondaryActions .voice-panel-heading[hidden]{display:none!important}
#tableSecondaryActions .voice-panel-close{display:inline-flex;flex:0 0 44px;align-items:center;justify-content:center;box-sizing:border-box;width:44px;height:44px;min-width:44px;min-height:44px;margin:0;padding:0!important;border:0;border-radius:8px;background:none!important;box-shadow:none!important;clip-path:none!important;color:#fff2d8;font:400 28px/1 system-ui,sans-serif;text-shadow:none;cursor:pointer}
#tableSecondaryActions .voice-panel-close::before,#tableSecondaryActions .voice-panel-close::after{content:none!important;display:none!important}
#tableSecondaryActions .voice-panel-close:hover{color:#b5ffda}
#tableSecondaryActions .voice-panel-close:focus-visible{outline:2px solid #b5ffda;outline-offset:1px}
