/* ==================== RESET ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==================== BODY ==================== */
html {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
}

body {
  width: 100%;
  min-height: 100vh;
  height: auto;
  background: #111;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  position: relative;
  font-family: 'Arial', sans-serif;
  padding: 0;
  margin: 0;
}

/* Wrapper pour centrer le contenu */
body > * {
  position: relative;
}

/* Mobile : permettre le scroll */
@media (max-width: 768px) {
  html, body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative;
    height: auto;
    min-height: 100vh;
  }
}

/* ==================== CANVAS RESPONSIVE ==================== */
canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  margin: 0 auto;
  position: relative;
}

/* Desktop : centré SANS bloquer le scroll */
@media (min-width: 769px) {
  canvas {
    position: relative;
    margin: 0 auto;
    display: block;
  }
}

/* Mobile : plein écran avec scroll si nécessaire */
@media (max-width: 768px) {
  canvas {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw;
    max-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
  }
  
  /* Permettre le scroll si le contenu dépasse */
  body.game-active {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Extra small screens */
@media (max-width: 380px) {
  canvas {
    min-height: 100vh;
  }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
  canvas {
    height: 100vh !important;
    width: auto !important;
    max-width: 100vw;
  }
}

/* ==================== GAME PAGE IMPROVEMENTS ==================== */
/* Améliorer la visibilité et l'interaction sur mobile */
@media (max-width: 768px) {
  /* S'assurer que le canvas prend tout l'espace */
  #canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
  }
  
  /* Empêcher le zoom sur double-tap */
  canvas {
    touch-action: manipulation;
  }
}

/* Portrait mobile - optimisations supplémentaires */
@media (max-width: 768px) and (orientation: portrait) {
  #canvas {
    height: 100vh !important;
  }
  
  /* Cacher la barre d'adresse sur scroll */
  body.game-active {
    position: fixed;
    width: 100%;
    height: 100vh;
    overflow: hidden;
  }
}

/* ==================== WELCOME PAGE ==================== */
.welcome-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  height: auto;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 10000;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 20px 0;
  -webkit-overflow-scrolling: touch;
  animation: welcomeGradient 10s ease infinite;
}

/* Desktop : FORCER le scroll */
@media (min-width: 769px) {
  .welcome-page {
    position: relative;
    overflow-y: auto !important;
    height: auto;
    min-height: 100vh;
  }
}

/* Mobile : scroll déjà activé ci-dessus */
@media (max-width: 768px) {
  .welcome-page {
    overflow-y: auto;
    overflow-x: hidden;
    align-items: flex-start;
    padding: 20px 0;
    -webkit-overflow-scrolling: touch;
  }
}

@keyframes welcomeGradient {
  0%, 100% {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  }
  50% {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 50%, #1a1a2e 100%);
  }
}

.welcome-page.hide {
  animation: fadeOutPage 0.8s ease forwards;
}

@keyframes fadeOutPage {
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* ==================== SNOW ANIMATION ==================== */
.snow-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.snow-container::before,
.snow-container::after {
  content: "❄️ ❄️ ❄️ ❄️ ❄️ ❄️ ❄️ ❄️ ❄️ ❄️ ❄️ ❄️ ❄️ ❄️ ❄️";
  position: absolute;
  top: -50px;
  left: 0;
  right: 0;
  font-size: 20px;
  white-space: nowrap;
  animation: snowfall 15s linear infinite;
  opacity: 0.6;
}

.snow-container::after {
  animation-delay: 7s;
  animation-duration: 20s;
}

@keyframes snowfall {
  from {
    transform: translateY(-50px);
  }
  to {
    transform: translateY(100vh);
  }
}

/* ==================== WELCOME CONTENT ==================== */
.welcome-content {
  text-align: center;
  padding: 10px;
  max-width: 750px;
  width: 90%;
  margin: 20px auto;
  animation: slideUp 0.8s ease;
}

@media (max-width: 768px) {
  .welcome-content {
    padding: 20px 15px;
    width: 95%;
    margin: auto;
  }
}

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

/* ==================== LOGO & TITLE ==================== */
.logo-container {
  position: relative;
  margin-bottom: 15px;
}

.star-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
  pointer-events: none;
}

