:root {
  --bg: #0f1114;
  --card: #141618;
  --muted: #9aa4ab;
  --accent: #FFB6C1;
  --gold: #FFD700;
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: linear-gradient(135deg, #0f1114 0%, #1a1d24 50%, #0f1114 100%);
  color: #e8eef2;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  overflow-x: hidden;
  position: relative;
}

/* Effet de fond animé */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(255, 182, 193, 0.05) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
  animation: bgPulse 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes bgPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

.container { 
  width: 100%; 
  max-width: 880px; 
  position: relative;
  z-index: 1;
}

.card {
  background: linear-gradient(135deg, rgba(20, 22, 24, 0.95) 0%, rgba(25, 28, 31, 0.95) 100%);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 
              0 0 80px rgba(255, 182, 193, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 182, 193, 0.1);
}

.card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 182, 193, 0.03), transparent);
  animation: cardShine 6s linear infinite;
  pointer-events: none;
}

@keyframes cardShine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

header {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  position: relative;
}

.logo {
  width: 80px; 
  height: 80px;
  background: linear-gradient(135deg, rgba(255,182,193,0.15), rgba(255,215,0,0.15));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  color: var(--gold);
  font-size: 28px; 
  font-weight: 700; 
  flex-shrink: 0;
  box-shadow: 0 8px 25px rgba(255, 182, 193, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: logoFloat 3s ease-in-out infinite;
  border: 2px solid rgba(255, 215, 0, 0.2);
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

.header-text h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.3;
  position: relative;
}

.lead {
  color: var(--muted);
  margin: 10px 0 20px;
  font-size: 1rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.panel {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(255, 182, 193, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 182, 193, 0.1), transparent);
  transition: left 0.5s ease;
}

.panel:hover::before {
  left: 100%;
}

.panel:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(255, 182, 193, 0.2);
  border-color: rgba(255, 182, 193, 0.3);
}

.panel label {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  border: 2px solid rgba(255,182,193,0.2);
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

input:focus { 
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 20px rgba(255, 182, 193, 0.3), inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn {
  background: linear-gradient(135deg, #FFB6C1 0%, #FFD700 100%);
  border: none; 
  padding: 12px 24px; 
  border-radius: 12px;
  cursor: pointer; 
  font-weight: 700; 
  color: #000;
  font-size: 1rem; 
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 182, 193, 0.4), 
              0 0 30px rgba(255, 215, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 25px rgba(255, 182, 193, 0.6), 
              0 0 50px rgba(255, 215, 0, 0.5);
}

.btn:active { 
  transform: translateY(0) scale(0.98); 
}

.spinBtn {
  width: 180px; 
  height: 180px; 
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1d24 0%, #0f1416 100%);
  color: #fff; 
  font-weight: 700; 
  border: 8px solid transparent;
  background-clip: padding-box;
  cursor: pointer; 
  margin: 40px auto; 
  display: block;
  font-size: 1.2rem;
  transition: all 0.4s ease;
  box-shadow: 0 0 0 2px rgba(255, 182, 193, 0.3),
              0 0 30px rgba(255, 182, 193, 0.4), 
              0 0 60px rgba(255, 215, 0, 0.3),
              inset 0 0 20px rgba(255, 182, 193, 0.1);
  position: relative;
  animation: wheelPulse 2s ease-in-out infinite;
}

.spinBtn::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  background: linear-gradient(45deg, #FFB6C1, #FFD700, #FF69B4, #FFB6C1);
  border-radius: 50%;
  z-index: -1;
  animation: wheelRotate 4s linear infinite;
}

@keyframes wheelRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes wheelPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.spinBtn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px rgba(255, 182, 193, 0.5),
              0 0 40px rgba(255, 182, 193, 0.6), 
              0 0 80px rgba(255, 215, 0, 0.5),
              inset 0 0 30px rgba(255, 182, 193, 0.2);
}

.hidden { display: none !important; }

.result {
  text-align: center;
  background: linear-gradient(135deg, rgba(255,182,193,0.15), rgba(255,215,0,0.1));
  border-radius: 16px;
  margin-top: 24px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 182, 193, 0.3);
  box-shadow: 0 10px 40px rgba(255, 182, 193, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: resultAppear 0.8s ease-out;
}

@keyframes resultAppear {
  0% { 
    opacity: 0; 
    transform: scale(0.8) translateY(30px); 
  }
  100% { 
    opacity: 1; 
    transform: scale(1) translateY(0); 
  }
}

.result h2 {
  font-size: 1.8rem;
  margin-bottom: 16px;
  background: linear-gradient(90deg, #FFB6C1, #FFD700);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleShine 3s ease-in-out infinite;
}

@keyframes titleShine {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
}

.result p {
  font-size: 1.1rem;
  line-height: 1.6;
}

.result strong { 
  color: var(--gold); 
  font-size: 1.3rem;
}

.result .giftBg {
  background-image: url('../images/cadeau_bg.png');
  background-size: 250px auto;
  background-repeat: no-repeat;
  background-position: center;
  position: absolute;
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0;
  opacity: 0.15;
  pointer-events: none;
  animation: bgFloat 6s ease-in-out infinite;
}

@keyframes bgFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}

footer {
  text-align: center;
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.95rem;
}

.confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.snowflake, .heart {
  position: fixed;
  top: -50px;
  font-size: 24px;
  z-index: 9998;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.heart {
  font-size: 2.5rem;
  color: #FFB6C1;
  animation: floatHeart 6s linear infinite;
  opacity: 0.8;
}

@keyframes floatHeart {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0.8; }
  50% { opacity: 1; }
  100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* Compte à rebours */
#countdownOverlay {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #0f1114 0%, #1a1d24 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 99999;
  color: var(--gold);
  font-family: 'Poppins', sans-serif;
  text-align: center;
  padding: 20px;
  overflow: hidden;
}

/* Empêcher le scroll quand le countdown est actif */
body.countdown-active {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

.countdownContent {
  position: relative;
  z-index: 10000;
  background: rgba(0,0,0,0.4);
  padding: 40px 50px;
  border-radius: 20px;
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 182, 193, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
              0 0 80px rgba(255, 182, 193, 0.2);
}

.countdownContent p {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

#timer { 
  margin-top: 20px; 
  font-size: 2.5rem; 
  font-weight: 700; 
}

#timer span { 
  display: inline-block; 
  min-width: 50px; 
  text-shadow: 0 0 15px #FFB6C1, 0 0 30px #FFD700, 0 0 45px #FF69B4;
  color: #FFB6C1;
  animation: timerGlow 2s ease-in-out infinite;
}

@keyframes timerGlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

#message {
  color: #FFD700;
  font-size: 2rem;
  margin-bottom: 30px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,100% { opacity:0.7; transform:scale(1);}
  50% { opacity:1; transform:scale(1.08);}
}

/* Bouton Calendrier de l'Avent */
.calendar-btn {
  display: inline-block;
  margin-top: 30px;
  padding: 16px 32px;
  background: linear-gradient(135deg, #FFB6C1 0%, #FFD700 100%);
  color: #000;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(255, 182, 193, 0.5), 
              0 0 40px rgba(255, 215, 0, 0.4);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 215, 0, 0.3);
  animation: calendarBtnPulse 2s ease-in-out infinite;
}

.calendar-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: calendarShine 3s linear infinite;
}

