/* =============================================
   style.css — Edition Luxe Premium
   Fond original conservé (gradient violet/bleu)
   Tout le reste : upgraded cinématique
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

/* =============================================
   VARIABLES & RESET
   ============================================= */
:root {
  --primary: #667eea;
  --primary-dark: #5568d3;
  --secondary: #764ba2;
  --accent: #f093fb;
  --success: #51cf66;
  --danger: #ff6b6b;
  --warning: #ffd43b;
  --dark: #1a1a2e;
  --dark-light: #16213e;
  --light: #f0eeff;
  --text: #2d3436;
  --text-light: #525c5f;
  /* Darkened for accessibility contrast */
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.18);
  --radius: 18px;
  --transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hidden {
  display: none !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea,
select,
button {
  -webkit-user-select: text !important;
  user-select: text !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* Fond original intact */
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body.no-scroll {
  overflow: hidden;
}

/* =============================================
   ANIMATED BACKGROUND — Renforcé
   ============================================= */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Grain de bruit subtil */
.bg-animation::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  animation: blobFloat 22s ease-in-out infinite;
}

.blob-1 {
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, #667eea, #764ba2 60%);
  top: -15%;
  left: -10%;
  animation-delay: 0s;
}

.blob-2 {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, #f093fb, #f5576c 60%);
  bottom: -12%;
  right: -8%;
  animation-delay: -8s;
}

.blob-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #4facfe, #00f2fe 60%);
  top: 45%;
  left: 45%;
  transform: translate(-50%, -50%);
  animation-delay: -16s;
}

@keyframes blobFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(35px, -45px) scale(1.07);
  }

  66% {
    transform: translate(-25px, 35px) scale(0.94);
  }
}

/* =============================================
   SCROLL PROGRESS BAR
   ============================================= */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.9), #f093fb);
  z-index: 1000;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* =============================================
   CONTAINER
   ============================================= */
.container {
  max-width: 88%;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.15));
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.3));
}

/* =============================================
   HEADER
   ============================================= */
.header {
  padding: 64px 0 44px;
  text-align: center;
}

/* =============================================
   LANGUAGE SELECTOR
   ============================================= */
.lang-selector {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
}

.lang-btn {
  min-width: 100px;
  height: 44px;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50px;
  color: white;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 100px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-menu.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.lang-option {
  padding: 12px 16px;
  color: #ffffff;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-option:last-child {
  border-bottom: none;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.3)
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 12px;
  animation: heroReveal 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(-40px) scale(0.95);
    filter: blur(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.logo-icon {
  font-size: 68px;
  display: block;
  animation: floatIcon 4s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
}

@keyframes floatIcon {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-12px) rotate(4deg);
  }
}

.header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 900;
  color: white;
  letter-spacing: -2px;
  line-height: 1;
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: clamp(14px, 2.5vw, 19px);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
  letter-spacing: 0.02em;
  animation: fadeIn 1s ease-out 0.4s both;
}

/* Status badge */
.status-badge {
  position: absolute;
  bottom: 0px;
  right: -10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(207, 81, 102, 0.95);
  box-shadow: 0 0 14px rgba(207, 81, 102, 0.6);
  backdrop-filter: blur(12px);
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: white;
  text-transform: uppercase;
  white-space: nowrap;
  /* Prevent breaking into two lines */
  animation: floatIcon 4s ease-in-out infinite;
  animation-delay: -2s;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: white;
  border-radius: 50%;
  flex-shrink: 0;
  /* Keep the dot perfectly round */
  animation: pulseDot 1.8s ease-in-out infinite;
}

@keyframes pulseDot {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.6;
  }
}

/* =============================================
   STATS BAR
   ============================================= */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  margin-bottom: 8px;
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
  position: relative;
}

