/* =============================================
   WangLuo Games – Main Stylesheet
   Vibrant, colorful, CrazyGames-inspired
   ============================================= */

:root {
  --bg-main:      #0d0f1a;
  --bg-card:      #161928;
  --bg-card-hover:#1e2235;
  --bg-header:    #0a0c14;
  --accent1:      #ff4d6d;
  --accent2:      #7c3aed;
  --accent3:      #06b6d4;
  --accent4:      #f59e0b;
  --accent5:      #10b981;
  --gradient1:    linear-gradient(135deg, #ff4d6d, #7c3aed);
  --gradient2:    linear-gradient(135deg, #06b6d4, #7c3aed);
  --gradient3:    linear-gradient(135deg, #f59e0b, #ff4d6d);
  --gradient4:    linear-gradient(135deg, #10b981, #06b6d4);
  --text-main:    #f0f2ff;
  --text-muted:   #8892b0;
  --border:       rgba(255,255,255,0.07);
  --shadow:       0 8px 32px rgba(0,0,0,0.4);
  --radius:       14px;
  --radius-sm:    8px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-main);
  color: var(--text-main);
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

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

img { max-width: 100%; display: block; }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.logo-icon { font-size: 1.8rem; }

.logo-text {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.logo-accent {
  background: var(--gradient1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.main-nav {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.main-nav a {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.2s;
  white-space: nowrap;
}

.main-nav a:hover {
  color: var(--text-main);
  background: var(--border);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.search-bar:focus-within { border-color: var(--accent2); }

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-main);
  padding: 0.5rem 1rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  width: 180px;
}

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

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  transition: transform 0.2s;
}

.search-btn:hover { transform: scale(1.2); }

.lang-switcher {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-card);
  border-radius: 50px;
  padding: 0.25rem;
  border: 1px solid var(--border);
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0.7rem;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.lang-btn:hover,
.lang-btn.active {
  background: var(--gradient1);
  color: #fff;
}

/* ===== HERO BANNER ===== */
.hero-banner {
  position: relative;
  background: linear-gradient(135deg, #0d0f1a 0%, #1a0a2e 50%, #0a1628 100%);
  padding: 5rem 2rem 4rem;
  text-align: center;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(124,58,237,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(255,77,109,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 80%, rgba(6,182,212,0.1) 0%, transparent 60%);
}

.hero-content { position: relative; z-index: 2; }

.hero-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, #ff4d6d 40%, #7c3aed 80%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-search {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 2px solid var(--accent2);
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(124,58,237,0.3);
}

.hero-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-main);
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
}

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

.hero-search button {
  background: var(--gradient1);
  border: none;
  color: #fff;
  padding: 1rem 1.75rem;
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.hero-search button:hover { opacity: 0.85; }

/* Floating bubbles */
.hero-bubbles { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.bubble {
  position: absolute;
  font-size: 2.5rem;
  opacity: 0.15;
  animation: floatBubble 6s ease-in-out infinite;
}
.b1 { top: 10%; left: 5%;  animation-delay: 0s;   font-size:3rem; }
.b2 { top: 70%; left: 10%; animation-delay: 1.5s; font-size:2rem; }
.b3 { top: 20%; right: 8%; animation-delay: 0.8s; font-size:3.5rem; }
.b4 { top: 65%; right: 5%; animation-delay: 2s;   font-size:2.5rem; }
.b5 { top: 40%; left: 50%; animation-delay: 3s;   font-size:2rem; }

@keyframes floatBubble {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-20px) rotate(10deg); }
}

/* ===== ADS ===== */
.ad-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0;
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ad-banner { min-height: 110px; }

/* ===== CONTAINER ===== */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== CATEGORY NAV PILLS ===== */
.category-nav {
  padding: 1.5rem 0;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
}

.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.2s;
  white-space: nowrap;
}

.cat-pill:hover {
  border-color: var(--accent2);
  color: var(--text-main);
  transform: translateY(-2px);
}

.cat-pill.active {
  background: var(--gradient1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 15px rgba(255,77,109,0.4);
}

/* ===== GAMES SECTION ===== */
.games-section { padding: 3rem 0 1rem; }

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

.section-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.8rem;
  color: var(--text-main);
}

.fire { animation: flicker 1s ease-in-out infinite alternate; }
@keyframes flicker { from { opacity:1; } to { opacity:0.6; } }

.see-all {
  font-weight: 700;
  color: var(--accent3);
  font-size: 0.95rem;
  transition: color 0.2s;
}
.see-all:hover { color: var(--accent1); }

/* ===== GAMES GRID ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.2rem;
}

.games-grid-large {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ===== GAME CARD ===== */
.game-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.25s;
  cursor: pointer;
  position: relative;
}

.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent2);
  box-shadow: 0 16px 40px rgba(124,58,237,0.3);
}

.game-card-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-card-hover);
}

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

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

.game-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
}

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

.play-btn {
  background: var(--gradient1);
  color: #fff;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  cursor: pointer;
  transform: scale(0.8);
  transition: transform 0.2s;
}

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

.game-card-cat-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-card-body {
  padding: 0.75rem 0.9rem;
}

.game-card-title {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.game-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
}

/* category color coding */
.cat-badge-action    { background: rgba(255,77,109,0.85); }
.cat-badge-puzzle    { background: rgba(124,58,237,0.85); }
.cat-badge-casual    { background: rgba(16,185,129,0.85); }
.cat-badge-sports    { background: rgba(245,158,11,0.85); }
.cat-badge-shooting  { background: rgba(239,68,68,0.85); }
.cat-badge-racing    { background: rgba(6,182,212,0.85); }
.cat-badge-adventure { background: rgba(168,85,247,0.85); }

/* ===== GAME PAGE ===== */
.game-page { padding: 2rem 0; }

.game-layout {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  gap: 1.5rem;
  align-items: start;
}

.ad-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  justify-content: center;
}

.game-main { min-width: 0; }

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a { color: var(--accent3); }
.breadcrumb a:hover { color: var(--accent1); }

.game-title {
  font-family: 'Fredoka One', cursive;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.game-frame-wrapper {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: 0 0 40px rgba(124,58,237,0.2);
  margin-bottom: 1rem;
}

.game-frame-inner {
  position: relative;
  aspect-ratio: 16/9;
  width: 100%;
}

.game-frame-inner iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.fullscreen-btn {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--border);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-btn:hover { background: var(--accent2); }

.game-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.game-meta { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.game-tag {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
}

.play-btn-big {
  background: var(--gradient1);
  color: #fff;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,77,109,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.play-btn-big:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255,77,109,0.5);
}

.game-description {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tag-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.tag-chip:hover {
  border-color: var(--accent3);
  color: var(--accent3);
}

.related-section { margin-top: 2rem; }
.related-section h3 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-size: 0.9rem;
  max-width: 280px;
}

.footer-links h4 {
  font-family: 'Fredoka One', cursive;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.footer-links a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent3); }

.footer-bottom {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-bottom a { color: var(--accent3); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .game-layout { grid-template-columns: 1fr; }
  .ad-sidebar { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .header-inner { gap: 1rem; }
  .main-nav { display: none; }
  .search-bar { display: none; }
  .hero-banner { padding: 3rem 1.5rem 2.5rem; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.9rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .ad-banner ins { width: 320px !important; height: 50px !important; }
}

@media (max-width: 480px) {
  .cat-pills { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.5rem; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .lang-btn { padding: 0.3rem 0.5rem; font-size: 0.7rem; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--bg-card-hover); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

/* ===== LOADING SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
