/* ============================================================
   GKA Design System — style.css
   NO inline styles. All tokens defined here.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;800;900&display=swap');

/* === DESIGN TOKENS === */
:root {
  /* Background - Deep Space */
  --c-bg:          #0B0E1F;
  --c-surface:     #131629;
  --c-surface-2:   #1A1E38;
  --c-surface-3:   #252A50;
  --c-border:      rgba(255, 255, 255, 0.10);

  /* Brand */
  --c-purple:       #9333EA;
  --c-pink:         #F72585;
  --c-yellow:       #FFD147;
  --c-green:        #22C55E;
  --c-blue:         #4CC9F0;
  --c-red:          #EF4444;

  /* Text */
  --c-text:       #F0F2FF;
  --c-text-muted: #A8AECE;
  --c-text-dim:   #6B7094;

  /* Gradients */
  --grad-hero:   linear-gradient(135deg, #F72585 0%, #7209B7 50%, #4CC9F0 100%);
  --grad-card:   linear-gradient(145deg, #131629, #1A1E38);
  --grad-green:  linear-gradient(180deg, #22C55E 0%, #16A34A 100%);
  --grad-yellow: linear-gradient(180deg, #FFD147 0%, #FFC107 100%);
  --grad-blue:   linear-gradient(180deg, #4CC9F0 0%, #0EA5E9 100%);

  /* Typography */
  --font-display: 'Fredoka One', cursive; /* Lego/Nintendo chunky header */
  --font-body:    'Nunito', sans-serif;

  /* Spacing */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;
  --sp-3xl: 64px;

  /* Radius - Apple Squircles */
  --r-sm:   12px;
  --r-md:   20px;
  --r-lg:   32px;
  --r-xl:   40px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-card:         0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow-purple:  0 8px 16px rgba(114, 9, 183, 0.45);
  --shadow-glow-pink:    0 8px 16px rgba(247, 37, 133, 0.45);
  --shadow-glow-yellow:  0 8px 16px rgba(255, 209, 71, 0.35);

  /* Transitions - Instant Snappy Feedback */
  --t-fast:   80ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --t-normal: 200ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --t-slow:   400ms cubic-bezier(0.2, 0, 0, 1);
}

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

img, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
ul { list-style: none; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; }

.text-gradient {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center { text-align: center; }
.text-muted  { color: var(--c-text-muted); }

/* === LAYOUT === */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

.section { padding: var(--sp-3xl) 0; }

/* === NAVIGATION === */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(22, 26, 48, 0.85); /* Indigo Glass */
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 2px solid var(--c-border);
  padding: var(--sp-md) 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.75rem;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  transition: transform var(--t-fast);
}

.nav-logo:hover {
  transform: scale(1.05); /* Instant feedback */
}

.nav-links {
  display: flex;
  gap: var(--sp-lg);
}

.nav-links a {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--c-text-muted);
  transition: color var(--t-fast);
}

.nav-links a:hover { color: var(--c-text); }

/* === HERO === */
.hero {
  padding: var(--sp-3xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 107, 154, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  margin-bottom: var(--sp-lg);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.375rem);
  color: var(--c-text-muted);
  max-width: 600px;
  margin: 0 auto var(--sp-2xl);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-md);
  flex-wrap: wrap;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-xl);
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}

.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--grad-hero);
  color: white;
  box-shadow: var(--shadow-glow-pink);
}

.btn-primary:hover { box-shadow: 0 12px 24px rgba(255, 0, 110, 0.3); transform: translateY(-4px); }
.btn-primary:active { transform: translateY(0) scale(0.95); }

.btn-ghost {
  background: transparent;
  color: var(--c-text);
  border: 2px solid var(--c-border);
}

.btn-ghost:hover {
  border-color: var(--c-purple-light);
  color: var(--c-purple-light);
}

.btn-lg {
  padding: var(--sp-lg) var(--sp-2xl);
  font-size: 1.25rem;
}

/* === GAME GRID === */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-md); /* a bit tighter gap for more items */
}

/* === GAME CARD === */
.game-card {
  background: var(--grad-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  min-width: 0; /* Prevents grid blowout */
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  cursor: pointer;
  display: block;
  box-shadow: var(--shadow-card);
}

.game-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 0 2px var(--c-purple);
}

