/* Import Outfit font */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
  --bg-dark: #05040d;
  --bg-deep: #080617;
  --bg-card: rgba(14, 11, 38, 0.55);
  --border-color: rgba(255, 255, 255, 0.06);
  
  --neon-purple: #7928ca;
  --neon-pink: #ff007f;
  --neon-cyan: #00f2fe;
  --neon-green: #00df89;
  --text-white: #f3f4f6;
  --text-muted: #9ca3af;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  background-image: radial-gradient(circle at 50% 15%, #150933 0%, #05030d 100%);
  color: var(--text-white);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ------------------- HEADER ------------------- */
.portal-header {
  position: sticky;
  top: 0;
  background: rgba(7, 5, 20, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.logo-icon {
  font-size: 1.8rem;
  animation: logo-spin 12s infinite linear;
}

@keyframes logo-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #ffffff 0%, var(--neon-cyan) 50%, var(--neon-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

/* Search Bar */
.search-container {
  flex-grow: 1;
  max-width: 400px;
  position: relative;
  margin: 0 24px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: white;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.25s ease;
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--neon-purple);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.menu-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--neon-purple);
}


/* ------------------- PORTAL CONTAINER ------------------- */
.portal-main {
  flex-grow: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ------------------- FEATURED HERO BANNER ------------------- */
.featured-hero-container {
  width: 100%;
  min-height: 280px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  padding: 40px 80px; /* Increase horizontal padding so content doesn't hit absolute arrows */
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.5s ease;
}

.hero-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 10, 30, 0.7);
  border: 1px solid var(--border-color);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 10;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.hero-carousel-arrow:hover {
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
  color: black;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.5);
  transform: translateY(-50%) scale(1.1);
}

.hero-carousel-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.hero-arrow-left {
  left: 20px;
}

.hero-arrow-right {
  right: 20px;
}

@media (max-width: 768px) {
  .featured-hero-container {
    padding: 24px 48px;
  }
  .hero-carousel-arrow {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
  .hero-arrow-left {
    left: 10px;
  }
  .hero-arrow-right {
    right: 10px;
  }
}

.hero-content {
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  z-index: 5;
  text-align: left;
}

.hero-category {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--neon-cyan);
  background: rgba(6, 182, 212, 0.15);
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.hero-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 2px 8px;
  border-radius: 99px;
}

.btn-hero-play {
  background: white;
  color: black;
  border: none;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(255,255,255,0.25);
}

.btn-hero-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255,255,255,0.4);
}

/* ------------------- HORIZONTAL GAME SHELVES ------------------- */
.category-section {
  width: 100%;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.section-icon {
  font-size: 1.3rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  text-transform: uppercase;
}

.game-shelf {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 8px 4px 20px 4px;
  scrollbar-width: none; /* Hide standard Firefox scrollbar */
  transition: all 0.3s ease;
}

.game-shelf::-webkit-scrollbar {
  display: none; /* Hide Chrome/Safari scrollbar */
}

.game-shelf.expanded-shelf {
  flex-wrap: wrap;
  overflow-x: visible;
  padding-bottom: 8px;
}

.btn-more-games {
  background: transparent;
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--neon-cyan);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.05);
}

.btn-more-games:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
  transform: translateY(-1px);
  color: white;
}

.btn-more-games:active {
  transform: translateY(0) scale(0.97);
}

/* ------------------- GAME CARD ------------------- */
.game-card {
  flex: 0 0 170px;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.25s, box-shadow 0.25s;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--neon-purple);
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.2);
}

.card-image-wrapper {
  aspect-ratio: 1.2;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

.card-icon {
  font-size: 3rem;
  transition: transform 0.3s ease;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
}

.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  top: 0;
  left: 0;
  padding: 2px;
  box-sizing: border-box;
}

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

.card-category-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.5);
  color: #d1d5db;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.05);
}

.card-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.card-rating {
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 800;
}

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

.card-plays {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.card-play-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.game-card:hover .card-play-btn {
  background: var(--neon-purple);
  border-color: var(--neon-purple);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

/* ------------------- SIDEBAR DRAWER ------------------- */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 5, 20, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg-deep);
  border-right: 1px solid var(--border-color);
  z-index: 1001;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 10px 0 30px rgba(0,0,0,0.5);
  text-align: left;
}

