/* Staff remote: a phone app look in BarPlay's own warm-dark colours (not the bar's), big tap targets. */
body.remote {
  --bg: #121417; --card: #1c1f24; --line: #2e333b; --ink: #f2f4f7; --muted: #a3acb9; --amber: #f5a524; --gold: #ffc94d; --good: #4cc38a; --bad: #f06a5b;
  --bar: #0b0d10; --field: #16191d; --on-amber: #121417;
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); overscroll-behavior: none;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%;
}
.remote a { color: var(--gold); }
.r-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .8rem; padding: calc(.8rem + env(safe-area-inset-top)) 1rem .8rem; background: var(--bar); border-bottom: 3px solid var(--amber); }
.r-back { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--card); color: var(--ink) !important; text-decoration: none; font-size: 1.6rem; line-height: 1; }
.r-at { margin: 0; font-weight: 800; font-size: 1.15rem; } .r-sub { margin: 0; color: var(--muted); font-size: .85rem; }
.r-main { max-width: 560px; margin: 0 auto; padding: 1rem 1rem calc(2rem + env(safe-area-inset-bottom)); display: grid; gap: 1rem; }
.r-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; display: grid; gap: .6rem; }
.r-off { opacity: .75; }
.r-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.r-head h2 { margin: 0; font-size: 1.2rem; }
.r-pill { font-size: .8rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; background: var(--line); color: var(--muted); white-space: nowrap; }
.r-pill.r-live { background: var(--good); color: #10200f; }
.r-code { margin: 0; color: var(--muted); } .r-code strong { color: var(--gold); letter-spacing: .12em; }
.r-label { margin: .4rem 0 0; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.r-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.r-chip { font: inherit; font-weight: 700; font-size: .95rem; padding: .6rem .85rem; min-height: 2.75rem; border-radius: 12px; border: 2px solid var(--line); background: transparent; color: var(--ink); }
.r-chip.r-on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); }
.r-btn { font: inherit; font-weight: 800; font-size: 1.05rem; min-height: 3.2rem; padding: 0 1rem; border-radius: 12px; border: 0; width: 100%; }
/* a link that looks exactly like a button (e.g. Open Help) */
a.r-link-btn { display: flex; align-items: center; justify-content: center; box-sizing: border-box; text-decoration: none; color: var(--ink); }
.r-go { background: var(--amber); color: var(--on-amber); font-size: 1.2rem; min-height: 3.6rem; margin-top: .4rem; }
.r-go:disabled { background: var(--line); color: var(--muted); }
.r-ghost { background: transparent; border: 2px solid var(--line); color: var(--ink); }
.r-danger { background: var(--bad); color: #fff; }
.r-players { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.r-players li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .35rem 0 .35rem .2rem; border-bottom: 1px solid var(--line); }
.r-players li:last-child { border-bottom: 0; }
.r-players .r-btn { width: auto; min-height: 2.5rem; font-size: .9rem; padding: 0 .8rem; flex: none; }
.r-players em { color: var(--muted); font-size: .85rem; }
.r-away > span { opacity: .6; }
.r-results { margin: 0; padding: 0; list-style: none; display: grid; gap: .2rem; }
.r-results li { display: flex; justify-content: space-between; } .r-results strong { color: var(--gold); }
.r-note { margin: 0; color: var(--muted); }
.r-hint { margin: 0; color: var(--muted); font-size: .85rem; text-align: center; }
.r-error { margin: 0; color: var(--bad); font-weight: 700; }
.r-install { color: var(--muted); font-size: .9rem; } .r-install summary { cursor: pointer; text-align: center; color: var(--gold); }
.r-install p { margin: .5rem 0 0; }
.r-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.r-list a { display: grid; padding: 1rem; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink) !important; text-decoration: none; }
.r-list span { color: var(--muted); font-size: .9rem; }

/* ---- the bar app: tabs, toast, forms */
.r-icon { width: 2.4rem; height: 2.4rem; border-radius: 10px; }
.r-main { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
.r-tab { display: grid; gap: 1rem; }
.r-tab[hidden] { display: none; }
.r-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; justify-content: center; background: var(--bar); border-top: 1px solid var(--line);
  padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom)); }