@keyframes calendarShine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes calendarBtnPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 25px rgba(255, 182, 193, 0.5), 0 0 40px rgba(255, 215, 0, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 12px 35px rgba(255, 182, 193, 0.7), 0 0 60px rgba(255, 215, 0, 0.6); }
}

.calendar-btn:hover {
  transform: translateY(-5px) scale(1.08);
  box-shadow: 0 15px 40px rgba(255, 182, 193, 0.8), 
              0 0 80px rgba(255, 215, 0, 0.7);
  border-color: rgba(255, 215, 0, 0.6);
}

.calendar-btn:active {
  transform: translateY(-2px) scale(1.02);
}

.eye { 
  font-size:3vw; 
  position:absolute; 
  z-index:9999;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

@media(max-width:500px){ 
  .eye { font-size:6vw;} 
}

/* Guirlande */
.guirlande {
  position: absolute;
  top: 5%;
  width: 90%;
  display: flex;
  justify-content: space-around;
}

.light {
  width: 18px; 
  height: 30px; 
  border-radius: 50%;
  animation: blink 1.5s infinite;
}

.light:nth-child(1) { background:red; box-shadow:0 0 15px red, 0 0 30px red; animation-delay:0s;}
.light:nth-child(2) { background:gold; box-shadow:0 0 15px gold, 0 0 30px gold; animation-delay:0.2s;}
.light:nth-child(3) { background:lime; box-shadow:0 0 15px lime, 0 0 30px lime; animation-delay:0.4s;}
.light:nth-child(4) { background:cyan; box-shadow:0 0 15px cyan, 0 0 30px cyan; animation-delay:0.6s;}
.light:nth-child(5) { background:magenta; box-shadow:0 0 15px magenta, 0 0 30px magenta; animation-delay:0.8s;}
.light:nth-child(6) { background:orange; box-shadow:0 0 15px orange, 0 0 30px orange; animation-delay:1s;}
.light:nth-child(7) { background:blue; box-shadow:0 0 15px blue, 0 0 30px blue; animation-delay:1.2s;}
.light:nth-child(8) { background:pink; box-shadow:0 0 15px pink, 0 0 30px pink; animation-delay:1.4s;}

@keyframes blink {
  0%,100%{opacity:0.3; transform: scale(0.9);}
  50%{opacity:1; transform: scale(1.1);}
}

/* Responsive */
@media(max-width:500px){
  .card { padding:24px;}
  .logo { width:70px; height:70px; font-size:24px;}
  .spinBtn { width:150px; height:150px; font-size:1rem;}
  .btn { width:100%;}
  input { font-size:14px;}
  .lead { font-size:0.9rem;}
  .calendar-btn { font-size: 1rem; padding: 14px 28px; }
}

/* Styles pour la validation des questions */
.hint {
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.hint.success {
    color: #FFB6C1;
    text-shadow: 0 0 10px #FFB6C1, 0 0 20px #FFD700, 0 0 30px #FF69B4;
    animation: popGlow 0.6s ease forwards;
}

@keyframes popGlow {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.hint.error {
    color: #FF6B6B;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
}

input:disabled {
    background: rgba(255, 182, 193, 0.15);
    border-color: rgba(255, 182, 193, 0.4);
    color: rgba(255, 182, 193, 0.7);
    cursor: not-allowed;
    box-shadow: 0 0 15px rgba(255, 182, 193, 0.3);
    transition: all 0.3s ease;
}

input:disabled::placeholder {
    color: rgba(255, 182, 193, 0.4);
}

input.disabledInput {
    animation: fadeLocked 0.6s ease forwards;
}

@keyframes fadeLocked {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(255, 182, 193, 0.6); }
    100% { transform: scale(1); }
}

#countdownOverlay, 
#countdownOverlay * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#title {
    background: linear-gradient(90deg, #FF4C4C, #FFD700, #FFB6C1, #FF69B4);
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: clamp(1.4rem, 2.8vw, 2rem);
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    filter: drop-shadow(0 0 8px rgba(255, 182, 193, 0.6)) 
            drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
    animation: titleGradient 5s ease infinite, titleFloat 3s ease-in-out infinite;
}

@keyframes titleGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes titleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.floatingEmoji {
    position: fixed;
    font-size: 20px;
    pointer-events: none;
    z-index: 9997;
    opacity: 0.9;
    animation-name: floatEmoji;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

@keyframes floatEmoji {
    0% { transform: translateY(100vh) rotate(0deg) scale(1); opacity: 0.9; }
    50% { opacity: 1; transform: translateY(50vh) rotate(180deg) scale(1.2); }
    100% { transform: translateY(-10vh) rotate(360deg) scale(0.8); opacity: 0; }
}

/* ===========================
   STYLES POUR L'EFFET GRATTAGE
   =========================== */

#giftTextContainer {
    position: relative;
    display: inline-block;
    font-weight: 700;
    color: var(--gold);
    font-size: 1.5rem;
    padding: 8px 0;
}

#giftText {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding: 12px 20px;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: linear-gradient(90deg, #FFD700, #FFB6C1, #FFD700);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#giftText.visible {
    opacity: 1;
}

#scratchCanvas {
    position: absolute;
    top: 0;
    left: 0;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="%23FFB6C1" opacity="0.5"/></svg>') 12 12, pointer;
    z-index: 2;
    border-radius: 10px;
    transition: opacity 0.5s ease;
}

