/* ==========================================
   THE SPOOKY CHALLENGE – Main Stylesheet
   Le Café des Auteurices
   ========================================== */

/* ---- Google Fonts already loaded in HTML ---- */

/* ---- CSS Variables ---- */
:root {
  --orange:        #c0002a;
  --orange-light:  #b76de0;
  --orange-glow:   rgba(192, 0, 42, 0.4);
  --purple-dark:   #1a0a2e;
  --purple-mid:    #2d1060;
  --purple-light:  #5c2d91;
  --red-blood:     #8b0000;
  --red-vivid:     #cc0000;
  --green-ghost:   #d966ff;
  --card-bg:       rgba(13, 4, 28, 0.82);
  --card-border:   rgba(192, 0, 42, 0.3);
  --text-light:    #f0e6ff;
  --text-muted:    #a080c0;
  --gold:          #ffd700;
  --silver:        #c0c0c0;
  --bronze:        #cd7f32;
  --radius:        16px;
  --transition:    0.3s ease;
}

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

/* ---- Base ---- */
html { scroll-behavior: smooth; }

body {
  font-family: 'Raleway', sans-serif;
  background-color: var(--purple-dark);
  background-image: url('halloween_bg_1791393428623.png');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Dark overlay on background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 2, 22, 0.75) 0%,
    rgba(26, 10, 46, 0.80) 50%,
    rgba(10, 2, 22, 0.90) 100%
  );
  pointer-events: none;
  z-index: 0;
}

main, header, footer { position: relative; z-index: 1; }

/* ==========================================
   PARTICLES
   ========================================== */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 6px 2px rgba(192, 0, 42, 0.5);
  animation: floatParticle linear infinite;
  opacity: 0;
}

@keyframes floatParticle {
  0%   { transform: translateY(110vh) scale(0); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.5; }
  100% { transform: translateY(-10vh) scale(1.5); opacity: 0; }
}

/* ==========================================
   BATS
   ========================================== */
.bats-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.bat {
  position: absolute;
  font-size: 1.4rem;
  animation: flyBat linear infinite;
  opacity: 0.7;
  filter: drop-shadow(0 0 4px rgba(192,0,42,0.5));
}

@keyframes flyBat {
  0%   { transform: translateX(-80px) translateY(0px) scaleX(1); }
  25%  { transform: translateX(25vw) translateY(-40px) scaleX(1); }
  50%  { transform: translateX(50vw) translateY(10px) scaleX(-1); }
  75%  { transform: translateX(75vw) translateY(-20px) scaleX(-1); }
  100% { transform: translateX(110vw) translateY(0px) scaleX(-1); }
}

/* ==========================================
   HEADER
   ========================================== */
.site-header {
  position: relative;
  padding: 3rem 1rem 2.5rem;
  text-align: center;
  overflow: hidden;
}

.header-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(192,0,42,0.22) 0%, rgba(92,45,145,0.15) 60%, transparent 100%);
  pointer-events: none;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Eyeball logo */
.logo-eyeball {
  animation: floatEyeball 3s ease-in-out infinite;
}

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

.eyeball {
  width: 100px;
  height: 100px;
  background: radial-gradient(circle at 40% 35%, #fff8f0, #e8d5c0);
  border-radius: 50%;
  border: 3px solid var(--red-blood);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 20px rgba(204,0,0,0.6),
    0 0 40px rgba(255,107,0,0.3),
    inset 0 0 15px rgba(0,0,0,0.2);
  animation: eyeMove 5s ease-in-out infinite;
}

@keyframes eyeMove {
  0%, 100% { transform: rotate(0deg); }
  20%       { transform: rotate(5deg); }
  40%       { transform: rotate(-5deg); }
  60%       { transform: rotate(3deg); }
  80%       { transform: rotate(-3deg); }
}

.iris {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 50px; height: 50px;
  background: radial-gradient(circle at 35% 30%, #cc0000, #8b0000);
  border-radius: 50%;
  border: 2px solid #660000;
  box-shadow: 0 0 8px rgba(139,0,0,0.8);
}

.pupil {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px;
  background: #0a0a0a;
  border-radius: 50%;
  animation: blink 5s ease-in-out infinite;
}

@keyframes blink {
  0%, 90%, 100% { transform: translate(-50%, -50%) scaleY(1); }
  95%           { transform: translate(-50%, -50%) scaleY(0.08); }
}

.pupil-shine {
  position: absolute;
  top: 4px; left: 6px;
  width: 7px; height: 7px;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
}

.bloodvein {
  position: absolute;
  background: var(--red-vivid);
  border-radius: 2px;
  opacity: 0.6;
}
.v1 { width: 2px; height: 30px; top: 5px;  left: 20px; transform: rotate(30deg); }
.v2 { width: 2px; height: 25px; top: 60px; right: 18px; transform: rotate(-20deg); }
.v3 { width: 2px; height: 20px; top: 30px; right: 12px; transform: rotate(50deg); }

/* Title */
.title-block { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }

.subtitle-top {
  font-family: 'Raleway', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orange-light);
  opacity: 0.9;
}

.main-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  gap: 0.1rem;
}