.star-particle {
  position: absolute;
  width: 100%;
  height: 100%;
  animation: starRotate 20s linear infinite;
}

.star-particle::before {
  content: "✨";
  position: absolute;
  font-size: 18px;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  animation: starPulse 2s ease-in-out infinite;
}

.star-particle:nth-child(1) { transform: rotate(0deg); }
.star-particle:nth-child(2) { transform: rotate(60deg); }
.star-particle:nth-child(3) { transform: rotate(120deg); }
.star-particle:nth-child(4) { transform: rotate(180deg); }
.star-particle:nth-child(5) { transform: rotate(240deg); }
.star-particle:nth-child(6) { transform: rotate(300deg); }

@keyframes starRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes starPulse {
  0%, 100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translateX(-50%) scale(1.2);
  }
}

.welcome-title {
  position: relative;
  z-index: 1;
  margin: 0;
}

.title-line {
  display: block;
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  font-weight: 900;
  background: linear-gradient(45deg, #ffd700, #ff6b6b, #4ecdc4, #ffd700);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
  letter-spacing: 2px;
}

.title-subtitle {
  display: block;
  font-size: clamp(0.9rem, 2vw, 1.3rem);
  font-weight: 700;
  color: #ffd700;
  margin-top: 5px;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
}

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

/* ==================== GAME PREVIEW ==================== */
.game-preview {
  margin: 15px 0;
  position: relative;
  height: 140px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 12px;
  backdrop-filter: blur(5px);
  border: 2px solid rgba(255, 215, 0, 0.2);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.preview-label {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ffd700 0%, #ff6b6b 100%);
  color: white;
  padding: 5px 18px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
  z-index: 100;
  animation: labelPulse 2s ease-in-out infinite;
}

@keyframes labelPulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.05);
  }
}

.preview-stars {
  position: relative;
  width: 100%;
  height: 100%;
}

.preview-star {
  position: absolute;
  font-size: clamp(32px, 5vw, 48px);
  animation: floatStar 3s ease-in-out infinite;
  cursor: default;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8)) 
          drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
  z-index: 10;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.9),
               0 0 30px rgba(255, 215, 0, 0.6);
}

.star-1 { 
  left: 8%; 
  top: 15%; 
  animation-delay: 0s;
  font-size: clamp(36px, 6vw, 52px);
}
.star-2 { 
  left: 28%; 
  top: 55%; 
  animation-delay: 0.5s;
  font-size: clamp(30px, 4.5vw, 44px);
}
.star-3 { 
  left: 48%; 
  top: 5%; 
  animation-delay: 1s;
  font-size: clamp(40px, 7vw, 56px);
}
.star-4 { 
  left: 68%; 
  top: 50%; 
  animation-delay: 1.5s;
  font-size: clamp(34px, 5.5vw, 48px);
}
.star-5 { 
  left: 82%; 
  top: 20%; 
  animation-delay: 2s;
  font-size: clamp(32px, 5vw, 46px);
}
.star-6 { 
  left: 45%; 
  top: 70%; 
  animation-delay: 2.5s;
  font-size: clamp(35px, 6vw, 50px);
}

@keyframes floatStar {
  0%, 100% {
    transform: translateY(0) rotate(0deg) scale(1);
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8)) 
            drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
  }
  25% {
    transform: translateY(-15px) rotate(8deg) scale(1.08);
    filter: drop-shadow(0 0 16px rgba(255, 215, 0, 1)) 
            drop-shadow(0 0 28px rgba(255, 215, 0, 0.6));
  }
  50% {
    transform: translateY(0) rotate(0deg) scale(1.04);
    filter: drop-shadow(0 0 20px rgba(255, 107, 107, 0.8)) 
            drop-shadow(0 0 32px rgba(255, 107, 107, 0.4));
  }
  75% {
    transform: translateY(15px) rotate(-8deg) scale(1.08);
    filter: drop-shadow(0 0 16px rgba(78, 236, 196, 0.8)) 
            drop-shadow(0 0 28px rgba(78, 236, 196, 0.4));
  }
}

