/* ==========================================================================
   GAMEVERSE PRIME - ARCADE & GAMING PORTAL STYLESHEET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Neon Arcade Palette */
  --bg-dark: #070913;
  --bg-surface: #0e1322;
  --bg-surface-hover: #161e36;
  --bg-card: #12182b;
  --glass-bg: rgba(14, 19, 34, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-pink: #ff007f;
  --accent-purple: #9d4edd;
  --accent-gold: #ffd700;
  --accent-green: #00ff87;

  --text-primary: #f8fafc;
  --text-secondary: #a0aec0;
  --text-muted: #64748b;

  --gradient-neon: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  --gradient-hot: linear-gradient(135deg, #ff007f, #9d4edd);
  --gradient-gold: linear-gradient(135deg, #ffd700, #ff8c00);
  --gradient-green: linear-gradient(135deg, #00ff87, #60efff);
  --gradient-dark: linear-gradient(180deg, rgba(7, 9, 19, 0) 0%, rgba(7, 9, 19, 0.95) 85%, #070913 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-neon: 0 0 25px rgba(0, 242, 254, 0.3);
  --shadow-pink: 0 0 25px rgba(255, 0, 127, 0.3);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.6);

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* Heading Font */
h1, h2, h3, .brand-logo, .hero-title, .game-card-title, .btn-play-game {
  font-family: 'Orbitron', sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Layout Utilities */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Global Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(7, 9, 19, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition-normal);
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.brand-logo span.gameverse {
  background: var(--gradient-neon);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.brand-logo span.badge-prime {
  background: var(--gradient-gold);
  color: #000;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.nav-links {
  display: flex;
  gap: 1.8rem;
  list-style: none;
}

.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-cyan);
  text-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

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

/* Search Bar */
.search-box {
  position: relative;
  width: 260px;
  transition: var(--transition-normal);
}

.search-box:focus-within {
  width: 320px;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.9rem;
}

.btn-favorites {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  padding: 0.6rem 1rem;
  border-radius: 30px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition-fast);
}

.btn-favorites:hover {
  background: rgba(255, 0, 127, 0.15);
  border-color: var(--accent-pink);
  color: var(--accent-pink);
}

.fav-counter {
  background: var(--accent-pink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
}

/* ==========================================================================
   ADVERTS CONTAINERS (AdSense & Adsterra Placement Ready)
   ========================================================================== */
.ad-slot-wrapper {
  margin: 1.5rem auto;
  text-align: center;
  position: relative;
  width: 100%;
}

.ad-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.ad-box {
  background: rgba(14, 19, 34, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  position: relative;
  overflow: hidden;
}

.ad-box-leaderboard {
  min-height: 90px;
  max-width: 970px;
  margin: 0 auto;
}

.ad-box-grid {
  min-height: 220px;
  max-width: 100%;
}

.ad-placeholder-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 1rem;
}

.ad-placeholder-info i {
  color: var(--accent-gold);
  font-size: 1.2rem;
}

/* Sticky Bottom Ad Bar */
.ad-sticky-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  background: rgba(7, 9, 19, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--glass-border);
  box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.8);
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ad-sticky-bottom.hidden {
  transform: translateY(100%);
}

.btn-close-ad {
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: var(--transition-fast);
}

.btn-close-ad:hover {
  background: #ff3b30;
  color: #fff;
}

/* Hero Carousel */
.hero-slider {
  position: relative;
  width: 100%;
  height: 480px;
  margin-bottom: 2rem;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
  background-size: cover;
  background-position: center;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #070913 0%, rgba(7, 9, 19, 0.85) 50%, rgba(7, 9, 19, 0.3) 100%),
              linear-gradient(0deg, #070913 0%, rgba(7, 9, 19, 0) 50%);
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 680px;
  padding: 0 1.5rem;
}

.hero-badge-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.badge-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-category {
  background: var(--gradient-neon);
  color: #000;
}

.badge-rating {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -1px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.hero-description {
  color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-play-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--gradient-neon);
  color: #000;
  font-weight: 900;
  font-size: 1.1rem;
  padding: 0.9rem 2.2rem;
  border-radius: 30px;
  transition: var(--transition-fast);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.5);
  letter-spacing: 0.5px;
}

.btn-play-hero:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 0 35px rgba(255, 0, 127, 0.6);
}

/* Slider Controls */
.slider-nav {
  position: absolute;
  bottom: 2rem;
  right: 3rem;
  z-index: 10;
  display: flex;
  gap: 0.6rem;
}

.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: var(--transition-fast);
}

.slider-dot.active {
  background: var(--accent-cyan);
  width: 32px;
  border-radius: 10px;
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Category Filters Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.genre-chips {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}

.genre-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 0.6rem 1.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: 25px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chip:hover, .chip.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title i {
  color: var(--accent-pink);
}

/* Games Grid Layout */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Game Card Component */
.game-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 0, 127, 0.5);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 0, 127, 0.25);
}

.game-thumb-wrapper {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  overflow: hidden;
  background: #000;
}

.game-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.game-badge-category {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

.game-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 19, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.btn-play-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-neon);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.7);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

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

.btn-favorite-card {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-favorite-card.active, .btn-favorite-card:hover {
  background: var(--accent-pink);
  color: #fff;
}

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

.game-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.game-card-rating {
  color: var(--accent-gold);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ==========================================================================
   GAME MODAL & INTERACTIVE CANVAS VIEWPORT
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(4, 6, 12, 0.95);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 1rem;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-window {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1100px;
  max-height: 94vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9);
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: #ff3b30;
  transform: rotate(90deg);
}

/* Game Viewport Box */
.game-viewport-box {
  position: relative;
  width: 100%;
  height: 520px;
  background: #000;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.game-canvas {
  background: #05070e;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  max-width: 100%;
  max-height: 100%;
}

/* Pre-Game Interstitial Ad Overlay */
.pre-game-ad-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(7, 9, 19, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.ad-timer-badge {
  background: var(--gradient-gold);
  color: #000;
  font-weight: 800;
  font-size: 1rem;
  padding: 8px 18px;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.btn-skip-ad {
  background: var(--gradient-neon);
  color: #000;
  font-weight: 800;
  padding: 0.8rem 1.8rem;
  border-radius: 30px;
  margin-top: 1rem;
  display: none;
}

.game-toolbar {
  background: #090d18;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
}

.game-title-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.btn-fullscreen {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.btn-fullscreen:hover {
  background: var(--accent-cyan);
  color: #000;
}

/* Game Info & Controls Guide */
.game-info-body {
  padding: 1.8rem;
}

.game-controls-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-top: 1rem;
}

.controls-title {
  font-size: 0.9rem;
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

/* Footer */
.footer {
  margin-top: auto;
  background: #04060c;
  border-top: 1px solid var(--glass-border);
  padding: 3rem 0 2rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-disclaimer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
}

/* Media Queries */
@media (max-width: 992px) {
  .hero-slider {
    height: 400px;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .game-viewport-box {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .navbar-container {
    height: 66px;
  }
  .nav-links {
    display: none;
  }
  .search-box {
    width: 180px;
  }
  .hero-title {
    font-size: 1.6rem;
  }
  .hero-description {
    display: none;
  }
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
  .game-viewport-box {
    height: 320px;
  }
}
