/* ===================== NOËL (cf. xmas.js, lib/xmas.js) =====================
   html.xmas : saison de Noel (1er decembre - 6 janvier, heure de Paris).
   Hiver sur tout le site (neige, guirlande, logo), calendrier de l'Avent,
   objets cosmetiques des joueurs (badge, cadre, pseudo, titre). */

:root {
  --xm-red: #e3262f;
  --xm-red-d: #8e0f18;
  --xm-green: #1f9d55;
  --xm-gold: #ffd36b;
  --xm-ice: #dff6ff;
  --xm-font: 'Mountains of Christmas', 'Space Grotesk', cursive;
}

/* Hors saison : rien de Noel ne se montre. */
html:not(.xmas) .nav-xmas,
html:not(.xmas) .xm-only,
html:not(.xmas) .logo-xmas { display: none !important; }
html.xmas .logo-std { display: none !important; }

/* ----- Ciel d'hiver */
html.xmas body {
  background:
    radial-gradient(ellipse 900px 520px at 18% -8%, rgba(120,200,255,0.20), transparent 60%),
    radial-gradient(ellipse 700px 460px at 100% 0%, rgba(227,38,47,0.10), transparent 58%),
    radial-gradient(ellipse 1100px 420px at 50% 118%, rgba(210,240,255,0.10), transparent 62%),
    #04070c;
  background-attachment: fixed;
}

/* ----- Logo de Noel : meme largeur que le logo habituel (le bonnet deborde a
   gauche, la neige en haut et en bas : marges negatives, la barre garde sa taille). */
.logo-xmas {
  height: 58px; width: auto; display: block; margin: -8px 0 -8px -8px;
  filter: drop-shadow(0 0 10px rgba(120,210,255,0.28));
}
@media (min-width: 901px) and (max-width: 1200px) { .topbar .logo-xmas { height: 48px; margin: -6px 0 -6px -8px; } }
html.mobile .logo-xmas { height: 42px; margin: -7px 0 -7px -6px; }
.mobile-gate-logo.logo-xmas { width: 230px; height: auto; margin: 0 auto 6px; }

