/* Full-screen race lobby styling (#lobbyScreen, markup injected by lobby.js at runtime, see
   lobby.html): the topbar, the three regions (Your ride / your tandem preview / people + chat),
   and the FTP/tier treatments as used in the lobby (the title / club-tag name styling is
   identity_row.css, shared with the dashboard header). */

#lobbyScreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--arch);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#lobbyScreen[hidden] {
  display: none;
}
.lobby-topbar {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: var(--paper-warm);
  border-bottom: 3px solid var(--ink);
}
.lobby-topbar h1 {
  font-family: var(--marker);
  font-size: 1.5rem;
  margin: 0;
}
.lobby-topbar h1 .ui-icon-img.page-heading-icon {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  vertical-align: -0.08em;
}
.lobby-code {
  font-family: var(--mono);
  font-size: 1.4rem;
  letter-spacing: 2px;
  background: var(--ink);
  color: var(--paper);
  padding: 2px 10px;
  border-radius: var(--r-sm);
}
.lobby-topbar .spacer {
  flex: 1;
}
.lobby-laps {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
}
.lobby-laps input {
  width: 60px;
  font-family: var(--mono);
  font-size: 1.1rem;
  padding: 4px 6px;
  border: 2px solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
}
.lobby-laps-ro {
  font-family: var(--mono);
  font-size: 1.1rem;
  padding: 4px 2px;
}
.lobby-laps select {
  font-family: var(--mono);
  font-size: 1rem;
  padding: 4px 6px;
  border: 2px solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
}
.lobby-keepup-config {
  font-size: 0.95rem;
}
.lobby-keepup-config input {
  width: 48px;
}
#lobbyModeUnsupported {
  font-size: 0.85rem;
  color: var(--ink-mute);
  max-width: 220px;
  line-height: 1.2;
}
.lobby-howto {
  position: relative;
  margin: 8px 16px 0;
  padding: 10px 40px 10px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  background: #fff8e1;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.lobby-howto h3 {
  margin: 0 0 4px;
  font-family: var(--hand);
  font-size: 1.15rem;
}
.lobby-howto-icon {
  width: 1.9em;
  height: 1.9em;
  object-fit: contain;
  vertical-align: middle;
}
.lobby-howto p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
}
.lobby-howto p.lobby-howto-funfact {
  margin-top: 8px;
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.75;
}
.lobby-howto-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}
.lobby-howto-tour {
  margin-top: 10px;
  font-family: var(--hand);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  padding: 4px 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.lobby-howto-tour:hover {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}
.lobby-btn {
  font-family: var(--hand);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  padding: 7px 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.lobby-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}
.lobby-btn .ui-icon-img.lobby-btn-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
}
.lobby-btn-start {
  background: var(--accent-lime);
  color: #fff;
}
.lobby-btn-danger {
  background: var(--accent-red);
  color: #fff;
}
.lobby-btn-solo {
  background: var(--accent-gold, #e0b64a);
  color: var(--ink);
}
.lobby-btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
  transform: none;
}
.lobby-status {
  width: 100%;
  min-height: 18px;
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0;
}
.lobby-status--countdown {
  font-size: 1.6rem;
  text-align: center;
  font-weight: 600;
}
/* Three regions (PT2 G3): LEFT "Your ride" (the viewer's steps, in order, with the current
   step's button pinned at the bottom), CENTRE the live preview of their tandem + the other
   tandems, RIGHT who's looking for a teammate + the chat. Each column scrolls on its own, so
   the action button and the chat input never scroll out of view. Below 960px wide (a phone, or
   a narrow window) it stacks Your ride, preview, chat in one scroll, and the action bar pins to
   the bottom of the screen. */
.lobby-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr) minmax(250px, 320px);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px 12px;
}
.lobby-ride,
.lobby-stage,
.lobby-side {
  min-width: 0;
  min-height: 0;
}
.lobby-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
}
.lobby-panel-head h2,
.lobby-step-head h2 {
  font-family: var(--marker);
  font-size: 1.05rem;
  margin: 0;
  line-height: 1.2;
}
.lobby-count {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--arch);
  font-size: 0.8rem;
  text-align: center;
  vertical-align: 0.1em;
}
.lobby-count:empty {
  display: none;
}
.lobby-empty {
  margin: 4px 0;
  color: var(--ink-mute);
  font-family: var(--hand);
  font-size: 1rem;
  list-style: none;
}
.lobby-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--ink-mute) transparent;
}