/* Sheen line */
.stats-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.stat-item {
  flex: 1;
  text-align: center;
  padding: 28px 20px;
  position: relative;
  transition: background 0.3s ease;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Dividers between stat items */
.stat-item+.stat-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.stat-number {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  color: white;
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* =============================================
   SEARCH BAR
   ============================================= */
.search-bar {
  display: flex;
  justify-content: center;
  margin: 28px auto 28px;
  width: 100%;
  max-width: 520px;
  position: relative;
  animation: fadeIn 1s ease-out 0.5s both;
}

.search-bar input {
  width: 100%;
  padding: 15px 52px 15px 22px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50px;
  font-size: 15px;
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  outline: none;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

.search-bar input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.search-bar input:hover:not(:focus) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.search-bar::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  opacity: 0.45;
  transition: opacity 0.3s, transform 0.3s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: none;
  outline: none;
}

.search-bar:focus-within::after {
  opacity: 0.75;
  transform: translateY(-50%) scale(1.1);
}

/* =============================================
   CATEGORY FILTERS
   ============================================= */
.category-filters {
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
  animation: fadeIn 0.8s ease-out 0.6s both;
}

.cat-filter-label {
  cursor: pointer;
  padding: 9px 18px !important;
  border-radius: 50px !important;
  font-size: 13px !important;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500 !important;
  letter-spacing: 0.02em;
  transition: var(--transition) !important;
  backdrop-filter: blur(12px);
}

.cat-filter-label:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.18) !important;
}

/* =============================================
   CATEGORY HEADERS (in-grid)
   ============================================= */
.category-header span {
  font-family: 'DM Sans', sans-serif !important;
  font-size: clamp(13px, 1.8vw, 16px) !important;
  font-weight: 700 !important;
  letter-spacing: 3px !important;
  color: rgba(255, 255, 255, 0.9) !important;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3) !important;
}

/* =============================================
   GAMES GRID
   ============================================= */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  justify-content: center;
  gap: 24px;
  margin-bottom: 60px;
  min-height: 800px;
  /* Réduit le CLS pendant le chargement */
}

.random-section {
  min-height: auto !important;
}

/* =============================================
   GAME CARD
   ============================================= */
.game-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  animation: cardReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.6);
  min-height: 480px;
  /* Réduit le CLS pendant le chargement */
  display: flex;
  flex-direction: column;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.game-card:nth-child(1) {
  animation-delay: 0.05s;
}

.game-card:nth-child(2) {
  animation-delay: 0.1s;
}

.game-card:nth-child(3) {
  animation-delay: 0.15s;
}

.game-card:nth-child(4) {
  animation-delay: 0.2s;
}

.game-card:nth-child(5) {
  animation-delay: 0.25s;
}

.game-card:nth-child(6) {
  animation-delay: 0.3s;
}

.game-card.is-hidden-desktop,
.game-card.is-hidden {
  display: none !important;
}

/* Hover : lift + glow */
.game-card:hover {
  transform: translateY(-10px) scale(1.01);
  box-shadow: 0 24px 60px rgba(102, 126, 234, 0.22), 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: rgba(102, 126, 234, 0.3);
}

