/* ============================================================
   Ana's Game Hub — Premium Stylesheet
   ============================================================ */

:root {
  --bg-primary: #0f0a1e;
  --bg-card: rgba(30, 20, 50, 0.6);
  --text-primary: #f0e6ff;
  --text-secondary: #a090c0;
  --accent: #c084fc;
  --accent-glow: rgba(192, 132, 252, 0.25);
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.06) 0%, transparent 60%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ==========================================
   ANIMATED BACKGROUND
   ========================================== */

.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  bottom: -40px;
  animation: float-up linear infinite;
}

@keyframes float-up {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  5% { opacity: 0.15; }
  95% { opacity: 0.15; }
  100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* ==========================================
   HEADER
   ========================================== */

.hub-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 1.5rem 2rem;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.avatar-wrapper {
  position: relative;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(192,132,252,0.15);
  animation: avatar-pulse 3s ease-in-out infinite;
}

@keyframes avatar-pulse {
  0%, 100% { box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(192,132,252,0.15); }
  50% { box-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(192,132,252,0.25); }
}

.hub-title {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, #c084fc, #f472b6, #fbbf24, #34d399);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 5s ease-in-out infinite;
  line-height: 1.1;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hub-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 1px;
}

/* ==========================================
   MAIN / CATEGORIES
   ========================================== */

.hub-main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

.category-section {
  margin-bottom: 3rem;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.category-icon {
  font-size: 1.5rem;
}

.category-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.category-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(192,132,252,0.3), transparent);
}

/* ==========================================
   GAME CARDS
   ========================================== */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-decoration: none;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  backdrop-filter: blur(20px);
  cursor: pointer;
  will-change: transform;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--card-glow), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
}

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

.game-card:hover {
  border-color: var(--card-accent);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 30px var(--card-glow);
}

.card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.2rem 0.6rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--card-accent);
  z-index: 1;
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  z-index: 1;
  position: relative;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.card-avatar {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1;
}

.card-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--card-accent);
  opacity: 0.7;
  transition: opacity var(--transition);
}

.game-card:hover .card-avatar img {
  opacity: 1;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  z-index: 1;
  position: relative;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
  z-index: 1;
  position: relative;
  margin-bottom: 1rem;
}

.card-footer {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  z-index: 1;
  position: relative;
  margin-bottom: 1rem;
}

.card-tag {
  padding: 0.2rem 0.5rem;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.card-play {
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, var(--card-accent), color-mix(in srgb, var(--card-accent), white 20%));
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  text-align: center;
  z-index: 1;
  position: relative;
  opacity: 0.85;
  transition: all var(--transition);
  box-shadow: 0 4px 15px var(--card-glow);
}

.game-card:hover .card-play {
  opacity: 1;
  box-shadow: 0 6px 25px var(--card-glow);
}

/* ==========================================
   FOOTER
   ========================================== */

.hub-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(192,132,252,0.4);
  opacity: 0.6;
}

.hub-footer strong {
  color: var(--accent);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 640px) {
  .hub-title {
    font-size: 2.2rem;
  }

  .avatar {
    width: 90px;
    height: 90px;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .hub-main {
    padding: 1rem 1rem 2rem;
  }

  .game-card {
    padding: 1.25rem;
  }
}