/* ── LEFT: Your ride ─────────────────────────────────────────────────────────────── */
.lobby-ride {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--ink);
  border-radius: var(--r-lg);
  background: var(--paper-warm);
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
}
.lobby-ride-steps {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-mute) transparent;
}
.lobby-step {
  border: 2px solid var(--ink-mute);
  border-radius: var(--r-md);
  background: var(--paper);
  padding: 7px 10px 9px;
  transition: opacity 0.2s ease;
}
.lobby-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lobby-step-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-family: var(--marker);
  font-size: 0.85rem;
}
.lobby-step-tag {
  padding: 0 7px;
  border: 1px dashed var(--ink-mute);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.lobby-step-note {
  margin-left: auto;
  font-family: var(--hand);
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-align: right;
}
.lobby-step-body {
  margin-top: 7px;
}
.lobby-step-body:empty {
  display: none;
}
.lobby-step-hint,
.lobby-step-summary {
  margin: 0;
  font-family: var(--hand);
  font-size: 1rem;
  color: var(--ink-soft);
}
.lobby-step-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
/* The step to do now stands out; done steps go quiet; later steps are dimmed until it's their turn. */
.lobby-step[data-state='current'] {
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--accent-red);
}
.lobby-step[data-state='current'] .lobby-step-num {
  background: var(--accent-red);
  color: #fff;
}
.lobby-step[data-state='done'] .lobby-step-num {
  background: var(--accent-lime);
  color: #fff;
}
.lobby-step[data-state='done'] .lobby-step-note {
  color: var(--accent-lime);
  font-weight: 700;
}
.lobby-step[data-state='waiting'] {
  border-style: dashed;
  border-color: var(--ink);
}
.lobby-step[data-state='blocked'],
.lobby-step[data-state='off'] {
  opacity: 0.45;
  border-style: dashed;
}
.lobby-step[data-state='blocked'] .lobby-step-body {
  pointer-events: none;
}
.lobby-step[data-state='off'] .lobby-step-body,
#lobbyStepWorkout[data-state='blocked'] .lobby-step-body {
  display: none;
}

/* The pinned action: one cue line + the current step's button, always on screen. */
.lobby-ride-action {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 12px 11px;
  border-top: 2px solid var(--ink);
  background: var(--paper);
}
/* The action-bar copy of the preview: only the one-column layout shows it (below). */
.lobby-ride-mini {
  display: none;
}
.lobby-ride-cue {
  margin: 0;
  font-family: var(--hand);
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--ink);
}
.lobby-ride-btn {
  width: 100%;
  font-size: 1.2rem;
  padding: 9px 14px;
}
.lobby-ride-btn--shop {
  background: var(--accent-yellow);
  color: var(--ink);
}
.lobby-ride-action[data-kind='connect-power'] .lobby-ride-btn {
  background: var(--accent-blue);
  color: var(--ink);
}