/* Random game card */
.game-card.random-game {
  background: linear-gradient(135deg, #fff 0%, #f8f5ff 100%);
  border: 1.5px dashed rgba(102, 126, 234, 0.35);
}

/* =============================================
   CARD HEADER (badges)
   ============================================= */
.card-header {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.badge {
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.badge-new {
  background: linear-gradient(135deg, #2b9348, #007f5f);
  /* Plus sombre pour le contraste */
  color: white;
  box-shadow: 0 2px 10px rgba(0, 127, 95, 0.4);
  animation: badgePulse 2.5s ease-in-out infinite;
}

@keyframes badgePulse {

  0%,
  100% {
    box-shadow: 0 2px 10px rgba(81, 207, 102, 0.4);
  }

  50% {
    box-shadow: 0 2px 18px rgba(81, 207, 102, 0.7);
  }
}

.badge-multiplayer {
  background: rgba(39, 174, 96, 0.95);
  color: white;
  box-shadow: 0 2px 10px rgba(39, 174, 96, 0.35);
}

.badge-action {
  background: rgba(192, 57, 43, 0.95);
  color: white;
  box-shadow: 0 2px 10px rgba(192, 57, 43, 0.35);
}

.badge-exploration {
  background: rgba(41, 128, 185, 0.95);
  /* Plus sombre */
  color: white;
  box-shadow: 0 2px 10px rgba(41, 128, 185, 0.35);
}

.badge-chill {
  background: rgba(142, 68, 173, 0.92);
  color: white;
  box-shadow: 0 2px 10px rgba(142, 68, 173, 0.35);
}

.badge-strategy {
  background: rgba(41, 128, 185, 0.95);
  color: white;
  box-shadow: 0 2px 10px rgba(41, 128, 185, 0.35);
}

.badge-popular {
  background: rgba(231, 76, 60, 0.95);
  color: white;
  box-shadow: 0 2px 10px rgba(231, 76, 60, 0.35);
}

.badge-classic {
  background: rgba(102, 126, 234, 0.92);
  color: white;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.35);
}

.badge-adventure {
  background: rgba(211, 84, 0, 0.95);
  /* Plus sombre */
  color: white;
  box-shadow: 0 2px 10px rgba(211, 84, 0, 0.35);
}

.badge-fun {
  background: rgba(142, 68, 173, 0.95);
  /* Plus sombre */
  color: white;
  box-shadow: 0 2px 10px rgba(142, 68, 173, 0.35);
}

.badge-brain {
  background: rgba(26, 188, 156, 0.92);
  color: white;
  box-shadow: 0 2px 10px rgba(26, 188, 156, 0.35);
}

.badge-simulation {
  background: rgba(26, 188, 156, 0.92);
  color: white;
  box-shadow: 0 2px 10px rgba(26, 188, 156, 0.35);
}

.badge-soon {
  background: rgba(255, 212, 59, 0.92);
  color: var(--dark);
  box-shadow: 0 2px 10px rgba(255, 212, 59, 0.35);
}

/* =============================================
   CARD IMAGE
   ============================================= */
.card-image {
  position: relative;
  width: 100%;
  height: 220px;
  background: linear-gradient(145deg, #f4f2ff 0%, #ece8ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Subtle pattern inside card image */
.card-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(102, 126, 234, 0.08) 1px, transparent 0);
  background-size: 28px 28px;
  pointer-events: none;
}

.card-image img {
  width: 130px;
  height: 130px;
  object-fit: contain;
  transition: var(--transition);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.12));
  position: relative;
  z-index: 1;
}

.game-card:hover .card-image img {
  transform: scale(1.12) rotate(4deg);
  filter: drop-shadow(0 10px 28px rgba(102, 126, 234, 0.25));
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.93) 0%, rgba(118, 75, 162, 0.93) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(2px);
  z-index: 5;
  /* Au dessus du contenu mais sous les boutons interactifs si besoin */
}

.game-card:hover .card-overlay {
  opacity: 1;
}

.play-button {
  transform: scale(0.75);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.3));
}

.game-card:hover .play-button {
  transform: scale(1);
  animation: popIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from {
    transform: scale(0.6);
  }

  50% {
    transform: scale(1.1);
  }

  to {
    transform: scale(1);
  }
}

.random-game-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.random-game-icon {
  font-size: 76px;
  margin-bottom: 10px;
  display: block;
  animation: spinSlow 4s linear infinite;
  filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.2));
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.random-game-content h4 {
  color: var(--text-light);
  font-size: 16px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
}

/* =============================================
   CARD CONTENT
   ============================================= */
.card-content {
  padding: 22px 22px 14px;
}

