/* Approved mobile 2-1 controls. The existing controller owns all actions. */
body.no-mobile-active {
  /* Match the shared Channels/Direct Messages surface and primary buttons. */
  --no-control-panel:var(--rx-background-page);
  --no-control-primary:linear-gradient(135deg,rgba(var(--rx-color-accent-rgb),.86),rgba(var(--rx-color-accent-secondary-rgb),.80));
  --no-control-danger:var(--rx-color-danger);
}
.no-control-dock, .no-control-dialog, .no-control-toast { font-family:var(--rx-font-sans); color:var(--rx-color-text); }
.no-control-dock, .no-control-dock *, .no-control-dialog, .no-control-dialog * { box-sizing:border-box; }
.no-control-dock button, .no-control-dialog button, .no-control-dialog select { font:inherit; cursor:pointer; touch-action:manipulation; }
.no-control-dock button, .no-control-dialog button { min-height:44px; min-width:44px; }
.no-control-dock button:focus-visible, .no-control-dialog :is(button,input,select):focus-visible { outline:3px solid var(--rx-color-accent); outline-offset:3px; }
.no-control-icon { display:block; width:21px; height:21px; flex:none; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
body.native-game-active.no-mobile-active #nativeWorkerGameRoot .native-game-shell.mode-no .native-game-side.no-control-dock { --no-control-key-height:clamp(44px,calc(20dvh - 20px),62px); --no-control-key-gap:8px; display:grid; grid-template-rows:minmax(0,1fr) auto; align-self:stretch; box-sizing:border-box; height:100%; min-height:0; max-height:100%; padding:clamp(8px,3dvh,16px) 10px 14px; gap:8px; overflow:hidden; border:0; border-left:1px solid var(--rx-color-border); border-radius:0; background:var(--rx-color-surface-quiet); box-shadow:none; }
/* The status region can yield space; it cannot push the action group down. */
.no-control-overview { min-height:0; overflow-x:hidden; overflow-y:auto; scrollbar-width:thin; overscroll-behavior:contain; }
.no-control-overview:focus-visible { outline:2px solid var(--rx-color-accent); outline-offset:-2px; }
.no-control-brand { text-align:center; padding:2px 0 8px; }
.no-control-brand strong { display:block; font-size:22px; font-weight:900; letter-spacing:-1px; line-height:1.15; }
.no-control-brand small { display:block; font-size:10px; line-height:13px; font-weight:600; color:var(--rx-color-text-muted); margin-top:3px; }
.no-control-turn { height:37px; grid-template-columns:6px minmax(0,1fr); align-items:center; gap:4px; padding:4px 2px; border-top:1px solid var(--rx-color-border); text-align:center; font-size:10px; line-height:14px; color:var(--rx-color-text); }
.no-control-turn-label { display:block; min-height:0; max-height:28px; overflow:auto; scrollbar-width:none; }
.no-control-turn::before { content:''; display:block; width:6px; height:6px; border-radius:50%; background:var(--rx-color-success); margin:0; box-shadow:0 0 10px color-mix(in srgb,var(--rx-color-success) 50%,transparent); }
.no-control-quick { display:grid; grid-auto-rows:var(--no-control-key-height); gap:var(--no-control-key-gap); min-width:0; margin:0; align-self:end; }
.no-control-key { width:100%; height:var(--no-control-key-height); display:flex; flex-direction:column; align-items:center; justify-content:center; position:relative; gap:3px; min-height:44px; padding:3px; border:1px solid var(--rx-color-border-strong); border-radius:var(--rx-radius-control); background:var(--rx-color-control); color:var(--rx-color-text); box-shadow:inset 0 1px 0 var(--rx-color-surface); transition:background .15s,transform .15s; }
.no-control-key .no-control-icon { width:clamp(18px,5dvh,21px); height:clamp(18px,5dvh,21px); }
.no-control-key:hover { background:var(--rx-color-control-hover); }
.no-control-key:active { transform:translateY(1px); }
.no-control-key span { font-size:11px; font-weight:650; line-height:14px; white-space:normal; overflow-wrap:anywhere; }
.no-control-key.no-control-menu-key { background:linear-gradient(145deg,rgba(var(--rx-color-accent-rgb),.27),rgba(var(--rx-color-accent-secondary-rgb),.12)); border-color:rgba(var(--rx-color-accent-rgb),.5); }
.no-control-badge { position:absolute; top:6px; right:9px; min-width:17px; height:17px; padding:0 4px; border-radius:var(--rx-radius-pill); display:grid; place-items:center; background:var(--no-control-primary); color:var(--rx-color-on-accent); font-size:10px; font-weight:750; }
.no-control-search { text-align:center; text-wrap:balance; margin:4px 0 0; padding:6px 0; border-block:1px solid var(--rx-color-border); font-size:10px; line-height:14px; color:var(--rx-color-text-muted); }
.no-control-search strong { display:block; font-size:19px; line-height:24px; letter-spacing:.5px; color:var(--rx-color-text); font-variant-numeric:tabular-nums; margin-top:2px; }
/* The viewport frame owns dismissal; the inner surface owns panel geometry.
   Early dialog engines use this same frame outside the native modal layer,
   avoiding iOS 15.4's missing or displaced menu painting. */
.no-control-dialog { position:fixed; inset:0; margin:0; padding:0; width:100%; height:100%; max-width:none; max-height:none; border:0; background:transparent; overflow:visible; }
.no-control-dialog[open] { display:block; }
.no-control-surface { position:absolute; inset:max(12px,var(--rx-safe-top)) max(12px,var(--rx-safe-right)) max(12px,var(--rx-safe-bottom)) auto; margin:0; padding:0; width:330px; max-width:calc(100vw - 24px); height:auto; max-height:500px; border:1px solid var(--rx-color-border-strong); border-radius:var(--rx-radius-panel); background:var(--rx-color-overlay-solid); background-image:var(--no-control-panel); box-shadow:var(--rx-shadow-overlay); overflow:hidden; display:flex; flex-direction:column; animation:no-control-enter .18s var(--rx-ease-emphasized); }
.no-control-dialog::backdrop { background:rgba(0,0,0,.48); }
.no-control-dialog-fallback { z-index:var(--rx-layer-modal); background:rgba(0,0,0,.48); }
.no-control-dialog header { display:flex; align-items:center; justify-content:space-between; flex:none; gap:10px; padding:12px 12px 10px 18px; border-bottom:1px solid var(--rx-color-border); }
.no-control-kicker { margin:0 0 3px; font-size:9px; letter-spacing:1.3px; font-weight:750; color:var(--rx-color-text-muted); text-transform:uppercase; }
.no-control-dialog h2 { font-size:19px; letter-spacing:-.4px; line-height:1.25; margin:0; font-weight:750; }
.no-control-close { display:grid; place-items:center; background:var(--rx-color-surface); color:var(--rx-color-text-muted); border:1px solid var(--rx-color-border); border-radius:var(--rx-radius-control); padding:0; width:44px; flex:none; }
.no-control-content { padding:10px 12px; flex:1 1 auto; min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; }
.no-control-row { width:100%; display:flex; align-items:center; gap:12px; min-height:49px!important; background:transparent; color:var(--rx-color-text); border:1px solid transparent; border-radius:var(--rx-radius-compact); text-align:left; padding:10px; }
.no-control-row:hover { background:var(--rx-color-control-hover); border-color:var(--rx-color-border); }
.no-control-row .no-control-icon:first-child { color:var(--rx-color-text-muted); }
.no-control-row-label { flex:1; min-width:0; font-size:13px; font-weight:600; }
.no-control-row-value { font-size:11px; padding:4px 8px; border-radius:8px; background:rgba(var(--rx-color-accent-rgb),.14); color:var(--rx-color-text); }
.no-control-row > .no-control-icon:last-child:not(:first-child) { width:15px; height:15px; color:var(--rx-color-text-subtle); }
.no-control-separator { height:1px; background:var(--rx-color-border); margin:6px 10px; }
.no-control-row.no-control-danger, .no-control-row.no-control-danger .no-control-icon { color:var(--rx-color-danger); }
.no-control-dialog footer { padding:10px 12px 12px; border-top:1px solid var(--rx-color-border); flex:none; }
.no-control-primary, .no-control-secondary, .no-control-destructive { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; padding:10px 14px; border-radius:var(--rx-radius-control); border:1px solid rgba(var(--rx-color-accent-rgb),.5); font-size:13px!important; font-weight:700!important; }
.no-control-primary { background:var(--no-control-primary); color:var(--rx-color-on-accent); box-shadow:inset 0 1px 0 rgba(255,255,255,.17); }
.no-control-primary:hover { filter:brightness(1.08); }
.no-control-secondary { background:var(--rx-color-control); color:var(--rx-color-text); border-color:var(--rx-color-border-strong); }
.no-control-destructive { background:var(--no-control-danger); color:white; border-color:var(--rx-color-danger); }
.no-control-note { color:var(--rx-color-text-muted); font-size:11px; line-height:1.5; margin:6px 10px 12px; }
.no-control-live-note { display:flex; align-items:center; gap:6px; font-size:10px; color:var(--rx-color-text-muted); padding:0 2px 8px; margin:0; }
.no-control-live-note .no-control-icon { width:13px; height:13px; }
.no-control-levels { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:10px 4px 14px; }
.no-control-level { display:flex; flex-direction:column; align-items:center; gap:12px; padding:15px 4px; min-height:80px!important; background:var(--rx-color-control); color:var(--rx-color-text-muted); border:1px solid var(--rx-color-border); border-radius:var(--rx-radius-control); font-size:12px!important; }
.no-control-level[aria-pressed="true"] { color:var(--rx-color-text); background:rgba(var(--rx-color-accent-rgb),.22); border-color:var(--rx-color-accent); box-shadow:inset 0 0 0 1px var(--rx-color-accent); }
.no-control-bars { display:flex; align-items:end; gap:4px; height:22px; }
.no-control-bars i { width:5px; border-radius:2px; background:var(--rx-color-border-strong); }
.no-control-bars i:nth-child(1) { height:9px; }.no-control-bars i:nth-child(2) { height:15px; }.no-control-bars i:nth-child(3) { height:22px; }
.no-control-bars i.lit { background:var(--rx-color-accent); }
.no-control-confirm-copy { font-size:13px; line-height:1.6; margin:8px 8px 14px; color:var(--rx-color-text-muted); }
.no-control-confirm-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.no-control-rules-sample { margin:4px 8px; }
.no-control-rules-sample h3 { font-size:13px; margin:12px 0 6px; }.no-control-rules-sample p { font-size:12px; line-height:1.6; color:var(--rx-color-text-muted); margin:0 0 14px; }
.no-control-select { display:block; margin:4px 8px 14px; }.no-control-select span { display:block; font-size:12px; margin-bottom:8px; }.no-control-select select { min-height:44px; width:100%; padding:8px 12px; border-radius:var(--rx-radius-control); color:var(--rx-color-text); background:var(--rx-color-control); border:1px solid var(--rx-color-border-strong); }
@keyframes no-control-enter { from { opacity:0; transform:translateX(16px); } to { opacity:1; transform:translateX(0); } }
@media(prefers-reduced-motion:reduce) { .no-control-surface { animation:none; }.no-control-key { transition:none; } }

body.native-game-active.no-mobile-active #nativeWorkerGameRoot .native-game-shell.mode-no .no-control-dock .native-no-landscape-status { display:grid; color:var(--rx-color-text); text-align:center; font-size:10px; line-height:14px; margin:0; }
.no-control-turn:not(.is-local-turn)::before { background:var(--rx-color-text-subtle); box-shadow:none; }
.no-control-key:disabled,.no-control-row:disabled,.no-control-level:disabled,.no-control-primary:disabled,.no-control-destructive:disabled { opacity:.45; cursor:default; transform:none; }

body.native-game-active.no-mobile-active #nativeWorkerGameRoot .native-game-shell.mode-no .native-no-layout:has(.no-control-dock) { grid-template-columns:minmax(0,1fr) 96px; }

.no-control-dialog .native-no-rules-intro { font-size:12px; padding:0 8px; }
.no-control-dialog .native-no-rules-list { padding:0; }
.no-control-dialog .native-no-rules-row { padding:12px 8px; grid-template-columns:24px minmax(0,1fr); }
.no-control-dialog .native-no-rules-row strong { font-size:13px; }
.no-control-dialog .native-no-rules-row p { font-size:12px; line-height:1.6; }
.no-control-dialog .native-practice-game-picker { display:grid; width:100%; gap:8px; padding:8px; color:var(--rx-color-text); font-size:12px; }
.no-control-dialog .native-practice-game-picker::after { content:none; }
.no-control-dialog .native-practice-game-picker > span { color:var(--rx-color-text-muted); }
.no-control-select-field { display:block; position:relative; min-width:0; }
.no-control-select-field .no-control-icon { position:absolute; right:14px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--rx-color-accent); pointer-events:none; }
.no-control-dialog select { width:100%; min-width:0; min-height:44px; font-size:16px; color:var(--rx-color-text); background:var(--rx-color-control); border:1px solid var(--rx-color-border-strong); border-radius:var(--rx-radius-control); padding:8px 42px 8px 12px; }
/* Actual match chat retains its composer, delivery and keyboard handling. */
body.native-game-active.no-mobile-active #nativeWorkerGameRoot .native-game-shell.mode-no .no-control-dock[data-native-panel="chat"] .native-game-panel-body.no-control-chat-sheet {
  position:fixed; inset:max(12px,var(--rx-visual-top,0px)) max(12px,var(--rx-safe-right)) calc(var(--rx-keyboard-bottom,0px) + max(12px,var(--rx-safe-bottom))) auto;
  width:min(330px,calc(100vw - 24px)); max-height:500px; height:auto; min-height:0;
  display:flex; padding:12px; border:1px solid var(--rx-color-border-strong); border-radius:var(--rx-radius-panel); background:var(--rx-color-overlay-solid);background-image:var(--rx-background-page); box-shadow:var(--rx-shadow-overlay); overflow:hidden; z-index:30;
}
body.native-game-active.no-mobile-active #nativeWorkerGameRoot .native-game-shell.mode-no .no-control-chat-sheet .native-game-chat-close { display:grid; place-items:center; flex:none; width:44px; min-height:44px; font-size:0; border:1px solid var(--rx-color-border); border-radius:var(--rx-radius-control); background:var(--rx-color-surface); color:var(--rx-color-text); }
body.native-game-active.no-mobile-active #nativeWorkerGameRoot .native-game-shell.mode-no .no-control-chat-sheet .native-game-chat-close::after { content:'×'; font-size:24px; }
body.native-game-active.no-mobile-active #nativeWorkerGameRoot .native-game-shell.mode-no .no-control-chat-sheet .native-game-chat-header { align-items:center; padding-bottom:8px; }
body.native-game-active.no-mobile-active #nativeWorkerGameRoot .native-game-shell.mode-no .no-control-chat-sheet .native-game-chat-header strong { font-size:19px; }
@media(max-height:350px) {
 body.native-game-active.no-mobile-active #nativeWorkerGameRoot .native-game-shell.mode-no .native-game-side.no-control-dock { --no-control-key-height:54px; --no-control-key-gap:6px; gap:6px; }
 .no-control-dock[data-no-control-mode="queue"] .no-control-quick [data-no-control="difficulty"] { display:none; }
 .no-control-brand { padding:0 0 6px; }.no-control-brand strong { font-size:20px; }
 .no-control-turn { height:33px; padding:2px 0; }
 .no-control-search { padding:5px 0; }
 .no-control-dialog header { padding-top:7px; padding-bottom:7px; }.no-control-dialog footer { padding-block:8px; }.no-control-content { padding-block:5px; }
}
@media(max-height:300px) {
 body.native-game-active.no-mobile-active #nativeWorkerGameRoot .native-game-shell.mode-no .native-game-side.no-control-dock { --no-control-key-height:44px; padding:8px 10px 14px; }
 .no-control-brand strong { font-size:19px; }.no-control-brand { padding:0 0 4px; }
 .no-control-turn { height:31px; padding:1px 0; }
 .no-control-search { padding:4px 0; margin:2px 0 5px; }.no-control-search strong { font-size:15px; }
 .no-control-key .no-control-icon { width:18px; height:18px; }
}
@media(min-height:550px) {
 body.native-game-active.no-mobile-active #nativeWorkerGameRoot .native-game-shell.mode-no .native-game-side.no-control-dock { --no-control-key-height:70px; padding:24px 22px; }
 body.native-game-active.no-mobile-active #nativeWorkerGameRoot .native-game-shell.mode-no .native-no-layout:has(.no-control-dock) { grid-template-columns:minmax(0,1fr) 160px; }
 .no-control-brand strong { font-size:30px; }.no-control-brand small { font-size:12px; }.no-control-key span { font-size:13px; }
 .no-control-surface { width:360px; top:auto; height:490px; bottom:max(24px,var(--rx-safe-bottom)); right:max(24px,var(--rx-safe-right)); max-height:calc(100dvh - 48px); }
 .no-control-row { min-height:58px!important; }
}

