/* =============================================
   home.css — Homepage Specific Styles
   Mini Games Hub — Premium Gaming UI
   ============================================= */

/* =============================================
   HERO SECTION
   ============================================= */
.hero-section {
  position: relative;
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-20) var(--space-8);
  overflow: hidden;
  background: var(--grad-hero);
}

/* Background particles */
.hero-bg-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.07;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.07; }
  90%  { opacity: 0.07; }
  100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* Gradient orbs */
.hero-section::before,
.hero-section::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

.hero-section::before {
  width: 650px; height: 650px;
  background: radial-gradient(circle, rgba(0,212,255,0.12) 0%, transparent 70%);
  top: -120px; left: -120px;
}

.hero-section::after {
  width: 550px; height: 550px;
  background: radial-gradient(circle, rgba(155,93,229,0.1) 0%, transparent 70%);
  bottom: -80px; right: -80px;
}

/* Hero Content */
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 620px;
  animation: fadeInUp 0.8s ease;
}

/* Hero badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.3);
  color: var(--clr-neon-blue);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-6);
  animation: pulse 3s ease infinite;
}
.hero-badge i { font-size: 0.85rem; }

/* Hero title */
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 4.2rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -1px;
  margin-bottom: var(--space-5);
  text-transform: uppercase;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--clr-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-8);
  max-width: 490px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
}

/* Hero stats */
.hero-stats {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--clr-neon-blue);
  line-height: 1;
  text-shadow: 0 0 20px rgba(0,212,255,0.5);
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: var(--space-1);
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--clr-border);
}

/* Hero visual — floating icon cards */
.hero-visual {
  position: relative;
  z-index: 1;
  width: 320px;
  height: 360px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-brand-poster {
  width: 240px;
  height: 240px;
  border-radius: 32px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35), 0 0 40px rgba(0,212,255,0.16);
  animation: float 7s ease-in-out infinite;
}

.hero-brand-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.floating-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: default;
  transition: all var(--transition-base);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.floating-card i {
  font-size: 1.2rem;
  width: 22px;
  text-align: center;
}

.floating-card:hover { transform: scale(1.06); }

.card-snake {
  top: 10px; left: 5%;
  background: rgba(0,245,160,0.1);
  border: 1px solid rgba(0,245,160,0.3);
  color: var(--clr-neon-green);
  box-shadow: 0 0 20px rgba(0,245,160,0.1);
  animation: float 5.5s ease-in-out infinite;
}

.card-memory {
  top: 45%; right: 0;
  background: rgba(155,93,229,0.12);
  border: 1px solid rgba(155,93,229,0.3);
  color: var(--clr-neon-purple);
  box-shadow: 0 0 20px rgba(155,93,229,0.1);
  animation: float 6.5s ease-in-out infinite 1.5s;
}

.card-tetris {
  bottom: 10px; left: 8%;
  background: rgba(247,37,133,0.1);
  border: 1px solid rgba(247,37,133,0.3);
  color: var(--clr-neon-pink);
  box-shadow: 0 0 20px rgba(247,37,133,0.1);
  animation: float 5s ease-in-out infinite 3s;
}

/* =============================================
   SEARCH SECTION
   ============================================= */
.search-section {
  padding: var(--space-6) 0 var(--space-4);
  position: sticky;
  top: var(--nav-height);
  z-index: 90;
  background: rgba(13,13,26,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--clr-border);
}

.search-wrapper {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
}

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

.search-wrapper:focus-within .search-icon-wrap {
  color: var(--clr-neon-blue);
}

.search-input {
  width: 100%;
  padding: 13px 44px 13px 42px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-full);
  color: var(--clr-text-primary);
  font-size: var(--text-base);
  font-weight: 500;
  transition: all var(--transition-base);
  outline: none;
  backdrop-filter: blur(8px);
}

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