/* ==================== FEATURES ==================== */
.welcome-features {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 15px 0;
  flex-wrap: wrap;
}

/* Carte stylée "6 étoiles mystérieuses" avec étoile brillante */
.mystery-stars-card {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
  backdrop-filter: blur(10px);
  padding: 16px 28px;
  border-radius: 15px;
  border: 2px solid rgba(255, 215, 0, 0.5);
  margin: 20px auto 10px auto;
  max-width: 280px;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.mystery-stars-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: #ffd700;
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.5);
}

.mystery-stars-card .card-icon {
  font-size: 36px;
  animation: sparkleIcon 2s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

@keyframes sparkleIcon {
  0%, 100% { 
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
  }
  50% { 
    transform: scale(1.15) rotate(180deg);
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1));
  }
}

.mystery-stars-card .card-title {
  color: white;
  font-size: 16px;
  line-height: 1.3;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.mystery-stars-card .card-title strong {
  color: #ffd700;
  font-size: 18px;
  font-weight: 900;
  display: inline;
}

.feature-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid rgba(255, 215, 0, 0.3);
  min-width: 140px;
  transition: all 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-3px);
  border-color: #ffd700;
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.feature-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.feature-text {
  color: white;
  font-size: 13px;
  line-height: 1.3;
}

.feature-text strong {
  color: #ffd700;
  font-size: 14px;
}

/* ==================== PRIZES SHOWCASE ==================== */
.prizes-showcase {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.prize-card {
  position: relative;
  padding: 18px 28px;
  border-radius: 18px;
  min-width: 160px;
  transform-style: preserve-3d;
  transition: all 0.4s ease;
  animation: prizeFloat 4s ease-in-out infinite;
}

.prize-card:hover {
  transform: translateY(-8px) rotateY(5deg);
}

.prize-gold {
  background: linear-gradient(135deg, #ffd700 0%, #ff6b6b 100%);
  box-shadow: 0 12px 35px rgba(255, 215, 0, 0.4);
  animation-delay: 0s;
}

.prize-silver {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 12px 35px rgba(118, 75, 162, 0.4);
  animation-delay: 2s;
}

@keyframes prizeFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.04);
  }
}

.prize-badge {
  font-size: 10px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

.prize-amount {
  font-size: 36px;
  font-weight: 900;
  color: white;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin: 6px 0;
}

.prize-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  line-height: 1.3;
}

.prize-condition {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
  font-style: italic;
  line-height: 1.3;
}

/* ==================== START BUTTON ==================== */
.start-button {
  position: relative;
  background: linear-gradient(135deg, #ff6b6b 0%, #ffd700 100%);
  color: white;
  border: none;
  padding: 16px 45px;
  font-size: clamp(15px, 2.5vw, 19px);
  font-weight: 900;
  border-radius: 40px;
  cursor: pointer;
  margin: 20px auto 15px;
  display: block;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(255, 107, 107, 0.5);
  transition: all 0.3s ease;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.start-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.start-button:hover::before {
  left: 100%;
}

.start-button:hover {
  transform: scale(1.05);
  box-shadow: 0 16px 45px rgba(255, 107, 107, 0.7);
}

.start-button:active {
  transform: scale(0.98);
}

.button-shine {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: buttonShine 3s infinite;
}

@keyframes buttonShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.button-text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-icon {
  font-size: 1.2em;
  animation: iconBounce 1s infinite;
}

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

/* ==================== ALREADY PLAYED BOX ==================== */
.already-played-box {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  border: 4px solid #ffd700;
  border-radius: 25px;
  padding: 35px 30px;
  margin: 25px auto;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 15px 50px rgba(255, 107, 107, 0.5);
  animation: alreadyPlayedFadeIn 0.6s ease;
  position: relative;
  overflow: hidden;
}

.already-played-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  animation: shimmer 3s infinite;
}

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

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.already-played-icon {
  font-size: 4em;
  margin-bottom: 15px;
  animation: lockShake 2s ease-in-out infinite;
  position: relative;
}

@keyframes lockShake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.already-played-title {
  color: white;
  font-size: 2em;
  margin-bottom: 15px;
  font-weight: 900;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
}

.already-played-message {
  color: white;
  font-size: 1.1em;
  line-height: 1.6;
  margin-bottom: 20px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  position: relative;
}

.countdown-info {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 15px 20px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px solid rgba(255, 215, 0, 0.4);
  position: relative;
}

.countdown-icon {
  font-size: 2em;
  animation: tickTock 1s ease-in-out infinite;
}

@keyframes tickTock {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(15deg); }
}

