/* Taro Games modes row and room lobby (house/lobby.js), shared by every game you can play with others, so the way
   in looks and reads the same everywhere (Peel Out's modes row and "Play with friends" box are the model).
   .lb-modes / .lb-mode   the segmented switch under the header: <button class="lb-mode"><b>Versus</b> <span>duel a friend</span></button>
   .lb-box                the lobby: display name, Host a room, code + Join, play the computer; then the room.
   Games set the --lb-* colours in their own CSS (a plain :root rule is enough: the defaults here carry no
   specificity). Without that they follow the Versus colours (--dv-*, house/duel.css), else neutral ones. */
:where(:root) { --lb-panel: var(--dv-panel, #ffffff); --lb-panel2: var(--dv-panel2, #f2f4f7); --lb-text: var(--dv-text, #17202a); --lb-muted: var(--dv-muted, #5f6b78);
  --lb-line: var(--dv-line, #d9dee5); --lb-accent: var(--dv-accent, #2f6fe4); --lb-ink: var(--dv-ink, #ffffff); --lb-bad: var(--dv-bad, #d0384b);
  --lb-font: var(--dv-font, inherit); --lb-head: var(--lb-font); }
:where(:root[data-theme="dark"]) { --lb-panel: var(--dv-panel, #161d27); --lb-panel2: var(--dv-panel2, #1e2733); --lb-text: var(--dv-text, #eef2f7); --lb-muted: var(--dv-muted, #9aa7b6);
  --lb-line: var(--dv-line, #2c3846); --lb-accent: var(--dv-accent, #6ea3ff); --lb-ink: var(--dv-ink, #0c1118); --lb-bad: var(--dv-bad, #ff6f7f); }

/* the modes row */
.lb-modes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; margin: 4px auto 10px; max-width: 600px; box-sizing: border-box;
  background: var(--lb-panel2); border: 1px solid var(--lb-line); border-radius: 14px; font-family: var(--lb-font); }
.lb-modes[hidden] { display: none; }
.lb-mode { -webkit-appearance: none; appearance: none; border: 0; margin: 0; background: transparent; border-radius: 10px; padding: 6px 8px; min-height: 36px; cursor: pointer; display: flex; gap: 6px;
  align-items: baseline; justify-content: center; color: var(--lb-muted); font: inherit; font-size: .9rem; line-height: 1.3; letter-spacing: normal; text-transform: none; white-space: nowrap;
  overflow: hidden; box-shadow: none; min-width: 0; }
.lb-mode b { color: var(--lb-text); font-weight: 700; }
.lb-mode span { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.lb-mode span span { font-size: inherit; }
.lb-mode.on { background: var(--lb-panel); box-shadow: 0 1px 4px rgba(20, 30, 40, .14); }
.lb-mode.on b { color: var(--lb-accent); }
.lb-mode:focus-visible { outline: 2px solid var(--lb-accent); outline-offset: -2px; }
.lb-modes.lb-4 .lb-mode, .lb-modes.lb-5 .lb-mode { padding-left: 4px; padding-right: 4px; }
@media (max-width: 380px) { .lb-mode span { display: none; } }
@media (max-width: 620px) { .lb-modes.lb-4 .lb-mode span, .lb-modes.lb-5 .lb-mode span { display: none; } }
@media (max-width: 400px) { .lb-modes.lb-4 .lb-mode, .lb-modes.lb-5 .lb-mode { font-size: .82rem; padding-left: 2px; padding-right: 2px; } }

/* the lobby */
.lb-box { margin: 14px auto 0; max-width: 600px; padding: 16px 16px 16px; background: var(--lb-panel); color: var(--lb-text); border: 1px solid var(--lb-line); border-radius: 20px;
  text-align: left; font-family: var(--lb-font); font-size: 16px; line-height: 1.4; box-sizing: border-box; letter-spacing: normal; text-transform: none; }
.lb-box *, .lb-box *::before, .lb-box *::after { box-sizing: border-box; }
.lb-box[hidden], .lb-box [hidden] { display: none !important; }
.lb-box.lb-bare { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; max-width: none; }     /* inside a card that already frames it */
.lb-home, .lb-room { display: grid; gap: 8px; }
.lb-h { margin: 0 0 4px; font: 700 1.15rem/1.2 var(--lb-head); color: var(--lb-text); }
.lb-fine { margin: 0; font-size: .88rem; line-height: 1.4; color: var(--lb-muted); }
.lb-intro { margin: 0 0 8px; }
.lb-intro:empty, .lb-fine:empty { display: none; }
.lb-lbl { margin: 0; font-size: .8rem; color: var(--lb-muted); }
.lb-box .lb-in { all: unset; display: block; width: 100%; min-width: 0; height: 46px; border-radius: 999px; border: 2px solid var(--lb-line); background: var(--lb-panel); color: var(--lb-text);
  padding: 0 18px; font: 600 16px/1 var(--lb-font); box-sizing: border-box; cursor: text; }
.lb-box .lb-in:focus { border-color: var(--lb-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lb-accent) 20%, transparent); }
.lb-box .lb-in::placeholder { color: var(--lb-muted); opacity: .8; }
.lb-box .lb-in:disabled { opacity: .55; }
.lb-box .lb-code { text-transform: uppercase; letter-spacing: .18em; }
.lb-box .lb-code::placeholder { letter-spacing: .18em; }
.lb-row { display: flex; gap: 8px; }
.lb-row .lb-in { flex: 1; }
/* buttons are pills (the house shape); a game that wants another sets border-radius on .lb-box .lb-btn */
.lb-box .lb-btn { all: unset; display: flex; align-items: center; justify-content: center; text-align: center; height: 46px; border-radius: 999px; background: var(--lb-accent); color: var(--lb-ink);
  font: 700 15px/1.15 var(--lb-font); padding: 0 20px; cursor: pointer; box-sizing: border-box; -webkit-user-select: none; user-select: none; }
@media (prefers-reduced-motion: no-preference) { .lb-box .lb-btn { transition: transform .2s cubic-bezier(.34, 1.4, .64, 1), filter .16s; } .lb-box .lb-btn:active:not(:disabled) { transform: scale(.97); } }
@media (hover: hover) { .lb-box .lb-btn:hover:not(:disabled) { filter: brightness(1.06); } }
.lb-box .lb-btn.lb-ghost { background: var(--lb-panel2); color: var(--lb-text); border: 1px solid var(--lb-line); }
.lb-box .lb-btn:disabled { opacity: .5; cursor: default; }
.lb-box .lb-btn:focus-visible, .lb-box .lb-under:focus-visible { outline: 2px solid var(--lb-accent); outline-offset: 2px; }
.lb-row .lb-btn { flex: none; }
.lb-or { margin: 6px 0 0; text-align: center; font-size: .8rem; color: var(--lb-muted); }
.lb-cpu { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.lb-cpu .lb-btn { padding: 0 6px; }
.lb-big { font: 800 44px/1.05 var(--lb-head); letter-spacing: .14em; text-align: center; font-variant-numeric: tabular-nums; color: var(--lb-text); }
.lb-box .lb-under { all: unset; justify-self: center; text-align: center; color: var(--lb-muted); font: 700 13.5px/1.2 var(--lb-font); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; padding: 8px; min-height: 40px; box-sizing: border-box; }
.lb-members { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lb-members li { background: var(--lb-panel2); border-radius: 12px; padding: 9px 12px; font-size: .92rem; overflow-wrap: anywhere; }
.lb-members li.lb-me { font-weight: 700; }
.lb-members li.lb-wait { color: var(--lb-muted); font-style: italic; }
.lb-err { margin: 8px 0 0; color: var(--lb-bad); font-weight: 600; font-size: .9rem; }
.lb-err.lb-note { color: var(--lb-text); }
.lb-err:empty { display: none; }
@media (max-width: 400px) { .lb-big { font-size: 38px; } }
/* touch screens: the modes row tall enough to hit, and no double-tap zoom on the lobby's controls */
.lb-mode, .lb-box button, .lb-box input { touch-action: manipulation; }
@media (pointer: coarse) { .lb-mode { min-height: 42px; padding-top: 12px; padding-bottom: 12px; } }
