/* =========================================================
   GameVerse 2026 Edition Cyberpunk Dark UI + Champions
========================================================= */
:root {
  --bg-main: #0a0b10;
  --bg-card: rgba(18, 20, 30, 0.85);
  --bg-elevated: #1a1d2e;
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.35);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --cyan: #00f0ff;
  --purple: #a855f7;
  --pink: #ec4899;
  --yellow: #f59e0b;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
@keyframes bgMove {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}
body {
  background: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(168, 85, 247, 0.2) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(0, 240, 255, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
  background-attachment: fixed;
  background-size: 200% 200%;
  animation: bgMove 15s ease infinite;
  color: var(--text-main);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 60px; /* Space for mobile nav */
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* Container */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(10, 11, 16, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 0;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--cyan), var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-icon {
  font-size: 1.8rem;
  -webkit-text-fill-color: initial;
}

/* Champions Header Badge */
.champions-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(26, 29, 46, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
  font-size: 0.88rem;
  white-space: nowrap;
}
.champ-crown { font-size: 1.1rem; }
.champ-text { color: #e2e8f0; }
.champ-highlight {
  color: #facc15;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
}

/* Search Box */
.search-box {
  position: relative;
  flex: 1;
  max-width: 440px;
}
.search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 10px 16px 10px 42px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
[dir="rtl"] .search-box input {
  padding: 10px 42px 10px 16px;
}
.search-box input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  font-size: 0.9rem;
}
[dir="rtl"] .search-icon {
  left: auto;
  right: 14px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 700;
  color: #e2e8f0;
  transition: var(--transition);
}
.lang-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--cyan);
  color: #fff;
}

.random-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(236, 72, 153, 0.4);
  font-size: 0.88rem;
  font-weight: 700;
  color: #f472b6;
  cursor: pointer;
  transition: var(--transition);
}
.random-btn:hover {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}

/* Hero */
.hero {
  text-align: center;
  padding: 36px 0 20px;
}
.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--cyan);
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}
.hero h1 {
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  line-height: 1.2;
}
.hero p {
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.05rem;
}
.hero-champ-tag {
  color: #facc15;
  font-weight: 800;
}

/* Champions Honor Ribbon */
.champions-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.7), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin: 20px 0 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.ribbon-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ribbon-icon { font-size: 1.8rem; }
.ribbon-title {
  font-weight: 900;
  font-size: 1.05rem;
  color: #fff;
  display: block;
}
.ribbon-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}
.ribbon-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
}

/* Recently Played Carousel */
.recent-section {
  margin-bottom: 24px;
  display: none; /* Shown via JS if history exists */
}
.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.recent-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.recent-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
  text-align: center;
}
.recent-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
}
.recent-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}
.recent-name {
  padding: 6px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Category Filter Bar */
.category-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 4px 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-bar::-webkit-scrollbar { display: none; }
.cat-pill {
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}
.cat-pill:hover, .cat-pill.active {
  background: linear-gradient(135deg, var(--cyan), #0284c7);
  color: #000;
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}
.cat-pill.fav-pill:hover, .cat-pill.fav-pill.active {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  color: #fff;
  border-color: #ec4899;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.game-card {
  position: relative;
  backdrop-filter: blur(10px);
  background: rgba(18, 20, 30, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  animation: cardEntrance 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) backwards;
}
.game-card:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: var(--cyan);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 240, 255, 0.35);
  z-index: 2;
}
.game-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  background: #111420;
  overflow: hidden;
}
.game-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.game-card:hover .game-thumb {
  transform: scale(1.06);
}
.game-cat-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
[dir="rtl"] .game-cat-badge {
  right: auto;
  left: 10px;
}

.game-rating-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.8);
  font-size: 0.75rem;
  font-weight: 800;
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.3);
}
[dir="rtl"] .game-rating-badge {
  left: auto;
  right: 8px;
}

.fav-card-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 0.9rem;
  transition: var(--transition);
  z-index: 2;
}
[dir="rtl"] .fav-card-btn {
  left: auto;
  right: 10px;
}
[dir="rtl"] .game-cat-badge {
  right: auto;
  left: 10px;
}
.fav-card-btn:hover, .fav-card-btn.active {
  background: #ec4899;
  border-color: #ec4899;
  color: #fff;
  transform: scale(1.15);
}

