/* Screen-space menu: the table keeps its existing 430px coordinate system. */
#tableMenuDialog {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: block;
  color: #f5edda;
  font-family: inherit;
  letter-spacing: -.035em;
  isolation: isolate;
}
#tableMenuDialog *, #tableMenuDialog *::before, #tableMenuDialog *::after { box-sizing: border-box; }
#tableMenuDialog[hidden], #tableMenuDialog [hidden],
#tableMenuDialog .hidden:not(#fullscreenMenuBtn) { display: none !important; }
#tableMenuDialog .table-menu-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,rgba(5,7,5,.12),rgba(5,7,5,.5) 40%,rgba(5,7,5,.65));
  -webkit-backdrop-filter: blur(1.4px);
  backdrop-filter: blur(1.4px);
}
#tableMenuDialog .gg-topbar-actions.has-menu-tabs {
  position: absolute !important;
  top: auto !important;
  bottom: max(82px,calc(env(safe-area-inset-bottom,0px) + 16px)) !important;
  left: 50% !important;
  right: auto !important;
  width: min(402px,calc(100% - 28px)) !important;
  max-width: none !important;
  max-height: calc(100dvh - 100px) !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  overflow: hidden !important;
  border: 1px solid #a88a4e !important;
  border-radius: 19px !important;
  background: linear-gradient(145deg,#2a2a22 0%,#1a1e18 57%,#151a15 100%) !important;
  box-shadow: 0 18px 70px #000b,0 1px 0 #ffe3a51c inset !important;
  color: #f5edda !important;
  font-family: inherit !important;
  pointer-events: auto !important;
}
#tableMenuDialog .tm-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; gap: 12px; padding: 21px 20px 15px;
}
#tableMenuDialog .tm-brand {
  margin-bottom: 4px; color: #b69b61; font-size: 9px;
  line-height: 1.3; letter-spacing: .16em; font-weight: 700;
}
#tableMenuDialog .tm-title {
  margin: 0; padding: 0; color: #f5edda; font-size: 23px;
  line-height: 1.25; font-weight: 800; letter-spacing: -.055em;
}
#tableMenuDialog .tm-close {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  display: grid; place-items: center; flex: none; padding: 0;
  border: 1px solid #ffffff14; border-radius: 50%; background: #ffffff06;
  color: #c9c1ac; font: 300 25px/1 sans-serif; box-shadow: none;
}
#tableMenuDialog .tm-tabs {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr));
  flex-shrink: 0; gap: 4px; margin: 0 16px 9px; padding: 4px;
  border: 1px solid #d8c38a14; border-radius: 10px; background: #0d120d;
}
#tableMenuDialog .tm-tab {
  min-width: 0; min-height: 44px; margin: 0; padding: 8px;
  border: 0; border-radius: 7px; background: transparent; box-shadow: none;
  color: #b6b6a5; font-family: inherit; font-size: 14px; line-height: 1.3;
  font-weight: 700; letter-spacing: -.04em;
}
#tableMenuDialog .tm-tab.is-active,
#tableMenuDialog .tm-tab[aria-selected="true"] {
  background: linear-gradient(#cfb47a,#b39a64); color: #161b13;
  box-shadow: 0 1px 0 #f9e2a8aa inset;
}
#tableMenuDialog .tm-content {
  min-height: 0; padding: 0 16px; overflow: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  scrollbar-color: #8d7b50 transparent; scrollbar-width: thin;
}
#tableMenuDialog .tm-tabpanel { margin: 0; padding: 0; }
#tableMenuDialog .tm-row,
#tableMenuDialog #fullscreenMenuBtn.hidden {
  display: flex !important; align-items: center; gap: 12px;
  flex-shrink: 0; width: 100%; min-height: 57px !important;
  margin: 0 !important; padding: 7px 8px !important;
  border: 0 !important; border-bottom: 1px solid #e8d9a70b !important;
  border-radius: 0 !important; background: transparent !important; box-shadow: none !important;
  color: #f5edda; font-family: inherit; text-align: left;
  cursor: pointer; line-height: 1.4;
}
#tableMenuDialog .tm-row:last-of-type { border-bottom-color: transparent !important; }
#tableMenuDialog .tm-icon { width: 22px; height: 22px; flex: none; color: #c9b37d; }
#tableMenuDialog .tm-icon svg { display: block; width: 22px; height: 22px; }
#tableMenuDialog .tm-label { min-width: 0; color: inherit; font-size: 15px; font-weight: 650; letter-spacing: -.05em; }
#tableMenuDialog .tm-current {
  display: flex; align-items: center; gap: 7px; margin-left: auto;
  padding: 0; border: 0; border-radius: 0; background: transparent;
  color: #c6b991; font-size: 12px; font-weight: 600; line-height: 1.4;
  white-space: nowrap; letter-spacing: -.03em; max-width: 58%;
}
#tableMenuDialog .tm-chevron { width: 13px; height: 16px; flex: none; color: #827b61; }
#tableMenuDialog .tm-chevron svg, #tableMenuDialog .tm-current > svg { width: 13px; height: 16px; }
#tableMenuDialog .tm-switch {
  display: block; width: 42px; min-width: 42px; height: 25px; margin-left: auto;
  padding: 3px; flex: none; border: 0; border-radius: 20px;
  background: #52584a; box-shadow: 0 0 0 1px #dfc78b22 inset;
  font-size: 0; color: transparent; line-height: 0;
}
#tableMenuDialog .tm-switch::after {
  content: ""; display: block; width: 19px; height: 19px;
  border-radius: 50%; background: #f9f2df; box-shadow: 0 1px 3px #0004;
  transform: translateX(0);
}
#tableMenuDialog .tm-toggle[aria-checked="true"] .tm-switch { background: #bca16d; }
#tableMenuDialog .tm-toggle[aria-checked="true"] .tm-switch::after { transform: translateX(17px); }
#tableMenuDialog .tm-row:disabled { cursor: default; opacity: .68; }
#tableMenuDialog .tm-note { margin: 8px 8px 0; color: #a49f8d; font-size: 11px; line-height: 1.5; }
#tableMenuDialog .tm-footer {
  flex-shrink: 0; margin: 11px 16px 16px; padding-top: 9px;
  border-top: 1px solid #b79e6130;
}
#tableMenuDialog .tm-lobby {
  display: flex !important; align-items: center; gap: 12px;
  width: 100%; min-height: 47px !important; margin: 0 !important; padding: 6px 8px !important;
  border: 0 !important; border-radius: 0 !important; background: transparent !important;
  box-shadow: none !important; color: #c0bcab; font-family: inherit; font-size: 14px;
  line-height: 1.4; font-weight: 600; text-align: left;
}
#tableMenuDialog .tm-lobby .tm-current { color: #837e6b; }
#tableMenuDialog .tm-danger { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 6px; }
#tableMenuDialog .tm-danger > button {
  display: flex !important; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-width: 0; min-height: 46px; height: auto;
  margin: 0 !important; padding: 8px 6px !important;
  border: 1px solid #c2ad7926 !important; border-radius: 9px !important;
  background: #ffffff03 !important; box-shadow: none !important;
  color: #d3c6a4; font-family: inherit; font-size: 12px; line-height: 1.4;
  font-weight: 650; text-align: center;
}
#tableMenuDialog .tm-danger > #forfeitToggle { border-color: #bc797637 !important; background: #a5444210 !important; color: #d49d96; }
#tableMenuDialog .tm-danger > button::before {
  content: ""; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--tm-action-icon) center / contain no-repeat;
  mask: var(--tm-action-icon) center / contain no-repeat;
}
#tableMenuDialog button:focus-visible { outline: 2px solid #dfc78b; outline-offset: -3px; }
/* Native permission and seat-state guards always win over row presentation. */
#tableMenuDialog [hidden],
#tableMenuDialog .hidden:not(#fullscreenMenuBtn) { display: none !important; }
@media (max-width: 360px) {
  #tableMenuDialog .gg-topbar-actions.has-menu-tabs {
    width: calc(100% - 20px) !important;
    bottom: max(64px,calc(env(safe-area-inset-bottom,0px) + 12px)) !important;
  }
  #tableMenuDialog .tm-header { padding: 15px 16px 12px; }
  #tableMenuDialog .tm-title { font-size: 21px; }
  #tableMenuDialog .tm-content { padding: 0 12px; }
  #tableMenuDialog .tm-tabs { margin: 0 12px 6px; }
  #tableMenuDialog .tm-row, #tableMenuDialog #fullscreenMenuBtn.hidden { min-height: 48px !important; }
  #tableMenuDialog .tm-label { font-size: 14px; }
  #tableMenuDialog .tm-current { font-size: 11px; }
  #tableMenuDialog .tm-footer { margin: 9px 12px 12px; }
  #tableMenuDialog .tm-danger > button { min-height: 44px; font-size: 11px; }
}