.countdown-text {
  color: white;
  font-size: 1.2em;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.shop-link {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
  text-decoration: none;
  padding: 15px 30px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.1em;
  margin-top: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
  position: relative;
}

.shop-link:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
  background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
}

/* ==================== CADRE "DÉJÀ GAGNÉ" (Gagnant à vie) ==================== */
.already-won-box {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  border: 4px solid #ffd700;
  border-radius: 25px;
  padding: 35px 30px;
  margin: 25px auto;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 15px 50px rgba(76, 175, 80, 0.5);
  animation: wonFadeIn 0.6s ease;
  position: relative;
  overflow: hidden;
}

.already-won-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 215, 0, 0.2) 50%,
    transparent 70%
  );
  animation: shimmerGold 3s infinite;
}

@keyframes wonFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes shimmerGold {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.already-won-icon {
  font-size: 4.5em;
  margin-bottom: 15px;
  animation: giftBounce 2s ease-in-out infinite;
  position: relative;
  filter: drop-shadow(0 5px 15px rgba(255, 215, 0, 0.5));
}

@keyframes giftBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.1); }
}

.already-won-title {
  color: white;
  font-size: 2.2em;
  margin-bottom: 15px;
  font-weight: 900;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
  position: relative;
}

.already-won-message {
  color: white;
  font-size: 1.2em;
  line-height: 1.7;
  margin-bottom: 20px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
}