.search-input:focus {
  border-color: var(--clr-neon-blue);
  background: rgba(0,212,255,0.04);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.12), var(--shadow-glow-blue);
}

.search-clear {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-muted);
  cursor: pointer;
  font-size: 0.65rem;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
}

.search-clear.visible {
  opacity: 1;
  pointer-events: auto;
}
.search-clear:hover {
  background: rgba(255,255,255,0.12);
  color: var(--clr-text-primary);
}

/* =============================================
   GAMES SECTION
   ============================================= */
.games-section {
  padding: var(--space-16) 0;
}

/* Games grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
}

/* ── GAME CARD ── */
.game-card {
  position: relative;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  transition: all var(--transition-bounce);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeInUp 0.6s ease both;
}

.game-card:hover {
  transform: translateY(-10px);
  border-color: var(--clr-border-hover);
  box-shadow: var(--shadow-glow-card);
}

/* Card glow orb */
.card-glow {
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.08;
  transition: opacity var(--transition-base);
  pointer-events: none;
}
.game-card:hover .card-glow { opacity: 0.2; }

/* Glow colours per game */
.glow-green   { background: #00f5a0; }
.glow-purple  { background: #9b5de5; }
.glow-orange  { background: #ff9500; }
.glow-cyan    { background: #00d4ff; }
.glow-yellow  { background: #f7c948; }
.glow-red     { background: #ff4757; }
.glow-pink    { background: #f72585; }
.glow-blue    { background: #4361ee; }
.glow-lime    { background: #a8ff3e; }
.glow-teal    { background: #00cfc8; }

/* Card shine overlay */
.card-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 55%);
  pointer-events: none;
  border-radius: inherit;
}

/* Thumbnail */
.card-thumb {
  position: relative;
  margin: 0;
  width: 100%;
  height: 155px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(6, 10, 22, 0.7), rgba(6, 10, 22, 0.95));
}

.card-thumb::before {
  content: '';
  position: absolute;
  inset: -12%;
  background-image: var(--thumb-bg);
  background-size: cover;
  background-position: center;
  filter: blur(20px) saturate(1.25);
  opacity: 0.6;
  transform: scale(1.12);
  transition: transform 0.5s ease, opacity 0.5s ease;
  pointer-events: none;
}

.card-thumb img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0.4rem;
  transition: transform 0.5s ease, filter 0.5s ease;
  filter: brightness(0.88) saturate(1.05) drop-shadow(0 10px 24px rgba(0,0,0,0.28));
  display: block;
}

.game-card:hover .card-thumb::before {
  transform: scale(1.18);
  opacity: 0.78;
}

.game-card:hover .card-thumb img {
  transform: scale(1.08);
  filter: brightness(0.98) saturate(1.12) drop-shadow(0 12px 28px rgba(0,0,0,0.36));
}

/* Colour overlay on thumbnail */
.card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    var(--thumb-overlay, rgba(0,212,255,0.15)) 0%,
    rgba(13,13,26,0.25) 52%,
    rgba(13,13,26,0.72) 100%
  );
  pointer-events: none;
}

/* Inner content wrapper */
.card-inner {
  padding: var(--space-5) var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  flex: 1;
}

/* Card header row */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.game-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--icon-bg, rgba(0,212,255,0.12));
  border: 1px solid var(--icon-border, rgba(0,212,255,0.25));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--icon-color, var(--clr-neon-blue));
  flex-shrink: 0;
  transition: all var(--transition-bounce);
  box-shadow: 0 2px 12px var(--icon-glow, rgba(0,212,255,0.2));
}
.game-card:hover .game-icon-wrap {
  transform: scale(1.12) rotate(5deg);
  box-shadow: 0 4px 24px var(--icon-glow, rgba(0,212,255,0.4));
}

.card-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
}

/* Card body */
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.game-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--clr-text-primary);
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.game-desc {
  font-size: var(--text-sm);
  color: var(--clr-text-secondary);
  line-height: 1.6;
}

