@import url("common.css");

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(15,23,42,.7);
  border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  font-weight: 900;
  letter-spacing: .1em;
  color: #fde68a;
}
.topbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
}
.pill {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: .9rem;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: #fff;
  display: grid; place-items: center;
}

.lobby-wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.lobby-actions {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px;
}
.lobby-actions .btn {
  border: none; border-radius: 12px; padding: 12px 16px; font-weight: 700;
}
.btn-primary { background: linear-gradient(135deg,#6366f1,#3b82f6); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.06); color: #fff; border: 1px solid rgba(255,255,255,.1); }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.filters input, .filters select {
  width: 100%;
  background: var(--card);
  border: 1px solid rgba(255,255,255,.1);
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
body {
  background:
    radial-gradient(ellipse at top, rgba(99,102,241,.14), transparent 50%),
    radial-gradient(circle at 10% 80%, rgba(16,185,129,.06), transparent 35%),
    var(--bg);
}
.room-card {
  background: linear-gradient(160deg, rgba(28,37,58,.95), rgba(15,23,42,.98));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 16px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}
.room-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: #64748b;
}
.room-card.status-playing::before { background: #22c55e; }
.room-card.status-countdown::before { background: #fbbf24; }
.room-card.status-waiting::before { background: #3b82f6; }
.room-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99,102,241,.45);
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
}
.room-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  margin-bottom: 10px;
}
.room-card h3 { margin: 0; font-size: 1.05rem; }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 800; letter-spacing: .02em;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(255,255,255,.06); color: #cbd5e1;
  white-space: nowrap;
}
.status-pill.playing { background: rgba(34,197,94,.15); color: #86efac; }
.status-pill.countdown { background: rgba(251,191,36,.15); color: #fde68a; }
.status-pill.waiting { background: rgba(59,130,246,.15); color: #93c5fd; }
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  display: inline-block;
  box-shadow: 0 0 0 0 currentColor;
  animation: livePulse 1.4s ease infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(134,239,172,.5); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.room-meta { color: var(--muted); font-size: .88rem; line-height: 1.55; }
.room-meta .k { color: #64748b; font-size: .78rem; text-transform: uppercase; margin-right: 4px; }
.seat-row { display: flex; align-items: center; gap: 5px; margin: 4px 0; }
.seat-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15);
}
.seat-dot.on { background: #3b82f6; border-color: #93c5fd; box-shadow: 0 0 8px rgba(59,130,246,.5); }
.room-card .join {
  margin-top: 12px;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 10px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-weight: 700;
}
.room-card .join:hover { filter: brightness(1.08); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: grid; place-items: center; z-index: 40; padding: 16px;
}
.modal {
  width: min(400px, 100%);
  background: var(--card2);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.1);
}
.modal h2 { margin: 0 0 14px; }
.modal label { display: block; font-size: .85rem; color: var(--muted); margin: 8px 0 4px; }
.modal input {
  width: 100%; background: #0b1220; border: 1px solid rgba(255,255,255,.12);
  color: #fff; border-radius: 10px; padding: 10px 12px;
}
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions button { flex: 1; border: none; border-radius: 10px; padding: 11px; font-weight: 700; }
.empty {
  text-align: center; color: var(--muted); padding: 40px 10px;
  border: 1px dashed rgba(255,255,255,.12); border-radius: 14px;
}

@media (max-width: 640px) {
  .topbar { padding: 10px 12px; }
  .lobby-wrap { padding: 14px 12px 90px; }
  .lobby-actions .btn { flex: 1 1 auto; min-height: 44px; font-size: .95rem; }
  .filters { grid-template-columns: 1fr 1fr; }
  .rooms-grid { grid-template-columns: 1fr; gap: 10px; }
  .room-card .join { min-height: 44px; font-size: 1rem; }
  .modal { padding: 16px; }
  .modal-actions button { min-height: 44px; }
}