.r-tabs :is(button, a) { flex: 1; max-width: 140px; display: grid; justify-items: center; gap: .1rem; font: inherit; font-size: .78rem; font-weight: 700; color: var(--muted);
  background: none; border: 0; padding: .35rem 0; border-radius: 10px; min-height: 3.4rem; }
.r-tabs :is(button, a) span { font-size: 1.35rem; line-height: 1.2; filter: grayscale(1); opacity: .7; }
.r-tabs :is(button, a)[aria-current] { color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.r-tabs :is(button, a)[aria-current] span { filter: none; opacity: 1; }
.r-tabs :is(button, a)[hidden] { display: none; }
.r-tabs > [data-more]:is([data-active], [aria-expanded="true"]) { color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.r-tabs > [data-more] span { line-height: 1; font-size: 1.6rem; }
.r-tabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.r-more-panel {
  position: absolute; bottom: calc(100% + .45rem); right: max(.65rem, calc((100% - 680px) / 2));
  width: min(15rem, calc(100% - 1.3rem)); display: grid; gap: .25rem; padding: .4rem;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  box-shadow: 0 .6rem 2rem #0004;
}
.r-more-panel :is(button, a) {
  width: 100%; max-width: none; min-height: 48px; grid-template-columns: 1.8rem auto;
  align-items: center; justify-content: start; gap: .45rem; padding: .25rem .55rem;
  font-size: .95rem; color: var(--ink); text-align: start; text-decoration: none;
}
.r-tabs .r-more-panel a[data-location-return] { border-bottom: 1px solid var(--line); border-radius: 9px 9px 0 0; }
.r-more-panel a:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.r-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h, 4.4rem) + .75rem);
  z-index: 4; margin: 0; width: max-content; max-width: calc(100% - 1.5rem); pointer-events: none; overflow-wrap: anywhere;
  background: var(--ink); color: var(--bg); font-weight: 700; padding: .7rem 1.1rem; border-radius: 999px; box-shadow: 0 4px 18px rgba(0,0,0,.4); text-align: center; }
.r-input { width: 100%; min-width: 0; font: inherit; font-size: 1.05rem; padding: .75rem .8rem; border-radius: 12px; border: 2px solid var(--line); background: var(--field); color: var(--ink); }
.r-input:focus { outline: none; border-color: var(--gold); }
select.r-input { appearance: auto; }
.r-field { display: grid; gap: .3rem; font-weight: 700; font-size: .92rem; }
.r-field small { color: var(--muted); font-weight: 400; }
.r-form { display: grid; gap: .7rem; }
.r-form .r-btn { margin-top: .2rem; }
.r-inline { display: flex; gap: .5rem; }
.r-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.r-wide { width: 100%; }
.r-center { display: grid; justify-items: center; }
.r-small { font-size: .82rem; }
.r-section { margin-top: .4rem; }
.r-link { font: inherit; background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; text-align: left; }
.r-btn:disabled { opacity: .5; }
.r-live-msg { display: grid; gap: .5rem; padding: .8rem; border-radius: 12px; background: color-mix(in srgb, var(--gold) 12%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.r-live-msg p { margin: 0; font-weight: 800; font-size: 1.1rem; } .r-live-msg small { color: var(--muted); }

/* setup checklist */
.r-card.r-setup { border: 1px solid var(--gold); padding: .5rem 1rem; }
.r-setup.r-fold > summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 44px; font-weight: 800; font-size: 1.1rem; cursor: pointer; }
.r-setup[open] > summary { margin-bottom: .25rem; }
.r-setup.r-fold > summary::after { margin-left: 0; }
.r-setup > summary > span:first-child { flex: 1; }
.r-setup > .r-link.r-small { justify-self: start; min-height: 44px; }
/* Tonight: who controls the TVs, and the first thing to do */
.r-incharge { display: grid; gap: .35rem; padding: .6rem .8rem; border-radius: 12px; background: color-mix(in srgb, var(--gold) 10%, transparent); color: var(--muted); font-size: .9rem; }
.r-incharge p { margin: 0; }
.r-incharge .r-dev { color: var(--ink); font-weight: 700; border: 0; padding: 0; }
.r-incharge .r-dev small { font-weight: 400; }
.r-incharge strong { color: var(--ink); }
.r-start { display: grid; gap: .5rem; text-align: center; }
.r-start .r-note { margin: 0; }
.r-steps { margin: 0; padding-left: 1.4rem; display: grid; gap: .45rem; }
.r-steps li::marker { color: var(--gold); font-weight: 800; }
.r-steps .r-done { color: var(--muted); text-decoration: line-through; }

/* games tab */
.r-options { display: grid; gap: .5rem; }
.r-opt { display: grid; text-align: left; gap: .1rem; font: inherit; padding: .75rem .9rem; border-radius: 12px; border: 2px solid var(--line); background: transparent; color: var(--ink); }
.r-opt span { color: var(--muted); font-size: .88rem; }
.r-opt.r-on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.r-switch { position: relative; flex: none; width: 3.4rem; height: 2rem; border-radius: 999px; border: 0; background: var(--line); padding: 0; }
.r-switch span { position: absolute; top: .25rem; left: .25rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--ink); transition: left .15s; }
.r-switch.r-on { background: var(--good); } .r-switch.r-on span { left: 1.65rem; }
.r-switch:disabled { opacity: .45; }