/* Bouton désactivé avant grattage */
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(0.5);
}

.btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.2);
}

/* Effet de scintillement sur le bouton actif */
.btn.sparkle {
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 182, 193, 0.4), 
                    0 0 30px rgba(255, 215, 0, 0.3);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 6px 30px rgba(255, 182, 193, 0.8), 
                    0 0 60px rgba(255, 215, 0, 0.6),
                    0 0 90px rgba(255, 105, 180, 0.4);
        transform: scale(1.08);
        filter: brightness(1.3);
    }
}

/* Animation de particules autour du texte */
#giftText.particles-glow {
    animation: particlesGlow 2s ease-in-out infinite, textFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px #FFD700) 
            drop-shadow(0 0 25px #FFB6C1) 
            drop-shadow(0 0 35px #FF69B4);
}

@keyframes particlesGlow {
    0%, 100% {
        filter: drop-shadow(0 0 15px #FFD700) 
                drop-shadow(0 0 25px #FFB6C1) 
                drop-shadow(0 0 35px #FF69B4);
    }
    50% {
        filter: drop-shadow(0 0 25px #FFD700) 
                drop-shadow(0 0 40px #FFB6C1) 
                drop-shadow(0 0 60px #FF69B4)
                drop-shadow(0 0 80px #FFC0CB);
    }
}

@keyframes textFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.05); }
}