/* Title row with heart */
.card-title-row {
  display: flex !important;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.card-description {
  font-size: 13.5px;
  color: var(--text-light);
  line-height: 1.65;
  margin: 10px 0 14px;
  font-weight: 300;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  padding: 5px 12px;
  background: #f0eeff;
  border-radius: 50px;
  font-size: 11.5px;
  font-weight: 500;
  color: #5e4db2;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, transform 0.2s ease;
}

.tag:hover {
  background: #e0d8ff;
  transform: translateY(-1px);
}

/* =============================================
   HEART BUTTON
   ============================================= */
.heart-btn {
  position: relative !important;
  z-index: 10;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: #c9c4e0;
  flex-shrink: 0;
}

.heart-btn:hover {
  transform: scale(1.15);
  background: #fff0f0;
  color: #ff4757;
}

.heart-btn.liked {
  color: #ff4757;
  background: #fff0f0;
  animation: heartPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.heart-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: fill 0.25s ease;
}

.heart-btn.liked svg {
  fill: #ff4757;
}

@keyframes heartPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.35);
  }

  100% {
    transform: scale(1);
  }
}

/* =============================================
   CARD FOOTER
   ============================================= */
.card-footer {
  padding: 0 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stars {
  color: #ffd43b;
  font-size: 15px;
  letter-spacing: 1px;
  filter: drop-shadow(0 1px 3px rgba(255, 212, 59, 0.4));
}

.rating-text {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.btn-play,
.btn-random {
  padding: 11px 26px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
}

.btn-play::before,
.btn-random::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.45s ease;
}

.btn-play:hover::before,
.btn-random:hover::before {
  left: 100%;
}

.btn-play:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
}

.btn-random {
  background: linear-gradient(135deg, var(--accent) 0%, #f5576c 100%);
  box-shadow: 0 4px 16px rgba(240, 147, 251, 0.35);
}

.btn-random:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 24px rgba(240, 147, 251, 0.5);
}

/* =============================================
   RANDOM SECTION
   ============================================= */
.random-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  justify-content: center;
  gap: 24px;
  margin-bottom: 80px;
  width: 100%;
}

.game-card.random-game {
  animation-delay: 0.45s;
}

