/* The lobby (hall.js): a page of felt over the blurred meadow. Every rule stays under #lobby or .hall
   (its dialog and toast) so the game's own .top/.card/.chip/.tabs keep their looks. */
#lobby {
  --bg-photo: url(img/join-day.webp); --veil: #f4ecd855; --live: #4f9a3a;
  position: fixed; inset: 0; z-index: 10; overflow-y: auto; box-sizing: border-box;
  padding: 20px max(24px, env(safe-area-inset-right, 0px)) 48px max(24px, env(safe-area-inset-left, 0px));
  background: var(--cloth); color: var(--ink); font: 600 16px/1.45 var(--font);
}
:root[data-theme="dark"] #lobby { --bg-photo: url(img/join-night.webp); --veil: #0d140f99; --live: #8fd277; }
.hall { --live: #4f9a3a; color: var(--ink); font: 600 16px/1.45 var(--font); }
:root[data-theme="dark"] .hall { --live: #8fd277; }
#lobby[hidden], #join[hidden] { display: none; }
#lobby::before {
  content: ""; position: fixed; inset: -24px; z-index: -1;
  background: linear-gradient(var(--veil), var(--veil)), var(--bg-photo) center / cover;
  filter: blur(10px) saturate(.9);
}
#lobby { isolation: isolate; }
.hall-app { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
/* the game's .panel is fixed; the id weight is on purpose here */
:is(#lobby, .hall) .panel:not(.dd-menu) { position: relative; z-index: auto; }
/* Shared rules use :where so they weigh like plain classes; :is(#lobby) would outrank the .hall .x rules below. */
:where(#lobby, .hall) :where(h1, h2, h3) { margin: 0; text-wrap: balance; }
:where(#lobby, .hall) p { margin: 0; }
:where(#lobby, .hall) button { font: inherit; }
:where(#lobby, .hall) .ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:where(#lobby, .hall) .muted { color: var(--ink-soft); }
:where(#lobby, .hall) .num { font-variant-numeric: tabular-nums; }
:where(#lobby, .hall) .field:focus-visible { outline: none; }

/* header */
#lobby .top { display: flex; align-items: center; gap: 12px; }
#lobby .logo { display: block; height: 56px; width: auto; }
#lobby .top .sp { flex: 1; }
#lobby .top > .ib { width: 52px; height: 52px; font: 900 19px var(--font); }
#lobby .me { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; min-height: 52px; box-sizing: border-box; border: 0; cursor: pointer; font: 800 16px var(--font); }
:where(#lobby, .hall) .ava { position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; object-fit: cover; font: 900 18px var(--font); color: var(--on-dark); background: var(--bronze) var(--fibre) 0 0 / 120px; background-blend-mode: soft-light; box-shadow: inset 0 -2px 3px #0003; }
#lobby .me img.ava { background: var(--tint); }
:where(#lobby, .hall) .ava.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 2.5px var(--panel); }
:where(#lobby, .hall) .ava-box { position: relative; flex: none; display: grid; }
:where(#lobby, .hall) .ava-box.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 2.5px var(--panel); }

/* meadow button */
#lobby .meadow { --r: var(--r-lg); --inset: 6px; width: 100%; min-height: 92px; justify-content: flex-start; gap: 18px; padding: 14px 26px; text-align: left; }
#lobby .meadow .ico { width: 40px; height: 40px; stroke-width: 1.8; }
#lobby .meadow b { display: block; font: 900 26px/1.1 var(--font); }
#lobby .meadow small { display: block; margin-top: 4px; font: 700 15px var(--font); color: var(--on-dark-soft); }
#lobby .meadow small:empty { display: none; }
#lobby .meadow .go { margin-left: auto; font: 800 16px var(--font); display: flex; align-items: center; gap: 6px; }
#lobby #status { margin: -8px 4px 0; font: 700 15px var(--font); color: var(--ink); }
#lobby #status.err { color: var(--off); }
#lobby #status:empty { display: none; }

/* main panel */
#lobby .board { padding: 22px; display: grid; gap: 18px; min-width: 0; }
#lobby .board > .decor.firs { right: 18px; bottom: 14px; --w: 90px; }
#lobby .board > .decor.mountains { left: 24px; bottom: 16px; --w: 240px; }
#lobby .tabs { display: flex; gap: 10px; flex-wrap: wrap; }
#lobby .tabs .pebble { height: 44px; padding: 0 18px; border: 0; cursor: pointer; font: 800 16px var(--font); display: inline-flex; align-items: center; gap: 8px; }
#lobby .tabs .pebble .cnt { font: 900 13px var(--font); opacity: .75; }
#lobby .pane { display: grid; gap: 14px; }
#lobby .pane[hidden] { display: none; }

/* room cards */
#lobby .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
#lobby .card { --inset: 5px; display: grid; grid-template-rows: auto 1fr auto; padding: 10px; gap: 10px; min-width: 0; }
#lobby .thumb { position: relative; aspect-ratio: 16 / 8; border-radius: 10px; overflow: hidden; background: var(--tint); max-width: 100%; }
#lobby .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
#lobby .thumb .chip { position: absolute; left: 8px; top: 8px; }
#lobby .chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font: 800 13px/1 var(--font); background: var(--panel); color: var(--ink); box-shadow: 0 1px 0 #0002; white-space: nowrap; }
#lobby .chip.call { background: var(--primary); color: var(--on-dark); }
#lobby .chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
#lobby .chip .dot.idle { background: var(--decor); }
#lobby .chip.full { background: var(--berry); color: var(--on-dark); }
#lobby .card-body { display: grid; gap: 6px; padding: 0 4px; min-width: 0; }
#lobby .card h3 { font: 900 20px/1.15 var(--font); overflow-wrap: anywhere; }
#lobby .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font: 700 14px/1.3 var(--font); color: var(--ink-soft); }
#lobby .meta span { display: inline-flex; align-items: center; gap: 5px; }
#lobby .meta .ico { width: 16px; height: 16px; }
#lobby .actions { display: flex; gap: 8px; align-items: center; }
#lobby .actions .btn { flex: 1; min-width: 0; }
#lobby .actions .ib { width: 44px; height: 44px; flex: none; }
#lobby .seatline { display: flex; align-items: center; gap: 8px; font: 800 14px var(--font); }
#lobby .seatline .meter { flex: 1; height: 10px; }
#lobby .create-card { min-height: 280px; border: 2.5px dashed var(--decor); border-radius: 16px; background: transparent; color: var(--ink-soft); display: grid; place-content: center; justify-items: center; gap: 8px; cursor: pointer; font: 800 18px var(--font); transition: background-color var(--press), color var(--press); }
#lobby .create-card:hover { background: var(--tint); color: var(--ink); }
#lobby .create-card .ico { width: 40px; height: 40px; }
#lobby .create-card small { font: 700 14px var(--font); }
#lobby .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font: 700 14px var(--font); color: var(--ink-soft); }
#lobby .foot b { color: var(--ink); }

/* empty states */
:where(#lobby, .hall) .empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 34px 16px; }
:where(#lobby, .hall) .empty h3 { font: 900 22px var(--font); }
:where(#lobby, .hall) .empty p { max-width: 46ch; font: 500 16px/1.5 var(--font-read); color: var(--ink-soft); }

/* public list: one toolbar row, every control 44px tall */
#lobby .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
#lobby .search { position: relative; }
#lobby .search .ico { position: absolute; left: 13px; top: 11px; color: var(--ink-soft); }
#lobby .toolbar .field { height: 44px; width: 100%; box-sizing: border-box; }
#lobby .search .field { padding-left: 42px; }
#lobby .search .field::-webkit-search-cancel-button { display: none; }
/* a carved hollow of stones: the chosen one rises out of it, the rest are pressed flush;
   both shadow lists keep 6 entries in the same order so the change animates */
#lobby .seg { display: flex; gap: 4px; padding: 4px; border-radius: 20px; background: var(--fibre) 0 0 / 160px, var(--fibre) 57px 31px / 90px, var(--stone-well); background-blend-mode: soft-light; box-shadow: var(--stone-carve); }
#lobby .seg .segbtn {
  height: 36px; padding: 0 14px; border: 0; cursor: pointer; font: 800 15px var(--font); white-space: nowrap;
  --c: color-mix(in oklab, var(--stone-well) 88%, #000); color: var(--ink-soft); transform: translateY(1px) scale(.97);
  box-shadow: inset 0 2px 4px #0006, inset 0 -1px 0 #ffffff12, inset 0 0 0 1px #0000, 0 0 0 #0000, 0 0 0 #0000, 0 0 0 #0000;
  transition: transform .26s cubic-bezier(.3, 1.7, .5, 1), box-shadow .2s, background-color .2s, color .2s;
}
#lobby .seg .segbtn:hover:not([aria-pressed="true"]) { color: var(--ink); filter: none; }
#lobby .seg .segbtn[aria-pressed="true"] {
  --c: var(--control); color: var(--ink); transform: translateY(-2px);
  box-shadow: inset 0 2px 1px #ffffff2e, inset 0 -3px 5px #0000001f, inset 0 0 0 1px #ffffff21,
    0 0 1.5px color-mix(in oklab, var(--c) 55%, #000), 0 2px 0 color-mix(in oklab, var(--c) 70%, #000), 0 4px 6px #0005;
}
@media (prefers-reduced-motion: reduce) { #lobby .seg .segbtn { transition: none; } }
#lobby .create-row { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; border: 2.5px dashed var(--decor); border-radius: 14px; background: transparent; color: var(--ink-soft); cursor: pointer; font: 800 16px var(--font); text-decoration: none; transition: background-color var(--press), color var(--press); }
#lobby .create-row:hover { background: var(--tint); color: var(--ink); }
#lobby .create-row small { font: 700 14px var(--font); }
#lobby .rows { display: grid; gap: 10px; }
#lobby .prow { --inset: 4px; display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px 12px 8px 8px; }
#lobby .prow .thumb { aspect-ratio: 16 / 10; border-radius: 8px; }
#lobby .prow h3 { font: 900 18px/1.2 var(--font); overflow-wrap: anywhere; }
#lobby .prow .btn { min-width: 132px; }
#lobby .prow.is-full { opacity: .62; }

/* dialogs */
dialog.hall { border: 0; padding: 0; background: transparent; max-width: min(720px, calc(100vw - 24px)); width: 100%; max-height: calc(100dvh - 24px); overflow: visible; }
dialog.hall::backdrop { background: color-mix(in oklab, var(--forest) 55%, transparent); backdrop-filter: blur(2px); }
dialog.hall[open] .sheet { animation: hallRise 220ms cubic-bezier(.25, 1, .5, 1); }
@keyframes hallRise { from { transform: translateY(14px); opacity: 0; } }
.hall .sheet { padding: 26px 28px 22px; display: grid; gap: 18px; max-height: calc(100dvh - 24px); box-sizing: border-box; overflow: auto; }
.hall .sheet-head { display: flex; align-items: center; gap: 12px; }
.hall .sheet-head h2 { flex: 1; font: 900 28px/1.1 var(--font); }
.hall .fld { display: grid; gap: 8px; }
.hall .fld > label, .hall .fld > .lbl { font: 800 16px var(--font); }
.hall .hint { font: 600 14px var(--font); color: var(--ink-soft); }
.hall .err { font: 800 14px var(--font); color: var(--off); }
.hall .err:empty { display: none; }
.hall .field { width: 100%; box-sizing: border-box; }
.hall .field[aria-invalid="true"] { box-shadow: var(--stone-carve), 0 0 0 2px var(--off); }
.hall .places { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hall .place { position: relative; display: grid; gap: 6px; justify-items: center; cursor: pointer; font: 800 15px var(--font); }
.hall .place input { position: absolute; opacity: 0; pointer-events: none; }
.hall .place img { width: 100%; aspect-ratio: 16 / 12; object-fit: cover; border-radius: 12px; box-shadow: 0 0 0 3px transparent; transition: box-shadow var(--press), transform var(--press); max-width: 100%; }
.hall .place:hover img { transform: translateY(-2px); }
.hall .place input:checked + img { box-shadow: 0 0 0 3px var(--panel), 0 0 0 6px var(--stone-on); }
.hall .place input:focus-visible + img { outline: 2px dashed var(--ink); outline-offset: 4px; }
.hall .access { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hall .acc { position: relative; display: grid; gap: 4px; padding: 12px 14px; cursor: pointer; transition: transform .2s; }
.hall .acc input { position: absolute; opacity: 0; pointer-events: none; }
.hall .acc b { display: flex; align-items: center; gap: 6px; font: 900 16px var(--font); }
.hall .acc small { font: 600 13px/1.35 var(--font); color: var(--ink-soft); }
.hall .acc:has(input:checked) { --c: var(--stone-on); color: var(--stone-on-ink); transform: translateY(-2px); }
.hall .acc:has(input:checked) b::after { content: ""; margin-left: auto; width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: var(--tick); mask: var(--tick); }
.hall .acc:has(input:checked) small { color: color-mix(in oklab, var(--stone-on-ink) 80%, transparent); }
.hall .acc:has(input:focus-visible) { outline: 2px dashed var(--ink); outline-offset: -6px; }
.hall .sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: flex-end; }
.hall .sheet-foot .note { margin-right: auto; font: 700 14px var(--font); color: var(--ink-soft); }
.hall .price { display: block; padding: 12px 14px; border-radius: 12px; background: var(--tint); font: 700 15px var(--font); }
.hall .price b { color: var(--mark); }
.hall .avatars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.hall #avatarPerk { margin: 0; font: 600 14px/1.4 var(--font); color: var(--ink-soft); }

/* settings */
dialog.hall.settings { max-width: min(860px, calc(100vw - 24px)); }
.hall .set-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 22px; min-height: 380px; }
.hall .side { display: grid; align-content: start; gap: 8px; }
.hall .side .pebble { height: 44px; border: 0; padding: 0 14px; text-align: left; cursor: pointer; font: 800 16px var(--font); display: flex; align-items: center; gap: 8px; }
.hall .side .badge-n { margin-left: auto; min-width: 22px; height: 22px; border-radius: 11px; background: var(--gold); color: var(--gold-btn-ink); font: 900 13px/22px var(--font); text-align: center; }
.hall .set-pane { display: grid; gap: 20px; align-content: start; min-width: 0; }
.hall .linkbox { display: flex; gap: 8px; align-items: center; }
.hall .linkbox .field { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.hall .people { display: grid; gap: 8px; }
.hall .person { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 12px; background: var(--tint); min-height: 52px; box-sizing: border-box; }
.hall .person .ava { width: 36px; height: 36px; font-size: 16px; }
.hall .person b { font: 800 16px var(--font); overflow-wrap: anywhere; }
.hall .person small { font: 700 13px var(--font); color: var(--ink-soft); }
.hall .person .grow { flex: 1; min-width: 0; display: grid; }
.hall .person .btn { min-height: 38px; padding: 0 14px; font-size: 15px; }
.hall .person .ib { width: 38px; height: 38px; flex: none; }
.hall .person .ib .ico { width: 18px; height: 18px; }
.hall .sec { display: grid; gap: 10px; }
.hall .sec h3 { font: 900 17px var(--font); display: flex; align-items: center; gap: 8px; }
.hall .sec h3 .muted { font-weight: 700; font-size: 14px; }
:where(#lobby, .hall) .textbtn { border: 0; background: none; padding: 6px 0; cursor: pointer; font: 800 15px var(--font); color: var(--off); justify-self: start; }
:where(#lobby, .hall) .textbtn:hover { text-decoration: underline; }
:where(#lobby, .hall) .textbtn.plain { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.hall .confirm { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: color-mix(in oklab, var(--berry) 14%, transparent); }
.hall .confirm p { font: 600 15px/1.45 var(--font-read); }
.hall .confirm .row2 { display: flex; gap: 8px; flex-wrap: wrap; }
.hall .bigseats { display: flex; align-items: baseline; gap: 8px; }
.hall .bigseats b { font: 900 40px/1 var(--font); }
.hall .plan { display: grid; gap: 8px; }
.hall .plan .line { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--tint); font: 700 15px var(--font); }

/* dropdown: a pebble opens a small felt panel under it */
:where(#lobby, .hall) .dd { position: relative; }
:where(#lobby, .hall) .felt.panel.dd-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: max-content; min-width: 230px; max-height: 300px; overflow: auto; padding: 8px; display: grid; gap: 2px; --r: 14px; }
/* opens upward: the sheet scrolls, so a menu hanging below its last field would be clipped */
.hall .fld .felt.panel.dd-menu { left: 0; right: auto; top: auto; bottom: calc(100% + 8px); max-height: 260px; }
:where(#lobby, .hall) .felt.panel.dd-menu[hidden] { display: none; }
:where(#lobby, .hall) .dd-menu button { display: flex; align-items: center; gap: 10px; height: 44px; flex: none; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 800 15px var(--font); cursor: pointer; text-align: left; white-space: nowrap; }
:where(#lobby, .hall) .dd-menu button:hover { background: var(--tint); }
/* chosen item is pressed into the felt like the filter well, marked with a stitched tick instead of a flat dot */
:where(#lobby, .hall) .dd-menu [aria-checked="true"] { background: var(--fibre) 0 0 / 160px, var(--fibre) 57px 31px / 90px, var(--stone-well); background-blend-mode: soft-light; box-shadow: var(--stone-carve); }
:root { --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M3 9.5l4 4 8-9' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' stroke-dasharray='2.4 2.4'/%3E%3C/svg%3E") center / contain no-repeat; }
:where(#lobby, .hall) .dd-menu [aria-checked="true"]::after { content: ""; margin-left: auto; width: 20px; height: 20px; flex: none; background: currentColor; opacity: .85; -webkit-mask: var(--tick); mask: var(--tick); }
:where(#lobby, .hall) .dd-menu .ico { width: 18px; height: 18px; color: var(--ink-soft); }
:where(#lobby, .hall) .chev { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; opacity: .8; transition: transform var(--press); }
:where(#lobby, .hall) [aria-expanded="true"] > .chev { transform: rotate(180deg); }
:where(#lobby, .hall) .sortbtn { height: 44px; border: 0; padding: 0 12px 0 16px; display: flex; align-items: center; gap: 6px; font: 800 15px var(--font); cursor: pointer; white-space: nowrap; }
.hall .fld .sortbtn { justify-self: start; min-width: 220px; justify-content: space-between; }

/* invite */
dialog.hall.invite { max-width: min(560px, calc(100vw - 24px)); }
.hall .twobtn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hall .twobtn a { text-decoration: none; }

/* entering / knocking */
dialog.hall.enter { max-width: min(460px, calc(100vw - 24px)); }
.hall.enter .sheet { justify-items: center; text-align: center; padding-block: 34px 26px; }
.hall.enter img { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; }
.hall .dots { display: flex; gap: 8px; }
.hall .dots[hidden] { display: none; }
.hall .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); animation: hallBlink 1s infinite ease-in-out; }
.hall .dots i:nth-child(2) { animation-delay: .15s; }
.hall .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes hallBlink { 50% { opacity: .25; transform: translateY(-3px); } }

/* toast: a popover, so it shows over an open dialog too */
#hallToast { inset: auto auto calc(28px + env(safe-area-inset-bottom, 0px)) 50%; translate: -50% 0; margin: 0; border: 0; display: flex; align-items: center; gap: 12px; padding: 12px 18px; max-width: calc(100vw - 32px); box-sizing: border-box; --c: var(--toast); --stitch: var(--stitch-on-dark); color: var(--on-dark); font: 800 15px var(--font); }
#hallToast:not(:popover-open) { display: none; }

/* friends column */
#lobby .cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
#lobby .left { display: grid; gap: 18px; min-width: 0; }
#lobby .friends { padding: 18px; display: grid; gap: 14px; position: sticky; top: 16px; min-width: 0; }
#lobby .friends h2 { font: 900 22px var(--font); display: flex; align-items: baseline; gap: 8px; }
#lobby .friends h2 .muted { font: 800 15px var(--font); }
#lobby .friends .sub { font: 900 14px var(--font); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
#lobby .friends .plain { font: 500 15px/1.5 var(--font-read); color: var(--ink-soft); }
#lobby .fr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-radius: 12px; }
#lobby .fr:hover { background: var(--tint); }
#lobby .fr-open { flex: 1 1 170px; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; min-height: 52px; border: 0; border-radius: 12px; background: none; color: var(--ink); cursor: pointer; text-align: left; font: inherit; }
#lobby span.fr-open { cursor: default; }
#lobby :is(.fr, .th-head) .grow { flex: 1; min-width: 0; display: grid; }
#lobby :is(.fr, .th-head) b { font: 800 16px var(--font); overflow: hidden; text-overflow: ellipsis; }
#lobby :is(.fr, .th-head) small { font: 700 13px/1.3 var(--font); color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lobby .fr small.new { color: var(--ink); }
#lobby .fr .cnt { min-width: 22px; height: 22px; padding: 0 5px; box-sizing: border-box; border-radius: 11px; background: var(--berry); color: var(--on-dark); font: 900 13px/22px var(--font); text-align: center; }
#lobby .fr > .btn, #lobby .fr > .ib { margin-right: 6px; }
#lobby :is(.fr, .th-head) .ib { width: 36px; height: 36px; flex: none; }
#lobby :is(.fr, .th-head) .ib .ico { width: 18px; height: 18px; }
#lobby .fr.off .fr-open { opacity: .7; }
#lobby :is(.fr, .where) .btn { min-height: 36px; padding: 0 12px; font-size: 14px; flex: none; }
#lobby .ib.has-badge { position: relative; }
#lobby .ib .badge-n { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; box-sizing: border-box; border-radius: 11px; background: var(--berry); color: var(--on-dark); font: 900 13px/22px var(--font); text-align: center; }

/* personal chat: the friends column turns into the conversation */
#lobby .th-head { display: flex; align-items: center; gap: 10px; }
#lobby .th-head .back .ico { transform: scaleX(-1); }
#lobby .where { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--tint); font: 700 14px/1.3 var(--font); }
#lobby .where span { flex: 1; min-width: 0; }
#lobby .msgs { height: min(400px, 52dvh); overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px; }
#lobby .msg { max-width: 85%; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--tint); font: 500 15px/1.4 var(--font-read); overflow-wrap: anywhere; }
#lobby .msg.me { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--primary); color: var(--on-dark); }
#lobby .msg time { display: block; margin-top: 2px; font: 700 11px var(--font); opacity: .65; }
#lobby .msg.sys { margin: auto; background: none; font: 700 14px var(--font); color: var(--ink-soft); }
:where(#lobby, .hall) .composer { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 4px 0 14px; border-radius: 16px; box-shadow: var(--stone-carve);
  background: var(--fibre) 0 0 / 160px, var(--fibre) 57px 31px / 90px, var(--stone-well); background-blend-mode: soft-light; }
:where(#lobby, .hall) .composer input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; color: var(--ink); font: 700 16px var(--font); }
:where(#lobby, .hall) .composer input::placeholder { color: var(--ink-soft); }
:where(#lobby, .hall) .composer .go { width: 40px; height: 40px; flex: none; --c: var(--primary); --stitch: var(--stitch-on-dark); color: var(--on-dark); }
:where(#lobby, .hall) .composer .go:hover:where(:not([disabled])) { --c: color-mix(in oklab, var(--primary) 88%, #fff); }
:where(#lobby, .hall) .composer .go[disabled] { opacity: .4; cursor: default; }
:where(#lobby, .hall) .composer .ico { width: 18px; height: 18px; }

@media (max-width: 1000px) {
  #lobby .cols { grid-template-columns: minmax(0, 1fr); }
  #lobby .friends { position: static; }
}
@media (max-width: 860px) {
  .hall .set-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hall .side { display: flex; flex-wrap: wrap; }
  .hall .side .pebble { height: 40px; font-size: 15px; }
}
@media (max-width: 560px) {
  #lobby { padding-block: 12px 32px; }
  #lobby .logo { height: 44px; }
  #lobby .top { gap: 8px; }
  #lobby .top > .ib { width: 44px; height: 44px; }
  #lobby .tabs { gap: 6px; flex-wrap: nowrap; }
  #lobby .tabs .pebble { flex: 1 1 auto; justify-content: center; height: 40px; padding: 0 8px; font-size: 14px; gap: 4px; white-space: nowrap; }
  #lobby .me .name { display: none; }
  #lobby .me { padding-right: 6px; min-height: 44px; }
  #lobby .me .ava { width: 32px; height: 32px; }
  #lobby .meadow { min-height: 80px; padding: 12px 18px; gap: 12px; }
  #lobby .meadow b { font-size: 21px; }
  #lobby .meadow .go span { display: none; }
  #lobby .board { padding: 16px 14px; }
  #lobby .board > .decor { display: none; }
  #lobby .cards { grid-template-columns: minmax(0, 1fr); }
  #lobby .toolbar { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "search sort" "seg seg"; }
  #lobby .toolbar .search { grid-area: search; }
  #lobby .toolbar .dd { grid-area: sort; }
  #lobby .toolbar .seg { grid-area: seg; }
  #lobby .seg .segbtn { flex: 1; padding: 0 6px; font-size: 14px; }
  #lobby .create-row { flex-wrap: wrap; row-gap: 0; padding: 10px; }
  #lobby .create-row small { flex-basis: 100%; text-align: center; }
  #lobby .prow { grid-template-columns: 76px minmax(0, 1fr); }
  #lobby .prow .btn { grid-column: 1 / -1; width: 100%; }
  .hall .places { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hall .access { grid-template-columns: minmax(0, 1fr); }
  .hall .sheet { padding: 20px 16px 16px; }
  .hall .sheet-head h2 { font-size: 23px; }
  .hall .twobtn { grid-template-columns: minmax(0, 1fr); }
  .hall .avatars { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  :where(#lobby, .hall), :where(#lobby, .hall) *, :where(#lobby, .hall) *::before, :where(#lobby, .hall) *::after { animation: none !important; transition: none !important; }
}
