/* Ultimate Sports lobby — app-specific layout override.
   The shared P2P-client design system is loaded via <link> in index.html
   (../shared/design-system.css). This sheet only holds lobby-specific page
   layout: the desktop wrapper, the window chrome wrapper, and the two-column
   body grid. All components (titlebar, toolbar, LCD strip, groups, tables,
   buttons, wallet chips, etc.) come from the shared design system. */

.desk {
  min-height: 100vh;
  padding: 24px 18px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.win {
  position: relative;
  width: 100%;
  max-width: 1180px;
  background: var(--chrome);
  border: 1px solid var(--frame);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 var(--bevel-hi);
}

.body { display: grid; grid-template-columns: 236px 1fr; gap: 8px; padding: 0 8px 8px; }
.rail { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.maincol { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

@media (max-width: 880px) {
  .body { grid-template-columns: 1fr; }
  .lv .hide { display: none; }
  .desk { padding: 10px 6px; }
  /* When the columns stack, the fight hero + server browser must come FIRST — not
     buried below Categories/Wallet/Friends/Settings 1500px down the page. */
  .maincol { order: -1; }
  /* The lobby toolbar is a single non-wrapping row; let its wallet/peers chips wrap
     onto a second line instead of clipping off the right edge under .win overflow. */
  .toolbar { flex-wrap: wrap; row-gap: 6px; }
  /* iOS Safari zooms the page when a <16px field is focused — including the room
     password. 16px is the no-zoom threshold; retro sizes stay on desktop. */
  .set-input, .friend-add input, .redeem-form input { font-size: 16px; }
}

@media (max-width: 560px) {
  /* Server-browser rows: let long titles wrap and hide the Variants column so the
     table fits 375px without a hidden horizontal scroll. */
  .lv td, .lv thead th { padding: 8px; }
  .lv td.srv { white-space: normal; }
}

/* Account recovery — reuses shared .wbtn/.wnote/.label-sm; only the local grid,
   code box, and restore disclosure are lobby-specific. */
.recovery-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 6px 0;
}
.recovery-code {
  width: 100%;
  box-sizing: border-box;
  margin: 6px 0;
  padding: 7px;
  border: 1px solid var(--frame);
  border-radius: 4px;
  background: var(--field, #101418);
  color: var(--ink, #cfe);
  font-family: var(--mono, monospace);
  font-size: 10.5px;
  line-height: 1.35;
  word-break: break-all;
  resize: vertical;
}
.recovery-restore { margin-top: 6px; }
.recovery-restore > summary {
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 0;
  color: var(--ink-dim, #9fb);
}
.recovery-status { margin: 6px 0 0; font-size: 11px; line-height: 1.4; min-height: 13px; }
.recovery-status.is-ok { color: var(--pos, #5c8); }
.recovery-status.is-err { color: var(--neg, #e77); }
.rec-field {
  display: block;
  margin: 6px 0;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-dim, #9fb);
}
.rec-field input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 3px;
  padding: 6px 7px;
  border: 1px solid var(--frame);
  border-radius: 4px;
  background: var(--field, #101418);
  color: var(--ink, #cfe);
  font-family: var(--mono, monospace);
  font-size: 16px; /* 16px avoids iOS focus-zoom */
  font-weight: 400;
}
.rec-hint { margin: 6px 0; font-size: 11px; color: var(--ink-dim, #9fb); }
.recovery-danger { margin-top: 6px; }
.recovery-danger > summary { cursor: pointer; font-size: 11px; padding: 3px 0; color: var(--ink-dim, #9fb); }
.recovery-danger .wbtn.wide { margin-top: 4px; }

/* ---------- Generated fit-pack art on server tiles ----------
   lobbyIcon overlays the category glyph when the fit's generated icon loads
   (it removes itself onerror, leaving the glyph); poolCardAccent paints a
   soft right-edge accent strip behind the row title. Both degrade to the
   plain tile when the pack is absent. */
.lv td.srv { position: relative; overflow: hidden; }
.lv td.srv .fl { position: relative; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.lv td.srv .fl .srv-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  background: var(--field-line);
}
.lv td.srv .srv-accent {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 120px;
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  opacity: 0.14;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, #000 30%, transparent);
  mask-image: linear-gradient(to left, #000 30%, transparent);
}

/* The password-modal join note: CSP style-src is strict here, so no inline styles. */
.pw-join-note { margin: 0 0 10px; }

/* Friend rows: the invite affordance */
.f-invite { border: 1px solid var(--line, #b3bac6); background: transparent; cursor: pointer; padding: 0 4px; }
