/* ============================================================
   MP Lobby layout hardening
   Keep the merged interior stable without forcing the panel open.
   ============================================================ */
#lobby-panel.hidden,
#host-options-panel.hidden {
  display: none !important;
}

#lobby-panel:not(.hidden) {
  display: flex !important;
  flex-direction: column !important;
}

#lobby-panel > .panel-header {
  flex: 0 0 auto !important;
}


/* ===== extracted: lobby-layered-card-polish ===== */

/* Lobby — stronger layered cards for waiting room UI */
#lobby-panel > .panel-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

#lobby-panel .lp-stage-controls,
#lobby-panel .lp-player-dock,
#lobby-panel .lp-chat-input-row,
#lobby-panel .lp-stage-choice,
#lobby-panel .lp-game-drawer-panel {
  border-radius: 18px;
  border: 1px solid rgba(122, 164, 206, 0.28);
  background: linear-gradient(180deg, rgba(16, 27, 41, 0.8), rgba(9, 16, 27, 0.84));
  box-shadow: 0 10px 24px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(3px);
}

#lobby-panel .lp-player-dock-header,
#lobby-panel .lp-stage-controls .lp-section-title,
#lobby-panel .lp-stage-choice-text,
#lobby-panel .lp-game-drawer-header {
  color: #eef5ff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}

/* ========================================================================
   MP LOBBY MINIMIZED BAR (docked next to ToolbarHUD)
   Shown when a minigame launches from a lobby.
========================================================================= */


/* extracted from 03-panel-contract.css — pass27 lobby/matchmake fit spill */
/* Lobby */

/* Matchmake */
#matchmake-panel > .panel-body.matchmake-body {
  padding: 12px;
  overflow: hidden;
}

#matchmake-panel .matchmake-status-row {
  flex: 0 0 auto;
  gap: 12px;
}

#matchmake-panel .matchmake-slot {
  min-height: 0;
  min-width: 0;
}

#matchmake-panel .matchmake-right {
  overflow: hidden;
}

#matchmake-panel #mm-waiting-room-slot {
  height: 100%;
  overflow: hidden;
}


/* extracted from 03-panel-contract.css — pass27 lobby-search canonical layer */
/* ============================================================
   Display pass patch33 — remaining setup/results/sidecard canonical layer
   Purpose: neutralize final raw ID-era size leftovers for panels that
   already carry panel-size tokens in index.html.
   ============================================================ */

/* extracted from 03-panel-contract.css — pass27 lobby root spill */
#mp-chat-panel {
  z-index: 9200;
  background: rgba(16, 28, 40, 0.98);
  border: 3px solid #3a4f69;
  border-radius: 12px;
}


/* ============================================================
   MULTIPLAYER LOBBY PANEL (Supabase + WebRTC)
   ============================================================ */

/* ============================================================
   HEADER
   ============================================================ */


/* ============================================================
   START BUTTON (INLINE, HOST ONLY)
   ============================================================ */

/* ============================================================
   GUEST MESSAGE
   ============================================================ */

/* ============================================================
   FOOTER BUTTONS
   ============================================================ */

/* ============================================================
   FRIEND ICON
   ============================================================ */

/* extracted from styles/03-panel-contract.css — Lobby search panel family */
/* ============================================================
   LOBBY SEARCH PANEL
============================================================ */
.lsp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(16,28,40,0.98);
  border-bottom: 2px solid #3a4f69;
}

.lsp-title {
  font-weight: 800;
  font-size: 18px;
}

.lsp-close {
  background: #253a52;
  border: 1px solid #3e587b;
  color: #eee;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.lsp-body {
  height: calc(100% - 44px);
  display: flex;
  gap: 10px;
  padding: 10px;
  box-sizing: border-box;
}

.lsp-results {
  flex: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lsp-results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.lsp-status {
  opacity: 0.75;
  font-size: 12px;
}

.lsp-grid {
  flex: 1;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-right: 4px;
}

.lsp-card {
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.2);
  padding: 10px;
  box-sizing: border-box;
}

.lsp-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.lsp-host {
  font-weight: 800;
}

.lsp-slots {
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.lsp-clients {
  margin-top: 8px;
  opacity: 0.9;
  font-size: 12px;
  line-height: 1.3;
  word-break: break-word;
}

.lsp-card-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.lsp-filters {
  flex: 1;
  min-width: 260px;
  border-left: 1px solid rgba(255,255,255,0.12);
  padding-left: 10px;
  box-sizing: border-box;
}

.lsp-field {
  margin-bottom: 10px;
}

.lsp-field label {
  display: block;
  margin-bottom: 4px;
  opacity: 0.9;
  font-size: 12px;
}

.lsp-input {
  width: 100%;
  box-sizing: border-box;
}

.lsp-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.lsp-hint {
  opacity: 0.75;
  font-size: 12px;
  margin-bottom: 10px;
}

.lsp-btn {
  padding: 8px 10px;
  background: #2b3e55;
  border: 1px solid #3e587b;
  color: #eee;
  border-radius: 10px;
  cursor: pointer;
  flex: 1;
}

.lsp-btn.primary {
  background: #2f5a87;
}

.lsp-btn.small {
  padding: 6px 10px;
  flex: 0 0 auto;
}

.lsp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================
   DEV / TEST PANEL


/* pass12: responsive ownership migrated from 19-panel-fit-helpers.css */
@media (max-width: 1360px), (max-height: 860px) {
  #lobby-panel .lp-wrapper {
    flex-direction: column;
  }

  #matchmake-panel .matchmake-topbar {
    grid-template-columns: 1fr 1fr;
  }

  #matchmake-panel .matchmake-grid {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   Migrated from 99-legacy-overrides-a.css — MP invite popup compat hooks
   Keep gameplay-only layer positioning here; popup inline skin moved to 00-tokens.css.
   ============================================================ */
.mp2x-chao-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