.title-the {
  font-family: 'Cinzel Decorative', cursive;
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: var(--text-muted);
  letter-spacing: 0.4em;
  text-transform: uppercase;
}

.title-spooky {
  font-family: 'Creepster', cursive;
  font-size: clamp(3.5rem, 12vw, 7rem);
  color: var(--orange);
  text-shadow:
    0 0 20px rgba(192,0,42,0.6),
    0 0 50px rgba(140,0,180,0.35),
    2px 2px 0 #6b0015,
    4px 4px 0 #3d0009;
  letter-spacing: 0.05em;
  animation: flickerTitle 6s infinite;
}

@keyframes flickerTitle {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    text-shadow:
      0 0 20px rgba(192,0,42,0.6),
      0 0 50px rgba(140,0,180,0.35),
      2px 2px 0 #6b0015,
      4px 4px 0 #3d0009;
  }
  20%, 24%, 55% {
    text-shadow: none;
    opacity: 0.85;
  }
}

.title-challenge {
  font-family: 'Creepster', cursive;
  font-size: clamp(2rem, 7vw, 4rem);
  color: var(--text-light);
  letter-spacing: 0.2em;
  text-shadow:
    0 0 15px rgba(255,255,255,0.2),
    1px 1px 0 var(--purple-mid);
}

.subtitle-bottom {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

/* ==========================================
   SECTIONS
   ========================================== */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* ==========================================
   COUNTER SECTION
   ========================================== */
.counter-section {}

.counter-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 0 40px rgba(192, 0, 42, 0.18),
    0 0 25px rgba(92, 45, 145, 0.15),
    0 20px 60px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.06);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.counter-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 50% 0%, rgba(192,0,42,0.1) 0%, rgba(92,45,145,0.06) 50%, transparent 70%);
  pointer-events: none;
}

.counter-card-inner { position: relative; }

.moon-icon {
  font-size: 2.5rem;
  animation: moonPulse 3s ease-in-out infinite;
}

@keyframes moonPulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 200, 0, 0.5)); transform: scale(1); }
  50%       { filter: drop-shadow(0 0 25px rgba(255, 200, 0, 0.9)); transform: scale(1.1); }
}

.counter-title {
  font-family: 'Cinzel Decorative', cursive;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--orange-light);
  margin: 0.5rem 0 0.2rem;
  letter-spacing: 0.05em;
}

.counter-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.counter-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.counter-number {
  font-family: 'Cinzel Decorative', cursive;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  color: var(--orange);
  text-shadow:
    0 0 20px rgba(192, 0, 42, 0.7),
    0 0 40px rgba(140, 0, 180, 0.3);
  letter-spacing: 0.02em;
  transition: all 0.5s ease;
}