/* Native button icons and permissions are retained through the new row shell. */
#tableMenuDialog .tm-row::before,
#tableMenuDialog .tm-row::after { display:none !important;content:none !important; }
#tableMenuDialog .tm-row { color:#f5edda !important;justify-content:flex-start !important;align-items:center !important; }
#tableMenuDialog .tm-row[hidden],
#tableMenuDialog .tm-danger > button[hidden] { display:none !important; }
@media (max-height:440px) {
  #tableMenuDialog .gg-topbar-actions.has-menu-tabs {
    bottom:max(8px,calc(env(safe-area-inset-bottom,0px) + 8px)) !important;
    max-height:calc(100dvh - 16px) !important;
  }
  #tableMenuDialog .tm-header { padding:8px 16px; }
  #tableMenuDialog .tm-title { font-size:19px; }
  #tableMenuDialog .tm-tabs { margin:0 12px 6px;padding:3px; }
  #tableMenuDialog .tm-row,
  #tableMenuDialog #fullscreenMenuBtn.hidden { min-height:44px !important; }
  #tableMenuDialog .tm-footer { margin:6px 12px 8px;padding-top:5px; }
  #tableMenuDialog .tm-lobby,
  #tableMenuDialog .tm-danger > button { min-height:44px !important; }
  #tableMenuDialog .tm-danger { gap:4px;margin-top:4px; }
}

