/* ==========================================================================
   VERTEX ARCADE - MODERN GAMING HUB STYLESHEET
   Dark Cyberpunk Theme with Motion Video Background & Glassmorphism UI
   ========================================================================== */

:root {
  --bg-dark: #090c15;
  --bg-card: rgba(18, 24, 38, 0.72);
  --bg-card-hover: rgba(26, 36, 60, 0.88);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(0, 243, 255, 0.45);
  
  --neon-cyan: #00f3ff;
  --neon-purple: #9d4edd;
  --neon-pink: #ff2a85;
  --neon-green: #00ff88;
  --neon-amber: #ffaa00;
  
  --text-primary: #f0f4fc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-main: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-display: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-neon: 0 0 20px rgba(0, 243, 255, 0.35);
  --shadow-purple: 0 0 20px rgba(157, 78, 221, 0.4);
  
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 11, 20, 0.85);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
}

/* ==========================================================================
   VIDEO BACKGROUND & OVERLAYS
   ========================================================================== */

#bg-video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

#bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  transition: filter 0.4s ease, opacity 0.4s ease;
}

#bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: radial-gradient(circle at 50% 20%, rgba(9, 12, 21, 0.45) 0%, rgba(5, 7, 12, 0.88) 80%, rgba(3, 4, 7, 0.96) 100%),
              linear-gradient(180deg, rgba(0, 243, 255, 0.03) 0%, transparent 40%);
  pointer-events: none;
  backdrop-filter: blur(2px);
  transition: opacity 0.3s ease;
}

body.dimmed #bg-overlay {
  background: rgba(4, 6, 12, 0.94);
  backdrop-filter: blur(8px);
}

/* ==========================================================================
   APP HEADER & NAVBAR
   ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(9, 12, 21, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
  transition: var(--transition);
}

.brand:hover .brand-icon {
  transform: rotate(10deg) scale(1.05);
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.7);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ffffff 40%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--neon-cyan);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  user-select: none;
  background: transparent;
  color: var(--text-primary);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-neon {
  background: linear-gradient(135deg, var(--neon-cyan), #0099ff);
  color: #05070d;
  font-weight: 700;
  border: none;
  box-shadow: 0 0 16px rgba(0, 243, 255, 0.35);
}

.btn-neon:hover {
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.65);
  transform: translateY(-2px);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

.badge-count {
  background: var(--neon-pink);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  margin-left: 0.25rem;
}

/* ==========================================================================
   HERO & SEARCH SECTION
   ========================================================================== */

.hero {
  padding: 3rem 1.5rem 1.5rem;
  max-width: 1300px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  background: rgba(0, 243, 255, 0.08);
  border: 1px solid rgba(0, 243, 255, 0.25);
  border-radius: var(--radius-full);
  color: var(--neon-cyan);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.hero-tag-pulse {
  width: 8px;
  height: 8px;
  background: var(--neon-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--neon-cyan);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
  background: linear-gradient(135deg, #ffffff 40%, #cbd5e1 70%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 680px;
  margin-bottom: 2rem;
}

/* Search Bar */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 660px;
  margin-bottom: 1.8rem;
}

.search-input {
  width: 100%;
  padding: 1rem 3.5rem 1rem 3.4rem;
  background: rgba(18, 24, 38, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 1.05rem;
  outline: none;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  border-color: var(--neon-cyan);
  background: rgba(22, 30, 48, 0.95);
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.25);
}

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

.search-icon-left {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

.search-hotkey {
  position: absolute;
  right: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.search-clear-btn:hover {
  background: var(--neon-pink);
  color: #fff;
}

/* Category Filter Pills */
.category-filter-container {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 1rem;
  scrollbar-width: thin;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 0.5rem 1.1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.filter-pill.active {
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.2), rgba(157, 78, 221, 0.25));
  border-color: var(--neon-cyan);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(0, 243, 255, 0.3);
}

/* ==========================================================================
   SUB-BAR & CONTROLS
   ========================================================================== */

.subbar {
  max-width: 1300px;
  margin: 0 auto 1.5rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.results-count strong {
  color: var(--neon-cyan);
  font-weight: 700;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sort-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.sort-select {
  background: rgba(18, 24, 38, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.sort-select:focus {
  border-color: var(--neon-cyan);
}

/* ==========================================================================
   GAMES GRID
   ========================================================================== */

.games-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.35rem;
}

.game-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.3s ease, 
              box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  user-select: none;
}

.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--card-border-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 243, 255, 0.22);
}

.game-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0f1422;
  overflow: hidden;
}

.game-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.game-card:hover .game-card-img {
  transform: scale(1.08);
}

/* Fallback badge avatar */
.game-card-fallback-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, #131a2c, #0a0e19);
  color: #fff;
  transition: var(--transition);
}

.fallback-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.4));
}

.fallback-initials {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  opacity: 0.85;
}

.game-fav-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 32px;
  height: 32px;
  background: rgba(9, 12, 21, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: var(--transition);
  z-index: 5;
}

.game-fav-btn:hover {
  background: rgba(255, 42, 133, 0.25);
  color: var(--neon-pink);
  border-color: var(--neon-pink);
  transform: scale(1.15);
}

.game-fav-btn.active {
  background: var(--neon-pink);
  color: #fff;
  border-color: var(--neon-pink);
  box-shadow: 0 0 12px var(--neon-pink);
}

.game-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 7, 13, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.game-card:hover .game-card-overlay {
  opacity: 1;
}

.play-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: var(--neon-cyan);
  color: #05070d;
  font-weight: 800;
  font-size: 0.82rem;
  border-radius: var(--radius-full);
  box-shadow: 0 0 15px var(--neon-cyan);
  transform: scale(0.9);
  transition: var(--transition);
}

.game-card:hover .play-badge {
  transform: scale(1);
}

.game-card-info {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.game-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-category-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--neon-cyan);
  background: rgba(0, 243, 255, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.game-flash-tag {
  color: var(--neon-amber);
  background: rgba(255, 170, 0, 0.12);
}

.game-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

/* Empty State */
.no-games-found {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.no-games-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: block;
}

/* Load More Loader */
.load-more-container {
  text-align: center;
  margin-top: 2rem;
}

/* ==========================================================================
   IN-PORTAL THEATER GAME PLAYER MODAL
   ========================================================================== */

.player-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.player-modal.active {
  display: flex;
  opacity: 1;
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(14, 19, 31, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-game-details {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.player-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.player-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.player-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--neon-cyan);
  color: #fff;
}

.player-btn-close {
  background: rgba(255, 42, 133, 0.15);
  border-color: rgba(255, 42, 133, 0.3);
  color: var(--neon-pink);
}

.player-btn-close:hover {
  background: var(--neon-pink);
  color: #fff;
  border-color: var(--neon-pink);
}

.player-frame-wrapper {
  flex: 1;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.player-spinner {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 4px solid rgba(0, 243, 255, 0.15);
  border-top-color: var(--neon-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  pointer-events: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 243, 255, 0.25);
  backdrop-filter: blur(16px);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast.show {
  transform: translateX(0);
}

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

.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 12, 21, 0.8);
  backdrop-filter: blur(12px);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-content {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

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

/* Responsive Tweaks */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
  }
  .brand-title {
    font-size: 1.1rem;
  }
  .hero {
    padding: 2rem 1rem 1rem;
  }
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
  .player-topbar {
    padding: 0.6rem 1rem;
  }
}