/* Step 3: you on the bike. Back seat left, front seat right, the bike pointing the way it rides. */
.lobby-tandem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px 8px;
  align-items: start;
}
.lobby-tandem .lobby-seat-chip {
  flex-direction: column;
  align-items: flex-start;
  border-radius: var(--r-md);
}
.lobby-tandem .lobby-seat-chip--front {
  align-items: flex-end;
  text-align: right;
}
.lobby-tandem-svg {
  grid-column: 1 / -1;
  width: 100%;
  height: 26px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Step 5, Front or back: two seat cards side by side, Back on the left as the bike rides. */
/* The rider and bike steps' own button (PT4), under the picks; sticky so a long gallery
   never hides it. */
.lobby-step-action {
  position: sticky;
  bottom: var(--lobby-ride-bar-h, 0px);
  z-index: 1;
  margin-top: 10px;
}
/* Step 3's own choices (PT4): invite a random teammate, or ride solo with a mirror. */
.lobby-tandem-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.lobby-tandem-choices .lobby-step-hint {
  grid-column: 1 / -1;
}
.lobby-tandem-choice {
  min-height: 44px;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--hand);
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--accent-red);
}
.lobby-tandem-choice:hover:not(:disabled) {
  background: var(--paper-warm);
}
.lobby-tandem-choice:disabled {
  cursor: wait;
  opacity: 0.7;
}
.lobby-seat-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.lobby-seat-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 2px solid var(--ink-mute);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.lobby-seat-choice--front {
  align-items: flex-end;
  text-align: right;
}
.lobby-seat-choice:hover:not(:disabled) {
  background: var(--paper-warm);
}
.lobby-seat-choice.is-selected {
  border-color: var(--ink);
  background: var(--paper-warm);
  box-shadow: 3px 3px 0 var(--accent-red);
}
.lobby-seat-choice:disabled {
  cursor: wait;
  opacity: 0.7;
}
.lobby-seat-choice-title {
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
}
.lobby-seat-choice--front .lobby-seat-choice-title {
  background: var(--accent-yellow);
  color: var(--ink);
}
.lobby-seat-choice-who {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}
.lobby-seat-choice-hint {
  font-family: var(--hand);
  font-size: 0.85rem;
  line-height: 1.2;
  color: var(--ink-soft);
}
.lobby-seat-choices + .lobby-step-hint {
  margin-top: 6px;
}
.lobby-tandem-arrow {
  stroke: var(--accent-red);
}

/* A seat: a Back / Front badge, the rider's face and name. */
.lobby-seat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 3px 8px 3px 4px;
  border: 2px solid var(--ink-mute);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.95rem;
}
.lobby-seat-chip.is-you {
  border-color: var(--accent-red);
  box-shadow: 2px 2px 0 var(--accent-red);
}
.lobby-seat-chip.is-empty {
  border-style: dashed;
  color: var(--ink-mute);
}
.lobby-seat-badge {
  flex: none;
  padding: 0 6px;
  border-radius: 999px;
  font-family: var(--arch);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.5;
}
.lobby-seat-chip--back .lobby-seat-badge {
  background: var(--ink);
  color: var(--paper);
}
.lobby-seat-chip--front .lobby-seat-badge {
  background: var(--accent-yellow);
  color: var(--ink);
}
.lobby-seat-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.lobby-seat-face {
  flex: none;
  width: 1.9em;
  height: 1.9em;
  object-fit: contain;
  border-radius: 50%;
  background: var(--paper-warm);
}

/* Step 4: the rider gallery, yours first, locked ones dimmed with their price. */
.rider-pick {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-mute) transparent;
}
.rider-pick-heading {
  margin: 4px 0 4px;
  font-family: var(--arch);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.rider-pick-heading--locked {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px dashed var(--ink-mute);
}
.rider-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 6px;
}
.rider-pick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 3px 5px;
  border: 2px solid transparent;
  border-radius: var(--r-md);
  background: none;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
}
.rider-pick-card:hover {
  background: var(--paper-warm);
}
.rider-pick-card.is-selected {
  border-color: var(--ink);
  background: var(--paper-warm);
  box-shadow: 2px 2px 0 var(--accent-red);
}
.rider-pick-img {
  position: relative;
  display: block;
}
.rider-pick-img img:first-child {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid var(--ink-mute);
  border-radius: var(--r-sm);
  background: var(--paper);
}
.rider-pick-card.is-locked .rider-pick-img img:first-child {
  filter: grayscale(1);
  opacity: 0.45;
}
.rider-pick-lock {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 22px;
  height: 22px;
}
.rider-pick-name {
  font-family: var(--hand);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}
