/* ---- lobby -------------------------------------------------------------- */

.lobby {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  padding: 88px 24px 48px;
}

.lobby-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.lobby h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.lobby-intro {
  margin: 6px 0 24px;
  color: var(--muted);
  font-size: 14.5px;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.room-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 10px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
  animation: pop-in 0.35s var(--ease);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s;
}
.room-card:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.room-card:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }

.room-card .preview {
  display: block;
  aspect-ratio: 16 / 10;
  margin-bottom: 8px;
  border-radius: 10px;
  background: #fff;
  outline: 1px solid var(--border);
  overflow: hidden;
}
.room-card canvas {
  width: 100%;
  height: 100%;
  cursor: inherit;
}

.room-card .room-name {
  padding: 0 4px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.room-card .room-meta {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
}
.room-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 4px 0;
}
.room-card .tags:empty { display: none; }
.tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

/* Inactive rooms are greyed out. */
.room-card:is([data-status="inactive"], [data-status="closing"]) .preview { filter: grayscale(1); opacity: 0.55; }
.room-card:is([data-status="inactive"], [data-status="closing"]) .room-name { color: var(--muted); }

.room-card.new {
  justify-content: center;
  align-items: center;
  min-height: 220px;
  border: 2px dashed var(--border);
  background: transparent;
  box-shadow: none;
  text-align: center;
}
.room-card.new .plus {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-text);
}
.room-card.new .plus svg { width: 24px; height: 24px; stroke-width: 2.5; }
.room-card.new:disabled { cursor: not-allowed; opacity: 0.6; }
.room-card.new:disabled .plus { background: var(--muted); }

.lobby-empty {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 640px) {
  .lobby { padding: 72px 14px 32px; }
}