/* Meta row */
.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.meta-item {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.meta-item i {
  font-size: 0.75rem;
  color: var(--icon-color, var(--clr-neon-blue));
  opacity: 0.8;
}

/* Score preview */
.game-score-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  background: rgba(0,0,0,0.25);
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
}

.score-label {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  font-weight: 500;
}

.score-value {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--icon-color, var(--clr-neon-blue));
  text-shadow: 0 0 10px currentColor;
}

/* Card footer */
.card-footer {
  margin-top: auto;
}

/* No-results */
.no-results {
  text-align: center;
  padding: var(--space-20) 0;
  color: var(--clr-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.no-results i { font-size: 3.5rem; color: var(--clr-text-muted); opacity: 0.5; }
.no-results p  { font-size: var(--text-lg); }

.game-card.hidden { display: none; }

/* =============================================
   FEATURES SECTION
   ============================================= */
.features-section {
  padding: var(--space-16) 0;
  background: linear-gradient(180deg, var(--clr-bg-primary) 0%, var(--clr-bg-secondary) 100%);
  border-top: 1px solid var(--clr-border);
  border-bottom: 1px solid var(--clr-border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
}

.feature-card {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  transition: all var(--transition-bounce);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.feature-card:hover {
  transform: translateY(-8px);
  border-color: var(--clr-border-hover);
  box-shadow: var(--shadow-glow-blue);
}

.feature-icon-wrap {
  width: 62px;
  height: 62px;
  border-radius: var(--radius-xl);
  margin: 0 auto var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  animation: float 5.5s ease-in-out infinite;
}

.feature-icon-wrap.icon-blue   { background:rgba(0,212,255,0.12);  border:1px solid rgba(0,212,255,0.3);  color:var(--clr-neon-blue);   box-shadow:0 0 20px rgba(0,212,255,0.15); }
.feature-icon-wrap.icon-purple { background:rgba(155,93,229,0.12); border:1px solid rgba(155,93,229,0.3); color:var(--clr-neon-purple); box-shadow:0 0 20px rgba(155,93,229,0.15); }
.feature-icon-wrap.icon-green  { background:rgba(0,245,160,0.12);  border:1px solid rgba(0,245,160,0.3);  color:var(--clr-neon-green);  box-shadow:0 0 20px rgba(0,245,160,0.15); }
.feature-icon-wrap.icon-orange { background:rgba(255,149,0,0.12);  border:1px solid rgba(255,149,0,0.3);  color:var(--clr-neon-orange); box-shadow:0 0 20px rgba(255,149,0,0.15); }

.feature-card:nth-child(1) .feature-icon-wrap { animation-delay: 0s; }
.feature-card:nth-child(2) .feature-icon-wrap { animation-delay: 1.3s; }
.feature-card:nth-child(3) .feature-icon-wrap { animation-delay: 2.6s; }
.feature-card:nth-child(4) .feature-icon-wrap { animation-delay: 3.9s; }

.feature-card h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--clr-text-primary);
}

.feature-card p {
  font-size: var(--text-sm);
  color: var(--clr-text-secondary);
  line-height: 1.65;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .hero-section {
    gap: var(--space-10);
  }
  .hero-visual {
    width: 260px;
    height: 300px;
  }
}

@media (max-width: 860px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
    padding: var(--space-12) var(--space-6);
    min-height: auto;
  }
  .hero-content { max-width: 100%; }
  .hero-subtitle { max-width: 100%; }
  .hero-actions  { justify-content: center; }
  .hero-stats    { justify-content: center; }
  .hero-visual   { width: 280px; height: 240px; }
}

@media (max-width: 640px) {
  .hero-visual { display: none; }
  .games-grid  { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .hero-title    { font-size: 2rem; }
  .features-grid { grid-template-columns: 1fr; }
  .card-thumb    { height: 130px; }
}
