/* ── "Schedule a Match" friend picker ─────────────────────────────────────
   The first step of the play-mode scheduling flow (src/client/schedule-match.js):
   pick a friend, then the shared schedule sheet (home.css .home-pt-schedule-*)
   opens on top. Centered modal — matches the play-mode / invite modal language
   rather than the suggest panel's slide-in. Theme tokens with fallbacks. */

.schedule-match-overlay {
  position: fixed;
  inset: 0;
  z-index: 305; /* below invite-modal (310) but above the page; sits under the
                   schedule sheet (home.css z-index 300 lives in its own
                   stacking context appended after this) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.schedule-match-overlay.hidden { display: none !important; }

.schedule-match-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.schedule-match-sheet {
  position: relative;
  background: var(--surface, #15151f);
  color: var(--text, #e8e8f0);
  border: 1px solid var(--border, #2c2c3a);
  border-radius: var(--radius, 12px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  width: min(440px, 92vw);
  max-height: min(80vh, 620px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.schedule-match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #2c2c3a);
  flex: 0 0 auto;
}

.schedule-match-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.schedule-match-close {
  border: none;
  background: none;
  color: var(--text-dim, #9a9ab0);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
}

.schedule-match-close:hover { color: var(--text, #e8e8f0); }

.schedule-match-context {
  margin: 0;
  padding: 12px 16px 0;
  font-size: 12px;
  color: var(--text-dim, #9a9ab0);
  flex: 0 0 auto;
}

.schedule-match-search {
  box-sizing: border-box;
  margin: 12px 16px 0;
  background: var(--surface2, #1d1d2a);
  border: 1px solid var(--border, #2c2c3a);
  border-radius: 8px;
  color: var(--text, #e8e8f0);
  font: inherit;
  font-size: 13px;
  padding: 9px 10px;
  flex: 0 0 auto;
}

.schedule-match-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.schedule-match-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 1px solid var(--border, #2c2c3a);
  border-radius: 10px;
  background: var(--surface2, #1d1d2a);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.schedule-match-row:hover,
.schedule-match-row:focus-visible { border-color: var(--accent, #00e5a0); }

.schedule-match-row-name {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-match-row-meta {
  font-size: 11px;
  color: var(--text-dim, #9a9ab0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Persistent live-status region (role=status). Collapses when cleared so it
   leaves no gap above the friend rows; reappears when a message is set. */
.schedule-match-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim, #9a9ab0);
  padding: 10px 16px;
}

.schedule-match-empty:empty { display: none; }

/* Full-bleed bottom sheet on narrow viewports — matches the schedule sheet. */
@media (max-width: 560px) {
  .schedule-match-overlay { align-items: flex-end; padding: 0; }
  .schedule-match-sheet {
    width: 100%;
    max-height: min(88vh, 100%);
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}