.sidebar-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--neon-purple);
}

.drawer-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.drawer-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-white);
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s;
}

.drawer-link:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--neon-purple);
}

.drawer-link-icon {
  font-size: 1.2rem;
}

/* ------------------- GAME PLAYER OVERLAY ------------------- */
.player-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-dark);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.player-overlay.active {
  transform: translateY(0);
}

/* Top bar controls */
.player-header {
  height: 56px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-back-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
}

.player-title {
  font-weight: 800;
  font-size: 1.1rem;
}

.player-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-body {
  flex-grow: 1;
  width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-dark);
}

.player-iframe-container {
  width: 100%;
  height: 65vh;
  min-height: 380px;
  max-height: 600px;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#game-iframe {
  width: 100%;
  height: 100%;
  max-width: 600px; /* Force game frame mobile aspect constraint similar to Gamezop */
  border: none;
  background: #000;
}

/* ------------------- RESPONSIVE VIEWPORTS ------------------- */
@media (max-width: 768px) {
  .portal-header {
    padding: 12px 16px;
    flex-wrap: wrap;
    row-gap: 10px;
  }
  
  .search-container {
    display: block;
    width: 100%;
    max-width: none;
    margin: 4px 0 0 0;
    order: 3;
  }

  .header-left {
    width: 100%;
  }
  
  .portal-main {
    padding: 16px;
    gap: 24px;
  }
  
  .featured-hero-container {
    padding: 24px;
    min-height: 220px;
  }
  
  .hero-title {
    font-size: 1.8rem;
  }
  
  .hero-desc {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .featured-hero-container {
    min-height: 180px;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-desc {
    display: none; /* Hide desc on very small screens */
  }
  
  .game-card {
    flex: 0 0 140px;
  }
  
  .card-icon {
    font-size: 2.2rem;
  }
  
  .card-title {
    font-size: 0.85rem;
  }
}

/* ------------------- PORTAL CUSTOMIZER & ADSENSE ------------------- */
.drawer-divider {
  height: 1px;
  background: var(--border-color);
  margin: 12px 0;
}

.customizer-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 4px;
}

.customizer-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.customizer-input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  color: white;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}

.customizer-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.25);
}

.btn-save {
  background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-blue) 100%);
  color: white;
  border: none;
  padding: 10px;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 0.85rem;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-save:active {
  transform: scale(0.98);
}

/* AdSense Containers */
.ad-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  text-align: center;
  box-sizing: border-box;
}

.ad-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.6rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 6px;
  border-radius: 3px;
  z-index: 10;
}

.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
}

.ad-banner-main {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 12px auto;
}

.ad-sidebar {
  width: 100%;
  max-width: 232px;
  height: 150px; /* custom sizing to fit sidebar perfectly */
  margin-top: auto;
}

.ad-player-banner {
  width: 100%;
  max-width: 100%;
  height: 70px;
  border-top: 1px solid var(--border-color);
  border-radius: 0;
  background: var(--bg-deep);
  border-left: none;
  border-right: none;
  border-bottom: none;
  margin: 0;
  flex-shrink: 0;
}

/* Game player detail card styling */
.player-info-card {
  width: 90%;
  max-width: 600px;
  margin: 20px auto 12px auto;
  padding: 20px;
  text-align: left;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-sizing: border-box;
}

.player-info-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.player-info-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-info-title {
  font-size: 1.3rem;
  font-weight: 800;
  text-transform: uppercase;
}

.player-info-tag {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--neon-cyan);
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

.player-info-stats {
  display: flex;
  gap: 8px;
}

.player-stat-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 6px;
}

.player-info-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 12px;
}

/* Game Player Layout responsive enhancements */
.player-details-column {
  width: 100%;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .player-body {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    gap: 24px;
    height: calc(100vh - 56px);
    box-sizing: border-box;
    overflow: hidden;
  }
  
  .player-iframe-container {
    flex: 1 1 65%;
    height: 100%;
    max-height: none;
    min-height: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  }

  #game-iframe {
    max-width: none;
  }

  .player-details-column {
    flex: 0 0 35%;
    max-width: 380px;
    padding: 0;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none; /* Hide scrollbar for cleaner look */
  }
  
  .player-details-column::-webkit-scrollbar {
    display: none;
  }
}
.player-related-games {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 16px;
  margin-top: 8px;
}