.game-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--c-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
}

.game-card-thumb-icon {
  transition: transform var(--t-normal);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

.game-card:hover .game-card-thumb-icon { transform: scale(1.2); }

.game-card-info {
  padding: var(--sp-md);
  min-width: 0;
}

.game-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: var(--sp-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-desc {
  font-size: 0.75rem;
  color: var(--c-text-muted);
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 800;
  margin-top: var(--sp-sm);
}

.badge-new  { background: var(--c-green); color: white; }
.badge-hot  { background: var(--c-pink);  color: white; }
.badge-soon { background: var(--c-surface-3); color: var(--c-text-muted); }

/* === SECTION HEADER === */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-xl);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

/* === STATS BAR === */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: var(--sp-2xl);
  padding: var(--sp-2xl) 0;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  margin: var(--sp-2xl) 0;
}

.stat-item { text-align: center; }

.stat-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-text-muted);
}

/* === FOOTER === */
.footer {
  border-top: 1px solid var(--c-border);
  padding: var(--sp-2xl) 0;
  text-align: center;
  color: var(--c-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.footer-links {
  margin-top: var(--sp-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  font-size: 0.8rem;
  color: var(--c-text-dim);
}

.footer-links a {
  color: var(--c-text-dim);
  transition: color var(--t-fast);
}

.footer-links a:hover { color: var(--c-text-muted); }

/* === ANIMATIONS === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 8px 16px rgba(255, 107, 154, 0.2); }
  50%       { box-shadow: 0 12px 24px rgba(255, 107, 154, 0.45); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anim-float      { animation: float 3s ease-in-out infinite; }
.anim-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
.anim-fade-in-up { animation: fade-in-up 0.6s ease forwards; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* === HERO BADGES === */
.hero-badges {
  display: flex;
  justify-content: center;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  margin-bottom: var(--sp-lg);
}

.hero-badge {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  padding: var(--sp-xs) var(--sp-md);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--c-text-muted);
  letter-spacing: 0.03em;
}

/* === SECTION COUNT === */
.section-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-text-muted);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  padding: var(--sp-xs) var(--sp-md);
}

/* === AD SLOTS ===
   AdSense policy: ads must be clearly labeled and distinguishable from content.
   The .ad-label pseudo-element always renders "Advertisement" above the slot.
   ================================================================ */
.ad-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  overflow: hidden;
}

/* Always-visible "Advertisement" label above every ad slot */
.ad-slot::before {
  content: 'Advertisement';
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  padding: 4px 0 2px;
  pointer-events: none;
}

.ad-slot-leaderboard {
  width: 100%;
  min-height: 90px;
}

.ad-slot-rect {
  width: 100%;
  min-height: 100px;
  border-radius: var(--r-md);
  margin: var(--sp-xl) 0;
  border: 1px dashed var(--c-border);
}

/* === GAME CARD — CATEGORY THUMBNAIL GRADIENTS ===
   data-category attribute on .game-card controls the thumb background.
   ================================================================ */
.game-card[data-category="action"] .game-card-thumb {
  background: linear-gradient(135deg, #1a0a2e 0%, #3d0066 50%, #7b1fa2 100%);
}
.game-card[data-category="puzzle"] .game-card-thumb {
  background: linear-gradient(135deg, #0a1628 0%, #0d3b6e 50%, #1565c0 100%);
}
.game-card[data-category="fun"] .game-card-thumb {
  background: linear-gradient(135deg, #1a2a0a 0%, #2e6b1a 50%, #43a047 100%);
}

/* Glow accent on hover per category */
.game-card[data-category="action"]:hover {
  box-shadow: 0 16px 48px rgba(0,0,0,0.7), 0 0 0 2px #F72585;
}
.game-card[data-category="puzzle"]:hover {
  box-shadow: 0 16px 48px rgba(0,0,0,0.7), 0 0 0 2px #4CC9F0;
}
.game-card[data-category="fun"]:hover {
  box-shadow: 0 16px 48px rgba(0,0,0,0.7), 0 0 0 2px #22C55E;
}

/* Subtle shimmer on thumb for live cards */
.game-card:not(.game-card-soon) .game-card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.06) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: card-shimmer 3s ease-in-out infinite;
}

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

/* === COMING SOON CARDS === */
.game-card-soon {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.game-card-soon:hover {
  transform: none;
  border-color: var(--c-border);
  box-shadow: none;
}

/* === HAMBURGER === */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--c-text);
  border-radius: 2px;
  transition: transform var(--t-normal), opacity var(--t-normal);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(19, 22, 41, 0.97);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--c-border);
    padding: var(--sp-md) 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: var(--sp-md) var(--sp-xl);
    font-size: 1.1rem;
  }
  .stats-bar { gap: var(--sp-xl); }
  .hero      { padding: var(--sp-2xl) 0; }
}