.already-won-message strong {
  color: #ffd700;
  font-size: 1.1em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.winner-badge {
  background: rgba(255, 215, 0, 0.25);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 20px;
  margin: 25px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 3px solid #ffd700;
  position: relative;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
}

.badge-icon {
  font-size: 3em;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { 
    transform: scale(1) rotate(0deg);
    filter: brightness(1);
  }
  50% { 
    transform: scale(1.2) rotate(180deg);
    filter: brightness(1.5);
  }
}

.badge-text {
  color: #ffd700;
  font-size: 1.8em;
  font-weight: 900;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 3px;
}

/* Zone d'affichage du code promo gagné */
.winner-code-display {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 15px 20px;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 2px solid rgba(255, 215, 0, 0.5);
}

.code-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.code-value {
  color: #ffd700;
  font-size: 1.8em;
  font-weight: 900;
  font-family: 'Courier New', monospace;
  letter-spacing: 4px;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
  padding: 8px 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  border: 2px dashed #ffd700;
}

.shop-link-gold {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  font-size: 1.2em;
  padding: 18px 35px;
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
}

.shop-link-gold:hover {
  transform: translateY(-5px) scale(1.08);
  box-shadow: 0 12px 40px rgba(255, 215, 0, 0.8);
  background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
}

/* Already played box - Mobile responsive */
@media (max-width: 768px) {
  .already-played-box {
    padding: 25px 20px;
    max-width: 90%;
  }
  
  .already-played-icon {
    font-size: 3em;
  }
  
  .already-played-title {
    font-size: 1.6em;
  }
  
  .already-played-message {
    font-size: 1em;
  }
  
  .countdown-text {
    font-size: 1em;
  }
  
  .shop-link {
    padding: 12px 25px;
    font-size: 1em;
  }
}

@media (max-width: 380px) {
  .already-played-title {
    font-size: 1.4em;
  }
  
  .already-played-message {
    font-size: 0.95em;
  }
}

/* ==================== WELCOME FOOTER ==================== */
.welcome-footer {
  margin-top: 15px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.welcome-footer p {
  margin: 6px 0;
}

.footer-small {
  font-size: 11px;
  color: rgba(255, 215, 0, 0.7);
}

/* ==================== FADE IN ANIMATION ==================== */
.fade-in-up {
  animation: fadeInUp 0.8s ease backwards;
}

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

/* ==================== CODE PROMO - DÉSACTIVÉ ==================== */
#promo-code {
  display: none !important;
}

/* ==================== EFFET NEIGE CSS (Page d'accueil uniquement) ==================== */
.welcome-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, white, transparent),
    radial-gradient(2px 2px at 60% 70%, white, transparent),
    radial-gradient(1px 1px at 50% 50%, white, transparent),
    radial-gradient(1px 1px at 80% 10%, white, transparent),
    radial-gradient(2px 2px at 90% 60%, white, transparent),
    radial-gradient(1px 1px at 33% 80%, white, transparent),
    radial-gradient(2px 2px at 15% 90%, white, transparent);
  background-size: 200px 200px, 300px 300px, 250px 250px, 350px 350px, 280px 280px, 320px 320px, 290px 290px;
  background-position: 0 0, 40px 60px, 80px 120px, 120px 180px, 160px 240px, 200px 300px, 240px 360px;
  animation: snowfall 20s linear infinite;
  pointer-events: none;
  opacity: 0.6;
  z-index: 1;
}

.welcome-page::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(1px 1px at 10% 20%, white, transparent),
    radial-gradient(2px 2px at 40% 40%, white, transparent),
    radial-gradient(1px 1px at 70% 60%, white, transparent),
    radial-gradient(2px 2px at 30% 80%, white, transparent),
    radial-gradient(1px 1px at 85% 15%, white, transparent),
    radial-gradient(2px 2px at 25% 45%, white, transparent);
  background-size: 220px 220px, 310px 310px, 270px 270px, 330px 330px, 260px 260px, 340px 340px;
  background-position: 0 0, 30px 50px, 60px 100px, 90px 150px, 120px 200px, 150px 250px;
  animation: snowfall 25s linear infinite;
  pointer-events: none;
  opacity: 0.4;
  z-index: 1;
}

@keyframes snowfall {
  0% {
    background-position: 0 0, 40px 60px, 80px 120px, 120px 180px, 160px 240px, 200px 300px, 240px 360px;
  }
  100% {
    background-position: 0 600px, 40px 660px, 80px 720px, 120px 780px, 160px 840px, 200px 900px, 240px 960px;
  }
}

/* S'assurer que le contenu de la welcome page est au-dessus */
.welcome-content {
  position: relative;
  z-index: 2;
}

/* ==================== FLOCONS DE NEIGE (désactivés) ==================== */
.snowflakes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  color: white;
  user-select: none;
  pointer-events: none;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

/* ==================== CONTRÔLE MUSIQUE ==================== */
.music-control {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  border: 3px solid rgba(255, 215, 0, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  z-index: 10001;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  animation: musicPulse 2s ease-in-out infinite;
}

.music-control:hover {
  transform: scale(1.1);
  border-color: #ffd700;
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.5);
}

.music-control.muted {
  background: linear-gradient(135deg, #555 0%, #333 100%);
  animation: none;
}

@keyframes musicPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
  }
}

@media (max-width: 768px) {
  .music-control {
    width: 50px;
    height: 50px;
    font-size: 24px;
    bottom: 15px;
    right: 15px;
  }
}