.related-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.related-shelf {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 4px;
  scrollbar-width: none; /* Hide Firefox scrollbar */
}

.related-shelf::-webkit-scrollbar {
  display: none; /* Hide Chrome/Safari scrollbar */
}

.related-shelf .game-card {
  flex: 0 0 140px; /* Make related cards slightly smaller to fit sidebar neatly */
  border-radius: 12px;
}

.related-shelf .card-image-wrapper {
  height: 80px;
}

.related-shelf .card-icon {
  font-size: 1.8rem;
}

.related-shelf .card-info {
  padding: 8px;
}

.related-shelf .card-title {
  font-size: 0.75rem;
}

.related-shelf .card-plays,
.related-shelf .card-rating,
.related-shelf .card-play-btn {
  display: none; /* Hide stats in mini cards to save space */
}

/* Related Games Carousel slide controls */
.related-carousel-wrapper {
  position: relative;
  width: 100%;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(14, 11, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  z-index: 10;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.carousel-arrow:hover {
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
  color: black;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.45);
  transform: translateY(-50%) scale(1.08);
}

.carousel-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.arrow-left {
  left: -12px;
}

.arrow-right {
  right: -12px;
}

/* Rewarded Ad Modal CSS styling */
.rewarded-ad-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 100;
  display: none; /* Controlled by js */
  align-items: center;
  justify-content: center;
}

.rewarded-ad-overlay.active {
  display: flex;
}

.rewarded-ad-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  background: radial-gradient(circle at center, #110e2e 0%, #030209 100%);
  color: white;
  box-sizing: border-box;
}

.rewarded-ad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ad-logo {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ad-countdown-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
}

.rewarded-video-placeholder {
  flex-grow: 1;
  margin: 16px 0;
  background: #000;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.rewarded-video-placeholder::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(0, 242, 254, 0.15) 50%, transparent 60%);
  animation: shine 4s infinite linear;
}

@keyframes shine {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.video-play-indicator {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid var(--neon-pink);
  border-top-color: transparent;
  animation: spin 1s infinite linear;
}

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

.rewarded-ad-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Game Loading Splash Screen Overlay */
.game-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #0e0a29 0%, #030209 100%);
  z-index: 90; /* Right below rewarded ad (z-index 100) but above iframe */
  display: none; /* Controlled by js */
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.game-loading-overlay.active {
  display: flex;
}

.loading-splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.loading-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-logo-icon {
  font-size: 3rem;
  animation: logo-bounce 2s infinite ease-in-out;
}

@keyframes logo-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); text-shadow: 0 10px 20px rgba(0, 242, 254, 0.4); }
}

.loading-logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #fff 0%, var(--neon-cyan) 50%, var(--neon-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.loading-spinner-container {
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner-ring {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top: 3px solid var(--neon-cyan);
  border-bottom: 3px solid var(--neon-pink);
  border-radius: 50%;
  animation: spin-double 1.2s infinite linear;
}

@keyframes spin-double {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-message {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0;
  animation: pulse-light 1.5s infinite alternate;
}

@keyframes pulse-light {
  0% { opacity: 0.5; }
  100% { opacity: 0.9; }
}

/* Category Explorer Overlay Page */
.explorer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  background-image: radial-gradient(circle at 50% 15%, #150933 0%, #05030d 100%);
  z-index: 80; /* Below player overlay (90) but above lobby main list */
  transform: translateX(100%); /* Slides from right */
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.explorer-overlay.active {
  transform: translateX(0);
}

.explorer-header {
  height: 64px;
  background: rgba(7, 5, 20, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  z-index: 10;
  flex-shrink: 0;
  box-sizing: border-box;
}

.explorer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.explorer-back-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, color 0.2s;
}

.explorer-back-btn:hover {
  transform: translateX(-4px);
  color: var(--neon-cyan);
}

.explorer-title {
  font-weight: 800;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  background: linear-gradient(to right, #fff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.explorer-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 32px 24px;
  box-sizing: border-box;
}

.explorer-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 768px) {
  .explorer-header {
    padding: 0 16px;
  }
  .explorer-body {
    padding: 24px 16px;
  }
  .explorer-games-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
  }
}
