/* --- Online Users Sidebar --- */
#online-users-panel {
  position: sticky;
  top: 49px; /* height of the sticky filter bar */
  height: calc(100vh - 49px);
  overflow-y: auto;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0.75rem 1.5rem 1.25rem;
  color: var(--text-primary);
  font-size: 0.9rem;
}
.online-users-title {
  font-weight: 700;
  margin-bottom: 0.7rem;
  color: var(--accent-gr);
}
.online-users-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.online-user-item {
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.2rem;
  background: rgba(34,197,94,0.08);
  color: var(--accent-gr);
  font-size: 1rem;
}
.online-users-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 2rem;
}

/* --- Top Right User Name --- */
#auth-area {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  z-index: 100;
}
.user-name {
  background: rgba(233,69,96,0.08);
  border-radius: 99px;
  padding: 0.3rem 1rem;
  border: 1px solid var(--accent);
  white-space: nowrap;
  line-height: 1.4;
}
#signout-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-secondary);
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: inherit;
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
#signout-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
/* --- Session Modal ----------------------------------------- */
#session-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13,13,26,0.82);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
#session-modal[hidden] {
  display: none;
}
#session-modal-content {
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 2.2rem 2.5rem 1.5rem;
  min-width: 320px;
  max-width: 96vw;
  max-height: 80vh;
  overflow-y: auto;
}
#close-session-modal {
  margin: 1.2rem auto 0 auto;
  display: block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.18s;
}
#close-session-modal:hover {
  background: #c72c47;
}
.btn-session {
  background: var(--accent-gr);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.4rem 1.1rem;
  font-size: 1rem;
  margin-left: 0.5rem;
  cursor: pointer;
  transition: background 0.18s;
}
.btn-session:hover {
  background: #178a3a;
}
/* ============================================================
   Game-On — Ignitesol Team Games Directory
   style.css
   ============================================================ */

/* --- CSS Variables ----------------------------------------- */
:root {
  --bg-primary:    #0d0d1a;
  --bg-secondary:  #13132b;
  --bg-card:       #181830;
  --bg-card-hover: #1e1e3a;
  --border:        #252545;
  --border-hover:  rgba(255, 255, 255, 0.12);

  --text-primary:   #e8e8f2;
  --text-secondary: #8888aa;
  --text-muted:     #55557a;

  --accent:    #e94560;
  --accent-bl: #4fc3f7;
  --accent-pu: #a855f7;
  --accent-gr: #22c55e;
  --accent-or: #f97316;

  /* Category palette */
  --col-drawing:   #ff6b6b;
  --col-trivia:    #4ecdc4;
  --col-music:     #a855f7;
  --col-deduction: #f59e0b;
  --col-geography: #22c55e;
  --col-party:     #f97316;
  --col-action:    #ef4444;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card:  0 4px 24px rgba(0, 0, 0, 0.45);
  --transition:   0.18s ease;
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Scrollbar --------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* --- Header ------------------------------------------------ */
.header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #0d0d1a 0%, #111126 50%, #0d0d1a 100%);
  border-bottom: 1px solid var(--border);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 60%, rgba(233, 69, 96, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 70% 40%, rgba(168, 85, 247, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.header-inner {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}

.header-eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: rgba(233, 69, 96, 0.12);
  border: 1px solid rgba(233, 69, 96, 0.28);
  padding: 0.2rem 0.75rem;
  border-radius: 99px;
  margin-bottom: 1rem;
}

.header-logo {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #e94560 0%, #a855f7 50%, #4fc3f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.6rem;
  line-height: 1.1;
}

.header-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
  margin-bottom: 1.25rem;
}

.header-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat-chip {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
}

.stat-chip strong {
  color: var(--text-primary);
}

/* --- Filters ----------------------------------------------- */
.filters-section {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 26, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.filters-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
}

.filters-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filters-row--second {
  margin-top: 0.45rem;
}

.filter-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  min-width: 58px;
  flex-shrink: 0;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.77rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}

.filter-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.filter-btn.active {
  background: var(--active-col, var(--accent));
  border-color: var(--active-col, var(--accent));
  color: #fff;
  font-weight: 600;
}

/* Search */
.search-wrapper {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.3rem 0.85rem;
  margin-left: auto;
  transition: border-color var(--transition);
}

.search-wrapper:focus-within {
  border-color: var(--accent);
}

.search-icon { font-size: 0.8rem; }

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  width: 175px;
}

.search-input::placeholder { color: var(--text-muted); }

/* --- Main -------------------------------------------------- */
.main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.results-bar {
  margin-bottom: 1.1rem;
}

.results-info {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.results-info strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* --- Games Grid -------------------------------------------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(308px, 1fr));
  gap: 1.1rem;
}

/* --- Game Card --------------------------------------------- */
.game-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  animation: fadeUp 0.3s ease both;
  animation-delay: calc(var(--idx, 0) * 0.035s);
}

.game-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2.5px;
  background: var(--cat-col, var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
  border-radius: 2px 2px 0 0;
}

.game-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.game-card:hover::after {
  transform: scaleX(1);
}

.game-card:focus-visible {
  outline: 2px solid var(--cat-col, var(--accent));
  outline-offset: 2px;
}

/* Team Pick ribbon */
.pick-ribbon {
  position: absolute;
  top: -1px;
  right: -1px;
  background: linear-gradient(135deg, #e94560, #a855f7);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 0 var(--radius-md) 0 var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* Card header row */
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.card-icon {
  font-size: 1.65rem;
  line-height: 1;
  flex-shrink: 0;
}

.card-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.28rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-free {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--col-free);
}

.badge-self {
  background: rgba(79, 195, 247, 0.12);
  border: 1px solid rgba(79, 195, 247, 0.3);
  color: var(--col-self);
}

/* Card body */
.card-title {
  font-size: 1rem;
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta row */
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.73rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.meta-item em {
  font-style: normal;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 500;
}

/* Card footer */
.card-footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.48rem 0.9rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: filter var(--transition), transform var(--transition), background var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--cat-col, var(--accent));
  color: #fff;
  flex: 1;
}

.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.11);
  color: var(--text-primary);
}

/* --- Empty State ------------------------------------------- */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}

.empty-icon { font-size: 2.8rem; margin-bottom: 0.85rem; }
.empty-state p { font-size: 0.9rem; margin-top: 0.4rem; }

/* --- Animations -------------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Responsive -------------------------------------------- */
@media (max-width: 900px) {
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 640px) {
  .header { padding: 2rem 1rem 1.75rem; }

  .filters-inner { padding: 0.6rem 1rem; }

  .filter-label { display: none; }

  .search-wrapper { margin-left: 0; width: 100%; }
  .search-input { width: 100%; flex: 1; }

  .filters-row { gap: 0.35rem; }

  .main { padding: 1rem 1rem 3rem; }

  .games-grid { grid-template-columns: 1fr; }
}