/* Portrait utilities keep their minimum touch size, but grow with enlarged
   labels. The surrounding layout reserves the row's actual height. */
#nativeWorkerGameRoot.has-mobile-controls { --native-mobile-control-height:52px; }
#nativeWorkerGameRoot .native-mobile-controls { display:flex; gap:8px; width:100%; margin:0; }
#nativeWorkerGameRoot .native-mobile-controls .no-control-key { flex:1 1 0; width:0; min-width:44px; min-height:var(--native-mobile-control-height); height:auto; padding:4px 6px; gap:2px; }
#nativeWorkerGameRoot .native-mobile-controls .no-control-icon { width:18px; height:18px; }
#nativeWorkerGameRoot .native-mobile-controls .no-control-key span { min-width:0; max-width:100%; font-size:12px; line-height:14px; overflow-wrap:anywhere; }
#nativeWorkerGameRoot.has-mobile-controls.native-game-root .native-game-panel-actions .native-mobile-controls .native-game-draw-label { inline-size:auto; min-width:0; }
#nativeWorkerGameRoot .native-mobile-controls .no-control-badge { background:var(--rx-color-accent); color:var(--rx-color-on-accent); }
#nativeWorkerGameRoot .native-mobile-controls .no-control-key:focus-visible { outline-offset:-3px; }
.native-mobile-control-dialog {
  --no-control-panel:var(--rx-background-page);
  --no-control-primary:linear-gradient(135deg,rgba(var(--rx-color-accent-rgb),.86),rgba(var(--rx-color-accent-secondary-rgb),.80));
  --no-control-danger:var(--rx-color-danger);
}
@supports (color: color-mix(in srgb, black, white)) {
  body.no-mobile-active, .native-mobile-control-dialog {
    --no-control-danger:color-mix(in srgb,var(--rx-color-danger) 80%,black);
  }
}
.native-mobile-control-dialog .no-control-surface {
  inset:max(12px,var(--rx-safe-top)) max(12px,var(--rx-safe-right)) max(12px,var(--rx-safe-bottom)) max(12px,var(--rx-safe-left));
  width:360px; height:490px; margin:auto;
  max-height:calc(100dvh - max(12px,var(--rx-safe-top)) - max(12px,var(--rx-safe-bottom)));
}
.native-mobile-control-dialog .native-poker-hierarchy-row { grid-template-columns:24px minmax(0,1fr); }
.native-mobile-control-dialog .native-poker-hierarchy-cards { grid-column:2; }
#nativeWorkerGameRoot.has-mobile-controls .native-practice-game-picker { display:none; }
@media(max-height:700px) {
  #nativeWorkerGameRoot.has-mobile-controls { --native-mobile-control-height:44px; }
  #nativeWorkerGameRoot .native-mobile-controls .no-control-key { flex-direction:row; gap:7px; }
}
@media(max-width:700px) {
  body.native-game-active #nativeWorkerGameRoot.has-mobile-controls > .native-practice-side[data-native-responsive-queue-tray] {
    /* This tray already occupies its own grid row above the buttons. */
    position:relative; bottom:0;
    height:auto;
    min-height:0; max-height:none;
  }
  body.native-game-active #nativeWorkerGameRoot.has-mobile-controls > .native-practice-side[data-native-responsive-queue-tray] .native-game-panel-body {
    height:auto; overflow:visible;
  }
  body.native-game-active #nativeWorkerGameRoot.has-mobile-controls > .native-practice-side[data-native-responsive-queue-tray] .native-practice-summary {
    grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); grid-template-rows:1fr;
    align-items:center; height:auto;
  }
  body.native-game-active #nativeWorkerGameRoot.has-mobile-controls > .native-practice-side[data-native-responsive-queue-tray] .native-practice-queue {
    grid-template-rows:auto auto;
  }
  body.native-game-active #nativeWorkerGameRoot.has-mobile-controls > .native-practice-side[data-native-responsive-queue-tray] [data-native-queue-label] {
    white-space:normal; overflow-wrap:anywhere; font-size:.86rem; line-height:1.25;
  }
  body.native-game-active #nativeWorkerGameRoot.has-mobile-controls > .native-practice-side[data-native-responsive-queue-tray] [data-native-practice-mode] {
    display:block; font-size:13px; line-height:1.2; color:var(--rx-color-text);
  }
  body.native-game-active #nativeWorkerGameRoot.has-mobile-controls > .native-practice-side[data-native-responsive-queue-tray] .native-practice-game-picker { display:none; }
}