.rider-pick-price {
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-yellow);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Step 5: frame and wheels cyclers, Freeze rim as a switch. */
.setup-row {
  display: grid;
  grid-template-columns: 5.4em auto 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.setup-row-title {
  font-family: var(--arch);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.setup-thumb img {
  display: block;
  width: 64px;
  height: 42px;
  object-fit: contain;
  border: 1px solid var(--ink-mute);
  border-radius: var(--r-sm);
  background: var(--paper);
}
.setup-row.is-locked .setup-thumb img {
  filter: grayscale(1);
  opacity: 0.45;
}
.setup-name {
  min-width: 0;
  font-family: var(--hand);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.1;
}
.setup-price {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-yellow);
  font-family: var(--arch);
  font-size: 0.75rem;
}
.setup-rim {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--hand);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}
.setup-rim-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.setup-rim-switch {
  position: relative;
  width: 2.4em;
  height: 1.3em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  transition: background 0.15s ease;
}
.setup-rim-switch::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 2px;
  width: calc(1.3em - 6px);
  height: calc(1.3em - 6px);
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.15s ease;
}
.setup-rim-input:checked + .setup-rim-switch {
  background: var(--accent-blue);
}
.setup-rim-input:checked + .setup-rim-switch::after {
  transform: translateX(1.05em);
}
.setup-rim-input:focus-visible + .setup-rim-switch {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
}
.setup-rim.is-disabled {
  opacity: 0.4;
  cursor: default;
}

/* Saved-preset chips atop the rider and setup steps. */
.theatre-preset-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.theatre-preset-strip-label {
  font-family: var(--arch);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ── CENTRE: your tandem, live ──────────────────────────────────────────────────── */
.lobby-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-mute) transparent;
}
.lobby-preview {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--r-lg);
  background: #fdfaf2;
  box-shadow: 3px 3px 0 var(--ink);
}
.lobby-preview-art {
  position: relative;
  width: 100%;
  max-width: 640px;
}
.lobby-preview-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 896;
  max-height: 42vh;
  object-fit: contain;
}
.lobby-preview-seat {
  position: absolute;
  bottom: 2%;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--arch);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  transform: translateX(-50%);
}
.lobby-preview-seat:empty {
  display: none;
}
.lobby-preview-seat--back {
  left: 28%;
  background: var(--ink);
  color: var(--paper);
}
.lobby-preview-seat--front {
  left: 72%;
  background: var(--accent-yellow);
  color: var(--ink);
}
.lobby-preview-seat.is-you {
  box-shadow: 0 0 0 2px var(--accent-red);
}
.lobby-preview-caption {
  margin: 0;
  max-width: 560px;
  min-height: 1.3em;
  font-family: var(--hand);
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--ink-soft);
  text-align: center;
}
.lobby-preview.is-previewing .lobby-preview-caption::before {
  content: 'Preview · ';
  font-family: var(--arch);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-red);
}

/* Your live numbers, like the race HUD: watts, cadence, a heart beating at your heart rate. */
.lobby-live-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
}
.lobby-live-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--mono);
  color: var(--ink-mute);
}
.lobby-live-icon {
  align-self: center;
  width: 1.6rem;
  height: 1.6rem;
  object-fit: contain;
  opacity: 0.55;
}
.lobby-live-num {
  display: inline-block;
  min-width: 2.2ch;
  font-size: 2.1rem;
  line-height: 1;
  text-align: right;
}
.lobby-live-unit {
  font-size: 1.05rem;
}
.lobby-live-stat.is-live {
  color: var(--ink);
}
.lobby-live-stat.is-live .lobby-live-icon {
  opacity: 1;
}
.lobby-live-stat[data-stat='watts'].is-live .lobby-live-num {
  color: var(--accent-red);
}
.lobby-live-stat[data-stat='watts'].is-estimated .lobby-live-unit::after {
  content: ' est.';
  font-family: var(--hand);
}
.lobby-live-heart.is-beating {
  animation-name: lobbyHeartBeat;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}
@keyframes lobbyHeartBeat {
  0%,
  100% {
    scale: 1;
  }
  14% {
    scale: 1.28;
  }
  28% {
    scale: 1;
  }
  42% {
    scale: 1.14;
  }
  60% {
    scale: 1;
  }
}

