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

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

/* Variables : voir css/theme.css */

html { scroll-behavior: smooth; }

body {
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.4s, color 0.3s;
}

#particles-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--navbar-border);
}

.nav-logo {
  font-family: 'Righteous', cursive;
  font-size: 1.7rem;
  background: linear-gradient(135deg, #7c3aed, #ec4899, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--primary); }

/* ── Main ── */
main {
  position: relative;
  z-index: 1;
  padding-top: 80px;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 999px;
  padding: 0.35rem 1.1rem;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.hero h1 {
  font-family: 'Righteous', cursive;
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
}
[data-theme="dark"] .hero h1 {
  background: linear-gradient(135deg, #fff 0%, #a78bfa 45%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* ── Pseudo box ── */
.pseudo-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.pseudo-box label {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pseudo-input {
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  width: 200px;
}
.pseudo-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.pseudo-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.btn-save {
  background: linear-gradient(135deg, var(--primary), #9333ea);
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1.2rem;
  color: white;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(124,58,237,0.5);
}

.pseudo-saved {
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 700;
  display: none;
  text-align: center;
}

/* ── Sections ── */
section {
  padding: 2.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header { margin-bottom: 1.5rem; }

.section-title {
  font-family: 'Righteous', cursive;
  font-size: 1.7rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
  margin: 0 2rem;
  position: relative;
  z-index: 1;
}

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

.game-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

[data-theme="sun"] .game-card {
  box-shadow: 0 4px 24px rgba(124,58,237,.12), 0 1px 4px rgba(0,0,0,.06);
  border-color: rgba(124,58,237,.18);
}
[data-theme="dark"] .game-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.4s;
}

.game-card[data-glow="green"]::before  { background: radial-gradient(ellipse at 20% 20%, rgba(16,185,129,0.12), transparent 65%); }
.game-card[data-glow="purple"]::before { background: radial-gradient(ellipse at 20% 20%, rgba(124,58,237,0.15), transparent 65%); }
.game-card[data-glow="pink"]::before   { background: radial-gradient(ellipse at 20% 20%, rgba(236,72,153,0.12), transparent 65%); }
.game-card[data-glow="cyan"]::before   { background: radial-gradient(ellipse at 20% 20%, rgba(6,182,212,0.12),  transparent 65%); }
.game-card[data-glow="blue"]::before   { background: radial-gradient(ellipse at 20% 20%, rgba(59,130,246,0.12), transparent 65%); }
.game-card[data-glow="yellow"]::before { background: radial-gradient(ellipse at 20% 20%, rgba(245,158,11,0.12), transparent 65%); }
.game-card[data-glow="orange"]::before { background: radial-gradient(ellipse at 20% 20%, rgba(249,115,22,0.12), transparent 65%); }

.game-card:hover { transform: translateY(-7px); }
.game-card:hover::before { opacity: 1; }

.game-card[data-glow="green"]:hover  { box-shadow: 0 8px 40px rgba(16,185,129,0.2);  border-color: rgba(16,185,129,0.35); }
.game-card[data-glow="purple"]:hover { box-shadow: 0 8px 40px rgba(124,58,237,0.25); border-color: rgba(124,58,237,0.4); }
.game-card[data-glow="pink"]:hover   { box-shadow: 0 8px 40px rgba(236,72,153,0.2);  border-color: rgba(236,72,153,0.35); }
.game-card[data-glow="cyan"]:hover   { box-shadow: 0 8px 40px rgba(6,182,212,0.22);  border-color: rgba(6,182,212,0.4); }
.game-card[data-glow="blue"]:hover   { box-shadow: 0 8px 40px rgba(59,130,246,0.22); border-color: rgba(59,130,246,0.4); }
.game-card[data-glow="yellow"]:hover { box-shadow: 0 8px 40px rgba(245,158,11,0.22); border-color: rgba(245,158,11,0.4); }
.game-card[data-glow="orange"]:hover { box-shadow: 0 8px 40px rgba(249,115,22,0.22); border-color: rgba(249,115,22,0.4); }

.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.card-icon { font-size: 3rem; line-height: 1; }

.card-meta { display: flex; flex-direction: column; gap: 0.35rem; }

.card-title {
  font-family: 'Righteous', cursive;
  font-size: 1.35rem;
  color: var(--text);
}

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.badge-easy   { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.badge-medium { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.badge-hard   { background: rgba(236,72,153,0.15); color: #ec4899; border: 1px solid rgba(236,72,153,0.3); }

.card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  position: relative;
  z-index: 1;
}

.card-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}
.card-score strong { font-weight: 800; color: var(--accent); }

.btn-play {
  display: block;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary), #9333ea);
  color: white;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.8rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: auto;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.btn-play::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}
.btn-play:hover::after { width: 250%; height: 250%; }
.btn-play:hover { transform: translateY(-2px); box-shadow: 0 0 28px rgba(124,58,237,0.5); }

/* ── Leaderboard ── */
.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.leaderboard-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
[data-theme="sun"] .leaderboard-card {
  box-shadow: 0 4px 18px rgba(124,58,237,.10);
  border-color: rgba(124,58,237,.18);
}
[data-theme="dark"] .leaderboard-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lb-title {
  font-family: 'Righteous', cursive;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.lb-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--lb-entry-border);
  font-size: 0.9rem;
}
.lb-entry:last-child { border-bottom: none; }

.lb-rank {
  font-family: 'Righteous', cursive;
  font-size: 1rem;
  width: 28px;
  text-align: center;
}
.lb-rank.gold   { color: #f59e0b; }
.lb-rank.silver { color: #94a3b8; }
.lb-rank.bronze { color: #b45309; }

.lb-pseudo {
  flex: 1;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-score { font-weight: 800; color: var(--accent); }

.lb-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem 0;
}

/* ── Jeu du Jour ── */
.jdj-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 0;
}
.jdj-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(124,58,237,.12) 0%, rgba(236,72,153,.08) 50%, rgba(6,182,212,.08) 100%);
  border: 2px solid rgba(124,58,237,.22);
  padding: 0;
  display: flex;
  gap: 0;
  max-height: 200px;
}
[data-theme="sun"] .jdj-wrap {
  background: linear-gradient(135deg, rgba(124,58,237,.08) 0%, rgba(236,72,153,.05) 50%, rgba(6,182,212,.05) 100%);
  box-shadow: 0 8px 32px rgba(124,58,237,.14);
}
.jdj-thumb {
  width: 280px;
  flex-shrink: 0;
  overflow: hidden;
}
.jdj-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.jdj-wrap:hover .jdj-thumb img { transform: scale(1.04); }
.jdj-body {
  flex: 1;
  padding: 1.4rem 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .55rem;
}
.jdj-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-size: .7rem;
  font-weight: 900;
  padding: .2rem .7rem;
  border-radius: 999px;
  letter-spacing: .06em;
  text-transform: uppercase;
  width: fit-content;
}
.jdj-title {
  font-family: 'Righteous', cursive;
  font-size: 1.7rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.jdj-desc {
  color: var(--text-muted);
  font-size: .88rem;
  line-height: 1.5;
  max-width: 480px;
}
.jdj-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.jdj-play {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: .9rem;
  padding: .55rem 1.3rem;
  border-radius: 10px;
  transition: transform .2s, box-shadow .2s;
}
.jdj-play:hover { transform: translateY(-2px); box-shadow: 0 0 22px rgba(124,58,237,.5); }
.jdj-double {
  font-size: .78rem;
  font-weight: 800;
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: .3rem;
}
@media (max-width: 640px) {
  .jdj-wrap { flex-direction: column; max-height: none; }
  .jdj-thumb { width: 100%; height: 140px; }
}

/* ── Barre de recherche ── */
.search-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: .7rem;
}
.search-input {
  width: 100%;
  max-width: 420px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 12px;
  padding: .6rem 1.1rem .6rem 2.6rem;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  outline: none;
  transition: border-color .25s, box-shadow .25s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: .8rem center;
  background-size: 1rem;
}
.search-input::placeholder { color: var(--text-muted); opacity: .75; }
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}

/* ── Bouton Favoris ── */
.filter-btn[data-filter="favoris"] { color: #ec4899; }
.filter-btn[data-filter="favoris"].active {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  box-shadow: 0 0 16px rgba(236,72,153,.45);
}

/* ── Cœur favoris sur les cartes ── */
.btn-fav {
  position: absolute;
  top: .7rem;
  right: .7rem;
  z-index: 2;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .2s, background .2s, box-shadow .2s;
  line-height: 1;
}
.btn-fav:hover { transform: scale(1.2); background: rgba(236,72,153,.15); }
.btn-fav.fav-on { color: #ec4899; }
.btn-fav.fav-on:hover { box-shadow: 0 0 12px rgba(236,72,153,.4); }

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--footer-border);
  margin-top: 3rem;
}
footer strong {
  font-family: 'Righteous', cursive;
  background: linear-gradient(135deg, #a78bfa, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Hamburger ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.2s;
}
.hamburger:hover { background: var(--glass); }
.hamburger span {
  display: block;
  height: 2.5px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s, width 0.3s;
  width: 100%;
}
.hamburger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Menu mobile overlay */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  opacity: 0;
  transition: opacity 0.25s;
}
.mobile-menu.open {
  display: flex;
  opacity: 1;
}
.mobile-menu a, .mobile-menu button {
  font-family: 'Righteous', cursive;
  font-size: 1.6rem;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 1.5rem;
  border-radius: 12px;
  transition: background 0.2s, color 0.2s;
}
.mobile-menu a:hover, .mobile-menu button:hover {
  background: rgba(124,58,237,0.12);
  color: var(--primary);
}
.mobile-menu-close {
  position: absolute;
  top: 1.2rem; right: 1.2rem;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar { padding: 0.8rem 1.2rem; }
  .hero { padding: 4rem 1rem 2rem; }
  section { padding: 1.5rem 1rem; }
  .nav-links { gap: 1rem; }
}
@media (max-width: 600px) {
  .hamburger { display: flex; }
  .nav-links { display: none; }
  .games-grid { grid-template-columns: 1fr; }
}
