/* ===================================================
   LE CONCOURS DU PÈRE NOËL - CHRISTMAS STYLING (2026)
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600;700&family=Playfair+Display:ital,wght@0,600;0,700;0,800;0,900;1,600;1,700&family=Quicksand:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --noel-red-dark: #660708;
  --noel-red: #a4161a;
  --noel-red-bright: #ba181b;
  --noel-red-ruby: #e5383b;
  --noel-gold: #f5c563;
  --noel-gold-glow: #ffe082;
  --noel-gold-dark: #b8860b;
  --noel-green-dark: #0b3c2e;
  --noel-green: #145942;
  --noel-green-light: #2a9d6e;
  --noel-night: #090e1a;
  --noel-night-card: rgba(18, 26, 45, 0.85);
  --parchment-bg: #fffbf0;
  --parchment-border: #e0cca7;
}

body {
  font-family: 'Quicksand', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--noel-night);
  color: #f8fafc;
  overflow-x: hidden;
  position: relative;
  letter-spacing: 0.15px;
}

/* Festive Typography */
.font-decorative {
  font-family: 'Playfair Display', serif;
}

.font-serif-luxury {
  font-family: 'Playfair Display', Georgia, serif;
}

.font-script, .font-handwriting {
  font-family: 'Dancing Script', cursive;
}

.font-rounded {
  font-family: 'Quicksand', sans-serif;
}