.counter-unit {
  font-family: 'Raleway', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Progress bar */
.progress-wrapper { margin: 1.5rem 0 1rem; }

.progress-bar-bg {
  width: 100%;
  height: 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  border: 1px solid rgba(192,0,42,0.3);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3d0060, #8b0000, #c0002a, #b76de0);
  border-radius: 10px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-width: 4px;
}

.progress-glow {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 30px;
  background: linear-gradient(90deg, transparent, rgba(183,109,224,0.9));
  border-radius: 0 10px 10px 0;
  filter: blur(4px);
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.counter-goal {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.counter-bonus {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.counter-bonus strong {
  color: var(--orange-light);
}

#words-remaining {
  color: var(--orange-light);
  font-weight: 700;
  font-style: normal;
}

/* ==========================================
   FORM SECTION
   ========================================== */
.form-section {}

.form-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 0 30px rgba(92, 45, 145, 0.25),
    0 0 20px rgba(192, 0, 42, 0.12),
    0 20px 60px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}

.form-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 50% 0%, rgba(92,45,145,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.form-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.form-icon { font-size: 1.5rem; animation: swingSpin 4s ease-in-out infinite; }
.form-icon:last-child { animation-delay: -2s; }

@keyframes swingSpin {
  0%, 100% { transform: rotate(-10deg); }
  50%       { transform: rotate(10deg); }
}

.form-title {
  font-family: 'Cinzel Decorative', cursive;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--orange-light);
  letter-spacing: 0.05em;
}

/* Form groups */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  z-index: 2;
  pointer-events: none;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.8rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(192,0,42,0.3);
  border-radius: 12px;
  color: var(--text-light);
  font-family: 'Raleway', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input::placeholder { color: rgba(160,128,192,0.5); }

input:focus {
  border-color: var(--orange);
  background: rgba(192,0,42,0.06);
  box-shadow: 0 0 0 3px rgba(192,0,42,0.18), 0 0 20px rgba(140,0,180,0.12);
}

input:hover:not(:focus) {
  border-color: rgba(192,0,42,0.5);
}

/* Remove number arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* Error */
.error-msg {
  font-size: 0.85rem;
  color: #ff4444;
  min-height: 1.2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all var(--transition);
}

/* Submit button */
.submit-btn {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #3d0060, #8b0000, #c0002a, #7b2fa0);
  background-size: 200% 100%;
  background-position: 100% 0;
  border: none;
  border-radius: 14px;
  color: #fff;
  font-family: 'Cinzel Decorative', cursive;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.4s ease;
  box-shadow: 0 4px 20px rgba(192,0,42,0.4), 0 0 0 1px rgba(140,0,180,0.25);
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.submit-btn:hover {
  background-position: 0% 0;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(192,0,42,0.55), 0 0 0 2px rgba(140,0,180,0.35);
}

.submit-btn:hover::before { transform: translateX(100%); }

.submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(192,0,42,0.35);
}

.btn-icon, .btn-sparkle { font-size: 1.2rem; transition: transform 0.3s ease; }
.submit-btn:hover .btn-icon   { transform: rotate(-10deg) scale(1.2); }
.submit-btn:hover .btn-sparkle { transform: rotate(20deg) scale(1.2); }

/* Success toast */
.success-toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1rem;
  padding: 0.8rem 1.2rem;
  background: rgba(183, 109, 224, 0.12);
  border: 1px solid rgba(183, 109, 224, 0.35);
  border-radius: 10px;
  color: var(--green-ghost);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
  pointer-events: none;
}

.success-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   LEADERBOARD
   ========================================== */
.leaderboard-section {}

.leaderboard-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.leaderboard-title {
  font-family: 'Cinzel Decorative', cursive;
  font-size: clamp(1.3rem, 4vw, 2rem);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  letter-spacing: 0.05em;
}

.lb-skull {
  font-size: 1.5rem;
  animation: skullBounce 2s ease-in-out infinite;
  display: inline-block;
}
.lb-skull:last-child { animation-delay: -1s; }

@keyframes skullBounce {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50%       { transform: translateY(-8px) rotate(5deg); }
}

.leaderboard-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 0.3rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-style: italic;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: candleFlicker 1.5s ease-in-out infinite;
}

@keyframes candleFlicker {
  0%, 100% { transform: scaleY(1) skewX(0deg); filter: brightness(1); }
  25%       { transform: scaleY(1.05) skewX(2deg); filter: brightness(1.2); }
  75%       { transform: scaleY(0.97) skewX(-1deg); filter: brightness(0.9); }
}