/* Other tandems: one line each, humans first; bots' tuning behind Manage. */
.lobby-others {
  flex: none;
  padding: 10px 12px;
  border: 2px dashed var(--ink-mute);
  border-radius: var(--r-lg);
  background: var(--paper-warm);
}
.lobby-bike-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.lobby-bike-row {
  border: 2px solid var(--ink);
  border-left: 6px solid var(--bike-color, var(--ink-mute));
  border-radius: var(--r-md);
  background: var(--paper);
  padding: 4px 8px;
}
.lobby-bike-row-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.lobby-bike-swatch {
  display: none;
}
.lobby-bike-seats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.lobby-bike-seats .lobby-seat-chip {
  max-width: 100%;
  border-width: 1px;
  padding: 1px 8px 1px 3px;
  font-size: 0.9rem;
}
.lobby-bike-seats .lobby-seat-face {
  width: 1.5em;
  height: 1.5em;
}
.lobby-bike-duo {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.lobby-bike-duo .lobby-seat-face {
  width: 1.5em;
  height: 1.5em;
}
.lobby-bike-manage {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--ink-mute);
}
.lobby-bike-manage-seat + .lobby-bike-manage-seat {
  margin-top: 6px;
}
.lobby-bike-manage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}
.lobby-host-tools {
  margin: 0 0 8px;
  font-size: 0.9rem;
}
.lobby-host-tools summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-family: var(--arch);
}
.lobby-host-tools .lobby-admin-bar {
  margin: 8px 0 4px;
}
.lobby-bot-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── RIGHT: who's looking for a teammate, then the chat ─────────────────────────── */
.lobby-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lobby-people {
  flex: none;
  max-height: 38%;
  overflow-y: auto;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--r-lg);
  background: var(--paper-warm);
  box-shadow: 3px 3px 0 var(--ink);
  scrollbar-width: thin;
  scrollbar-color: var(--ink-mute) transparent;
}
.lobby-rail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lobby-rider-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 5px 8px;
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  background: var(--paper);
}
.lobby-rider-row--incoming {
  border-color: var(--accent-red);
  box-shadow: 2px 2px 0 var(--accent-red);
}
.lobby-rider-name {
  flex: 1 1 8em;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
.lobby-row-marker {
  width: 1.6em;
  height: 1.6em;
}
.lobby-rider-ask {
  flex-basis: 100%;
  font-family: var(--hand);
  font-size: 1rem;
  color: var(--accent-red);
}
.lobby-rider-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lobby-mini-btn.lobby-accept {
  background: var(--accent-lime);
  color: #fff;
  font-weight: 700;
}
.lobby-rider-pending {
  color: var(--ink-mute);
  font-size: 0.85rem;
}
.lobby-step .lobby-rider-row {
  margin-top: 8px;
}
.rider-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(29, 26, 20, 0.3);
  text-underline-offset: 2px;
}
.rider-link:hover {
  text-decoration-color: rgba(29, 26, 20, 0.8);
}
/* head-N.png — a dedicated head-only asset per character (see lobby.js's
   riderCharacterHeadSrc), not a crop of the full-body portrait. `contain`, not `cover`, so the
   whole head is always visible on the more loosely framed ones. */
.lobby-seat-character-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid var(--ink);
  flex-shrink: 0;
  background: var(--paper);
}
.lobby-step-summary .lobby-seat-character-icon {
  width: 40px;
  height: 40px;
}
.seat-marker-icon {
  width: 2.4em;
  height: 2.4em;
  vertical-align: -0.7em;
}

/* FTP verified star (shared markup from ftp_badge.js). Self-contained tooltip
   styles so the lobby doesn't depend on profile.html's .badge-tooltip. */
