body[data-scene="table"] .title-row, body[data-scene="table"] .masthead { display: none; }
.crew-collection, .crew-drop { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 10px; border: 0; border-radius: 6px; color: var(--ink); background: var(--surface); font: 700 14px var(--ui); }
.crew-drop { margin: 4px 0; color: var(--accent); }
.crew-drop img { width: 36px; height: 36px; border-radius: 5px; image-rendering: pixelated; }
.crew-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.crew-list button { position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; min-width: 0; padding: 5px; border-radius: 7px; border: 1px solid var(--line); color: var(--ink); background: var(--surface); font: 700 13px var(--ui); }
.crew-list img { display: block; width: min(100%,76px); aspect-ratio: 1; border-radius: 5px; image-rendering: pixelated; }
.crew-list [aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: -2px; }
.crew-list [aria-pressed="true"]::after { content: "✓"; position: absolute; right: 4px; top: 2px; color: var(--accent); }
.crew-list button:disabled { opacity: .72; cursor: default; }
.crew-list button:disabled img { filter: grayscale(.92) brightness(.68); }
.crew-note { color: var(--muted); margin: 6px 0 10px; font: 600 13px/1.35 var(--ui); }
body[data-scene="table"] .club { --side: 4px; }
body[data-scene="table"] .felt:not(.preview) { border-radius: 10px; padding-inline: clamp(5px,1.6vw,12px); }
.felt:not(.preview) .seat .avatar { width: clamp(42px,12cqw,56px); height: clamp(42px,12cqw,56px); border-radius: 7px; border: 0; box-shadow: none; }
.felt:not(.preview) .self .avatar { width: clamp(46px,14cqw,64px); height: clamp(46px,14cqw,64px); }
.felt:not(.preview) .avatar-img { width: 100%; height: 100%; object-fit: cover; transform: none; image-rendering: pixelated; }
.felt:not(.preview) .seat-label { width: max-content; max-width: 100%; position: relative; padding: 3px 5px 3px 3px; gap: 5px; }
.felt:not(.preview) .seat-name { font: 750 clamp(13px,3.4cqw,16px)/1.08 var(--ui); white-space: normal; overflow-wrap: anywhere; }
.felt:not(.preview) .seat-meta .stack, .felt:not(.preview) .seat-meta .seat-bet { font: 700 clamp(12px,3.1cqw,15px)/1.12 var(--ui); }
.felt:not(.preview) .seat-meta { gap: 4px; flex-wrap: wrap; }
.felt:not(.preview) .stack { display: inline-flex; align-items: center; gap: 3px; }
.felt:not(.preview) .stack::before { content: ""; width: 8px; height: 6px; flex: none; border-radius: 50%; background: #eece87; box-shadow: inset 0 1px #fff0b9,inset -2px -1px #ad7b4a,0 2px #8d734f; }
.felt:not(.preview) .seat-label .turn-clock { top: -7px; inset-inline-end: -8px; width: 20px; height: 20px; font-size: 9px; }
.felt:not(.preview) .dealer { position: absolute; top: -5px; left: -5px; z-index: 2; }
.felt:not(.preview) .opponent { min-width: 0; max-width: 100%; }
.felt:not(.preview) .self { min-width: 0; max-width: min(48cqw,250px); }
.felt:is([data-seats="5"],[data-seats="6"]) { column-gap: 4px; }
.felt:is([data-seats="5"],[data-seats="6"]) .self { max-width: min(100%,250px); }
.felt[data-seats="2"] .opponent, .felt[data-seats="3"] .opponent { max-width: min(52cqw,250px); }
@media(max-width: 740px) {
  body[data-scene="table"] .club { width: 100%; padding-bottom: max(8px,env(safe-area-inset-bottom),calc(var(--tg-content-safe-area-inset-bottom,0px) + var(--tg-safe-area-inset-bottom,0px))); }
  body[data-scene="table"] .table-wrap { margin-top: 1px; }
  body[data-scene="table"] .felt:not(.preview) { height: max(300px, var(--table-height, calc(100svh - 186px))); }
  body[data-scene="table"] #actions { position: static; translate: none; width: 100%; margin: 4px 0 0; }
  body[data-scene="table"]::after { display: none; }
  body[data-scene="table"] .controls { padding: 3px 5px; }
  body[data-scene="table"] .hand-tools { margin: 3px 5px; }
}
@media(min-width: 741px) {
  body[data-scene="table"] .club { width: min(100%,1280px); }
  body[data-scene="table"] .felt:not(.preview) { height: clamp(298px,var(--table-height,70svh),900px); }
}
@media(max-width: 430px) {
  .felt[data-seats="6"] .opponent .seat-label, .felt[data-seats="5"] .opponent .seat-label { flex-direction: column; min-width: 65px; max-width: 100%; padding: 3px 5px 4px; gap: 2px; }
  .felt[data-seats="6"] .opponent .seat-body, .felt[data-seats="5"] .opponent .seat-body { text-align: center; }
  .felt[data-seats="6"] .opponent .seat-meta, .felt[data-seats="5"] .opponent .seat-meta { justify-content: center; }
}
.pilot-speech { position: absolute; z-index: 18; max-width: min(145px,42%); width: max-content; padding: 4px 8px 5px; border: 0; border-radius: 5px 5px 5px 1px; background: #f3dfa9; color: #30212c; box-shadow: 0 2px 0 #251e30; font: 750 15px/1.05 var(--pixel,"Club Arcade",monospace); text-align: center; pointer-events: none; transform-origin: var(--tip) bottom; }
.pilot-speech::after { content: ""; position: absolute; top: 100%; left: var(--tip); width: 7px; height: 4px; background: #f3dfa9; clip-path: polygon(0 0,100% 0,0 100%); }
.pilot-speech[data-above="false"]::after { top: auto; bottom: 100%; transform: scaleY(-1); }
.pilot-throw, .pilot-speck { position: absolute; z-index: 17; left: 0; top: 0; pointer-events: none; }
.pilot-throw { width: clamp(23px,7cqw,38px); height: auto; image-rendering: pixelated; filter: drop-shadow(0 2px 0 #211b2a88); }
.pilot-speck { width: 3px; height: 3px; background: currentColor; }
.pilot-prop { position: absolute; z-index: 17; width: clamp(19px,5cqw,28px); transform: translate(6px,2px); pointer-events: none; image-rendering: pixelated; }
#emote-bar [data-group="react"] { grid-template-columns: repeat(6,minmax(0,1fr)); }
#emote-bar [data-group="react"] button { grid-column: span 2; }
#emote-bar [data-group="react"] [data-face] { background: var(--surface); color: var(--ink); }
#emote-bar [data-face] img { width: 44px; height: 44px; border-radius: 5px; image-rendering: pixelated; }
:root[data-skin="orbit"] body[data-scene="table"] .felt:not(.preview)::before { background-image: url("./crew/nighttrain.webp"); filter: none; }
:root[data-skin="ember"] body[data-scene="table"] .felt:not(.preview)::before { background-image: url("./crew/afterhours.webp"); filter: none; }

/* Poker lobby */
body[data-scene="lobby"] .club {
  width: min(100%, 620px);
  padding-bottom: max(20px, env(safe-area-inset-bottom), calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px)));
}
body[data-scene="lobby"] .table-wrap, body[data-scene="lobby"]::after,
body[data-scene="lobby"] #control-head:has(#control-title:empty),
body[data-scene="lobby"] .controls:has(#actions:empty):has(#notice[hidden]):has(#control-title:empty) { display: none; }
body[data-scene="lobby"] #actions { position: static; translate: none; width: 100%; margin: 6px 0; }
.lobby-home [hidden], .entry-picker [hidden], #lobby-home[hidden], #lobby-booking[hidden] { display: none; }
.lobby-home { display: grid; gap: 18px; font-family: var(--ui); }
.lobby-home button, .entry-picker button, .lobby-primary { touch-action: manipulation; }
.lobby-home :is(button,a):focus-visible, .entry-picker button:focus-visible, .lobby-primary:focus-visible {
  outline: 2px solid var(--signal); outline-offset: 2px;
}
.lobby-nav { display: flex; align-items: center; gap: 10px; margin-bottom: -9px; }
.games-back, #lobby-more, .lobby-wallet { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font: 700 14px/1.2 var(--ui); }
.games-back { margin-right: auto; color: var(--muted); text-decoration: none; }
#lobby-more { padding: 0 4px; border: 0; background: transparent; color: var(--ink); }
.more-dots { font: 800 12px/1 var(--ui); letter-spacing: 1px; color: var(--accent); }
.lobby-wallet { color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lobby-wallet img { width: 18px; height: 18px; }
.lobby-play { background: var(--panel); border-radius: 10px; }
.lobby-poster { position: relative; isolation: isolate; overflow: hidden; border-radius: 10px 10px 0 0; background: #2c2030; }
.poster-copy { position: relative; z-index: 1; width: 40%; min-height: clamp(108px, 30vw, 162px); display: flex; flex-direction: column; justify-content: center; padding: 12px 0 12px clamp(14px, 4.4vw, 25px); }
.poster-copy h1 { margin: 0; font: 700 clamp(42px, 10vw, 60px)/.96 "Club Arcade", monospace; letter-spacing: 0; text-transform: none; color: #ffdcab; }
.poster-copy p { margin: 7px 0 0; color: #ead6c3; font: 650 13px/1.25 var(--ui); }
.poster-art { position: absolute; z-index: 0; inset: 0 0 0 auto; width: 62%; height: 100%; object-fit: cover; object-position: 50% 41%; clip-path: polygon(12% 0,100% 0,100% 100%,0 100%,0 75%,3% 75%,3% 50%,6% 50%,6% 25%,9% 25%,9% 10%,12% 10%); }
#lobby-booking { padding: 13px clamp(12px, 3.8vw, 22px) 17px; }
.entry-picker { display: grid; gap: 12px; }
.entry-mode, .entry-stakes { display: grid; gap: 4px; min-width: 0; }
.entry-mode { grid-template-columns: repeat(2, minmax(0,1fr)); padding: 3px; border-radius: 7px; background: var(--page); }
.entry-mode button, .entry-stakes button { min-width: 0; min-height: 44px; border: 0; background: transparent; color: var(--muted); border-radius: 4px; font: 700 14px/1.2 var(--ui); }
.entry-mode button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 1px #0005; }
.entry-row { display: grid; grid-template-columns: minmax(5em,auto) minmax(0,1fr); align-items: center; gap: 9px; }
.entry-label { font: 650 13px/1.2 var(--ui); color: var(--muted); }
.entry-stakes { grid-template-columns: repeat(4,minmax(0,1fr)); }
.entry-stakes button { padding: 0 2px; white-space: nowrap; background: var(--surface); }
.entry-stakes button[aria-pressed="true"] { background: #39303a; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.entry-stakes button:disabled, .lobby-primary:disabled { cursor: default; opacity: .5; }
.entry-picker p.entry-terms, .entry-picker p.entry-notice { margin: -3px 0 0; font: 600 12px/1.4 var(--ui); }
.entry-picker p.entry-terms { color: var(--muted); }
.entry-notice, .entry-notice a, .entry-notice button { color: var(--accent); }
.retry-wallet { border: 0; background: transparent; text-decoration: underline; font: inherit; }
.lobby-primary, .resume-seat {
  border: 0; border-radius: 5px; width: 100%; min-width: 0; min-height: 52px; padding: 9px 14px;
  background: var(--accent); color: #29202c; box-shadow: 0 3px 0 #0005;
  font: 800 clamp(15px, 4.2vw, 19px)/1.16 var(--ui);
}
.lobby-primary {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px;
  text-align: left; margin-top: 14px; border-radius: 0; box-shadow: inset 0 -3px #38233933;
  clip-path: polygon(0 6px,3px 6px,3px 3px,6px 3px,6px 0,calc(100% - 6px) 0,calc(100% - 6px) 3px,calc(100% - 3px) 3px,calc(100% - 3px) 6px,100% 6px,100% calc(100% - 6px),calc(100% - 3px) calc(100% - 6px),calc(100% - 3px) calc(100% - 3px),calc(100% - 6px) calc(100% - 3px),calc(100% - 6px) 100%,6px 100%,6px calc(100% - 3px),3px calc(100% - 3px),3px calc(100% - 6px),0 calc(100% - 6px));
}
.lobby-home .lobby-primary:focus-visible, dialog .lobby-primary:focus-visible { outline: 2px solid #382339; outline-offset: -5px; }
.lobby-primary:not(:disabled):active, .resume-seat:active { transform: translateY(2px); box-shadow: none; }
.entry-emoji { font: 21px/1 "Apple Color Emoji","Segoe UI Emoji",sans-serif; }
.entry-price { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font: 800 15px/1.2 var(--ui); font-variant-numeric: tabular-nums; }
.entry-price img { width: 20px; height: 20px; image-rendering: pixelated; }
.resume-seat { display: block; margin: 12px auto; width: calc(100% - 26px); }
.rooms-panel { margin: 0; padding: 0 2px; background: transparent; }
.rooms-head { display: flex; align-items: center; gap: 1px; }
.rooms-head h2 { margin: 0; font: 700 32px/1 "Club Arcade", monospace; color: var(--ink); text-transform: none; letter-spacing: 0; }
#refresh-rooms, .new-table { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 0; }
#refresh-rooms { width: 44px; background: transparent; color: var(--muted); }
.new-table { margin-left: auto; gap: 5px; padding: 0 10px; background: var(--surface); color: var(--ink); border-radius: 5px; font: 700 13px/1.2 var(--ui); }
.rooms-empty { margin: 7px 0 3px; color: var(--muted); font: 600 14px/1.4 var(--ui); }
.rooms-list { margin: 5px 0 0; padding: 0; display: grid; gap: 5px; }
.rooms-list:empty { display: none; }
.room-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 57px; padding: 6px 8px; border: 0; border-radius: 6px; background: var(--panel); }
.room-row:not(:has(.host-face)) .room-info { grid-column: span 2; }
.host-face { width: 42px; height: 42px; border-radius: 4px; image-rendering: pixelated; }
.room-host { font: 750 15px/1.2 var(--ui); }
.room-meta { font: 600 12px/1.35 var(--ui); gap: 2px 8px; }
.room-join { min-height: 44px; padding: 4px 10px; border: 0; background: var(--surface); color: var(--accent); border-radius: 4px; font: 750 14px/1.15 var(--ui); }
.room-join:disabled { color: var(--muted); cursor: default; }
.club-links { display: grid; grid-template-columns: 1.12fr 1fr 1fr; gap: 3px; }
.club-links button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 48px; border: 0; border-radius: 6px; background: var(--panel); color: var(--ink); font: 700 13px/1.2 var(--ui); }
.club-links .icon { color: var(--accent); }
.sheet .lobby-ranking { padding: 0; list-style: none; }
.lobby-ranking li { display: grid; grid-template-columns: 1.5em minmax(0,1fr) auto; align-items: baseline; gap: 5px; }
.lobby-ranking .top-player { min-width: 0; overflow-wrap: anywhere; }
dialog[data-purpose="lobby-menu"] .sheet-actions { display: grid; gap: 14px; }
@media (max-width: 340px) {
  .poster-copy h1 { font-size: 38px; }
}
@media (max-width: 375px) {
  .entry-row { grid-template-columns: 1fr; gap: 5px; }
  .club-links button { flex-direction: column; gap: 4px; min-height: 54px; }
  .lobby-nav { gap: 7px; }
}

/* With company in the club, show the seats before the quick-match controls. */
.lobby-poster { margin-bottom: -18px; }
.lobby-play { border-radius: 0 0 10px 10px; }
.has-tables .lobby-poster { margin-bottom: -8px; border-radius: 10px; }
.has-tables .poster-copy { min-height: clamp(80px,22vw,112px); }
.has-tables .poster-copy h1 { font-size: clamp(36px,9vw,48px); }
.has-tables .lobby-play { border-radius: 8px; }
.room-price { white-space: nowrap; color: var(--ink); }
.room-price img { display: inline-block; width: 16px; height: 16px; }
.browse-rooms { width: 100%; min-height: 44px; border: 0; background: transparent; color: var(--accent); display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding-inline: 6px; font: 700 13px/1.2 var(--ui); }
.rooms-count { font-variant-numeric: tabular-nums; }
.forward-arrow { transform: rotate(180deg); }
.table-menu-only { display: none; }
#dialog-title:focus { outline: none; }

#dialog:is([data-purpose="table-menu"],[data-purpose="room-directory"],[data-purpose="confirm-seat"]) {
  --inset-bottom: max(env(safe-area-inset-bottom), calc(var(--tg-safe-area-inset-bottom,0px) + var(--tg-content-safe-area-inset-bottom,0px)));
  --inset-top: max(env(safe-area-inset-top), calc(var(--tg-safe-area-inset-top,0px) + var(--tg-content-safe-area-inset-top,0px)));
  --inset-left: max(env(safe-area-inset-left), calc(var(--tg-safe-area-inset-left,0px) + var(--tg-content-safe-area-inset-left,0px)));
  --inset-right: max(env(safe-area-inset-right), calc(var(--tg-safe-area-inset-right,0px) + var(--tg-content-safe-area-inset-right,0px)));
  position: fixed; inset: 0; width: min(100%,460px); max-width: 100%;
  max-height: calc(100% - 12px); max-height: calc(100dvh - var(--inset-top) - 8px);
  margin: auto auto 0; padding: 0; overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0;
  box-shadow: 0 -8px 30px #06091040;
}
#dialog:is([data-purpose="table-menu"],[data-purpose="room-directory"],[data-purpose="confirm-seat"])::backdrop { background: rgb(5 10 14 / .45); }
#dialog:is([data-purpose="table-menu"],[data-purpose="room-directory"],[data-purpose="confirm-seat"]) .sheet {
  padding: 13px max(16px,var(--inset-right)) max(9px,var(--inset-bottom)) max(16px,var(--inset-left));
}
#dialog:is([data-purpose="table-menu"],[data-purpose="room-directory"],[data-purpose="confirm-seat"]) .sheet-head { gap: 0 10px; margin: 0 0 10px; }
#dialog:is([data-purpose="table-menu"],[data-purpose="room-directory"],[data-purpose="confirm-seat"]) .sheet-head h2 {
  margin: 0; color: var(--ink); font: 700 32px/1 "Club Arcade", monospace; letter-spacing: 0;
}
#dialog:is([data-purpose="table-menu"],[data-purpose="room-directory"],[data-purpose="confirm-seat"]) .close-button {
  display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; padding: 0;
  background: transparent; color: var(--muted); font: 400 25px/1 var(--ui); border-radius: 5px;
}
#dialog[data-purpose="table-menu"] {
  --panel: #172a2b; --surface: #253d3d; --page: #112122; --line: #405352;
  --ink: #fbf1da; --muted: #becdc3; --accent: #ffce8b; --signal: #a6e2c6;
  background: var(--panel);
}
:root[data-skin="ember"] #dialog[data-purpose="table-menu"] {
  --panel: #30212a; --surface: #432e37; --page: #261a21; --line: #62484a;
  --muted: #dfc7c0; --signal: #f3c28b;
}
:root[data-skin="lagoon"] #dialog[data-purpose="table-menu"] {
  --panel: #192c38; --surface: #29414d; --page: #12232d; --line: #405d69;
  --muted: #bfd2db; --accent: #b8e6ce; --signal: #a8dbe4;
}
#dialog[data-purpose="table-menu"] .sheet-head {
  display: grid; grid-template: "face title close" auto "face info close" auto / 45px minmax(0,1fr) 44px;
}
#dialog[data-purpose="table-menu"] #dialog-title { grid-area: title; align-self: end; }
#dialog[data-purpose="table-menu"] .close-button { grid-area: close; }
#dialog[data-purpose="table-menu"] .menu-portrait {
  grid-area: face; display: grid; place-items: center; width: 45px; height: 48px;
  background: var(--page); color: var(--accent); overflow: hidden; border-radius: 4px;
}
.menu-portrait img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
#dialog[data-purpose="table-menu"] .menu-table-info {
  display: flex; grid-area: info; flex-wrap: wrap; align-items: baseline; gap: 2px 12px;
  color: var(--muted); font: 650 12px/1.35 var(--ui);
}
.menu-seat-count { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.table-options { display: grid; gap: 5px; font-family: var(--ui); }
.table-options :is(button,a) { touch-action: manipulation; }
.table-options button { border: 0; cursor: pointer; }
.menu-invite {
  min-height: 46px; width: 100%; padding: 6px 14px; display: grid;
  grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; text-align: left;
  background: var(--accent); color: #31222c; font: 800 16px/1.2 var(--ui);
  box-shadow: inset 0 -3px #55352335;
  clip-path: polygon(0 4px,4px 4px,4px 0,calc(100% - 4px) 0,calc(100% - 4px) 4px,100% 4px,100% calc(100% - 4px),calc(100% - 4px) calc(100% - 4px),calc(100% - 4px) 100%,4px 100%,4px calc(100% - 4px),0 calc(100% - 4px));
}
.menu-invite:focus-visible { outline: 2px solid #332b23; outline-offset: -4px; }
.menu-joker { font: 22px/1 "Apple Color Emoji","Segoe UI Emoji",sans-serif; }
.table-shortcuts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; }
.table-shortcuts :is(a,button), .menu-records button, .menu-leave {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 44px;
  padding: 4px 2px; background: transparent; border: 0; text-decoration: none; color: var(--ink);
  font: 700 13px/1.25 var(--ui);
}
.table-shortcuts .icon, .menu-records .icon { color: var(--accent); }
.game-grid-icon { position: relative; width: 14px; height: 14px; flex: none; color: var(--accent); }
.game-grid-icon::before { content: ""; position: absolute; inset: 1px auto auto 1px; width: 5px; height: 5px; background: currentColor; box-shadow: 7px 0, 0 7px, 7px 7px; }
.table-audio { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 125px),1fr)); gap: 6px; }
.table-audio button {
  display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 5px 10px;
  border-radius: 5px; background: var(--page); color: var(--ink); font: 700 14px/1.2 var(--ui);
}
.table-audio button > :first-child { color: var(--muted); }
.note-icon { width: 16px; font: 700 20px/1 "Club Arcade", var(--ui); }
.table-audio i { position: relative; flex: none; width: 30px; height: 17px; margin-left: auto; background: var(--line); border-radius: 5px; }
.table-audio i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 11px; height: 11px; border-radius: 2px; background: #eee6d8; }
.table-audio [aria-checked="true"] i { background: var(--signal); }
.table-audio [aria-checked="true"] i::after { transform: translateX(13px); background: var(--panel); }
.cloth-picker { min-inline-size: 0; margin: 5px 0 0; padding: 0; border: 0; }
.cloth-picker legend { padding: 0; margin: 0 0 2px; color: var(--muted); font: 650 12px/1.3 var(--ui); }
.cloth-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
.sheet .cloth-option {
  position: relative; display: flex; justify-content: center; align-items: center; gap: 6px; min-width: 0; min-height: 44px;
  border-radius: 5px; color: var(--muted); font: 650 13px/1.2 var(--ui); cursor: pointer;
}
.cloth-option:has(input:checked) { background: var(--surface); color: var(--ink); }
.cloth-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.cloth-swatch {
  position: relative; flex: none; width: 32px; height: 24px; border-radius: 5px;
  background-position: center; background-size: 100% 100%; background-repeat: no-repeat;
}
.cloth-swatch[data-skin="orbit"] { background-image: url("./crew/nighttrain.webp"); }
.cloth-swatch[data-skin="ember"] { background-image: url("./crew/afterhours.webp"); }
.cloth-swatch[data-skin="lagoon"] { background-image: url("./orbital-table.webp"); filter: sepia(.75) saturate(1.05) hue-rotate(118deg) brightness(1.1); }
.cloth-option input:checked + .cloth-swatch::after {
  content: ""; position: absolute; inset: 5px 9px; background: #fff5cc;
  -webkit-mask: url("./icons/check.svg") center/contain no-repeat; mask: url("./icons/check.svg") center/contain no-repeat;
}
.menu-records { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.menu-records button { justify-content: flex-start; }
.menu-leave { width: fit-content; padding-inline: 2px 10px; color: #f1b4a9; }
.exit-icon { --icon: url("./icons/logout.svg"); }
#dialog:is([data-purpose="room-directory"],[data-purpose="confirm-seat"]) { background: var(--panel); }
#dialog[data-purpose="confirm-seat"] .sheet p { color: var(--muted); }
#dialog[data-purpose="confirm-seat"] .entry-price { white-space: nowrap; }
#dialog[data-purpose="room-directory"] .sheet {
  display: flex; flex-direction: column; max-height: min(80dvh,calc(100dvh - var(--inset-top) - 8px),730px);
}
#dialog[data-purpose="room-directory"] .sheet-head { flex: none; margin-bottom: 4px; }
#dialog[data-purpose="room-directory"] #dialog-content { display: flex; flex-direction: column; min-height: 0; }
.sheet .directory-search { display: flex; flex: none; align-items: center; gap: 9px; min-height: 44px; margin: 0 0 6px; padding: 0 10px; border-radius: 5px; background: var(--page); color: var(--muted); }
.directory-search:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.directory-search input { min-width: 0; flex: 1; height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); font: 600 16px/1.2 var(--ui); }
.directory-search input:focus { outline: none; }
.directory-search input::placeholder { color: var(--muted); opacity: 1; }
.search-glass { position: relative; width: 12px; height: 12px; margin-right: 2px; border: 2px solid currentColor; border-radius: 50%; }
.search-glass::after { content: ""; position: absolute; right: -5px; bottom: -3px; width: 6px; height: 2px; background: currentColor; transform: rotate(45deg); }
.directory-modes { display: grid; flex: none; grid-template-columns: .7fr 1fr 1fr; gap: 3px; background: var(--page); border-radius: 5px; padding: 3px; }
.directory-modes button { min-width: 0; min-height: 44px; padding-inline: 2px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font: 700 14px/1.2 var(--ui); }
.directory-modes button[aria-pressed="true"] { color: var(--ink); background: var(--surface); }
.sheet .directory-list { min-height: 0; margin: 9px 0 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; }
.sheet .directory-list .room-row { margin: 0; background: var(--page); }
.sheet .directory-list .room-join { align-self: center; }
@media (min-width: 701px) {
  #dialog[data-purpose="table-menu"] { margin: auto max(20px,calc((100vw - 1200px) / 2)) 18px auto; border: 1px solid var(--line); border-radius: 10px; }
  #dialog:is([data-purpose="room-directory"],[data-purpose="confirm-seat"]) { margin: auto; border: 1px solid var(--line); border-radius: 10px; width: min(530px,94vw); }
}
@media (max-width: 350px) {
  .sheet .cloth-option { font-size: 12px; gap: 4px; }
  .cloth-swatch { width: 25px; height: 21px; }
  .table-shortcuts :is(a,button) { gap: 4px; font-size: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  #dialog:is([data-purpose="table-menu"],[data-purpose="room-directory"],[data-purpose="confirm-seat"])[open] { animation: room-panel-in 150ms ease-out; }
  .table-audio i::after { transition: transform 120ms ease-out; }
  @keyframes room-panel-in { from { transform: translateY(10px); opacity: .88; } }
}