/* Leaderboard list */
.leaderboard-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.lb-entry {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: slideInEntry 0.5s ease forwards;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

@keyframes slideInEntry {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.lb-entry:hover {
  transform: translateX(6px) translateY(-2px);
  border-color: rgba(192,0,42,0.55);
  box-shadow: 0 8px 30px rgba(192,0,42,0.2), 0 0 15px rgba(140,0,180,0.15), 0 4px 20px rgba(0,0,0,0.4);
}

/* Rank 1 */
.lb-entry.rank-1 {
  border-color: rgba(255, 215, 0, 0.5);
  background: linear-gradient(135deg, rgba(13,4,28,0.9), rgba(50, 35, 0, 0.7));
  box-shadow: 0 0 25px rgba(255,215,0,0.2), 0 4px 20px rgba(0,0,0,0.4);
}
.lb-entry.rank-1 .lb-name { color: var(--gold); }

/* Rank 2 */
.lb-entry.rank-2 {
  border-color: rgba(192, 192, 192, 0.5);
  background: linear-gradient(135deg, rgba(13,4,28,0.9), rgba(30,30,40,0.7));
  box-shadow: 0 0 20px rgba(192,192,192,0.15), 0 4px 20px rgba(0,0,0,0.4);
}
.lb-entry.rank-2 .lb-name { color: var(--silver); }

/* Rank 3 */
.lb-entry.rank-3 {
  border-color: rgba(205, 127, 50, 0.5);
  background: linear-gradient(135deg, rgba(13,4,28,0.9), rgba(35,20,5,0.7));
  box-shadow: 0 0 20px rgba(205,127,50,0.15), 0 4px 20px rgba(0,0,0,0.4);
}
.lb-entry.rank-3 .lb-name { color: var(--bronze); }

.lb-medal {
  font-size: 1.8rem;
  min-width: 2.2rem;
  text-align: center;
  filter: drop-shadow(0 0 6px currentColor);
  animation: medalGlow 2s ease-in-out infinite;
}

@keyframes medalGlow {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%       { transform: scale(1.12) rotate(5deg); }
}

.lb-rank-num {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-muted);
  min-width: 2rem;
  text-align: center;
}

.lb-info {
  flex: 1;
  min-width: 0;
}

.lb-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
}

.lb-words {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.lb-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.lb-count-num {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--orange);
  text-shadow: 0 0 15px rgba(192, 0, 42, 0.6), 0 0 30px rgba(140,0,180,0.25);
  transition: all 0.5s ease;
}

.lb-count-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Glow line for top 3 */
.lb-entry.rank-1::after,
.lb-entry.rank-2::after,
.lb-entry.rank-3::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  border-radius: 4px 0 0 4px;
}
.lb-entry.rank-1::after { background: linear-gradient(180deg, var(--gold), rgba(255,215,0,0.3)); }
.lb-entry.rank-2::after { background: linear-gradient(180deg, var(--silver), rgba(192,192,192,0.3)); }
.lb-entry.rank-3::after { background: linear-gradient(180deg, var(--bronze), rgba(205,127,50,0.3)); }


/* Participant count badge */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat-badge {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  padding: 0.5rem 1.2rem;
  text-align: center;
  backdrop-filter: blur(10px);
}

.stat-badge-num {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 1.2rem;
  color: var(--orange-light);
  display: block;
}

.stat-badge-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(192,0,42,0.15);
  position: relative;
  z-index: 1;
}

.footer-sub {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  opacity: 0.6;
}

/* ==========================================
   CONFETTI BURST
   ========================================== */
.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9999;
  animation: confettiFall 1.5s ease-out forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateY(200px) rotate(720deg) scale(0.3); opacity: 0; }
}

/* ==========================================
   NUMBER ANIMATION
   ========================================== */
.pop-animate {
  animation: popIn 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes popIn {
  0%   { transform: scale(1.3); color: var(--orange-light); }
  100% { transform: scale(1); }
}

/* ==========================================
   BESTIAIRE (paliers)
   ========================================== */
.bestiary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.beast-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 0.9rem 0.6rem 0.8rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.beast-img-wrap {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  position: relative;
}

.beast-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.beast-name {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-light);
}

.beast-step {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Verrouillée : silhouette d'ombre */
.beast-card.locked img {
  filter: brightness(0) drop-shadow(0 0 6px rgba(92, 45, 145, 0.6));
  opacity: 0.55;
}
.beast-card.locked .beast-img-wrap::after {
  content: '?';
  position: absolute;
  font-family: 'Creepster', cursive;
  font-size: 2.2rem;
  color: var(--orange-light);
  text-shadow: 0 0 12px var(--orange-light);
  animation: candleFlicker 3s ease-in-out infinite;
}
.beast-card.locked .beast-name { color: var(--text-muted); }

/* Débloquée : la créature flotte et luit */
.beast-card.unlocked {
  border-color: rgba(183, 109, 224, 0.55);
  box-shadow: 0 0 20px rgba(183, 109, 224, 0.25), inset 0 0 30px rgba(192, 0, 42, 0.12);
}
.beast-card.unlocked:hover { transform: translateY(-4px) scale(1.04); }
.beast-card.unlocked img {
  filter: drop-shadow(0 0 10px rgba(183, 109, 224, 0.55));
  animation: beastFloat 3.5s ease-in-out infinite;
}
.beast-card.unlocked:nth-child(odd) img { animation-delay: -1.7s; }

/* Créature qui vient d'apparaître */
.beast-card.just-unlocked { animation: beastReveal 1.2s ease-out; }

@keyframes beastFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-6px) rotate(2deg); }
}