.ftp-star,
.ftp-star-inline {
  position: relative;
  display: inline-block;
  cursor: help;
}
.ftp-star-icon {
  width: 1.4em;
  height: 1.4em;
  vertical-align: -0.25em;
}
.ftp-star .ftp-star-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  background: #10202a;
  color: #eaf2f6;
  border: 1px solid rgba(120, 200, 230, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.ftp-star .ftp-star-tooltip a {
  color: #6fd3ff;
}
.ftp-star:hover .ftp-star-tooltip {
  opacity: 1;
  pointer-events: auto;
}
.lobby-bot-tune {
  margin-top: 7px;
  display: none;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.lobby-bot-tune.open {
  display: flex;
}
.lobby-bot-tune label {
  display: flex;
  flex-direction: column;
  font-size: 0.68rem;
  color: var(--ink-soft);
  gap: 1px;
}
.lobby-bot-tune input {
  width: 56px;
  font-family: var(--mono);
  padding: 2px 4px;
  border: 1px solid var(--ink-mute);
  border-radius: var(--r-sm);
  background: var(--paper-warm);
  color: var(--ink);
}
.lobby-teammate-chooser {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.lobby-teammate-chooser select,
.lobby-teammate-chooser input {
  font-family: var(--arch);
  border: 2px solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
  padding: 4px 6px;
}
.lobby-teammate-chooser input[type='number'] {
  width: 54px;
  font-family: var(--mono);
}
.lobby-teammate-chooser input[type='text'] {
  width: 92px;
  font-family: var(--arch);
}
.lobby-skin-arrow {
  font-family: var(--hand);
  cursor: pointer;
  border: 1px solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
  padding: 4px 8px;
}
.lobby-skin-arrow:disabled {
  opacity: 0.4;
  cursor: default;
}
.locked-skin-preview {
  opacity: 0.4;
  filter: grayscale(1);
}
.lock-suffix-icon {
  width: 0.9em;
  height: 0.9em;
  vertical-align: -0.1em;
}
.lobby-mini-btn {
  font-family: var(--hand);
  cursor: pointer;
  border: 1px solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--paper-warm);
  color: var(--ink);
  padding: 2px 8px;
  font-size: 0.85rem;
}
/* The chat: a solid column of its own (PT1/PT2: never see-through, never over anything, can't be
   closed). New messages only scroll you down while you're at the latest one; otherwise the
   "New messages" pill shows a red dot. */
.lobby-chat {
  position: relative;
  flex: 1 1 auto;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--ink);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
}
.lobby-chat .lobby-panel-head {
  margin: 0;
  padding: 7px 12px;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-warm);
}
.lobby-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-mute) transparent;
}
.lobby-chat-msg {
  font-size: 0.95rem;
  word-break: break-word;
}
.lobby-chat-msg .chat-sender {
  font-weight: 700;
  color: var(--accent-red);
}
.lobby-chat-msg.is-mine .chat-sender {
  color: var(--ink-soft);
}
.lobby-chat-jump {
  position: absolute;
  left: 50%;
  bottom: 62px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--hand);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}
.lobby-chat-jump[hidden] {
  display: none;
}
.lobby-chat-dot {
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--accent-red);
}
.lobby-chat-form {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 2px solid var(--ink);
}
.lobby-chat-form input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 2px solid var(--ink);
  border-radius: var(--r-sm);
  font-family: var(--arch);
  background: var(--paper);
  color: var(--ink);
}
.lobby-seat-chip .lobby-seat-face {
  width: 1.9em;
  height: 1.9em;
  border-width: 1px;
}
.lobby-bike-row .lobby-seat-chip .lobby-seat-face,
.lobby-bike-duo .lobby-seat-face {
  width: 1.5em;
  height: 1.5em;
}

/* One column below 960px wide (phones, narrow windows): Your ride, the preview, the other
   tandems, who's looking, then the chat, in one scroll; the action bar pins to the bottom. */
@media (max-width: 959px) {
  .lobby-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-bottom: 110px;
  }
  .lobby-ride,
  .lobby-stage,
  .lobby-side {
    flex: none;
    overflow: visible;
  }
  .lobby-ride-steps {
    overflow: visible;
  }
  .lobby-ride-action {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    box-shadow: 0 -3px 0 var(--ink);
  }
  .lobby-people {
    max-height: none;
  }
  .lobby-chat {
    min-height: 0;
    height: 60vh;
    height: 60dvh;
  }
  .lobby-preview-canvas {
    max-height: 34vh;
  }
  /* Browsing riders or the bike with the preview scrolled away: a small copy of it sits next to
     the pinned action, so a pick shows on the bike without scrolling. */
  .lobby-ride-action[data-mini='1'] {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px 10px;
  }
  .lobby-ride-action[data-mini='1'] .lobby-ride-mini {
    display: block;
    grid-row: 1 / span 2;
    width: 112px;
    height: 84px;
    border: 2px solid var(--ink);
    border-radius: var(--r-sm);
    background: var(--paper-warm);
  }
}
/* Touch screens: bigger targets (VIEW_REQUIREMENTS.md §4, capability-gated). */
@media (hover: none) and (pointer: coarse) {
  .lobby-skin-arrow {
    min-width: 40px;
    min-height: 40px;
  }
  .lobby-mini-btn {
    min-height: 36px;
    padding: 4px 12px;
  }
  .lobby-topbar {
    padding: 8px 12px;
    gap: 6px 10px;
  }
}
/* The sensor strip itself (.lobby-sensor-strip, .lss-*, .lobby-ready-chip) lives in
   sensor-strip.css: the FTP and equipment tests mount it too (PT5). */
