/* Charlie's Game Hub - Styles */

:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #141430;
  --bg-tertiary: #1a1a3e;
  --accent: #e94560;
  --accent-light: #ff6b81;
  --accent-glow: rgba(233, 69, 96, 0.3);
  --accent-green: #4ecca3;
  --accent-blue: #6ec6ff;
  --text-primary: #ffffff;
  --text-secondary: #8888aa;
  --text-muted: #555577;
  --card-bg: rgba(30, 30, 60, 0.9);
  --card-border: rgba(255, 255, 255, 0.12);
  --card-border-hover: rgba(233, 69, 96, 0.5);
  --radius: 16px;
  --radius-sm: 8px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Tahoma, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===================== */
/*    HERO SECTION       */
/* ===================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 2rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0a0a1a 0%, #12122a 40%, #1a1040 70%, #0a0a1a 100%);
  z-index: 0;
}

/* Animated floating shapes */
.hero-bg::before,
.hero-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 20s ease-in-out infinite;
}

.hero-bg::before {
  width: 600px;
  height: 600px;
  background: var(--accent);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.hero-bg::after {
  width: 500px;
  height: 500px;
  background: var(--accent-blue);
  bottom: -150px;
  left: -100px;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.02); }
}

/* Grid pattern overlay */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 1;
}

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

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(233, 69, 96, 0.15);
  border: 1px solid rgba(233, 69, 96, 0.3);
  border-radius: 20px;
  color: var(--accent-light);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
}

.hero-coin-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(255, 179, 71, 0.1);
  border: 1px solid rgba(255, 179, 71, 0.3);
  border-radius: 20px;
  color: #ffb347;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.hero-coin-balance .hcb-icon {
  font-size: 1.4rem;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #e94560 50%, #6ec6ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.hero-cta:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.hero-cta .arrow {
  transition: transform 0.3s ease;
}

.hero-cta:hover .arrow {
  transform: translateY(3px);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2s ease-in-out infinite;
}

.scroll-indicator span {
  display: block;
  width: 2px;
  height: 30px;
  background: linear-gradient(to bottom, transparent, var(--text-muted));
  margin: 0 auto 4px;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* ===================== */
/*    GAMES SECTION      */
/* ===================== */

.games-section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border-radius: 0;
}

/* Give the section full width bg */
.games-section {
  max-width: none;
  padding-left: calc((100% - 1200px) / 2 + 2rem);
  padding-right: calc((100% - 1200px) / 2 + 2rem);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-title-accent {
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 0.75rem;
}

/* Filter tags */
.filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2.5rem;
}

.filter-pill {
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.filter-pill.active {
  background: rgba(233, 69, 96, 0.15);
  border-color: var(--accent);
  color: var(--accent-light);
}

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

/* ===================== */
/*    GAME CARD          */
/* ===================== */

.game-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.35s ease;
  cursor: default;
}

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

.card-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.game-card:hover .card-thumbnail img {
  transform: scale(1.05);
}

/* Gradient placeholder when no thumbnail */
.card-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.card-thumbnail-placeholder.gradient-1 {
  background: linear-gradient(135deg, #e94560, #6ec6ff);
}

.card-thumbnail-placeholder.gradient-2 {
  background: linear-gradient(135deg, #4ecca3, #3498db);
}

.card-thumbnail-placeholder.gradient-3 {
  background: linear-gradient(135deg, #f39c12, #e74c3c);
}

/* Status badge */
.card-status {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-status.playable {
  background: rgba(78, 204, 163, 0.2);
  color: var(--accent-green);
  border: 1px solid rgba(78, 204, 163, 0.3);
}

.card-status.coming-soon {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.card-status.in-development {
  background: rgba(110, 198, 255, 0.2);
  color: var(--accent-blue);
  border: 1px solid rgba(110, 198, 255, 0.3);
}

/* Featured badge */
.card-featured {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: rgba(233, 69, 96, 0.9);
  color: white;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-body {
  padding: 1.25rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.25rem;
}

.card-tag {
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  gap: 10px;
}

.btn-play {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.25s ease;
  border: none;
  cursor: pointer;
}

.btn-play:hover {
  background: var(--accent-light);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-play.disabled {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-play.disabled:hover {
  box-shadow: none;
  background: var(--card-bg);
}

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

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

.footer-content {
  max-width: 600px;
  margin: 0 auto;
}

.footer-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  font-size: 0.75rem;
  margin-top: 1rem;
  color: var(--text-secondary);
}

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

@media (max-width: 768px) {
  .games-grid {
    grid-template-columns: 1fr;
  }

  .games-section {
    padding: 4rem 1rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 1.5rem;
  }

  .hero-cta {
    padding: 12px 24px;
    font-size: 1rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-bg::before,
  .hero-bg::after {
    animation: none;
  }

  .scroll-indicator {
    animation: none;
  }

  .game-card {
    transition: none;
  }

  .card-thumbnail img {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