/* look tab */
.r-pvs { display: grid; grid-template-columns: 1fr 34%; gap: .6rem; align-items: start; }
.r-pvs figure { margin: 0; display: grid; gap: .25rem; } .r-pvs figcaption { color: var(--muted); font-size: .8rem; text-align: center; }
.r-pv { position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: #000; }
.r-pv iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; }
.r-pv-tv { aspect-ratio: 16 / 9; } .r-pv-tv iframe { width: 1280px; height: 720px; }
.r-pv-phone { aspect-ratio: 390 / 780; } .r-pv-phone iframe { width: 390px; height: 780px; }
.r-warn { margin: 0; padding-left: 1.2rem; color: var(--gold); font-size: .88rem; } .r-warn:empty { display: none; }
.r-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .6rem; }
.r-swatch { display: grid; justify-items: center; gap: .3rem; font-size: .82rem; font-weight: 700; }
.r-swatch input { width: 3.2rem; height: 3.2rem; border: 2px solid var(--line); border-radius: 50%; padding: 0; background: none; overflow: hidden; }
.r-swatch input::-webkit-color-swatch-wrapper { padding: 0; } .r-swatch input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.r-swatch input:disabled { opacity: .35; }
.r-word-color { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem 1rem; }
.r-word-color .r-swatch { display: flex; align-items: center; gap: .5rem; }
.r-word-color .r-swatch input { width: 2.75rem; height: 2.75rem; }
.r-word-color .r-check { align-items: center; min-height: 44px; font-size: .82rem; }
.r-word-color .r-check input { margin-top: 0; }
.r-patterns { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.r-pat { display: grid; gap: .3rem; justify-items: center; font: inherit; font-size: .8rem; font-weight: 700; padding: .4rem; border-radius: 12px; border: 2px solid var(--line); background: transparent; color: var(--ink); }
.r-pat.r-on { border-color: var(--gold); }
.r-pat-tile { width: 100%; aspect-ratio: 16 / 10; border-radius: 8px; background-color: var(--field); }
.r-check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 700; } .r-check input { width: 1.4rem; height: 1.4rem; margin-top: .1rem; }
.r-check small { display: block; color: var(--muted); font-weight: 400; }
.r-filebtn { display: grid; place-items: center; cursor: pointer; } .r-file { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* TV and team settings */
.r-tvs, .r-people { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.r-tv { display: grid; gap: .45rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.r-tv .r-form { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } .r-tv .r-form .r-btn { width: auto; margin: 0; min-height: 2.9rem; }
.r-dev { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.r-dev small { display: block; color: var(--muted); font-size: .8rem; }
.r-dev .r-btn, .r-people .r-btn { width: auto; min-height: 2.5rem; font-size: .9rem; padding: 0 .8rem; flex: none; }
.r-people li { display: flex; align-items: center; gap: .5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.r-people li > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.r-people small { display: block; color: var(--muted); font-size: .8rem; }
.r-people em { color: var(--muted); }
.r-role { width: auto; padding: .45rem .5rem; font-size: .9rem; }
.r-more summary { cursor: pointer; color: var(--gold); font-weight: 700; padding: .3rem 0; } .r-more[open] summary { margin-bottom: .6rem; }
.r-tv-panel { min-width: 0; }
.r-tv-panel > summary { min-height: 44px; align-content: center; overflow-wrap: anywhere; }
.r-tv-panel .r-dev > span { min-width: 0; overflow-wrap: anywhere; }
.r-tv-panel > .r-form { margin-bottom: .6rem; }
.r-tv-panel > .r-tvs { margin-top: .65rem; }
.r-tv-panel > .r-note { margin-bottom: .6rem; }

.r-coderow { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.r-coderow .r-btn { width: auto; min-height: 2.4rem; font-size: .85rem; padding: 0 .8rem; }

/* QR invite sheet: the whole screen, so it's easy to scan across a bar */
.r-sheet { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 92%, transparent); padding: 1rem; }
.r-sheet-in { width: min(100%, 420px); display: grid; gap: .8rem; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.2rem; }
.r-qr { width: 100%; aspect-ratio: 1; border-radius: 12px; background: #fff; }

/* Promote tab */
.r-sp { width: 100%; }
.r-sp .sp { border-radius: 12px; }
.r-sp-live { position: sticky; top: 4.4rem; z-index: 1; }
.r-day { min-width: 3.1rem; justify-content: center; }
.r-people li { flex-wrap: wrap; }
.r-perm { flex-basis: 100%; padding-left: .2rem; color: var(--muted); font-size: .9rem; }
.r-card .r-head > div h2 { margin: 0; }
input[type="time"].r-input { min-height: 3rem; }
.r-row4 { grid-template-columns: 1fr 1fr auto auto; } .r-row4 .r-btn { min-width: 3.2rem; }
/* a tab is never wider than the phone, whatever is inside it */
.r-tab { grid-template-columns: minmax(0, 1fr); }
.r-main { overflow-x: clip; }
.r-inline-form { grid-template-columns: 1fr auto; align-items: center; } .r-inline-form .r-btn { width: auto; margin: 0; }

/* Install button in the app's header, and the iPhone guide */
.r-top { justify-content: flex-start; } .r-top > div { flex: 1; min-width: 0; }
.r-install-btn { flex: none; font: inherit; font-weight: 800; font-size: .85rem; padding: .55rem .8rem; border-radius: 999px; border: 0; background: var(--amber); color: var(--on-amber); }
.r-install-btn[hidden] { display: none; }
.r-guide { margin: 0; padding: 0; list-style: none; display: grid; gap: .8rem; text-align: left; }
.r-guide li { display: flex; gap: .7rem; align-items: center; font-size: 1.05rem; }
.r-step-n { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--amber); color: var(--on-amber); font-weight: 900; }
.r-step-icon { display: inline-block; margin-left: .3rem; padding: .1rem .5rem; border-radius: 8px; background: var(--line); color: var(--ink); white-space: nowrap; }

/* Undo bar: sits above the tabs while an action waits */
.r-undo { position: fixed; left: .6rem; right: .6rem; bottom: calc(4.9rem + env(safe-area-inset-bottom)); z-index: 5; display: grid; gap: .4rem; max-width: 540px; margin: 0 auto; }
.r-undo[hidden] { display: none; }
.r-undo-row { display: flex; align-items: center; gap: .8rem; padding: .6rem .6rem .6rem 1rem; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 700;
  box-shadow: 0 6px 22px rgba(0,0,0,.5); }
.r-undo-row span { flex: 1; min-width: 0; }
.r-undo-btn { flex: none; font: inherit; font-weight: 900; font-size: 1.05rem; padding: .7rem 1.2rem; border-radius: 10px; border: 0; background: var(--amber); color: var(--on-amber); }

/* Tonight: big tiles for the game, a huge Start, the rest folded */
.r-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.r-tile { display: flex; align-items: center; gap: .55rem; min-height: 3.6rem; padding: .5rem .7rem; font: inherit; font-weight: 800; font-size: 1rem; text-align: left;
  border-radius: 14px; border: 2px solid var(--line); background: var(--field); color: var(--ink); }
.r-tile.r-on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); }
.r-tile-icon { font-size: 1.5rem; line-height: 1; }
.r-huge { min-height: 4.4rem; font-size: 1.45rem; border-radius: 16px; }
.r-big { min-height: 3.8rem; font-size: 1.15rem; }
.r-fold { border-top: 1px solid var(--line); padding-top: .2rem; }
.r-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; min-height: 3rem; font-weight: 800; color: var(--ink); }
.r-fold > summary::-webkit-details-marker { display: none; }
.r-fold > summary::after { content: '▾'; margin-left: auto; color: var(--muted); font-size: 1.2rem; transition: transform .15s; }
.r-fold[open] > summary::after { transform: rotate(180deg); }
.r-fold[open] { display: grid; gap: .55rem; padding-bottom: .4rem; }

/* Play tab: the player screen fills the phone above the tab bar, like a guest's phone */
body.r-playmode .r-top, body.r-playmode [data-conn], body.r-playmode .r-undo, body.r-playmode [data-tab="play"] .r-view-title { display: none; }
body.r-playmode [data-tab="play"] { position: fixed; top: 0; left: 0; right: 0; bottom: var(--tabs-h, 4.4rem); display: block; overflow-y: auto; background: var(--bg); }
.r-playbox { position: absolute; inset: 0; }
.r-playbox[hidden], .r-playpick[hidden], .r-play-swap[hidden] { display: none; }
.r-playframe { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }
.r-playpick { display: grid; gap: 1rem; min-width: 0; }
.r-play-feature { background: linear-gradient(145deg, color-mix(in srgb, var(--amber) 12%, var(--card)), var(--card) 70%); }
.r-play-feature .r-go { width: auto; justify-self: start; min-height: 48px; font-size: 1rem; }
.r-play-feature h3 { margin: 0; }
.r-play-game { margin: 0; font-size: 1.65rem; font-weight: 800; letter-spacing: -.04em; }
.r-play-swap { position: absolute; top: calc(.5rem + env(safe-area-inset-top)); right: .5rem; z-index: 2; font: inherit; font-weight: 800; font-size: .85rem;
  padding: .45rem .75rem; border-radius: 999px; border: 0; background: rgba(0, 0, 0, .55); color: #fff; }
.r-tabs :is(button, a) { min-width: 0; font-size: .72rem; }

/* signed-out app pages (get the app, sign in, sign up) */
.r-big { margin: 0; font-size: 1.45rem; line-height: 1.2; }
.r-alink { display: grid; place-items: center; text-decoration: none; box-sizing: border-box; }
a.r-go { color: var(--on-amber) !important; } a.r-ghost { color: var(--ink) !important; }
.r-two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: .6rem; }
.r-ok { margin: 0; color: var(--good, #5fd38d); font-weight: 700; }

/* Tonight: a TV's live vote */
.r-votes { list-style: none; margin: .3rem 0; padding: 0; display: grid; gap: .3rem; }
.r-votes li { display: flex; justify-content: space-between; padding: .45rem .7rem; border-radius: 10px; background: var(--field); }
.r-votes strong { color: var(--gold); }

/* Location navigation stays visible and touchable without squeezing long bar names. */
.r-at { overflow-wrap: anywhere; }
.r-location-group { margin-bottom: 1.5rem; }
.r-location-group h2 { font-size: 1rem; color: var(--muted); margin: 0 0 .6rem; overflow-wrap: anywhere; }
.r-app-top { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; }
.r-app-top .r-bar-name { display: block; padding: .25rem 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-bar-name:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.r-tv-panel summary:has([data-tv-status]) > span:first-child { padding-inline-end: .4rem; }
.r-tv-panel summary [data-tv-status] { float: inline-end; }

/* Promote → Guest link */
.r-join-qr { justify-self: center; width: min(240px, 100%); padding: .75rem; border-radius: 16px; background: #fff; }
.r-join-qr img { display: block; width: 100%; height: auto; }
.r-join-url { margin: 0; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: var(--field);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.4; overflow-wrap: anywhere; user-select: all; }
.r-linkbtn { display: flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; }
.r-join-ways { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.r-join-ways li { display: grid; gap: .15rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.r-join-ways li:last-child { padding-bottom: 0; border-bottom: 0; }
.r-join-ways span { color: var(--muted); font-size: .92rem; }
/* two-step sign-in: the authenticator QR and recovery codes */
.r-join-qr svg { display: block; width: 100%; height: auto; }
.r-recovery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem 1rem; margin: 0; padding-left: 1.4rem; }
.r-recovery code { font-size: 1rem; letter-spacing: .06em; }

/* TVs: "Yes: type the code" is a choice like its "No" partner, so it looks like a button */
.r-tv-panel[data-tv-panel="pair"] > summary {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: .5rem 1rem;
  border: 1px solid var(--gold); border-radius: 12px; color: var(--ink); font-weight: 800; list-style: none; cursor: pointer;
}
.r-tv-panel[data-tv-panel="pair"] > summary::-webkit-details-marker { display: none; }
.r-tv-panel[data-tv-panel="pair"][open] > summary { margin-bottom: .6rem; }
.r-section-hint { margin: -.3rem 0 .2rem; text-align: left; }

/* Help page: "who → how" rows for each kind of phone */
.help-ways { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.help-ways li { display: grid; gap: .1rem; padding: .5rem .75rem; border-radius: 10px; background: color-mix(in srgb, var(--gold) 8%, transparent); }
.help-ways span { color: var(--muted); }
.help h2 { margin: 0; font-size: 1.15rem; }
.help .r-card { scroll-margin-top: 5rem; }
.r-league-leave { display: flex; justify-content: center; }
.r-leave-link { min-height: 44px; color: var(--muted); }

/* Nights (app-nights.js): three numbers side by side, then the busiest hour and most played game */
.r-night-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.r-night-stats div { display: grid; gap: .15rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 12px; }
.r-night-stats strong { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.r-night-stats span { color: var(--muted); font-size: .82rem; }
.r-nights { list-style: none; margin: 0; padding: 0; }
.r-night-item { border-top: 1px solid var(--line); }
.r-night-item summary { padding: .8rem 0; cursor: pointer; }
.r-night-item summary strong { margin-inline: .35rem .65rem; }
.r-night-item summary span { color: var(--muted); font-size: .875rem; }
.r-night-item > .r-note { margin: .65rem 0; }

/* Venue navigation uses the same outline icon weight on every screen. */
.r-tabs[data-bar-tabs] { gap: .25rem; }
.r-tabs[data-bar-tabs] .r-nav-icon { display: grid; place-items: center; opacity: 1; filter: none; }
.r-nav-icon svg { width: 21px; height: 21px; }
.r-tabs .r-more-panel {
  width: min(21rem, calc(100% - 1.3rem)); padding: 0; gap: 0;
  max-height: calc(100dvh - var(--tabs-h, 4.4rem) - env(safe-area-inset-top) - 1rem); overflow: auto;
}
.r-more-title { margin: 0; padding: .75rem 1rem; font-size: 1rem; font-weight: 800; }
.r-tabs .r-more-panel :is(button, a) {
  border: 0; border-top: 1px solid var(--line); border-radius: 0;
  justify-items: start; grid-template-columns: 2.15rem minmax(0, 1fr); padding: .6rem .85rem;
}
.r-tabs .r-more-panel a[data-location-return] { border-bottom: 0; border-radius: 0; }
.r-tabs .r-more-panel .r-nav-icon {
  width: 2.1rem; height: 2.1rem; border-radius: 9px; color: var(--gold);
  background: color-mix(in srgb, var(--amber) 12%, var(--card));
}
.r-tabs .r-more-panel .r-nav-copy { display: grid; gap: .14rem; color: var(--ink); font-size: .91rem; filter: none; opacity: 1; }
.r-nav-copy small { color: var(--muted); font-weight: 500; line-height: 1.25; }
.r-tabs .r-more-panel :is(button, a):hover { background: var(--field); }

.r-game-library { display: grid; list-style: none; padding: 0; margin: 0; }
.r-library-game { min-width: 0; padding-block: .7rem; border-top: 1px solid var(--line); }
.r-library-game:last-child { padding-bottom: 0; }
.r-library-game h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
[data-library-settings] > .r-card { background: var(--field); }

.r-savebar { position: sticky; bottom: calc(5.2rem + env(safe-area-inset-bottom)); z-index: 2; display: grid; grid-template-columns: 1fr 2fr; gap: .6rem; padding: .6rem; border-radius: 16px;
  background: var(--bar); border: 1px solid var(--gold); box-shadow: 0 -4px 20px rgba(0,0,0,.4); }
.r-savebar .r-go { margin: 0; }
.r-savebar[hidden] { display: none; }

.r-view-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.r-look-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.r-look-actions .r-btn { width: auto; min-height: 44px; margin: 0; padding-inline: .85rem; font-size: .9rem; }