/* The host's start button once every rider is ready (fast start). */
.lobby-btn-start--allready {
  animation: lssPulse 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .lobby-btn-start--allready {
    animation: none;
  }
}
/* The sensor strip inside step 1: a compact stack of chips (the live numbers live under the
   preview). The ready control only makes sense once you're on a bike. */
#lobbyStepSensors .lobby-sensor-strip {
  border: none;
  box-shadow: none;
  background: none;
  padding: 0;
}
#lobbyStepSensors .lss-head strong,
#lobbyStepSensors .lss-watts {
  display: none;
}
#lobbyStepSensors .lss-head {
  margin-bottom: 6px;
}
#lobbyStepSensors .lss-sub {
  font-size: 0.95rem;
}
#lobbyStepSensors .lss-chips {
  flex-direction: column;
  flex-basis: 100%;
  gap: 5px;
}
#lobbyStepSensors .lss-chip {
  justify-content: space-between;
}
#lobbyStepSensors .lss-chip-label {
  flex: 1;
}
#lobbyStepSensors[data-seated='0'] .lss-ready {
  display: none;
}
#lobbyStepSensors[data-state='done'] .lss-sub {
  display: none;
}

/* Step 2: the workout. Each choice shows its zone-coloured profile, minutes and purpose. */
.lobby-workout-picker[hidden] {
  display: none;
}
.lw-fieldset {
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
}
.lw-intro,
.lw-ftp {
  margin: 0 0 6px;
  font-family: var(--hand);
  font-size: 1rem;
  line-height: 1.25;
  color: var(--ink-soft);
}
.lw-link {
  padding: 0;
  border: none;
  background: none;
  font-family: var(--hand);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
}
.lw-ftp-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
}
.lw-ftp-label {
  font-family: var(--hand);
  font-size: 1rem;
  font-weight: 700;
}
.lw-ftp-input {
  width: 5em;
  padding: 3px 6px;
  border: 2px solid var(--ink);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 1.05rem;
  background: var(--paper);
  color: var(--ink);
}
.lw-ftp-error {
  flex-basis: 100%;
  color: var(--accent-red);
  font-size: 0.9rem;
}
.lw-picked {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.lw-picked .lw-expand {
  align-self: flex-start;
}
.lw-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lw-choice {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  width: 100%;
  padding: 5px 7px;
  border: 2px solid var(--ink-mute);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
}
button.lw-choice {
  cursor: pointer;
}
button.lw-choice:hover {
  background: var(--paper-warm);
}
.lw-choice.is-selected {
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--accent-red);
}
.lw-choice--plan {
  border-color: var(--accent-blue);
}
.lw-thumb {
  display: block;
  height: 30px;
  border-bottom: 1px solid var(--ink-mute);
}
.lw-thumb svg {
  display: block;
  width: 100%;
  height: 100%;
}
.lw-thumb--none {
  border-bottom-style: dashed;
}
.lw-choice-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.lw-choice-plan {
  font-family: var(--arch);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.lw-choice-title {
  font-family: var(--hand);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.15;
}
.lw-choice-min {
  margin-left: 6px;
  font-family: var(--arch);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink-soft);
}
.lw-choice-sub {
  font-family: var(--arch);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.lw-choice-blurb {
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--ink-soft);
}
.lw-more {
  align-self: flex-start;
  margin-top: 2px;
}