/* Preserve the existing multi-table controls inside the tournament tab. */
#tableMenuDialog #multiTournamentSwitcher {
  position:relative !important;inset:auto !important;transform:none !important;
  width:100% !important;min-width:0 !important;max-width:none !important;
  height:auto !important;min-height:0 !important;max-height:none !important;
  margin:0 0 8px !important;padding:0 !important;
}
#tableMenuDialog #multiTournamentSwitcher .mts-viewport {
  width:100% !important;max-width:100% !important;height:auto !important;
  margin:0 !important;padding:3px !important;overflow-x:auto !important;overflow-y:hidden !important;
}
#tableMenuDialog #multiTournamentSwitcher .mts-track {
  width:max-content !important;min-width:100% !important;height:auto !important;
  min-height:44px !important;display:flex !important;gap:6px !important;
}
#tableMenuDialog #multiTournamentSwitcher .mts-slot {
  min-width:44px !important;min-height:44px !important;height:44px !important;flex-shrink:0 !important;
}
#tableMenuDialog #multiTournamentSwitcher.hidden { display:none !important; }

/* Match the approved muted footer, overriding legacy global menu typography. */
#tableMenuDialog .tm-danger > #sitOutToggle,
#tableMenuDialog .tm-danger > #forfeitToggle {
  align-items:center !important;justify-content:center !important;text-align:center !important;
  font-family:inherit !important;font-size:12px !important;font-weight:650 !important;
  color:#d3c6a4 !important;
}
#tableMenuDialog .tm-danger > #forfeitToggle { color:#d49d96 !important; }
#tableMenuDialog .tm-danger > button::before {
  content:"" !important;display:block !important;flex:none !important;
  width:16px !important;height:16px !important;margin:0 !important;background:currentColor !important;
  -webkit-mask:var(--tm-action-icon) center / contain no-repeat !important;
  mask:var(--tm-action-icon) center / contain no-repeat !important;
}
@media(max-width:360px) {
  #tableMenuDialog .tm-danger > #sitOutToggle,
  #tableMenuDialog .tm-danger > #forfeitToggle { font-size:11px !important; }
}

/* Legacy menu rows specify 43px with !important; footer touch targets are 44px. */
#tableMenuDialog .tm-danger > #sitOutToggle,
#tableMenuDialog .tm-danger > #forfeitToggle { min-height:44px !important; }