/* ── BOUTON HEADER ───────────────────────────────────────── */
.daily-challenge-wrapper {
  position: fixed;
  top: 24px;
  /*mettre au centre */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.daily-challenge-btn {
  display: flex;
  align-items: center;
  height: 44px;
  gap: 7px;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  padding: 8px 14px 8px 10px;
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .22s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  letter-spacing: .2px;
  white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.daily-challenge-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.challenge-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .9;
}

/* État : complété aujourd'hui */
.daily-challenge-btn.challenge-done {
  background: rgba(67, 233, 123, 0.15);
  border-color: rgba(67, 233, 123, 0.45);
  color: #43e97b;
}

.daily-challenge-btn.challenge-done:hover {
  background: rgba(67, 233, 123, 0.25);
}

/* État : ignoré */
.daily-challenge-btn.challenge-skipped {
  opacity: .55;
}

/* État : offline (grisé, pas de hover lift) */
.daily-challenge-btn.challenge-offline {
  opacity: .45;
  cursor: default;
  pointer-events: auto;
  /* on garde les clics pour le toast */
}

.daily-challenge-btn.challenge-offline:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ── STAT PROFIL ─────────────────────────────────────────── */
/* La grille passe à 3 colonnes quand la carte challenge est présente */
.profile-stats-grid:has(.pstat-card-challenge) {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* Fallback sans :has() — ajouter manuellement la classe si besoin */
.profile-stats-grid.has-challenge {
  grid-template-columns: repeat(3, 1fr) !important;
}

.pstat-card-challenge .pstat-icon {
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pstat-challenge-name {
  font-size: .85rem !important;
  font-weight: 800 !important;
  letter-spacing: -.2px;
}

/* ── ANIMATIONS MODAL ────────────────────────────────────── */
@keyframes modal-fadein {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modal-slidein {
  from {
    transform: translateY(24px) scale(.97);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Hover boutons dans la modal */
#challengePlayBtn:hover {
  transform: scale(1.02) !important;
  opacity: .92 !important;
}

#challengeSkipBtn:hover {
  opacity: .75 !important;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  padding: 44px 0 36px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.footer p {
  margin-bottom: 18px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  /* Plus clair pour le contraste */
  font-weight: 400;
  letter-spacing: 0.02em;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.footer-link {
  color: #ffffff;
  display: flex;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  padding: 8px 18px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.01em;
}

.footer-link:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  color: white;
}

.footer-link svg {
  flex-shrink: 0;
  opacity: 0.85;
  margin-right: 6px;
}

.footer-link:hover svg {
  opacity: 1;
}

.separator {
  color: rgba(255, 255, 255, 0.3);
  font-size: 12px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.social-links a {
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.social-links a:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-4px) scale(1.08);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.social-links a:nth-child(1):hover {
  background: linear-gradient(135deg, #833ab4, #fd1d1d 50%, #fcb045);
  border-color: transparent;
}

.social-links a:nth-child(2):hover {
  background: rgba(51, 51, 51, 0.9);
  border-color: rgba(255, 255, 255, 0.15);
}

/* =============================================
   FLOATING SETTINGS
   ============================================= */
.floating-settings-container {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 2000;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.floating-settings-container.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.settings-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-floating {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  opacity: 0.85;
  /* Plus visible */
}

.btn-floating.secondary {
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  margin-left: -12px;
  pointer-events: none;
}

.floating-settings-container:hover .btn-floating.secondary {
  width: 52px;
  height: 52px;
  opacity: 0.65;
  margin-left: 0;
  pointer-events: auto;
}

.btn-floating:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.1);
  opacity: 1 !important;
  color: white;
}

.btn-floating.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
  opacity: 1 !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =============================================
   ANIMATIONS KEYFRAMES
   ============================================= */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================
   RESPONSIVE — MOBILE
   ============================================= */
@media (max-aspect-ratio: 1/1) {
  .header {
    padding: 48px 0 32px;
  }

  .header h1 {
    font-size: 34px;
    letter-spacing: -1px;
  }

  .logo-icon {
    font-size: 48px;
  }

  .status-badge {
    font-size: 9px;
    padding: 4px 10px;
  }

  .status-dot {
    width: 6px;
    height: 6px;
  }

  .subtitle {
    font-size: 14px;
  }

  .stats-bar {
    flex-direction: column;
    gap: 0;
    padding: 0;
  }

  .stat-item {
    padding: 18px 20px;
  }

  .stat-item+.stat-item::before {
    top: 0;
    left: 20%;
    width: 60%;
    height: 1px;
  }

  .stat-number {
    font-size: 22px;
  }

  .stat-label {
    font-size: 11px;
  }

  .search-bar {
    width: 92%;
    max-width: 400px;
    margin: 20px auto 24px;
  }

  .search-bar input {
    font-size: 14px;
    padding: 13px 44px 13px 18px;
  }

  .category-filters {
    display: none !important;
  }

  .games-grid,
  .random-section {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .card-title {
    font-size: 18px;
  }

  .card-image {
    height: 190px;
  }

  .card-image img {
    width: 110px;
    height: 110px;
  }

  .challenge-btn-label {
    display: none;
  }

  .daily-challenge-btn {
    padding: 8px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    justify-content: center;
  }

  .daily-challenge-wrapper {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 8px;
  }

  .footer-link {
    font-size: 12.5px;
    padding: 7px 14px;
  }

  .social-links {
    gap: 12px;
  }

  .floating-settings-container {
    bottom: 20px;
    left: 20px;
  }

  .btn-floating {
    width: 46px;
    height: 46px;
  }
}

/* =============================================
   TABLET
   ============================================= */
@media (min-width: 600px) and (max-width: 900px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}