/* ── Rooms Screen ───────────────────────────────────── */

#screen-rooms {
  align-items: flex-start;
  justify-content: flex-start;
}

.rooms-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

/* .rooms-header gets its display/padding/border/title styling from the
   shared .page-header rule in style.css. Nothing page-specific needed here. */

/* ── System filter tabs ────────────────────────────── */
.rooms-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.rooms-filter-tab {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 4px 10px;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.rooms-filter-tab:hover { color: var(--text); }
.rooms-filter-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0, 229, 160, 0.08);
}

/* ── Room card grid ────────────────────────────────── */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.room-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.room-card:hover {
  border-color: var(--accent);
  box-shadow: var(--glow);
}

.room-card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface2);
  display: block;
}
.room-card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.room-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.room-card-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.room-card-system {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--accent2);
  background: rgba(0, 184, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.room-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-dim);
}
.room-card-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.room-card-host {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}
.room-card-type {
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.room-card-type.solo {
  color: var(--accent);
  background: rgba(0, 229, 160, 0.1);
}
.room-card-type.matchmaking {
  color: var(--accent2);
  background: rgba(0, 184, 255, 0.15);
}
.room-card-viewers {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── States ────────────────────────────────────────── */
.rooms-loading {
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 32px;
}

.rooms-empty {
  text-align: center;
  padding: 48px 16px;
}
.rooms-empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
}
.rooms-empty-title {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text);
  margin-bottom: 8px;
}
.rooms-empty-desc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  max-width: 340px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 600px) {
  .rooms-grid {
    grid-template-columns: 1fr;
  }
  .rooms-container {
    padding: 16px 12px 32px;
  }
}