.game-info {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.game-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.play-btn {
  display: block;
  text-align: center;
  background: linear-gradient(135deg, var(--cyan), #0284c7);
  color: #000;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.play-btn:hover {
  box-shadow: 0 0 15px var(--cyan);
  color: #000;
}

/* Game Play Viewport Page */
.play-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 0;
}
.game-frame-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 82vh;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(0, 240, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
}
.game-frame-wrapper.theater {
  max-height: 94vh;
  aspect-ratio: auto;
  height: 94vh;
  border-color: var(--pink);
  box-shadow: 0 0 40px rgba(236, 72, 153, 0.3);
}
.game-frame {
  width: 100%;
  height: 100%;
  border: none;
}
.game-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-card);
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
}
.action-btn:hover {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 12px var(--cyan);
}
.action-btn.active-fav {
  background: #ec4899;
  border-color: #ec4899;
  color: #fff;
}
.action-btn.primary {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff;
  border: none;
}

/* Mobile Bottom Bar */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 11, 16, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  z-index: 999;
  justify-content: space-around;
  align-items: center;
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.mobile-nav-item.active, .mobile-nav-item:hover {
  color: var(--cyan);
}
.mobile-nav-icon {
  font-size: 1.25rem;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: #08090d;
  border-top: 1px solid var(--border);
  padding: 36px 0 20px;
  color: var(--text-muted);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}
.footer-links {
  display: flex;
  gap: 18px;
}

@media (max-width: 768px) {
  body { padding-bottom: 70px; }
  .mobile-nav-bar { display: flex; }
  .hero h1 { font-size: 1.9rem; }
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .game-frame-wrapper { aspect-ratio: 4/3; max-height: 65vh; }
  .header-inner { flex-wrap: wrap; }
  .search-box { order: 3; max-width: 100%; width: 100%; }
  .champions-ribbon { flex-direction: column; gap: 12px; }
  .ribbon-divider { width: 80%; height: 1px; }
}

/* Stagger Animations */
.game-card:nth-child(1) { animation-delay: 0.03s; }
.game-card:nth-child(2) { animation-delay: 0.06s; }
.game-card:nth-child(3) { animation-delay: 0.09s; }
.game-card:nth-child(4) { animation-delay: 0.12s; }
.game-card:nth-child(5) { animation-delay: 0.15s; }
.game-card:nth-child(6) { animation-delay: 0.18s; }
.game-card:nth-child(7) { animation-delay: 0.21s; }
.game-card:nth-child(8) { animation-delay: 0.24s; }
.game-card:nth-child(9) { animation-delay: 0.27s; }
.game-card:nth-child(10) { animation-delay: 0.3s; }
.game-card:nth-child(11) { animation-delay: 0.32999999999999996s; }
.game-card:nth-child(12) { animation-delay: 0.36s; }
.game-card:nth-child(13) { animation-delay: 0.39s; }
.game-card:nth-child(14) { animation-delay: 0.42s; }
.game-card:nth-child(15) { animation-delay: 0.44999999999999996s; }
.game-card:nth-child(16) { animation-delay: 0.48s; }
.game-card:nth-child(17) { animation-delay: 0.51s; }
.game-card:nth-child(18) { animation-delay: 0.54s; }
.game-card:nth-child(19) { animation-delay: 0.57s; }
.game-card:nth-child(20) { animation-delay: 0.6s; }
.game-card:nth-child(21) { animation-delay: 0.63s; }
.game-card:nth-child(22) { animation-delay: 0.6599999999999999s; }
.game-card:nth-child(23) { animation-delay: 0.69s; }
.game-card:nth-child(24) { animation-delay: 0.72s; }
.game-card:nth-child(25) { animation-delay: 0.75s; }
.game-card:nth-child(26) { animation-delay: 0.78s; }
.game-card:nth-child(27) { animation-delay: 0.8099999999999999s; }
.game-card:nth-child(28) { animation-delay: 0.84s; }
.game-card:nth-child(29) { animation-delay: 0.87s; }
.game-card:nth-child(30) { animation-delay: 0.8999999999999999s; }