@keyframes beastReveal {
  0%   { transform: scale(0.6); box-shadow: 0 0 0 rgba(192, 0, 42, 0); }
  50%  { transform: scale(1.12); box-shadow: 0 0 50px rgba(192, 0, 42, 0.9); }
  100% { transform: scale(1); }
}

/* ==========================================
   APPARITION (overlay plein écran)
   ========================================== */
.summon-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: radial-gradient(circle at 50% 45%, rgba(45, 16, 96, 0.92) 0%, rgba(5, 0, 12, 0.97) 70%);
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.summon-overlay.show { opacity: 1; visibility: visible; }

.summon-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.summon-overlay.show .summon-flash { animation: summonLightning 1.4s ease-out; }

.summon-fog {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(192, 0, 42, 0.25), transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(183, 109, 224, 0.25), transparent 50%);
  animation: summonFog 8s ease-in-out infinite alternate;
  pointer-events: none;
}

.summon-stage {
  position: relative;
  width: min(60vmin, 380px);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summon-rays {
  position: absolute;
  inset: -25%;
  background: repeating-conic-gradient(
    rgba(183, 109, 224, 0.22) 0deg 8deg,
    transparent 8deg 24deg
  );
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%);
          mask: radial-gradient(circle, #000 20%, transparent 68%);
  animation: summonSpin 18s linear infinite;
}

.summon-circle {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 2px solid rgba(192, 0, 42, 0.7);
  box-shadow: 0 0 30px rgba(192, 0, 42, 0.6), inset 0 0 30px rgba(192, 0, 42, 0.4);
  outline: 1px dashed rgba(183, 109, 224, 0.6);
  outline-offset: 10px;
  animation: summonSpin 12s linear infinite reverse;
}

.summon-img {
  position: relative;
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  opacity: 0;
  filter: brightness(0) blur(8px);
}
.summon-overlay.show .summon-img {
  animation:
    summonRise 2.2s cubic-bezier(.2, .9, .3, 1.2) 0.4s forwards,
    beastFloat 3.5s ease-in-out 2.6s infinite;
}

.summon-text {
  position: relative;
  text-align: center;
  opacity: 0;
}
.summon-overlay.show .summon-text { animation: summonTextIn 0.8s ease-out 1.8s forwards; }

.summon-step {
  font-size: 0.9rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--orange-light);
}

.summon-name {
  font-family: 'Creepster', cursive;
  font-size: clamp(2.4rem, 9vw, 4.5rem);
  color: var(--red-vivid);
  text-shadow: 0 0 20px rgba(204, 0, 0, 0.8), 0 0 40px rgba(192, 0, 42, 0.5);
  letter-spacing: 0.05em;
  animation: flickerTitle 4s infinite;
}

.summon-bonus {
  font-family: 'Cinzel Decorative', cursive;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

.summon-hint {
  margin-top: 0.8rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

@keyframes summonRise {
  0%   { opacity: 0; transform: translateY(60px) scale(0.3); filter: brightness(0) blur(8px); }
  45%  { opacity: 1; transform: translateY(-10px) scale(1.1); filter: brightness(0) drop-shadow(0 0 25px #c0002a); }
  70%  { filter: brightness(1.8) drop-shadow(0 0 40px #b76de0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1) drop-shadow(0 0 25px rgba(183, 109, 224, 0.8)); }
}

@keyframes summonLightning {
  0%, 100% { opacity: 0; }
  5%  { opacity: 0.8; }
  10% { opacity: 0.1; }
  15% { opacity: 0.6; }
  25% { opacity: 0; }
}

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

@keyframes summonSpin { to { transform: rotate(360deg); } }

@keyframes summonFog {
  from { transform: translateX(-4%) scale(1); }
  to   { transform: translateX(4%) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .summon-overlay *, .beast-card img { animation: none !important; }
  .summon-img, .summon-text { opacity: 1; filter: none; }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 600px) {
  .form-card, .counter-card { padding: 1.5rem 1.2rem; }
  .lb-entry { padding: 0.8rem 1rem; gap: 0.7rem; }
  .lb-count-num { font-size: 1rem; }
  .submit-btn { font-size: 0.9rem; }
  .stats-bar { gap: 1rem; }
  .bestiary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 601px) and (max-width: 800px) {
  .bestiary-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================
   SCROLLBAR
   ========================================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--purple-dark); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--orange), var(--purple-light), #b76de0);
  border-radius: 4px;
}