@media (max-width: 768px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-sm);
  }

  .game-card-thumb {
    font-size: 2rem;
  }

  .game-card-thumb-icon {
    font-size: 2rem;
  }

  .game-card-info {
    padding: var(--sp-sm);
  }

  .game-card-title {
    font-size: 0.8rem;
  }

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

  .game-card-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
  }
}

@media (max-width: 480px) {
  .stats-bar { flex-wrap: wrap; gap: var(--sp-lg); }
}

/* ================================================================
   BADGE / TROPHY SYSTEM
   ================================================================ */

/* Card crown overlay */
.card-crown {
  position: absolute;
  top: 6px; right: 8px;
  font-size: 1.3rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.7));
  pointer-events: none;
}

/* Hero stats bar */
.hero-stats {
  display: flex;
  gap: var(--sp-lg);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--sp-md);
  font-size: 0.9rem;
  color: var(--c-text-muted);
}
.hero-stats span { display: flex; align-items: center; gap: 4px; }
.hero-stats strong { color: var(--c-text); }

/* ---- Profile page ---- */
.profile-section {
  max-width: 860px;
  margin: 0 auto var(--sp-3xl);
  padding: 0 var(--sp-md);
}
.profile-section h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--c-text);
  margin-bottom: var(--sp-md);
  border-bottom: 1px solid var(--c-border);
  padding-bottom: var(--sp-sm);
}

/* Stats cards row */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-md);
  margin-bottom: var(--sp-2xl);
}
.profile-stat-card {
  background: var(--grad-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-lg) var(--sp-md);
  text-align: center;
}
.profile-stat-card .stat-val {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--c-text);
  line-height: 1;
}
.profile-stat-card .stat-lbl {
  font-size: 0.75rem;
  color: var(--c-text-muted);
  margin-top: 4px;
}

/* Trophy grid */
.trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-md);
  margin-bottom: var(--sp-2xl);
}
.trophy-card {
  background: var(--grad-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-md);
  text-align: center;
  transition: transform var(--t-fast);
}
.trophy-card.unlocked {
  border-color: var(--c-yellow);
  box-shadow: 0 0 12px rgba(255, 209, 71, 0.25);
}
.trophy-card.locked {
  opacity: 0.4;
  filter: grayscale(1);
}
.trophy-icon { font-size: 2rem; line-height: 1; margin-bottom: 6px; }
.trophy-name { font-size: 0.8rem; font-weight: 700; color: var(--c-text); }
.trophy-desc { font-size: 0.7rem; color: var(--c-text-muted); margin-top: 2px; }

/* Game badges table */
.badge-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-2xl);
}
.badge-row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  background: var(--grad-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: var(--sp-sm) var(--sp-md);
}
.badge-row-icon  { font-size: 1.4rem; width: 2rem; text-align: center; flex-shrink: 0; }
.badge-row-title { flex: 1; font-size: 0.9rem; color: var(--c-text); }
.badge-row-crowns { display: flex; gap: 4px; font-size: 1.1rem; }
.badge-crown-slot { opacity: 0.2; }
.badge-crown-slot.earned { opacity: 1; }

/* Reset button */
.reset-btn {
  display: inline-block;
  padding: var(--sp-sm) var(--sp-xl);
  background: transparent;
  border: 1px solid var(--c-red);
  border-radius: var(--r-full);
  color: var(--c-red);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.reset-btn:hover { background: var(--c-red); color: #fff; }
