/* ============================================
   ALESSKI 2.0 - Light Pastel Modern
   ============================================ */

/* --- Custom Properties --- */
:root {
  /* Palette */
  --bg: #f6f4ff;
  --bg-card: rgba(255,255,255,0.7);
  --bg-card-solid: #ffffff;
  --bg-elevated: #ffffff;
  --border: rgba(124,92,252,0.12);
  --border-hover: rgba(124,92,252,0.25);

  /* Accents */
  --accent: #7c5cfc;
  --accent-hover: #6a4ce0;
  --secondary: #f472b6;
  --tertiary: #06b6d4;
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;

  /* Game colors */
  --game-morpion: #7c5cfc;
  --game-sudoku: #06b6d4;
  --game-pendu: #f472b6;
  --game-multiplication: #f59e0b;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #7c5cfc, #f472b6);
  --gradient-hero: linear-gradient(135deg, #7c5cfc 0%, #a78bfa 50%, #f472b6 100%);
  --gradient-morpion: linear-gradient(135deg, #7c5cfc, #a78bfa);
  --gradient-sudoku: linear-gradient(135deg, #06b6d4, #67e8f9);
  --gradient-pendu: linear-gradient(135deg, #f472b6, #fb923c);
  --gradient-multiplication: linear-gradient(135deg, #f59e0b, #fbbf24);

  /* Text */
  --text: #1e1b4b;
  --text-muted: #6366f1;
  --text-subtle: #94a3b8;
  --text-light: #a5b4fc;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(124,92,252,0.08);
  --shadow-md: 0 8px 24px rgba(124,92,252,0.12);
  --shadow-lg: 0 16px 48px rgba(124,92,252,0.16);
  --shadow-glow: 0 0 20px rgba(124,92,252,0.25);
  --shadow-card: 0 4px 16px rgba(124,92,252,0.08);

  /* Layout */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-pill: 50px;
  --max-width: 1200px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 0.2s var(--ease-out);
  --transition-normal: 0.3s var(--ease-out);
  --transition-slow: 0.5s var(--ease-out);

  /* Typography */
  --font-heading: 'Nunito', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Glassmorphism */
  --glass-bg: rgba(255,255,255,0.6);
  --glass-border: rgba(255,255,255,0.3);
  --glass-blur: blur(20px);
}

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Typography Scale --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* --- Keyframes --- */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(2deg); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(124,92,252,0.2); }
  50% { box-shadow: 0 0 40px rgba(124,92,252,0.4); }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes bounce-in {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-8deg); }
  30% { transform: rotate(6deg); }
  45% { transform: rotate(-4deg); }
  60% { transform: rotate(2deg); }
  75% { transform: rotate(-1deg); }
}
@keyframes pop-in {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes rainbow-border {
  0% { border-color: #7c5cfc; }
  25% { border-color: #f472b6; }
  50% { border-color: #06b6d4; }
  75% { border-color: #34d399; }
  100% { border-color: #7c5cfc; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* --- Particles Background --- */
#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

main {
  padding: 40px 0;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* --- Header (Glassmorphism Sticky) --- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  padding: 16px 0;
  transition: box-shadow var(--transition-normal);
}
header.scrolled {
  box-shadow: var(--shadow-md);
}
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.5px;
  transition: transform var(--transition-fast);
}
.logo:hover { transform: scale(1.05); }

nav {
  display: flex;
  gap: 6px;
  align-items: center;
}
nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}
nav a:hover {
  background: rgba(124,92,252,0.08);
  color: var(--accent);
}
nav .btn-outline {
  border: 2px solid var(--border);
  color: var(--text);
  background: transparent;
}
nav .btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(124,92,252,0.05);
}
nav .btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 8px 22px;
}
nav .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}
nav .user-info {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  margin-right: 8px;
}

/* Mute button */
.mute-btn {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
  margin-left: 4px;
  color: var(--text);
}
.mute-btn:hover {
  border-color: var(--accent);
  background: rgba(124,92,252,0.05);
}

/* --- Footer --- */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 20px 24px;
  margin-top: auto;
  background: var(--bg-card-solid);
}
.footer-wave {
  display: block;
  width: 100%;
  height: 60px;
  margin-bottom: -1px;
}
footer p {
  color: var(--text-subtle);
  font-size: 0.85rem;
}
footer a {
  color: var(--accent);
  transition: color var(--transition-fast);
}
footer a:hover { color: var(--secondary); }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}
.footer-links a {
  font-size: 0.9rem;
  font-weight: 500;
}

/* --- Flash Messages --- */
.flash-messages { margin-bottom: 20px; }
.flash {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fade-up 0.4s var(--ease-out);
}
.flash-success {
  background: rgba(52,211,153,0.1);
  color: #059669;
  border: 1px solid rgba(52,211,153,0.2);
}
.flash-error {
  background: rgba(248,113,113,0.1);
  color: #dc2626;
  border: 1px solid rgba(248,113,113,0.2);
}
.flash-warning {
  background: rgba(251,191,36,0.1);
  color: #d97706;
  border: 1px solid rgba(251,191,36,0.2);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-heading);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
}
.btn-primary:hover {
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--bg-card-solid);
  color: var(--accent);
  border: 2px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-success {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  padding: 10px 20px;
}
.btn-ghost:hover {
  background: rgba(124,92,252,0.06);
  box-shadow: none;
}

/* Button spotlight effect (JS controlled) */
.btn .spotlight {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover .spotlight { opacity: 1; }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
}
.card:hover {
  box-shadow: var(--shadow-md);
}

/* Game Cards */
.game-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 0;
  text-align: center;
  transition: all var(--transition-normal);
  border: 1px solid var(--border);
  text-decoration: none;
  display: block;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.game-card-stripe {
  height: 5px;
  border-radius: 0;
}
.game-card-body {
  padding: 28px 24px;
}
.game-card .icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 1.8rem;
}
.game-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  font-family: var(--font-heading);
}
.game-card p {
  color: var(--text-subtle);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Blog Cards */
.blog-card {
  background: var(--bg-card-solid);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Auth Cards */
.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--gradient-primary);
}