/* Background Gradients & Glow */
.bg-festive-sky {
  background: radial-gradient(circle at 50% 10%, #1e293b 0%, #0d1527 60%, #070b14 100%);
}

.gold-gradient-text {
  background: linear-gradient(135deg, #fff3c4 0%, #f7d070 30%, #e6a838 60%, #fff7d6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(245, 197, 99, 0.45));
  line-height: 1.35;
  display: inline-block;
}

.gold-gradient-btn {
  background: linear-gradient(135deg, #f7d070 0%, #e5a738 50%, #c48316 100%);
  color: #3e2200;
  box-shadow: 0 4px 20px rgba(230, 168, 56, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gold-gradient-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(230, 168, 56, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.ruby-gradient-btn {
  background: linear-gradient(135deg, #ba181b 0%, #a4161a 50%, #660708 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(186, 24, 27, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ruby-gradient-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(186, 24, 27, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* Snowflake Canvas Overlay */
#snow-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
}

/* Fairy Lights Garland across Top */
.fairy-lights-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 24px;
  z-index: 50;
  pointer-events: none;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 0 10px;
  overflow: hidden;
}

.garland-wire {
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 20px;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.25);
}

.fairy-bulb {
  width: 10px;
  height: 14px;
  border-radius: 50% 50% 45% 45%;
  margin-top: 2px;
  position: relative;
  animation: bulbGlow 1.8s infinite alternate ease-in-out;
}

.fairy-bulb::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 2px;
  width: 6px;
  height: 4px;
  background: #2b3420;
  border-radius: 2px;
}

.fairy-bulb.bulb-red {
  background: #ff3344;
  box-shadow: 0 0 12px #ff3344, 0 0 20px rgba(255, 51, 68, 0.6);
  animation-delay: 0.1s;
}

.fairy-bulb.bulb-gold {
  background: #ffcc00;
  box-shadow: 0 0 12px #ffcc00, 0 0 20px rgba(255, 204, 0, 0.6);
  animation-delay: 0.6s;
}

.fairy-bulb.bulb-green {
  background: #00e676;
  box-shadow: 0 0 12px #00e676, 0 0 20px rgba(0, 230, 118, 0.6);
  animation-delay: 1.1s;
}

.fairy-bulb.bulb-blue {
  background: #00e5ff;
  box-shadow: 0 0 12px #00e5ff, 0 0 20px rgba(0, 229, 255, 0.6);
  animation-delay: 1.5s;
}

@keyframes bulbGlow {
  0% { opacity: 0.45; filter: brightness(0.7); }
  100% { opacity: 1; filter: brightness(1.3); }
}

/* Glass Floating Navbar */
.glass-header {
  background: rgba(9, 14, 26, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Vintage Parchment Santa Letter Card */
.santa-letter-card {
  background: var(--parchment-bg);
  color: #2b2219;
  border-radius: 28px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 0 7px #961d22, 0 0 0 11px #d4a359;
  overflow: hidden;
  font-family: 'Quicksand', sans-serif;
}

.airmail-strip {
  height: 12px;
  background: repeating-linear-gradient(
    -45deg,
    #ba181b,
    #ba181b 15px,
    #fffbf0 15px,
    #fffbf0 25px,
    #145942 25px,
    #145942 40px,
    #fffbf0 40px,
    #fffbf0 50px
  );
}

.postmark-stamp {
  position: absolute;
  top: 25px;
  right: 25px;
  width: 90px;
  height: 90px;
  border: 2px dashed #961d22;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #961d22;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  transform: rotate(12deg);
  opacity: 0.85;
  pointer-events: none;
}

.wax-seal {
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, #e5383b 0%, #a4161a 70%, #660708 100%);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(102, 7, 8, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffd700;
  font-size: 24px;
  border: 2px dashed #ffd700;
  transform: rotate(-10deg);
}

.santa-letter-card label {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  color: #6b2124;
  letter-spacing: 0.2px;
}

.letter-input {
  background: #ffffff;
  border: 1.5px solid #d9c8af;
  border-radius: 14px;
  padding: 12px 18px;
  color: #1e293b;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 14px;
  width: 100%;
  transition: all 0.25s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.letter-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
  font-size: 13px;
  font-style: italic;
}

.letter-input:focus {
  outline: none;
  border-color: #ba181b;
  box-shadow: 0 0 0 4px rgba(186, 24, 27, 0.18), inset 0 1px 2px rgba(0, 0, 0, 0.02);
  background: #fff;
}

/* Countdown Clock Tile */
.countdown-tile {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(245, 197, 99, 0.3);
  border-radius: 16px;
  padding: 12px 16px;
  text-align: center;
  min-width: 75px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* ===================================================
   MAGICAL CHRISTMAS TREE WITH GIFT BOXES
   =================================================== */

.christmas-tree-scene {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 16px 20px 16px;
  text-align: center;
}

/* Shining Star on Top */
.tree-star-wrapper {
  position: relative;
  display: inline-block;
  z-index: 25;
  margin-bottom: -15px;
}

.tree-star {
  font-size: 46px;
  line-height: 1;
  color: #ffd700;
  filter: drop-shadow(0 0 20px #ffd700) drop-shadow(0 0 40px #ffb703);
  animation: starPulse 2.4s infinite alternate ease-in-out;
  display: inline-block;
  cursor: pointer;
}

@keyframes starPulse {
  0% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 15px #ffd700); }
  100% { transform: scale(1.15) rotate(6deg); filter: drop-shadow(0 0 32px #fff3b0) drop-shadow(0 0 50px #ffb703); }
}

/* Christmas Tree Foliage Stack */
.tree-structure {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  z-index: 10;
}

/* Tree Foliage Tier */
.tree-tier {
  position: relative;
  background: linear-gradient(180deg, #165b33 0%, #114b2a 65%, #0b3c20 100%);
  border-radius: 50% 50% 30% 30% / 90% 90% 20% 20%;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.6), inset 0 8px 16px rgba(255, 255, 255, 0.15), inset 0 -10px 20px rgba(0, 0, 0, 0.4);
  border-bottom: 5px solid #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  transition: all 0.3s ease;
}

/* Tier Sizing */
.tree-tier-1 {
  width: 320px;
  min-height: 90px;
  z-index: 16;
  margin-top: 0;
}

.tree-tier-2 {
  width: 480px;
  min-height: 110px;
  z-index: 15;
  margin-top: -22px;
}

.tree-tier-3 {
  width: 640px;
  min-height: 130px;
  z-index: 14;
  margin-top: -26px;
}

.tree-tier-4 {
  width: 800px;
  min-height: 150px;
  z-index: 13;
  margin-top: -30px;
}

/* Mobile responsive tree widths */
@media (max-width: 840px) {
  .tree-tier-1 { width: 92%; max-width: 290px; }
  .tree-tier-2 { width: 95%; max-width: 420px; margin-top: -18px; }
  .tree-tier-3 { width: 98%; max-width: 550px; margin-top: -22px; }
  .tree-tier-4 { width: 100%; max-width: 680px; margin-top: -26px; }
}

@media (max-width: 640px) {
  .tree-tier {
    padding: 10px 6px;
    gap: 6px;
  }
  .gift-cube {
    width: 54px;
    height: 54px;
    border-radius: 12px;
  }
  .gift-bow {
    top: -10px;
    font-size: 16px;
  }
  .gift-avatar {
    font-size: 22px;
  }
  .gift-nametag {
    font-size: 10px;
    padding: 2px 6px;
    max-width: 84px;
    gap: 2px;
  }
  .tree-tier-1 { max-width: 260px; min-height: 80px; }
  .tree-tier-2 { max-width: 330px; min-height: 95px; }
  .tree-tier-3 { max-width: 360px; min-height: 110px; }
  .tree-tier-4 { max-width: 380px; min-height: 125px; }
}

@media (max-width: 380px) {
  .gift-cube {
    width: 46px;
    height: 46px;
    border-radius: 10px;
  }
  .gift-avatar {
    font-size: 18px;
  }
  .gift-nametag {
    font-size: 9px;
    padding: 2px 4px;
    max-width: 72px;
  }
}

/* Tree Garland String Lights across tiers */
.tree-garland-lights {
  position: absolute;
  top: 15%;
  left: 5%;
  right: 5%;
  height: 20px;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

/* Tree Trunk */
.tree-trunk {
  width: 80px;
  height: 48px;
  background: linear-gradient(90deg, #422510 0%, #633718 50%, #351d0d 100%);
  margin-top: -16px;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
  z-index: 12;
  position: relative;
}

/* Snowy Tree Base & Ground Carpet */
.tree-snow-ground {
  position: relative;
  background: radial-gradient(ellipse at 50% 50%, #ffffff 0%, #dbeafe 60%, rgba(14, 22, 40, 0) 80%);
  width: 100%;
  max-width: 860px;
  min-height: 80px;
  margin: -20px auto 0 auto;
  border-radius: 50%;
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 15px 15px 10px 15px;
}

/* ===================================================
   INTERACTIVE CHRISTMAS GIFT BOX (HỘP QUÀ NOEL)
   =================================================== */

.tree-gift-box {
  position: relative;
  cursor: pointer;
  z-index: 20;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tree-gift-box:hover {
  transform: translateY(-8px) scale(1.08);
  z-index: 30;
}

.tree-gift-box:active {
  transform: scale(0.95);
}

/* 3D Gift Box Cube */
.gift-cube {
  width: 66px;
  height: 66px;
  border-radius: 14px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5), inset 0 2px 3px rgba(255, 255, 255, 0.5), inset 0 -4px 6px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Bow Tie on Top */
.gift-bow {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  z-index: 4;
  animation: bowWiggle 3s infinite ease-in-out;
}

@keyframes bowWiggle {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  50% { transform: translateX(-50%) rotate(8deg); }
}

/* Ribbon Ribs on Box */
.gift-ribbon-v {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 14px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #f7d070, #e6a838);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.gift-ribbon-h {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 14px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, #f7d070, #e6a838);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

/* Avatar on the center of Box */
.gift-avatar {
  position: relative;
  z-index: 3;
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Name Tag Tagged on the Box */
.gift-nametag {
  margin-top: 6px;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #f5c563;
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  max-width: 115px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Hover Sparkle Glow for all Gift Boxes */
.tree-gift-box:hover .gift-cube {
  box-shadow: 0 0 25px rgba(245, 197, 99, 0.9), 0 12px 24px rgba(0, 0, 0, 0.7);
  transform: translateY(-4px) scale(1.05);
}

.tree-gift-box:hover .gift-nametag {
  border-color: #f5c563;
  color: #fff;
  transform: scale(1.05);
}

/* Color Themes for Gift Boxes */
.gift-theme-ruby .gift-cube { background: linear-gradient(135deg, #ba181b, #7f1d1d); }
.gift-theme-ruby .gift-ribbon-v, .gift-theme-ruby .gift-ribbon-h { background: linear-gradient(135deg, #fde047, #ca8a04); }

.gift-theme-emerald .gift-cube { background: linear-gradient(135deg, #059669, #064e3b); }
.gift-theme-emerald .gift-ribbon-v, .gift-theme-emerald .gift-ribbon-h { background: linear-gradient(135deg, #fef08a, #eab308); }

.gift-theme-sapphire .gift-cube { background: linear-gradient(135deg, #2563eb, #1e3a8a); }
.gift-theme-sapphire .gift-ribbon-v, .gift-theme-sapphire .gift-ribbon-h { background: linear-gradient(135deg, #f8fafc, #cbd5e1); }

.gift-theme-amethyst .gift-cube { background: linear-gradient(135deg, #9333ea, #581c87); }
.gift-theme-amethyst .gift-ribbon-v, .gift-theme-amethyst .gift-ribbon-h { background: linear-gradient(135deg, #fde047, #ca8a04); }

.gift-theme-gold .gift-cube { background: linear-gradient(135deg, #f59e0b, #b45309); }
.gift-theme-gold .gift-ribbon-v, .gift-theme-gold .gift-ribbon-h { background: linear-gradient(135deg, #ef4444, #991b1b); }

.gift-theme-frost .gift-cube { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.gift-theme-frost .gift-ribbon-v, .gift-theme-frost .gift-ribbon-h { background: linear-gradient(135deg, #fda4af, #f43f5e); }

.gift-theme-rose .gift-cube { background: linear-gradient(135deg, #e11d48, #881337); }
.gift-theme-rose .gift-ribbon-v, .gift-theme-rose .gift-ribbon-h { background: linear-gradient(135deg, #fef08a, #eab308); }

.gift-theme-teal .gift-cube { background: linear-gradient(135deg, #0d9488, #134e4a); }
.gift-theme-teal .gift-ribbon-v, .gift-theme-teal .gift-ribbon-h { background: linear-gradient(135deg, #fbcfe8, #f472b6); }

.gift-theme-midnight .gift-cube { background: linear-gradient(135deg, #312e81, #1e1b4b); }
.gift-theme-midnight .gift-ribbon-v, .gift-theme-midnight .gift-ribbon-h { background: linear-gradient(135deg, #fef08a, #f59e0b); }

.gift-theme-candy .gift-cube { background: linear-gradient(135deg, #dc2626, #991b1b); }
.gift-theme-candy .gift-ribbon-v, .gift-theme-candy .gift-ribbon-h { background: linear-gradient(135deg, #ffffff, #e2e8f0); }

.gift-theme-forest .gift-cube { background: linear-gradient(135deg, #15803d, #14532d); }
.gift-theme-forest .gift-ribbon-v, .gift-theme-forest .gift-ribbon-h { background: linear-gradient(135deg, #f43f5e, #be123c); }

/* Quick member pill badge */
.member-quick-pill {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(245, 197, 99, 0.3);
  color: #f1f5f9;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.member-quick-pill:hover {
  background: rgba(186, 24, 27, 0.85);
  border-color: #f5c563;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(186, 24, 27, 0.5);
}

.member-quick-pill.claimed {
  border-color: #10b981;
  color: #a7f3d0;
}

/* Taken Avatar Styling & Shake Effect */
.avatar-option {
  position: relative;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.avatar-option.avatar-taken {
  opacity: 0.45;
  filter: grayscale(0.7);
  background: #f1f5f9 !important;
  cursor: not-allowed;
  border-color: #cbd5e1 !important;
}

.avatar-option.avatar-taken:hover {
  opacity: 0.85;
  transform: scale(1.06);
}

.avatar-option .taken-badge,
.edit-avatar-opt .taken-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #dc2626;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 999px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  border: 1px solid #fff;
}

@keyframes avatarShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px) rotate(-6deg); }
  40%, 80% { transform: translateX(4px) rotate(6deg); }
}

.avatar-shake {
  animation: avatarShake 0.45s ease-in-out;
}

/* Pulsing heart animation */
@keyframes heartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.heart-pulse {
  animation: heartPulse 0.4s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #090e1a;
}
::-webkit-scrollbar-thumb {
  background: #a4161a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #f5c563;
}
