/* ═══════════════════════════════════════════
   MateKids — Global Styles
   ═══════════════════════════════════════════ */

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

/* ── TOKENS ── */
:root {
  --bg: #FFF8F0;
  --bg-dark: #1a1a2e;
  --surface: #ffffff;
  --surface-alt: #f8f5ff;

  --primary: #FF6B35;
  --primary-dark: #e55a28;
  --primary-light: #ff8c5a;
  --primary-glow: rgba(255, 107, 53, 0.3);

  --accent: #4ECDC4;
  --accent-dark: #3ab5ad;
  --accent-light: #7eddd7;

  --purple: #C77DFF;
  --purple-dark: #a855f7;
  --yellow: #FFE66D;
  --pink: #FF85A1;
  --green: #06D6A0;
  --blue: #118AB2;

  --text: #2d2d3f;
  --text-light: #6b6b80;
  --text-muted: #9e9eb5;

  --ok: #2ECC71;
  --err: #E74C3C;
  --warn: #f39c12;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 30px var(--primary-glow);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Baloo 2', cursive;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ── BACKGROUND DECORATION ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(255,107,53,.06) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(78,205,196,.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(199,125,255,.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 0 24px;
  transition: box-shadow var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
  transition: transform var(--transition);
}

.navbar-brand:hover {
  transform: scale(1.03);
}

.navbar-brand .logo-icon {
  font-size: 28px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.navbar-menu a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-light);
  transition: all var(--transition);
  position: relative;
}

.navbar-menu a:hover {
  color: var(--primary);
  background: rgba(255,107,53,0.08);
}

.navbar-menu a.active {
  color: var(--primary);
  background: rgba(255,107,53,0.12);
}

.navbar-menu .nav-emoji {
  font-size: 18px;
}

/* Auth buttons in navbar */
.navbar-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

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

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255,107,53,0.05);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  box-shadow: 0 4px 15px rgba(78,205,196,0.3);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(78,205,196,0.4);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 18px;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 13px;
}

/* User badge in navbar */
.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  background: var(--surface-alt);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  transition: all var(--transition);
}

.user-badge:hover {
  background: rgba(199,125,255,0.12);
}

.user-badge .avatar {
  font-size: 22px;
  line-height: 1;
}

/* Mobile menu toggle */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

@media (max-width: 768px) {
  .navbar-toggle {
    display: block;
  }

  .navbar-center {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: var(--shadow-md);
  }

  .navbar-center.open {
    display: block;
  }

  .navbar-menu {
    flex-direction: column;
    gap: 4px;
  }

  .navbar-menu a {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
  }

  .navbar-auth {
    flex-direction: column;
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.06);
  }

  .navbar-auth .btn {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════ */
.hero {
  position: relative;
  padding: 80px 24px 100px;
  text-align: center;
  overflow: hidden;
  z-index: 1;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(255,107,53,0.08) 0%, transparent 70%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 900;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(16px, 3vw, 20px);
  color: var(--text-light);
  font-weight: 600;
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-emojis {
  margin-top: 40px;
  font-size: 48px;
  display: flex;
  justify-content: center;
  gap: 20px;
  animation: float 4s ease-in-out infinite;
}

.hero-emojis span {
  display: inline-block;
  animation: popIn 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}

.hero-emojis span:nth-child(1) { animation-delay: 0.1s; }
.hero-emojis span:nth-child(2) { animation-delay: 0.2s; }
.hero-emojis span:nth-child(3) { animation-delay: 0.3s; }
.hero-emojis span:nth-child(4) { animation-delay: 0.4s; }
.hero-emojis span:nth-child(5) { animation-delay: 0.5s; }

@keyframes popIn {
  from { opacity: 0; transform: scale(0.5) translateY(20px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* ═══════════════════════════════════════════
   GAME CARDS SECTION
   ═══════════════════════════════════════════ */
.section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 24px;
}

.section-title {
  text-align: center;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}

.section-subtitle {
  text-align: center;
  font-size: 17px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 40px;
}

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

.game-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: block;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255,107,53,0.15);
}

.game-card:hover::before {
  transform: scaleX(1);
}

.game-card .card-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.game-card h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.game-card p {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 16px;
}

.game-card .card-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  background: rgba(78,205,196,0.12);
  color: var(--accent-dark);
}

.game-card .card-tag.coming-soon {
  background: rgba(158,158,181,0.12);
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   AUTH FORMS (Login / Register)
   ═══════════════════════════════════════════ */
.auth-page {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0,0,0,0.05);
  animation: slideUp 0.5s var(--bounce);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-card .auth-icon {
  font-size: 56px;
  text-align: center;
  display: block;
  margin-bottom: 8px;
}

.auth-card h2 {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}

.auth-card .auth-subtitle {
  text-align: center;
  font-size: 15px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2.5px solid #e5e5e5;
  border-radius: var(--radius-md);
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  transition: all var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(78,205,196,0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.form-error {
  background: rgba(231,76,60,0.08);
  color: var(--err);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-success {
  background: rgba(46,204,113,0.08);
  color: var(--ok);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-card .btn {
  width: 100%;
  margin-top: 8px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-light);
  font-weight: 600;
}

.auth-footer a {
  color: var(--primary);
  font-weight: 700;
  transition: color var(--transition);
}

.auth-footer a:hover {
  color: var(--primary-dark);
}

/* Avatar picker */
.avatar-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.avatar-option {
  width: 48px;
  height: 48px;
  border: 3px solid #e5e5e5;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
}

.avatar-option:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}

.avatar-option.selected {
  border-color: var(--primary);
  background: rgba(255,107,53,0.08);
  transform: scale(1.1);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ═══════════════════════════════════════════
   PROFILE / PROGRESS
   ═══════════════════════════════════════════ */
.profile-header {
  text-align: center;
  padding: 48px 24px;
  position: relative;
  z-index: 1;
}

.profile-avatar {
  font-size: 72px;
  margin-bottom: 8px;
  display: block;
  animation: float 3s ease-in-out infinite;
}

.profile-header h2 {
  font-size: 28px;
  font-weight: 900;
}

.profile-header p {
  font-size: 16px;
  color: var(--text-light);
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  max-width: 600px;
  margin: 24px auto 0;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.05);
}

.stat-card .stat-value {
  font-size: 36px;
  font-weight: 900;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.site-footer a {
  color: var(--primary);
  font-weight: 700;
}

/* ═══════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