/* --- Form Groups --- */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-heading);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font-body);
  background: var(--bg-card-solid);
  color: var(--text);
  transition: all var(--transition-fast);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124,92,252,0.1);
}
.form-group input::placeholder {
  color: var(--text-subtle);
}

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-heading);
}
.badge-easy {
  background: rgba(52,211,153,0.15);
  color: #059669;
}
.badge-medium {
  background: rgba(251,191,36,0.15);
  color: #d97706;
}
.badge-hard {
  background: rgba(248,113,113,0.15);
  color: #dc2626;
}

/* --- Game Shared Styles --- */
.game-container {
  text-align: center;
  position: relative;
  z-index: 1;
}
.game-container h1 {
  font-family: var(--font-heading);
  font-weight: 900;
  margin-bottom: 8px;
}
.game-container > p {
  color: var(--text-subtle);
  margin-bottom: 24px;
}

/* --- Utility Classes --- */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* --- Turbo Page Transitions --- */
.turbo-progress-bar {
  height: 3px;
  background: var(--gradient-primary);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(124,92,252,0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(124,92,252,0.4); }

/* --- Selection --- */
::selection {
  background: rgba(124,92,252,0.2);
  color: var(--text);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  header .container { flex-direction: column; gap: 12px; }
  nav { flex-wrap: wrap; justify-content: center; }
  nav a { padding: 6px 14px; font-size: 0.85rem; }
  .container { padding: 0 16px; }
  main { padding: 24px 0; }
  .footer-links { flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  nav a { padding: 6px 10px; font-size: 0.8rem; }
  .btn { padding: 10px 20px; font-size: 0.9rem; }
}