/* ----- Barre du haut : guirlande lumineuse */
html.xmas .topbar { position: relative; }
.xm-garland { position: absolute; left: 0; right: 0; bottom: -15px; height: 28px; pointer-events: none; z-index: 11; overflow: visible; }
.xm-garland svg { display: block; width: 100%; height: 100%; overflow: visible; }
.xm-wire { fill: none; stroke: #1d3b2a; stroke-width: 1.6; }
.xm-bulb .cap { fill: #3d4a44; }
.xm-bulb .glass { fill: var(--c); opacity: 0.55; }
.xm-bulb .halo { fill: var(--c); opacity: 0; }
.xm-bulb.on .glass { animation: xmBulb 2.6s ease-in-out infinite; animation-delay: var(--d); }
.xm-bulb.on .halo { animation: xmHalo 2.6s ease-in-out infinite; animation-delay: var(--d); }
@keyframes xmBulb { 0%, 100% { opacity: 0.45; } 45%, 60% { opacity: 1; } }
@keyframes xmHalo { 0%, 100% { opacity: 0; } 45%, 60% { opacity: 0.55; } }
html.mobile .xm-garland { bottom: -12px; height: 22px; }
body.in-match .xm-garland { opacity: 0.5; }

/* ----- Neige */
#xmSnow { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }
.xm-snow-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; padding: 0; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: rgba(160,220,255,0.06); color: #cfefff;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.xm-snow-btn:hover { border-color: rgba(160,220,255,0.5); background: rgba(160,220,255,0.12); }
.xm-snow-btn svg { width: 18px; height: 18px; }
.xm-snow-btn .slash { display: none; }
.xm-snow-btn.off { color: var(--text-dim); background: none; }
.xm-snow-btn.off .slash { display: inline; }
html.mobile .xm-snow-btn { width: 32px; height: 32px; }
/* Tout a droite de la barre du haut, connecte ou pas. */
.account-box > .xm-snow-btn { order: 10; }
body.in-match .xm-snow-btn { display: none; }

/* ----- Neige sur les cartes du lobby */
.xm-cap {
  position: absolute; left: -1px; right: -1px; top: -1px; height: 13px; z-index: 3; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 14' preserveAspectRatio='none'><path d='M0 0h80v6c-4 0-5 3-9 3s-4 4-7 4-3-5-7-5-5 2-9 2-4-3-8-3-4 5-8 5-4-4-7-4-5 3-9 3-3-2-7-2-4 2-9 1z' fill='%23f4fbff'/><path d='M0 0h80v2c-6 1-10 0-16 1s-12 0-18 1-14-1-22 0-14 0-24-1z' fill='%23ffffff'/></svg>") repeat-x 0 0 / 80px 13px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.35));
}
html:not(.xmas) .xm-cap { display: none; }

/* ----- Onglet Calendrier */
.nav-xmas { position: relative; display: inline-flex; align-items: center; gap: 7px; }
.nav-xmas .nav-icon { color: #ff5a63; animation: xmGiftWiggle 4s ease-in-out infinite; transform-origin: 50% 80%; }
.nav-xmas .xm-nav-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff; background: var(--xm-red); box-shadow: 0 0 12px rgba(227,38,47,0.7);
}
.nav-xmas .xm-nav-count:empty { display: none; }
.nav-xmas.active { color: #ffd9a0; }
@keyframes xmGiftWiggle { 0%, 82%, 100% { transform: rotate(0); } 86% { transform: rotate(-14deg); } 90% { transform: rotate(12deg); } 94% { transform: rotate(-6deg); } }
html.mobile.xmas .main-nav { grid-template-columns: repeat(7, minmax(0, 1fr)); }
html.mobile.xmas body.defi-on .main-nav { grid-template-columns: repeat(8, minmax(0, 1fr)); }
html.mobile .nav-xmas .xm-nav-count { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 15px; height: 15px; font-size: 9.5px; padding: 0 4px; }
/* Ordinateur : la barre du haut est deja pleine. Sous 1600 px, l'onglet n'est
   plus qu'un cadeau (et son compteur) et les onglets se serrent un peu. Le
   bouton neige reste toujours en haut a droite (connecte ou pas). */
@media (min-width: 901px) and (max-width: 1599px) {
  html:not(.mobile) .main-nav .nav-xmas > span[data-i18n] { display: none; }
  html:not(.mobile) .main-nav .nav-xmas { gap: 4px; }
  html:not(.mobile) .main-nav .nav-xmas .nav-icon { display: block; width: 19px; height: 19px; }
  html:not(.mobile) .main-nav .nav-xmas .xm-nav-count { position: absolute; top: -3px; right: -4px; min-width: 15px; height: 15px; padding: 0 4px; font-size: 9.5px; }
}
@media (min-width: 901px) and (max-width: 1200px) {
  html.xmas:not(.mobile) .main-nav .nav-link { padding-left: 4px; padding-right: 4px; }
}
@media (min-width: 901px) and (max-width: 1000px) {
  html.xmas:not(.mobile) .main-nav .nav-link, html.xmas:not(.mobile) .main-nav .nav-discord { padding-left: 3px; padding-right: 3px; }
}
@media (min-width: 1401px) and (max-width: 1599px) {
  html.xmas:not(.mobile) .main-nav .nav-link { padding-left: 6px; padding-right: 6px; }
}
@media (min-width: 1201px) and (max-width: 1400px) {
  html.xmas:not(.mobile) .main-nav .nav-link, html.xmas:not(.mobile) .main-nav .nav-discord { padding-left: 5px; padding-right: 5px; }
}
/* Pastille du compte : pseudo sur une ligne ; sous 1600 px, son badge n'y est pas
   (il reste visible dans le chat, le classement et le profil). */
#navName { white-space: nowrap; }
/* Ordinateur etroit (901-1249 px), connecte : la barre ne tient pas avec le
   pseudo dans la pastille du compte ; il n'y reste que la photo (le pseudo est
   dans le chat, le classement et le profil). */
@media (min-width: 901px) and (max-width: 1249px) {
  html.xmas:not(.mobile) #navName, html.xmas:not(.mobile) .profile-pill .caret { display: none; }
  html.xmas:not(.mobile) .profile-pill { padding-left: 4px; padding-right: 4px; gap: 0; }
  html.xmas:not(.mobile) .account-box, html.xmas:not(.mobile) .account-area { gap: 6px; }
  /* Langue : seulement le bouton de l'autre langue (FR <-> EN). */
  html.xmas:not(.mobile) .lang-switch .lang-btn.active { display: none; }
}
/* Wallet connecte (solde affiche) : la pastille du compte garde seulement la
   photo jusqu'a 1499 px. */
@media (min-width: 901px) and (max-width: 1499px) {
  html.xmas:not(.mobile) .account-area:has(#navSolBalance:not(.hidden)) #navName,
  html.xmas:not(.mobile) .account-area:has(#navSolBalance:not(.hidden)) .profile-pill .caret { display: none; }
  html.xmas:not(.mobile) .account-area:has(#navSolBalance:not(.hidden)) .profile-pill { padding-left: 4px; padding-right: 4px; gap: 0; }
}
/* Tres etroit (901-1050 px) : le solde n'a plus la place (on le voit dans son wallet). */
@media (min-width: 901px) and (max-width: 1050px) {
  html.xmas:not(.mobile) #navSolBalance { display: none; }
}
@media (max-width: 1599px) { html:not(.mobile) .profile-pill .xm-badge { display: none; } }
.xm-snow-item { display: flex; align-items: center; gap: 8px; }
.xm-snow-item svg { width: 15px; height: 15px; flex: none; }
.xm-snow-item .slash { display: none; }
.xm-snow-item.off .slash { display: inline; }

/* ----- Encart du lobby et de l'ecran telephone */
.xm-promo {
  display: inline-flex; align-items: center; gap: 8px; margin-left: auto; padding: 6px 13px 6px 10px; border-radius: 999px;
  font: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: 0; text-transform: none; color: #fff4e0; cursor: pointer;
  border: 1px solid rgba(255,211,107,0.55);
  background: linear-gradient(90deg, rgba(227,38,47,0.35), rgba(31,157,85,0.25));
  box-shadow: 0 0 18px -4px rgba(227,38,47,0.6);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.xm-promo:hover { transform: translateY(-1px); border-color: var(--xm-gold); }
.xm-promo .xm-promo-gift { font-size: 15px; animation: xmGiftWiggle 3.2s ease-in-out infinite; }
.xm-promo b { color: var(--xm-gold); font-weight: 800; }
.arcade-topline .xm-promo + .defi-promo-pill { margin-left: 8px; }
html.mobile .xm-promo-lobby { display: none !important; }
.xm-promo-gate { margin: 14px auto 0; font-size: 14px; padding: 10px 16px; }

/* =========================================================== CALENDRIER */
#xmas.view.active { overflow: hidden; }
#xmas [hidden] { display: none !important; }
.xm-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 6px 30px 0; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
html.mobile #xmas.view.active { overflow: visible; }
html.mobile .xm-scroll { overflow: visible; padding: 0; }
/* Ordinateur : tout le calendrier tient dans la page, sans defiler. Les cases
   prennent la hauteur disponible (5 rangees) ; la hotte s'ouvre par-dessus.
   Ecran tres bas : les cases ne descendent pas sous ~55 px, la page defile. */
@media (min-width: 701px) {
  html:not(.mobile) main#app:has(#xmas.active) { max-width: 1320px; padding-top: 16px; padding-bottom: 16px; }
  html:not(.mobile) #xmas .xm-scroll { display: flex; flex-direction: column; padding: 0; }
  html:not(.mobile) #xmas .xm-hero { flex: none; margin-bottom: 14px; }
  html:not(.mobile) #xmas .xm-board { flex: 1 1 0; min-height: 360px; display: flex; flex-direction: column; padding: 18px 20px 26px; }
  html:not(.mobile) #xmas .xm-grid { flex: 1; min-height: 0; gap: 12px; grid-auto-rows: auto; grid-template-rows: repeat(5, minmax(0, 1fr)); }
  html:not(.mobile) #xmas .xm-title { font-size: 46px; margin: 2px 0 4px; }
  html:not(.mobile) #xmas .xm-sub { max-width: 720px; font-size: 14px; line-height: 1.5; }
}
@media (min-width: 701px) and (max-height: 860px) {
  html:not(.mobile) #xmas .xm-sub { display: none; }
  html:not(.mobile) #xmas .xm-title { font-size: 40px; }
}
@media (min-width: 701px) and (max-height: 700px) {
  html:not(.mobile) main#app:has(#xmas.active) { padding-top: 10px; padding-bottom: 10px; }
  html:not(.mobile) #xmas .xm-hero { margin-bottom: 10px; align-items: center; }
  html:not(.mobile) #xmas .xm-kicker { display: none; }
  html:not(.mobile) #xmas .xm-title { font-size: 36px; margin: 0; }
  html:not(.mobile) #xmas .xm-board { padding: 14px 16px 20px; }
  html:not(.mobile) #xmas .xm-grid { gap: 10px; }
}

.xm-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 0 0 22px; }
.xm-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 3px; color: var(--xm-gold); }
.xm-kicker::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--xm-red); box-shadow: 0 0 10px var(--xm-red); animation: xmBlink 1.6s ease-in-out infinite; }
@keyframes xmBlink { 50% { opacity: 0.3; } }
.xm-title {
  margin: 4px 0 6px; font-family: var(--xm-font); font-weight: 700; font-size: 52px; line-height: 1.02; letter-spacing: 0.5px;
  background: linear-gradient(180deg, #ffffff 0%, #e6f7ff 45%, #9fd8f5 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.45)) drop-shadow(0 0 18px rgba(140,215,255,0.35));
}
.xm-sub { margin: 0; max-width: 620px; font-size: 15px; line-height: 1.55; color: #b9cbd8; }
.xm-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.xm-side-top { display: flex; align-items: stretch; gap: 10px; }
.xm-hotte-btn {
  position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 0 18px; min-height: 46px; border-radius: 16px; cursor: pointer; white-space: nowrap; flex: none;
  font: inherit; font-size: 14px; font-weight: 800; color: #3a0408;
  background: linear-gradient(90deg, #ffe08a, #ffc94a); border: 0; box-shadow: 0 8px 24px -10px rgba(255,201,74,0.85);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.xm-hotte-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px -8px rgba(255,201,74,0.95); }
.xm-hotte-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.xm-hotte-btn-ico { font-size: 19px; line-height: 1; }
.xm-hotte-n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; background: #b3121d; }
.xm-hotte-n:empty { display: none; }
.xm-count {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 16px;
  background: rgba(10,22,44,0.75); border: 1px solid rgba(160,220,255,0.22);
}
.xm-count-label { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: #9fc4dc; text-transform: uppercase; }
.xm-count-time { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: #fff; letter-spacing: 1px; text-shadow: 0 0 14px rgba(140,215,255,0.5); }
.xm-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: #d9e8f2; }
.xm-progress-bar { width: 180px; height: 9px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.xm-progress-bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: repeating-linear-gradient(-45deg, #ff4b55 0 8px, #ffffff 8px 16px);
  box-shadow: 0 0 12px rgba(255,75,85,0.6); transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ----- Le calendrier : nuit d'hiver, lune, etoiles, collines enneigees */
.xm-board {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 28px; padding: 26px 26px 34px;
  background:
    radial-gradient(circle at 88% 12%, #fff9e3 0 24px, rgba(255,249,227,0.35) 26px, rgba(255,249,227,0.08) 60px, transparent 110px),
    radial-gradient(ellipse 70% 45% at 25% 0%, rgba(92,255,176,0.12), transparent 70%),
    radial-gradient(ellipse 60% 40% at 70% 5%, rgba(120,140,255,0.12), transparent 70%),
    linear-gradient(180deg, #071228 0%, #0a1e42 45%, #0f2d57 78%, #16416e 100%);
  border: 1px solid rgba(160,220,255,0.2);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.85), inset 0 0 90px rgba(120,200,255,0.07);
}
.xm-board::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0.9;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff 60%, transparent 62%),
    radial-gradient(1px 1px at 33% 9%, #fff 60%, transparent 62%),
    radial-gradient(1.6px 1.6px at 52% 22%, #dff6ff 60%, transparent 62%),
    radial-gradient(1px 1px at 71% 30%, #fff 60%, transparent 62%),
    radial-gradient(1.3px 1.3px at 90% 41%, #fff 60%, transparent 62%),
    radial-gradient(1px 1px at 6% 52%, #fff 60%, transparent 62%),
    radial-gradient(1.4px 1.4px at 41% 46%, #fff 60%, transparent 62%),
    radial-gradient(1px 1px at 63% 58%, #dff6ff 60%, transparent 62%);
  background-size: 380px 260px;
  animation: xmStars 5s ease-in-out infinite alternate;
}
@keyframes xmStars { from { opacity: 0.55; } to { opacity: 1; } }
.xm-board::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 150px; z-index: -1; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 150' preserveAspectRatio='none'><path d='M0 70 C150 30 300 40 420 75 S700 120 860 70 S1100 30 1200 60 V150 H0Z' fill='%23aecde3' opacity='.35'/><g fill='%230a1e3a' opacity='.8'><path d='M90 72 l14 -40 14 40z M98 60 l6 -22 6 22z'/><path d='M140 80 l10 -30 10 30z'/><path d='M1010 62 l16 -46 16 46z'/><path d='M1050 70 l11 -32 11 32z'/><path d='M640 96 l9 -26 9 26z'/></g><path d='M0 105 C200 70 380 80 560 108 S900 140 1200 95 V150 H0Z' fill='%23e8f6ff'/><path d='M0 125 C260 105 520 112 760 130 S1050 140 1200 120 V150 H0Z' fill='%23ffffff'/></svg>") center bottom / 100% 100% no-repeat;
}

.xm-grid {
  position: relative; z-index: 1;
  display: grid; gap: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 116px;
  grid-template-areas:
    "d7 d19 d24 d24 d3 d12"
    "d15 d1 d24 d24 d21 d9"
    "d22 d22 d5 d11 d18 d18"
    "d2 d13 d20 d8 d16 d4"
    "d10 d23 d6 d17 d14 d14";
}
@media (max-width: 700px) {
  .xm-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 92px; gap: 10px;
    grid-template-areas:
      "d24 d24 d7 d19"
      "d24 d24 d3 d12"
      "d15 d1 d21 d9"
      "d22 d22 d5 d11"
      "d2 d13 d18 d18"
      "d20 d8 d16 d4"
      "d10 d10 d23 d17"
      "d6 d6 d14 d14";
  }
}

/* ----- Une case */
.xm-door {
  container: xmdoor / size;
  position: relative; display: block; min-width: 0; padding: 0; margin: 0; border: 0; border-radius: 15px;
  background: none; font: inherit; color: inherit; text-align: center; cursor: pointer;
  perspective: 900px; -webkit-tap-highlight-color: transparent;
}
.xm-door:focus-visible { outline: 3px solid var(--xm-gold); outline-offset: 3px; }
.xm-inside {
  position: absolute; inset: 0; border-radius: 15px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px;
  background: radial-gradient(circle at 50% 42%, rgba(255,214,120,0.42), rgba(120,40,12,0.55) 45%, rgba(20,8,6,0.96) 78%), #140806;
  box-shadow: inset 0 6px 20px rgba(0,0,0,0.85), inset 0 0 0 1px rgba(255,211,107,0.25);
}
.xm-inside-name { max-width: 100%; font-size: 11.5px; font-weight: 700; color: #ffe9bd; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xm-inside-day { position: absolute; top: 6px; left: 9px; font-family: var(--xm-font); font-size: 17px; font-weight: 700; color: rgba(255,233,189,0.65); }
.xm-inside .xm-iv { transform: scale(0.82); }
.xm-door.is-open .xm-inside::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.12) 45%, transparent 60%);
  background-size: 250% 100%; animation: xmSheen 5s ease-in-out infinite;
}
@keyframes xmSheen { 0% { background-position: 120% 0; } 60%, 100% { background-position: -80% 0; } }

.xm-leaf { position: absolute; inset: 0; transform-origin: 0 50%; transform-style: preserve-3d; }
.xm-leaf-front, .xm-leaf-back { position: absolute; inset: 0; border-radius: 15px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.xm-leaf-back { transform: rotateY(180deg); background: linear-gradient(90deg, #d9c9ab, #efe3cc); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25), inset -10px 0 18px rgba(0,0,0,0.25); }
.xm-leaf-front {
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--pat, none), var(--bg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14), inset 0 -12px 26px rgba(0,0,0,0.32), 0 10px 22px -10px rgba(0,0,0,0.8);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.xm-leaf-front::before { content: ''; position: absolute; inset: 7px; border-radius: 10px; border: 2px dashed rgba(255,255,255,0.3); pointer-events: none; }
.xm-num {
  position: relative; font-family: var(--xm-font); font-weight: 700; font-size: 50px; font-size: clamp(24px, 43cqh, 64px); line-height: 1; color: var(--ink);
  text-shadow: 0 3px 0 rgba(0,0,0,0.3), 0 0 22px var(--glow, transparent);
}
.xm-motif { position: absolute; right: 12px; bottom: 11px; width: 22px; height: 22px; color: var(--ink); opacity: 0.8; }
.xm-motif svg { width: 100%; height: 100%; display: block; }
/* Poignee de la porte. */
.xm-leaf-front::after { content: ''; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: rgba(255,255,255,0.55); box-shadow: 0 1px 2px rgba(0,0,0,0.5); }

.xm-door.t-red { --bg: linear-gradient(145deg, #ec3a43, #9b111b); --pat: repeating-linear-gradient(-45deg, rgba(255,255,255,0.07) 0 9px, transparent 9px 18px); --ink: #fff3d6; --glow: rgba(255,170,150,0.5); }
.xm-door.t-green { --bg: linear-gradient(145deg, #27ad63, #0d4f2c); --pat: radial-gradient(rgba(255,255,255,0.1) 1.4px, transparent 1.8px) 0 0 / 14px 14px; --ink: #fff3d6; --glow: rgba(160,255,200,0.4); }
.xm-door.t-navy { --bg: linear-gradient(145deg, #234a98, #0b1a40); --pat: radial-gradient(rgba(255,230,160,0.16) 1px, transparent 1.6px) 0 0 / 22px 18px; --ink: #ffd36b; --glow: rgba(255,211,107,0.45); }
.xm-door.t-gold { --bg: linear-gradient(145deg, #f8d572, #b8862a); --pat: repeating-linear-gradient(45deg, rgba(255,255,255,0.12) 0 2px, transparent 2px 12px); --ink: #6a0d14; --glow: rgba(255,255,255,0.5); }
.xm-door.t-ice { --bg: linear-gradient(145deg, #f2fbff, #a6d6ec); --pat: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.9), transparent 40%); --ink: #0f4c6b; --glow: rgba(255,255,255,0.8); }
.xm-door.t-star { --bg: radial-gradient(circle at 50% 38%, #ff4f59, #a3121d 60%, #5c0710); --pat: repeating-conic-gradient(from 0deg at 50% 45%, rgba(255,211,107,0.1) 0 8deg, transparent 8deg 16deg); --ink: #ffd36b; --glow: rgba(255,211,107,0.8); }
.xm-door.t-star .xm-leaf-front { box-shadow: inset 0 0 0 2px rgba(255,211,107,0.7), inset 0 -14px 30px rgba(0,0,0,0.35), 0 0 34px -6px rgba(255,211,107,0.55); }
.xm-door.t-star .xm-num { font-size: 96px; font-size: clamp(44px, 40cqh, 120px); }
.xm-door.t-star .xm-motif { width: 34px; height: 34px; right: 18px; bottom: 16px; }

/* Case du futur : givree, cadenas. */
.xm-door.is-locked { cursor: default; }
.xm-door.is-locked .xm-leaf-front { filter: saturate(0.45) brightness(0.62); }
.xm-frost {
  position: absolute; inset: 0; border-radius: 15px; pointer-events: none; z-index: 2;
  background:
    radial-gradient(circle at 0 0, rgba(235,250,255,0.55), transparent 32%),
    radial-gradient(circle at 100% 100%, rgba(235,250,255,0.4), transparent 30%),
    radial-gradient(circle at 100% 0, rgba(235,250,255,0.25), transparent 22%);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 9px;
}
.xm-lock { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #e9f6ff; background: rgba(6,14,28,0.72); }
.xm-lock svg { width: 11px; height: 11px; }
.xm-door.is-locked.shake { animation: xmNo 0.45s ease; }
@keyframes xmNo { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* Case a ouvrir : elle brille, elle bouge un peu. */
.xm-door.is-ready .xm-leaf-front { animation: xmReady 2.4s ease-in-out infinite; }
.xm-door.is-ready:hover .xm-leaf-front { transform: rotateY(-14deg); }
.xm-door.is-ready { animation: xmJiggle 5s ease-in-out infinite; animation-delay: var(--jd, 0s); }
@keyframes xmReady {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14), inset 0 -12px 26px rgba(0,0,0,0.32), 0 0 0 2px rgba(255,211,107,0.55), 0 0 16px 2px rgba(255,211,107,0.3); }
  50% { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14), inset 0 -12px 26px rgba(0,0,0,0.32), 0 0 0 3px rgba(255,211,107,0.95), 0 0 34px 8px rgba(255,211,107,0.55); }
}
@keyframes xmJiggle { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(-2.2deg); } 94% { transform: rotate(2deg); } 97% { transform: rotate(-1deg); } }
.xm-today {
  position: absolute; z-index: 3; top: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  padding: 3px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: 1.5px; color: #3a0408;
  background: linear-gradient(90deg, #ffe08a, #ffc94a); box-shadow: 0 4px 14px rgba(255,201,74,0.55);
}
.xm-openme { position: absolute; z-index: 2; left: 0; right: 0; bottom: 9px; font-size: 11px; font-weight: 800; letter-spacing: 0.5px; color: var(--ink); opacity: 0.9; pointer-events: none; }

/* Ouverture : la porte tourne sur ses gonds puis s'efface. */
.xm-door.opening { z-index: 5; }
.xm-door.opening .xm-leaf { animation: xmSwing 1.15s cubic-bezier(0.3, 0.7, 0.2, 1) forwards; }
@keyframes xmSwing {
  0% { transform: rotateY(0); }
  12% { transform: rotateY(8deg); }
  70% { transform: rotateY(-112deg); opacity: 1; }
  100% { transform: rotateY(-118deg); opacity: 0; }
}
.xm-door.is-open .xm-leaf, .xm-door.is-open .xm-frost { display: none; }
.xm-door.opening .xm-leaf { display: block; }
.xm-door.opening .xm-inside { animation: xmGlowIn 1.2s ease forwards; }
@keyframes xmGlowIn { 0% { filter: brightness(2.2); } 100% { filter: brightness(1); } }

/* Petites cases (ecran bas, telephone) : on allege. */
@container xmdoor (max-height: 104px) {
  .xm-lock-text { display: none; }
  .xm-lock { padding: 4px 6px; }
  /* Le cadenas passe dans le coin : le chiffre reste lisible. */
  .xm-frost { align-items: flex-start; justify-content: flex-end; padding: 6px 7px 0 0; }
  .xm-motif { width: 16px; height: 16px; right: 8px; bottom: 8px; }
  .xm-openme { font-size: 10px; bottom: 6px; }
  .xm-door.is-ready .xm-motif { display: none; }
  .xm-inside { gap: 2px; padding: 4px; }
  .xm-inside .xm-iv { transform: scale(0.62); }
  .xm-inside-name { font-size: 10px; }
  .xm-inside-day { font-size: 14px; top: 3px; left: 7px; }
}
@container xmdoor (max-height: 80px) {
  .xm-openme, .xm-inside-name, .xm-leaf-front::after { display: none; }
  .xm-lock { padding: 3px 5px; }
  .xm-lock svg { width: 9px; height: 9px; }
  .xm-inside .xm-iv { transform: scale(0.52); }
  .xm-motif { width: 13px; height: 13px; right: 6px; bottom: 6px; }
}

/* ----- Rendus des objets (case ouverte, revelation, hotte) */
.xm-iv { display: inline-flex; align-items: center; justify-content: center; }
.xm-iv-badge { font-size: 44px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)); }
.xm-iv-av { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; background: #10202c; }
.xm-iv-name { font-size: 17px; font-weight: 800; max-width: 100%; }
.xm-iv-title {
  padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #ffe9bd; white-space: nowrap;
  background: linear-gradient(90deg, rgba(227,38,47,0.45), rgba(31,157,85,0.4)); border: 1px solid rgba(255,211,107,0.55);
}
.xm-iv-effect { position: relative; font-size: 40px; line-height: 1; }
.xm-iv-pet::after, .xm-iv-weather::after, .xm-iv-trail::after { content: none; }
.xm-iv .xm-pet-kimchi { width: 52px; height: 52px; }
.xm-iv-effect::after { content: '✨'; position: absolute; right: -14px; top: -10px; font-size: 20px; animation: xmBlink 1.2s ease-in-out infinite; }

/* ----- Revelation de l'objet */
.xm-reveal {
  position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(2,6,16,0.74); backdrop-filter: blur(6px); animation: xmFade 0.3s ease;
}
@keyframes xmFade { from { opacity: 0; } }
.xm-reveal-card {
  position: relative; overflow: hidden; width: min(440px, 100%); padding: 34px 28px 26px; border-radius: 26px; text-align: center;
  background: linear-gradient(180deg, #142b55, #0a1630);
  border: 1px solid rgba(255,211,107,0.5);
  box-shadow: 0 30px 90px -20px rgba(0,0,0,0.9), 0 0 70px -12px rgba(255,211,107,0.4);
  animation: xmPop 0.6s cubic-bezier(0.2, 1.5, 0.4, 1);
}
@keyframes xmPop { from { transform: scale(0.6) translateY(30px); opacity: 0; } }
.xm-reveal-rays {
  position: absolute; left: 50%; top: 132px; width: 640px; height: 640px; margin: -320px 0 0 -320px; z-index: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255,211,107,0.18) 0 9deg, transparent 9deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 10%, transparent 62%); mask: radial-gradient(circle, #000 10%, transparent 62%);
  animation: xmSpin 16s linear infinite;
}
@keyframes xmSpin { to { transform: rotate(360deg); } }
.xm-reveal-card > *:not(.xm-reveal-rays) { position: relative; z-index: 1; }
.xm-reveal-kicker { font-size: 12px; font-weight: 800; letter-spacing: 3px; color: var(--xm-gold); }
.xm-reveal-got { margin: 6px 0 0; font-family: var(--xm-font); font-size: 30px; font-weight: 700; color: #fff; }
.xm-reveal-item { display: flex; align-items: center; justify-content: center; min-height: 130px; margin: 6px 0 4px; animation: xmItemIn 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) 0.15s both; }
.xm-reveal-item .xm-iv { transform: scale(1.6); }
.xm-reveal-item .xm-iv-name, .xm-reveal-item .xm-iv-title { transform: scale(1.25); }
@keyframes xmItemIn { from { transform: scale(0) rotate(-20deg); opacity: 0; } }
.xm-reveal-name { font-size: 22px; font-weight: 800; color: #fff; }
.xm-reveal-rare { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 2px; color: #3a0408; background: linear-gradient(90deg, #ffe08a, #ffc94a); }
.xm-reveal-type { margin: 6px 0 0; font-size: 14px; color: #b9cbd8; }
.xm-reveal-vis { margin: 4px 0 0; font-size: 12.5px; color: #7f9db3; }
.xm-reveal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.xm-btn {
  padding: 11px 20px; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
  border: 1px solid rgba(255,211,107,0.55); color: #fff4e0; background: rgba(255,255,255,0.05);
  transition: transform 0.15s ease, background 0.15s ease;
}
.xm-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.1); }
.xm-btn-main { color: #3a0408; border-color: transparent; background: linear-gradient(90deg, #ffe08a, #ffc94a); box-shadow: 0 8px 26px -8px rgba(255,201,74,0.8); }
.xm-btn-main:hover { background: linear-gradient(90deg, #fff0b8, #ffd36b); }
.xm-btn:disabled { cursor: default; opacity: 0.75; transform: none; }
.xm-equipped { display: inline-flex; align-items: center; gap: 6px; padding: 11px 16px; font-size: 14px; font-weight: 800; color: #7ff0b0; }

/* Eclats a l'ouverture (flocons, etoiles). */
.xm-burst { position: fixed; z-index: 160; pointer-events: none; left: 0; top: 0; font-size: 16px; line-height: 1; will-change: transform, opacity; animation: xmBurst var(--t, 1.1s) cubic-bezier(0.15, 0.7, 0.3, 1) forwards; }
@keyframes xmBurst {
  0% { transform: translate(var(--x0), var(--y0)) scale(0.4) rotate(0); opacity: 1; }
  100% { transform: translate(var(--x1), var(--y1)) scale(var(--s, 1)) rotate(var(--r, 180deg)); opacity: 0; }
}

/* ----- Ma hotte (fenetre par-dessus le calendrier) */
.xm-modal {
  position: fixed; inset: 0; z-index: 140; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(2,6,16,0.74); backdrop-filter: blur(6px); animation: xmFade 0.25s ease;
}
.xm-modal[hidden] { display: none !important; }
.xm-modal-card {
  position: relative; width: min(900px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; border-radius: 24px;
  background: linear-gradient(160deg, rgba(227,38,47,0.12), rgba(15,18,19,0.96) 40%, rgba(31,157,85,0.1)), var(--bg-panel);
  border: 1px solid rgba(255,211,107,0.3); box-shadow: 0 30px 90px -20px rgba(0,0,0,0.9);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent; animation: xmPop 0.45s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.xm-modal-x {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font: inherit; font-size: 22px; line-height: 1; color: var(--text);
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
}
.xm-modal-x:hover { border-color: rgba(255,211,107,0.6); }
.xm-hotte { padding: 22px 24px 4px; }
.xm-hotte-head { padding-right: 44px; }
.xm-modal-card .xm-rules { margin: 6px 24px 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.xm-hotte-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.xm-hotte-head h2 { margin: 0; font-family: var(--xm-font); font-size: 34px; font-weight: 700; color: #fff; }
.xm-hotte-head p { margin: 0; font-size: 13.5px; color: var(--text-dim); max-width: 520px; }
.xm-hotte-body { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .xm-hotte-body { grid-template-columns: 1fr; } }
.xm-preview { padding: 16px; border-radius: 16px; background: rgba(5,10,18,0.75); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.xm-preview-label { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--text-dim); text-transform: uppercase; }
.xm-pv-msg { display: flex; gap: 10px; align-items: flex-start; }
.xm-pv-av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.xm-pv-name { font-weight: 700; font-size: 14.5px; }
.xm-pv-time { margin-left: 6px; font-size: 11px; color: var(--text-dim); }
.xm-pv-text { margin-top: 2px; font-size: 14px; color: var(--text); }
.xm-pv-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px 14px; border-radius: 14px; background: rgba(255,255,255,0.03); }
.xm-pv-card .xm-pv-av { width: 70px; height: 70px; }
.xm-pv-card .xm-pv-name { font-size: 18px; }
.xm-slots { display: flex; flex-direction: column; gap: 14px; }
.xm-slot-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.xm-slot-head b { font-size: 13px; font-weight: 800; letter-spacing: 1px; color: #fff; text-transform: uppercase; }
.xm-slot-head span { font-size: 12px; color: var(--text-dim); }
.xm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.xm-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 12px; border-radius: 11px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--text); background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.xm-chip:hover:not(:disabled) { border-color: rgba(255,211,107,0.6); transform: translateY(-1px); }
.xm-chip.on { border-color: var(--xm-gold); background: rgba(255,211,107,0.12); box-shadow: 0 0 0 1px rgba(255,211,107,0.35) inset; }
.xm-chip.on::after { content: '✓'; color: var(--xm-gold); font-weight: 900; }
.xm-chip.locked { cursor: default; color: #5d6b72; border-style: dashed; background: none; font-size: 15px; padding: 6px 13px; }
.xm-chip .xm-chip-icon { font-size: 17px; line-height: 1; }
.xm-chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.xm-chip:disabled:not(.locked) { opacity: 0.6; cursor: progress; }
.xm-hotte-empty { padding: 18px; border-radius: 14px; text-align: center; color: var(--text-dim); background: rgba(255,255,255,0.03); }
.xm-hotte-empty .xm-btn { margin-top: 12px; }
.xm-bonus { margin-top: 14px; padding: 10px 14px; border-radius: 12px; font-size: 13px; font-weight: 700; color: #ffe9bd; background: rgba(255,211,107,0.08); border: 1px dashed rgba(255,211,107,0.4); }
.xm-bonus.done { border-style: solid; background: rgba(255,211,107,0.15); }
.xm-rules { margin: 18px 4px 0; font-size: 12.5px; line-height: 1.55; color: var(--text-dim); }

/* =========================================================== COSMETIQUES
   Cadre de photo (xf-*), couleur de pseudo (xn-* sur .xm-n), badge (.xm-badge),
   titre (.xm-utitle). */
img.xf { border-radius: 50%; }
img.xf-frost { box-shadow: 0 0 0 2px #f2fcff, 0 0 0 4px #7fd2ef, 0 0 14px 3px rgba(140,225,255,0.65) !important; }
img.xf-candy { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #e3262f, 0 0 0 6px #ffffff, 0 0 12px 4px rgba(227,38,47,0.45) !important; }
img.xf-lights { animation: xfLights 1.8s steps(1) infinite; }
@keyframes xfLights {
  0% { box-shadow: 0 0 0 2px #ff4d4d, 0 0 0 4px #13221a, 0 0 14px 3px rgba(255,77,77,0.8); }
  25% { box-shadow: 0 0 0 2px #ffd36b, 0 0 0 4px #13221a, 0 0 14px 3px rgba(255,211,107,0.8); }
  50% { box-shadow: 0 0 0 2px #3be37f, 0 0 0 4px #13221a, 0 0 14px 3px rgba(59,227,127,0.8); }
  75% { box-shadow: 0 0 0 2px #5ab8ff, 0 0 0 4px #13221a, 0 0 14px 3px rgba(90,184,255,0.8); }
}
img.xf-aurora { animation: xfAurora 5s linear infinite; }
@keyframes xfAurora {
  0%, 100% { box-shadow: 0 0 0 3px #5cffb0, 0 0 16px 4px rgba(92,255,176,0.6); }
  33% { box-shadow: 0 0 0 3px #5ab8ff, 0 0 16px 4px rgba(90,184,255,0.6); }
  66% { box-shadow: 0 0 0 3px #b67cff, 0 0 16px 4px rgba(182,124,255,0.6); }
}
img.xf-goldframe { animation: xfGold 2.6s ease-in-out infinite; }
@keyframes xfGold {
  0%, 100% { box-shadow: 0 0 0 2px #fff3c4, 0 0 0 4px #e0a92e, 0 0 12px 3px rgba(255,200,80,0.6); }
  50% { box-shadow: 0 0 0 2px #fff9e3, 0 0 0 4px #ffd36b, 0 0 24px 7px rgba(255,211,107,0.85); }
}

.xm-n.xn-snowname { color: #f0faff; text-shadow: 0 0 6px rgba(170,228,255,0.95), 0 0 14px rgba(120,200,255,0.55); }
.xm-n.xn-candyname {
  background: repeating-linear-gradient(-45deg, #ff3b47 0 5px, #ffffff 5px 10px);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 3px rgba(255,59,71,0.5));
}
.xm-n.xn-auroraname {
  background: linear-gradient(90deg, #5cffb0, #5ab8ff, #b67cff, #5cffb0); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  animation: xnSlide 6s linear infinite;
}
.xm-n.xn-goldname {
  background: linear-gradient(100deg, #c08a12 0%, #ffe08a 35%, #fffbe6 50%, #ffd35c 65%, #c08a12 100%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  animation: xnSlide 3.2s linear infinite; filter: drop-shadow(0 0 4px rgba(255,211,107,0.45));
}
@keyframes xnSlide { from { background-position: 0% 0; } to { background-position: 300% 0; } }
.xm-badge { display: inline-block; margin-left: 5px; font-size: 0.95em; line-height: 1; vertical-align: -0.08em; font-style: normal; -webkit-text-fill-color: initial; }
.xm-badge.b-star { animation: xmTwinkle 1.8s ease-in-out infinite; }
@keyframes xmTwinkle { 50% { filter: drop-shadow(0 0 6px rgba(255,211,107,0.95)); transform: scale(1.15); } }
.xm-utitle {
  display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 2px; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.3px; color: #ffe9bd;
  background: linear-gradient(90deg, rgba(227,38,47,0.28), rgba(31,157,85,0.24)); border: 1px solid rgba(255,211,107,0.45);
}
.xm-utitle::before { content: '🎄'; font-size: 11px; }
.xm-utitle.hidden { display: none; }
.lb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----- KIMCHI en bonnet */
html.xmas .kimchi-boss::after {
  content: ''; position: absolute; z-index: 3; left: 29%; top: 3%; width: 46%; height: 34%; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 80'><defs><linearGradient id='r' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%23ff4b55'/><stop offset='1' stop-color='%23a3121d'/></linearGradient></defs><path d='M14 62 Q26 18 66 10 Q88 8 95 36 Q82 25 70 30 Q78 44 86 62 Z' fill='url(%23r)'/><path d='M40 24 Q56 14 70 14' stroke='%23ffffff' stroke-opacity='.25' stroke-width='3' fill='none' stroke-linecap='round'/><rect x='6' y='56' width='88' height='19' rx='9.5' fill='%23f6f8fa'/><rect x='6' y='66' width='88' height='9' rx='4.5' fill='%23dfe5ea'/><circle cx='94' cy='40' r='9.5' fill='%23ffffff'/><circle cx='91' cy='37' r='3' fill='%23ffffff' opacity='.9'/></svg>") center / contain no-repeat;
  transform: rotate(-12deg); filter: drop-shadow(0 6px 8px rgba(0,0,0,0.6));
}

/* ----- Le traineau du Pere Noel traverse le ciel (de temps en temps) */
.xm-sleigh { position: fixed; z-index: 59; left: 0; top: 0; width: 280px; height: 66px; pointer-events: none; will-change: transform; }
.xm-sleigh svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 6px rgba(255,220,140,0.85)) drop-shadow(0 0 16px rgba(255,200,90,0.45)); }
.xm-sleigh .leg-f { transform-box: fill-box; transform-origin: 0 0; animation: xmGallopF 0.5s ease-in-out infinite alternate; }
.xm-sleigh .leg-b { transform-box: fill-box; transform-origin: 100% 0; animation: xmGallopB 0.5s ease-in-out infinite alternate; }
@keyframes xmGallopF { from { transform: rotate(-18deg); } to { transform: rotate(14deg); } }
@keyframes xmGallopB { from { transform: rotate(16deg); } to { transform: rotate(-16deg); } }
.xm-dust { position: fixed; z-index: 58; left: 0; top: 0; width: 4px; height: 4px; border-radius: 50%; pointer-events: none; background: #ffe7a8; box-shadow: 0 0 6px 2px rgba(255,214,120,0.8); animation: xmDust 1.4s ease-out forwards; }
@keyframes xmDust { to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; } }

/* Confettis de victoire aux couleurs de Noel (flocons compris). */
.confetti-piece.xm-flake { width: auto; height: auto; background: none !important; color: #f2fbff; font-size: 16px; line-height: 1; text-shadow: 0 0 8px rgba(170,228,255,0.9); }
.confetti-piece.xm-gift { width: auto; height: auto; background: none !important; font-size: 24px; line-height: 1; }

/* ----- Telephone et petits ecrans */
html.mobile .mobile-gate-logo.logo-xmas { width: 240px; height: auto; margin: 0 auto 8px; }
@media (max-width: 700px) {
  .xm-title { font-size: 40px; }
  .xm-hero { gap: 14px; }
  .xm-side { align-items: stretch; width: 100%; }
  .xm-count { justify-content: space-between; }
  .xm-progress-bar { flex: 1; width: auto; }
  .xm-board { padding: 14px 12px 26px; border-radius: 22px; }
  .xm-lock-text { display: none; }
  .xm-lock { padding: 4px 6px; }
  .xm-motif { width: 16px; height: 16px; right: 8px; bottom: 8px; }
  .xm-openme { font-size: 9.5px; bottom: 6px; }
  .xm-today { font-size: 9px; padding: 2px 7px; letter-spacing: 1px; }
  .xm-inside { gap: 2px; padding: 4px; }
  .xm-inside .xm-iv { transform: scale(0.62); }
  .xm-inside-name { font-size: 9.5px; }
  .xm-inside-day { font-size: 14px; top: 3px; left: 7px; }
  .xm-side-top { width: 100%; flex-direction: column; }
  .xm-side-top .xm-count { order: -1; }
  .xm-hotte-btn { justify-content: center; }
  .xm-modal { padding: 10px; align-items: flex-end; }
  .xm-modal-card { max-height: calc(100dvh - 20px); border-radius: 22px; }
  .xm-hotte { padding: 16px 14px 4px; }
  .xm-hotte-head h2 { font-size: 28px; }
  .xm-modal-card .xm-rules { margin: 6px 14px 16px; }
}

/* Mouvements reduits : pas d'animation en continu. */
@media (prefers-reduced-motion: reduce) {
  .xm-bulb.on .glass, .xm-bulb.on .halo, .nav-xmas .nav-icon, .xm-promo .xm-promo-gift, .xm-kicker::before, .xm-board::before,
  .xm-door.is-ready, .xm-door.is-ready .xm-leaf-front, .xm-door.is-open .xm-inside::after, .xm-reveal-rays,
  img.xf-lights, img.xf-aurora, img.xf-goldframe, .xm-n.xn-auroraname, .xm-n.xn-goldname, .xm-badge.b-star { animation: none !important; }
  .xm-bulb .glass { opacity: 0.9; }
}

/* ----- Effets et objets « rien que pour soi » */
.xm-try {
  margin-left: auto; padding: 3px 10px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 800; white-space: nowrap; flex: none;
  color: #ffe9bd; background: rgba(255,211,107,0.12); border: 1px solid rgba(255,211,107,0.45);
}
.xm-try:hover { background: rgba(255,211,107,0.22); }

/* Mini KIMCHI (compagnon) : le masque avec un bonnet. */
.xm-pet-kimchi { position: relative; display: inline-block; width: 1em; height: 1em; vertical-align: middle; }
.xm-pet-kimchi img { width: 100%; height: 100%; display: block; border-radius: 28%; }
.xm-pet-kimchi::after {
  content: ''; position: absolute; left: 20%; top: -26%; width: 62%; height: 46%; pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 80'><path d='M14 62 Q26 18 66 10 Q88 8 95 36 Q82 25 70 30 Q78 44 86 62 Z' fill='%23e0202c'/><rect x='6' y='56' width='88' height='19' rx='9.5' fill='%23f6f8fa'/><circle cx='94' cy='40' r='9.5' fill='%23ffffff'/></svg>") center / contain no-repeat;
  transform: rotate(-12deg);
}

/* Trainee derriere la souris / le doigt. */
#xmTrail { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 165; }

/* Compagnon : il se promene en bas de l'ecran. */
.xm-pet {
  position: fixed; left: 0; bottom: 6px; z-index: 55; width: 52px; height: 56px; padding: 0; margin: 0;
  border: 0; background: none; cursor: pointer; will-change: transform; -webkit-tap-highlight-color: transparent;
}
html.mobile .xm-pet { bottom: calc(66px + env(safe-area-inset-bottom)); width: 44px; height: 48px; }
body.in-match .xm-pet { display: none !important; }
.xm-pet-flip { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; transition: transform 0.25s ease; }
.xm-pet.left .xm-pet-flip { transform: scaleX(-1); }
.xm-pet-hop { display: inline-block; font-size: 38px; line-height: 1; transform-origin: 50% 100%; animation: xmPetWalk 0.42s ease-in-out infinite alternate; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.55)); }
html.mobile .xm-pet-hop { font-size: 32px; }
.xm-pet.idle .xm-pet-hop { animation: xmPetIdle 2.4s ease-in-out infinite; }
.xm-pet.jump .xm-pet-hop { animation: xmPetJump 0.6s cubic-bezier(0.3, 0.7, 0.4, 1); }
.xm-pet-emoji { display: inline-block; }
.xm-pet-shadow { position: absolute; left: 50%; bottom: 2px; width: 30px; height: 6px; margin-left: -15px; border-radius: 50%; background: rgba(0,0,0,0.45); filter: blur(2px); }
.xm-pet-say {
  position: absolute; left: 50%; bottom: 100%; margin-bottom: 4px; padding: 6px 11px; border-radius: 12px; white-space: nowrap; pointer-events: none;
  font-size: 12.5px; font-weight: 700; color: #10202c; background: #f4fbff; box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  opacity: 0; transform: translate(-50%, 6px) scale(0.9); transition: opacity 0.18s ease, transform 0.18s ease;
}
.xm-pet-say::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: #f4fbff; }
.xm-pet-say.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
@keyframes xmPetWalk { from { transform: translateY(0) rotate(-6deg); } to { transform: translateY(-4px) rotate(6deg); } }
@keyframes xmPetIdle { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, 0.96); } }
@keyframes xmPetJump { 0% { transform: translateY(0) scale(1.1, 0.85); } 40% { transform: translateY(-34px) scale(0.95, 1.08) rotate(-10deg); } 75% { transform: translateY(0) scale(1.12, 0.86); } 100% { transform: translateY(0) scale(1); } }

/* Feu d'artifice : la fusee monte puis eclate (anneau + eclats). */
.xm-rocket {
  position: fixed; z-index: 158; left: 0; top: 0; width: 4px; height: 16px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(#fff6d0, rgba(255,200,90,0)); box-shadow: 0 0 10px 2px rgba(255,214,120,0.8);
  animation: xmRocket 0.62s cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
}
@keyframes xmRocket { from { transform: translate(var(--x), var(--y0)); } to { transform: translate(var(--x), var(--y1)); } }
.xm-boom {
  position: fixed; z-index: 158; width: 12px; height: 12px; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%);
  border: 2px solid var(--c, #ffd36b); box-shadow: 0 0 14px var(--c, #ffd36b);
  animation: xmBoom 0.85s cubic-bezier(0.1, 0.7, 0.3, 1) forwards;
}
@keyframes xmBoom { from { width: 12px; height: 12px; opacity: 1; } to { width: 240px; height: 240px; opacity: 0; } }

/* Tempete de neige : l'ecran se givre un instant. */
.xm-frost-flash {
  position: fixed; inset: 0; z-index: 157; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(220,245,255,0) 40%, rgba(220,245,255,0.55) 100%);
  box-shadow: inset 0 0 120px rgba(200,240,255,0.65);
  animation: xmFrostFlash 2.6s ease-out forwards;
}
@keyframes xmFrostFlash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .xm-pet-hop, .xm-pet.idle .xm-pet-hop { animation: none !important; }
}

/* ==========================================================================
   Rarete (commun, rare, epique, legendaire) + nouveaux cadres/pseudos
   + bloc « Ma collection » du profil.
   ========================================================================== */
:root { --r-common: #9fb2bd; --r-rare: #4fa8ff; --r-epic: #b46bff; --r-legendary: #ffb733; }
.r-common { --rc: var(--r-common); }
.r-rare { --rc: var(--r-rare); }
.r-epic { --rc: var(--r-epic); }
.r-legendary { --rc: var(--r-legendary); }

/* Etiquette de rarete (revelation) */
.xm-rarity {
  display: inline-block; margin-top: 8px; padding: 3px 12px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase;
  color: #0b1424; background: var(--rc);
}
.xm-rarity.r-common { color: #0b1424; background: #c7d3da; }
.xm-rarity.r-legendary { background: linear-gradient(90deg, #ffd35c, #fff1b8, #ffb733); background-size: 200% 100%; animation: xnSlide 2.4s linear infinite; }
.xm-reveal.r-rare .xm-reveal-card { border-color: rgba(79,168,255,0.7); box-shadow: 0 30px 90px -20px rgba(0,0,0,0.9), 0 0 70px -10px rgba(79,168,255,0.55); }
.xm-reveal.r-epic .xm-reveal-card { border-color: rgba(180,107,255,0.8); box-shadow: 0 30px 90px -20px rgba(0,0,0,0.9), 0 0 90px -6px rgba(180,107,255,0.65); }
.xm-reveal.r-legendary .xm-reveal-card { border: 2px solid #ffd35c; box-shadow: 0 30px 90px -20px rgba(0,0,0,0.9), 0 0 110px 0 rgba(255,183,51,0.7); animation: xmPop 0.6s cubic-bezier(0.2, 1.5, 0.4, 1), xmLegend 2.2s ease-in-out 0.6s infinite; }
@keyframes xmLegend { 50% { box-shadow: 0 30px 90px -20px rgba(0,0,0,0.9), 0 0 140px 12px rgba(255,211,107,0.85); } }

/* Pastilles de la hotte : liseré de la couleur de rarete */
.xm-chip.r-rare, .xm-chip.r-epic, .xm-chip.r-legendary { border-color: color-mix(in srgb, var(--rc) 55%, transparent); }
.xm-chip.r-epic { box-shadow: 0 0 10px -3px var(--r-epic); }
.xm-chip.r-legendary { box-shadow: 0 0 12px -2px var(--r-legendary); }
.xm-chip.r-common.on { border-color: #e6eef2; background: rgba(230,238,242,0.12); box-shadow: 0 0 0 1px rgba(230,238,242,0.35) inset; }
.xm-chip.r-common.on::after { color: #e6eef2; }
.xm-chip.r-rare.on, .xm-chip.r-epic.on, .xm-chip.r-legendary.on { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 16%, transparent); }
.xm-chip.r-rare.on::after, .xm-chip.r-epic.on::after, .xm-chip.r-legendary.on::after { color: var(--rc); }
.xm-chip.locked.excl { font-size: 12.5px; font-weight: 700; color: #8d9aa2; border-color: color-mix(in srgb, var(--rc) 45%, transparent); display: inline-flex; align-items: center; gap: 6px; filter: grayscale(0.6); }
.xm-chip.locked.excl .xm-pet-kimchi { width: 20px; height: 20px; }
.xm-chip.locked.excl .xm-pet-kimchi img { width: 20px; height: 20px; }
.xm-coll-count { margin-left: 8px; font-family: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif; font-size: 15px; letter-spacing: 0.3px; font-weight: 700; color: var(--xm-gold, #ffd36b); vertical-align: middle; white-space: nowrap; }

/* Case ouverte : lueur de la couleur de rarete */
.xm-inside.r-rare { box-shadow: inset 0 6px 20px rgba(0,0,0,0.85), inset 0 0 0 2px rgba(79,168,255,0.75), inset 0 0 18px rgba(79,168,255,0.35); }
.xm-inside.r-epic { box-shadow: inset 0 6px 20px rgba(0,0,0,0.85), inset 0 0 0 2px rgba(180,107,255,0.85), inset 0 0 22px rgba(180,107,255,0.45); }
.xm-inside.r-legendary { box-shadow: inset 0 6px 20px rgba(0,0,0,0.85), inset 0 0 0 2px #ffd35c, inset 0 0 26px rgba(255,183,51,0.6); }

/* Nouveaux cadres */
img.xf-holly { box-shadow: 0 0 0 2px #1f9d55, 0 0 0 4px #0f5e31, 0 0 0 5px #e3262f, 0 0 10px 3px rgba(31,157,85,0.5) !important; }
img.xf-ribbon { box-shadow: 0 0 0 2px #fff1f3, 0 0 0 4px #c9184a, 0 0 0 6px #ffd36b, 0 0 14px 4px rgba(201,24,74,0.5) !important; }

/* Nouveaux pseudos */
.xm-n.xn-pinename { color: #4fe08a; text-shadow: 0 0 6px rgba(31,157,85,0.85); }
.xm-n.xn-icename {
  background: linear-gradient(180deg, #ffffff 0%, #bfe9ff 45%, #5ab8ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 4px rgba(90,184,255,0.6));
}
.xm-n.xn-firename {
  background: linear-gradient(0deg, #ff3b1f 0%, #ff8a1f 45%, #ffe066 90%); background-size: 100% 220%;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  animation: xnFire 1.4s ease-in-out infinite alternate; filter: drop-shadow(0 0 4px rgba(255,100,30,0.6));
}
@keyframes xnFire { from { background-position: 0 0%; } to { background-position: 0 100%; } }

/* Profil : Ma collection */
.xm-profile-coll { display: flex; flex-direction: column; gap: 10px; }
.xm-pc-count { margin: 0; font-weight: 700; }
.xm-pc-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.xm-pc-pill { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--rc); border: 1px solid color-mix(in srgb, var(--rc) 55%, transparent); background: color-mix(in srgb, var(--rc) 12%, transparent); }
.xm-pc-worn { display: flex; flex-wrap: wrap; gap: 6px; }
.xm-pc-it { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; font-size: 18px; border: 1px solid color-mix(in srgb, var(--rc) 60%, transparent); background: color-mix(in srgb, var(--rc) 12%, transparent); }
.xm-pc-it .xm-pet-kimchi, .xm-pc-it .xm-pet-kimchi img { width: 24px; height: 24px; }

@media (prefers-reduced-motion: reduce) {
  .xm-rarity.r-legendary, .xm-reveal.r-legendary .xm-reveal-card, .xm-n.xn-firename { animation: none !important; }
}