/* ==================== MODAL OVERLAY ==================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10001;
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ==================== MODAL CONTENT ==================== */
.modal-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  position: relative;
  animation: bounceIn 0.6s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-content.win {
  background: linear-gradient(135deg, #6600ff 0%, #2146d8 100%);
  border: 5px solid #ff6b6b;
}

.modal-content.lose {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* ==================== MODAL TITLE ==================== */
.modal-title {
  font-size: 1.7em;
  margin-bottom: 20px;
  font-weight: bold;
}

.modal-content.win .modal-title {
  color: #ff6b6b;
}

.modal-content.lose .modal-title {
  color: white;
}

/* ==================== MODAL MESSAGE ==================== */
.modal-message {
  font-size: 1.5em;
  margin-bottom: 30px;
}

.modal-content.win .modal-message {
  color: white;
}

.modal-content.lose .modal-message {
  color: white;
}

/* ==================== PRIZE ==================== */
.prize {
  font-size: 3em;
  font-weight: bold;
  color: #ffd700;
  margin: 20px 0;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ==================== BUTTON ==================== */
.close-btn {
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 1.2em;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.close-btn:hover {
  background: #ff5252;
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6);
}

.close-btn:active {
  transform: scale(0.98);
}

/* ==================== CONFETTI ==================== */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: #ff6b6b;
  animation: fall 3s linear infinite;
  z-index: 10002;
}

@keyframes fall {
  to {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* ==================== RESPONSIVE MOBILE PARFAIT ==================== */

/* ====== iPhone & Smartphones (< 768px) ====== */
@media (max-width: 768px) {
  /* Page d'accueil mobile */
  .welcome-content {
    padding: 20px 15px;
    max-width: 100%;
    width: 100%;
  }

  .logo-container {
    margin-bottom: 25px;
  }

  .star-burst {
    width: 120px;
    height: 120px;
  }

  .star-particle::before {
    font-size: 14px;
  }

  /* Titre parfaitement responsive */
  .title-line {
    font-size: clamp(1.6rem, 7vw, 2.4rem);
    letter-spacing: 1px;
    line-height: 1.2;
  }

  .title-subtitle {
    font-size: clamp(0.8rem, 3vw, 1.1rem);
    letter-spacing: 3px;
    margin-top: 8px;
  }

  /* Aperçu du jeu - plus compact */
  .game-preview {
    height: 110px;
    margin: 15px 0;
    padding: 8px;
  }

  .preview-label {
    font-size: 10px;
    padding: 4px 12px;
    top: -8px;
  }

  .preview-stars {
    gap: 8px;
  }

  .preview-star {
    font-size: 26px !important;
  }

  .star-1 { font-size: 30px !important; }
  .star-2 { font-size: 24px !important; }
  .star-3 { font-size: 32px !important; }
  .star-4 { font-size: 28px !important; }
  .star-5 { font-size: 26px !important; }
  .star-6 { font-size: 28px !important; }

  /* Carte mystérieuse mobile */
  .mystery-stars-card {
    padding: 12px 20px;
    max-width: 90%;
    margin: 15px auto 10px auto;
    gap: 10px;
  }
  
  .mystery-stars-card .card-icon {
    font-size: 30px;
  }
  
  .mystery-stars-card .card-title {
    font-size: 14px;
  }
  
  .mystery-stars-card .card-title strong {
    font-size: 15px;
  }

  /* Features - CÔTE À CÔTE en 2 colonnes */
  .welcome-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 15px 0;
    width: 100%;
    padding: 0 5px;
  }

  .feature-item {
    padding: 12px 10px;
    min-width: auto;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .feature-icon {
    font-size: 24px;
    margin-bottom: 5px;
  }

  .feature-text {
    font-size: 11px;
    line-height: 1.3;
  }

  .feature-text strong {
    font-size: 12px;
    display: block;
  }

  /* Prix - CÔTE À CÔTE */
  .prizes-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 15px 0;
    width: 100%;
    padding: 0 5px;
  }

  .prize-card {
    padding: 12px 15px;
    min-width: auto;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .prize-badge {
    font-size: 9px;
    margin-bottom: 5px;
    padding: 3px 8px;
  }

  .prize-amount {
    font-size: 28px;
    margin: 6px 0;
  }

  .prize-desc {
    font-size: 11px;
    line-height: 1.3;
    margin-bottom: 5px;
  }

  .prize-condition {
    font-size: 10px;
    line-height: 1.3;
  }

  /* Bouton - bien centré et large */
  .start-button {
    padding: 14px 35px;
    font-size: 16px;
    margin: 20px auto 15px;
    width: 90%;
    max-width: 300px;
    display: block;
  }

  .button-text {
    font-size: 14px;
  }

  .button-icon {
    font-size: 1.1em;
  }

  /* Footer mobile */
  .welcome-footer {
    margin-top: 15px;
    margin-bottom: 25px;
    font-size: 11px;
  }

  .welcome-footer p {
    margin: 6px 0;
  }

  .footer-small {
    font-size: 10px;
  }

  /* Modal mobile parfaite */
  .modal-content {
    padding: 25px 18px;
    max-width: 92%;
    width: 92%;
    margin: 0 auto;
  }

  .modal-title {
    font-size: 1.1em;
    margin-bottom: 15px;
  }

  .modal-message {
    font-size: 1.1em;
    margin-bottom: 20px;
    line-height: 1.4;
  }

  .prize {
    font-size: 2.2em;
    margin: 15px 0;
  }

  .close-btn {
    padding: 12px 30px;
    font-size: 1.1em;
  }

  /* Cadre "Déjà joué" mobile */
  .already-played-box {
    padding: 25px 20px;
    max-width: 90%;
    width: 90%;
  }
  
  .already-played-icon {
    font-size: 2.5em;
  }
  
  .already-played-title {
    font-size: 1.5em;
  }
  
  .already-played-message {
    font-size: 0.95em;
    line-height: 1.5;
  }
  
  .countdown-text {
    font-size: 0.95em;
  }
  
  .shop-link {
    padding: 12px 25px;
    font-size: 0.95em;
  }

  /* Cadre "Déjà gagné" mobile */
  .already-won-box {
    padding: 25px 20px;
    max-width: 90%;
    width: 90%;
  }
  
  .already-won-icon {
    font-size: 3em;
  }
  
  .already-won-title {
    font-size: 1.6em;
  }
  
  .already-won-message {
    font-size: 1em;
    line-height: 1.6;
  }
  
  .winner-badge {
    padding: 15px;
    margin: 20px 0;
  }
  
  .badge-icon {
    font-size: 2.5em;
  }
  
  .badge-text {
    font-size: 1.5em;
    letter-spacing: 2px;
  }
  
  .winner-code-display {
    padding: 12px 15px;
    margin: 15px 0;
  }
  
  .code-label {
    font-size: 0.8em;
  }
  
  .code-value {
    font-size: 1.4em;
    letter-spacing: 3px;
    padding: 6px 12px;
  }
  
  .shop-link-gold {
    padding: 14px 28px;
    font-size: 1em;
  }
}

/* ====== iPhone SE / Petits écrans (< 380px) ====== */
@media (max-width: 380px) {
  .welcome-content {
    padding: 15px 10px;
  }

  .title-line {
    font-size: 1.4rem;
  }

  .title-subtitle {
    font-size: 0.75rem;
    letter-spacing: 2px;
  }

  .game-preview {
    height: 95px;
    padding: 6px;
  }

  .preview-star {
    font-size: 22px !important;
  }

  /* Features ultra compact */
  .welcome-features {
    gap: 8px;
    padding: 0 2px;
  }

  .feature-item {
    padding: 10px 8px;
  }

  .feature-icon {
    font-size: 20px;
  }

  .feature-text {
    font-size: 10px;
  }

  .feature-text strong {
    font-size: 11px;
  }

  /* Prix ultra compact */
  .prizes-showcase {
    gap: 8px;
    padding: 0 2px;
  }

  .prize-card {
    padding: 10px 12px;
  }

  .prize-amount {
    font-size: 24px;
  }

  .prize-desc {
    font-size: 10px;
  }

  .prize-condition {
    font-size: 9px;
  }

  /* Bouton */
  .start-button {
    padding: 12px 30px;
    font-size: 14px;
    width: 92%;
  }

  /* Modal */
  .modal-title {
    font-size: 1.1em;
  }

  .modal-message {
    font-size: 1em;
  }

  .prize {
    font-size: 2em;
  }

  /* Cadre déjà joué */
  .already-played-title {
    font-size: 1.3em;
  }
  
  .already-played-message {
    font-size: 0.9em;
  }
}

/* ====== Landscape Mobile (hauteur < 500px) ====== */
@media (max-width: 768px) and (orientation: landscape) {
  .welcome-content {
    padding: 10px 15px;
  }

  .logo-container {
    margin-bottom: 10px;
  }

  .star-burst {
    width: 80px;
    height: 80px;
  }

  .title-line {
    font-size: 1.5rem;
  }

  .title-subtitle {
    font-size: 0.8rem;
    margin-top: 3px;
  }

  .game-preview {
    height: 80px;
    margin: 10px 0;
  }

  /* Features et Prix en ligne */
  .welcome-features {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 10px 0;
  }

  .feature-item {
    padding: 8px 6px;
  }

  .feature-icon {
    font-size: 20px;
    margin-bottom: 3px;
  }

  .feature-text {
    font-size: 10px;
  }

  .prizes-showcase {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
  }

  .prize-card {
    padding: 10px 12px;
  }

  .prize-amount {
    font-size: 24px;
  }

  .start-button {
    padding: 10px 25px;
    font-size: 14px;
    margin: 10px auto;
  }

  .welcome-footer {
    margin-top: 10px;
    margin-bottom: 15px;
  }
}

/* ====== Tablettes Portrait (768px - 1024px) ====== */
@media (min-width: 769px) and (max-width: 1024px) {
  .welcome-content {
    padding: 30px 25px;
    max-width: 90%;
  }

  /* Features en ligne sur tablette */
  .welcome-features {
    flex-direction: row;
    gap: 15px;
  }

  .feature-item {
    flex: 1;
    min-width: 140px;
  }

  /* Prix en ligne sur tablette */
  .prizes-showcase {
    flex-direction: row;
    gap: 20px;
  }

  .prize-card {
    flex: 1;
  }
}

/* ==================== FIN DU RESPONSIVE ==================== */

  .welcome-footer {
    font-size: 11px;
  }

  .footer-small {
    font-size: 10px;
  }


/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .welcome-page {
    align-items: flex-start;
  }

  .welcome-content {
    padding: 10px;
  }

  .logo-container {
    margin-bottom: 8px;
  }

  .star-burst {
    width: 120px;
    height: 120px;
  }

  .title-line {
    font-size: clamp(1.3rem, 6vw, 2rem);
  }

  .title-subtitle {
    font-size: clamp(0.8rem, 2.5vw, 1.1rem);
  }

  .game-preview {
    height: 100px;
    margin: 12px 0;
  }

  .welcome-features {
    flex-direction: row;
    gap: 10px;
  }

  .feature-item {
    min-width: 150px;
    padding: 10px 14px;
  }

  .prizes-showcase {
    flex-direction: row;
    gap: 12px;
  }

  .prize-card {
    min-width: 160px;
    padding: 12px 18px;
  }

  .prize-amount {
    font-size: 30px;
  }

  .start-button {
    padding: 12px 35px;
    margin: 15px auto 12px;
  }

  .welcome-footer {
    margin-top: 12px;
    margin-bottom: 20px;
  }
}
