/* ==========================================================================
   🎄 CHRISTMAS THEME — Perle de Naomie
   Loaded AFTER each page's own styles (only when "Christmas" is chosen in
   Admin -> Theme), so it simply repaints everything.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@400;700&display=swap');

/* ---- Colour palette ------------------------------------------------- */
:root {
    /* index / leaderboard pages */
    --bg-color: #06121d;
    --bg-panel: #0c1f2e;
    --bg-panel-2: #12293b;
    --glass-bg: rgba(8, 24, 38, 0.80);
    --glass-border: rgba(255, 209, 102, 0.30);
    --primary: #ffd166;            /* festive gold */
    --primary-hover: #ffe3a1;
    --accent: #b3182c;             /* Santa red */
    --accent-hover: #d92a41;
    --text-main: #f6f9ff;
    --text-muted: #9db6cc;
    --cyan: #6fe3a7;               /* mint */
    --danger: #ff5468;
    --warning: #ffc24b;

    /* admin page */
    --bg-grad: linear-gradient(160deg, #06121d 0%, #0b2236 55%, #07161f 100%);
    --panel-bg: rgba(10, 28, 42, 0.84);
    --border-subtle: rgba(255, 209, 102, 0.20);
    --accent-cyan: #ff6b7d;
    --success: #6fe3a7;

    --xm-title-font: 'Mountains of Christmas', 'Segoe Script', 'Brush Script MT', cursive;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(ellipse at 50% 120%, rgba(190, 215, 255, 0.20), transparent 55%),
        radial-gradient(circle at 15% 15%, rgba(31, 122, 77, 0.22), transparent 40%),
        radial-gradient(circle at 88% 10%, rgba(179, 24, 44, 0.16), transparent 32%);
    background-attachment: fixed;
}
body.xm-admin { background: var(--bg-grad); background-attachment: fixed; }

/* ---- Festive titles -------------------------------------------------- */
h1, h2, h3 {
    font-family: var(--xm-title-font);
    font-style: normal;
    font-weight: 700;
    letter-spacing: .5px;
}
h1 {
    font-size: 2.9em;
    line-height: 1.1;
    color: #fff;
    text-shadow: 2px 2px 0 #c8102e, 4px 4px 0 #0f5a35, 0 0 24px rgba(255, 255, 255, .45);
    animation: xmTitleGlow 4s ease-in-out infinite;
}
.auth-container h1 { font-size: 2.5em; }
h2 { font-size: 2.3em; color: var(--primary); text-shadow: 0 0 14px rgba(255, 209, 102, .45), 2px 2px 0 #7a0f1d; }
h3 { font-size: 1.7em; text-shadow: 0 0 10px rgba(255, 209, 102, .3); }
.past-container > summary, .price-amount, .rank {
    font-family: var(--xm-title-font);
    font-style: normal;
    font-weight: 700;
}
.price-amount { font-size: 1.7em; }
.past-container > summary { font-size: 1.9em; }
.status-panel h2 { font-size: 32px; }

/* icicles hanging under the main title */
.auth-container h1::after {
    content: '';
    display: block;
    height: 26px;
    width: min(260px, 82%);
    margin: 4px auto 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 26' preserveAspectRatio='none'><g fill='%23d9ecff'><rect width='260' height='4' rx='2'/><path d='M14 3h9l-4.500 20z'/><path d='M44 3h6l-3 12z'/><path d='M78 3h10l-5 23z'/><path d='M112 3h6l-3 10z'/><path d='M140 3h9l-4.500 18z'/><path d='M176 3h6l-3 13z'/><path d='M206 3h10l-5 22z'/><path d='M238 3h7l-3.500 11z'/></g></svg>") center / 100% 100% no-repeat;
    filter: drop-shadow(0 0 5px rgba(170, 215, 255, .8));
    animation: xmIcicle 5s ease-in-out infinite;
    transform-origin: top center;
}

/* snow drift on top of the login card */
.auth-container::before {
    content: '';
    position: absolute; top: -9px; left: 10px; right: 10px; height: 14px;
    background:
        radial-gradient(circle at 12px 8px, #fff 8px, transparent 9px) 0 0 / 24px 14px repeat-x,
        radial-gradient(circle at 24px 10px, #e6f0fb 6px, transparent 7px) 0 0 / 34px 14px repeat-x;
    border-radius: 8px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
}

/* ---- Panels, cards, buttons ----------------------------------------- */
.auth-container, .profile-box, .status-panel, .row {
    box-shadow: 0 15px 40px rgba(0, 0, 0, .6), 0 0 28px rgba(255, 209, 102, .08);
}
details.event-card { background: rgba(8, 22, 34, .62); border-color: rgba(255, 209, 102, .26); }
details.event-card[open] {
    background: rgba(9, 26, 40, .80);
    border-color: rgba(255, 209, 102, .5);
    box-shadow: 0 15px 30px rgba(0, 0, 0, .5), 0 0 26px rgba(255, 209, 102, .12);
}
.past-container { background: rgba(4, 12, 20, .55); border-color: rgba(255, 209, 102, .14); }

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 209, 102, .18);
}
a:hover { text-shadow: 0 0 10px rgba(255, 209, 102, .55); }

button {
    background: linear-gradient(135deg, #c8102e, #146b3f);
    box-shadow: 0 4px 14px rgba(200, 16, 46, .30);
}
button:hover {
    background: linear-gradient(135deg, #e0213f, #1e8c55);
    box-shadow: 0 6px 22px rgba(224, 33, 63, .5);
}
.game-link:hover, .navlink:hover, .btn-outline:hover, .settings-dropdown > summary:hover { background: rgba(255, 209, 102, .14); }
.profile-pic:hover { box-shadow: 0 8px 20px rgba(255, 209, 102, .35); }
.welcome-message { background: rgba(255, 209, 102, .06); }

/* admin extras that had hard-coded blue */
.plusone-btn.plus { background: rgba(255, 107, 125, .15); color: #ff6b7d; border-color: #ff6b7d; }
.plusone-count { color: #ff6b7d; }
.chat-admin { background: linear-gradient(135deg, #c8102e, #146b3f); }
.top-bar h1 { font-size: 30px; animation: none; text-shadow: 1px 1px 0 #c8102e, 0 0 12px rgba(255, 255, 255, .35); }
.top-bar h1::after { display: none; }

/* check-in page (kept readable & fast at the door) */
body.xm-checkin { background: #05101a; }
body.xm-checkin .topbar { background: rgba(8, 22, 34, .95); border-bottom-color: rgba(255, 209, 102, .45); }
body.xm-checkin .event-title { font-family: 'Mountains of Christmas', cursive; font-weight: 700; font-size: 30px; color: #fff; text-shadow: 1px 1px 0 #c8102e; }
body.xm-checkin .guest-row { background: rgba(10, 28, 42, .9); border-color: rgba(255, 209, 102, .22); }
body.xm-checkin .guest-pic { border-color: #ffd166; }
body.xm-checkin #searchBox:focus { border-color: #ffd166; }

/* ======================================================================
   ANIMATED SCENE  (built by christmas.js, sits behind everything)
   ====================================================================== */
#xm-bg {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1; overflow: hidden; pointer-events: none;
}
#xm-bg * { pointer-events: none; }

/* twinkling stars */
.xm-star { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px 1px rgba(255, 255, 255, .7); animation: xmTwinkle 3s ease-in-out infinite; }

/* aurora ribbons */
.xm-aurora { position: absolute; left: -30%; width: 160%; height: 34%; will-change: transform; }
.xm-aurora.a1 { top: 2%; background: radial-gradient(ellipse at 30% 50%, rgba(70, 255, 180, .20), transparent 55%), radial-gradient(ellipse at 70% 40%, rgba(90, 140, 255, .16), transparent 55%); animation: xmAurora 28s ease-in-out infinite alternate; }
.xm-aurora.a2 { top: 10%; background: radial-gradient(ellipse at 60% 50%, rgba(255, 90, 140, .12), transparent 55%), radial-gradient(ellipse at 20% 40%, rgba(80, 255, 200, .14), transparent 55%); animation: xmAurora 40s ease-in-out infinite alternate-reverse; }

/* shooting star */
.xm-shoot { position: absolute; top: 8%; left: 70%; width: 110px; height: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff); opacity: 0; transform: rotate(-28deg); animation: xmShoot 14s linear infinite; animation-delay: 4s; }

/* snowfall */
.xm-flake {
    position: absolute; top: -12px; border-radius: 50%;
    background: radial-gradient(circle, #fff 0 55%, rgba(255, 255, 255, 0) 72%);
    opacity: 0; will-change: transform, opacity;
    animation: xmFall linear infinite;
}

/* the snowy ground scene */
.xm-ground { position: absolute; bottom: 0; left: 50%; width: max(100vw, 1100px); height: auto; transform: translateX(-50%); display: block; }
.xm-bounce, .xm-arm-up-l, .xm-arm-up-r, .xm-wave, .xm-scarf, .xm-sm-arm, .xm-nod, .xm-nose, .xm-tstar, .xm-ho { transform-box: fill-box; }
.xm-bounce { animation: xmBounce .9s ease-in-out infinite; transform-origin: 50% 100%; }
.xm-bounce.b2 { animation-duration: 1.1s; animation-delay: -.4s; }
.xm-arm-up-l { animation: xmArmL .9s ease-in-out infinite; transform-origin: 90% 100%; }
.xm-arm-up-r { animation: xmArmR .9s ease-in-out infinite; transform-origin: 10% 100%; }
.xm-wave { animation: xmWave 1.3s ease-in-out infinite; transform-origin: 8% 92%; }
.xm-scarf { animation: xmScarf 2.4s ease-in-out infinite; transform-origin: 20% 0%; }
.xm-sm-arm { animation: xmSmArm 2s ease-in-out infinite; transform-origin: 0% 100%; }
.xm-nod { animation: xmNod 3s ease-in-out infinite; transform-origin: 20% 100%; }
.xm-nose { animation: xmNose 1.6s ease-in-out infinite; }
.xm-tstar { animation: xmTStar 2.2s ease-in-out infinite; transform-origin: 50% 50%; filter: drop-shadow(0 0 6px #ffd166); }
.xm-bulb { animation: xmBulb 1.6s ease-in-out infinite; }
.xm-ho { animation: xmHo 9s ease-in-out infinite; transform-origin: 20% 100%; }

/* Santa's sleigh crossing the sky */
.xm-sleigh { position: absolute; left: 0; top: 12vh; width: clamp(170px, 24vw, 300px); will-change: transform; animation: xmSleigh 46s linear infinite; animation-delay: 2s; }
.xm-sleigh .bob { animation: xmBob 2.4s ease-in-out infinite alternate; }
.xm-sleigh svg { display: block; width: 100%; height: auto; overflow: visible; }
.xm-sleigh .xm-trail { position: absolute; right: 100%; top: 38%; width: 160px; height: 12px; margin-right: -30px; background: linear-gradient(270deg, rgba(255, 220, 130, .55), transparent); filter: blur(3px); border-radius: 6px; }
.xm-sleigh .leg1 { animation: xmGallop .5s ease-in-out infinite alternate; transform-origin: 50% 0; transform-box: fill-box; }
.xm-sleigh .leg2 { animation: xmGallop .5s ease-in-out infinite alternate-reverse; transform-origin: 50% 0; transform-box: fill-box; }

/* string of Christmas lights across the top */
.xm-lights { position: absolute; top: 0; left: 0; width: 100%; height: 46px; }
.xm-lights svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.xm-lights i {
    position: absolute; width: 9px; height: 13px; border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    background: var(--c); box-shadow: 0 0 10px 3px var(--c);
    animation: xmBulb 1.8s ease-in-out infinite;
}

/* ---- Keyframes ------------------------------------------------------- */
@keyframes xmTitleGlow {
    0%, 100% { text-shadow: 2px 2px 0 #c8102e, 4px 4px 0 #0f5a35, 0 0 18px rgba(255, 255, 255, .35); }
    50%      { text-shadow: 2px 2px 0 #c8102e, 4px 4px 0 #0f5a35, 0 0 32px rgba(255, 255, 255, .7); }
}
@keyframes xmIcicle { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.12); } }
@keyframes xmTwinkle { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.3); } }
@keyframes xmAurora { from { transform: translateX(-6%) skewX(-8deg); opacity: .7; } to { transform: translateX(8%) skewX(8deg); opacity: 1; } }
@keyframes xmShoot {
    0%, 92% { opacity: 0; transform: translate(0, 0) rotate(-28deg); }
    93% { opacity: 1; }
    100% { opacity: 0; transform: translate(-320px, 170px) rotate(-28deg); }
}
@keyframes xmFall {
    0%   { transform: translate(0, 0); opacity: 0; }
    8%   { opacity: var(--o, .8); }
    50%  { transform: translate(var(--dx, 20px), 55vh); }
    92%  { opacity: var(--o, .8); }
    100% { transform: translate(calc(var(--dx, 20px) * -.6), 108vh); opacity: 0; }
}
@keyframes xmBounce {
    0%, 100% { transform: translateY(0) scale(1.06, .92); }
    45%      { transform: translateY(-24px) scale(.96, 1.06); }
    80%      { transform: translateY(0) scale(1.06, .92); }
}
@keyframes xmArmL { 0%, 100% { transform: rotate(18deg); } 50% { transform: rotate(-22deg); } }
@keyframes xmArmR { 0%, 100% { transform: rotate(-18deg); } 50% { transform: rotate(22deg); } }
@keyframes xmWave { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(26deg); } }
@keyframes xmScarf { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(14deg); } }
@keyframes xmSmArm { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(16deg); } }
@keyframes xmNod { 0%, 100% { transform: rotate(0); } 40% { transform: rotate(7deg); } 70% { transform: rotate(-4deg); } }
@keyframes xmNose { 0%, 100% { opacity: .75; filter: drop-shadow(0 0 3px #ff2a2a); } 50% { opacity: 1; filter: drop-shadow(0 0 10px #ff2a2a); } }
@keyframes xmTStar { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.22) rotate(10deg); } }
@keyframes xmBulb { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes xmHo { 0%, 62% { opacity: 0; transform: scale(.5); } 68%, 90% { opacity: 1; transform: scale(1); } 96%, 100% { opacity: 0; transform: scale(.8); } }
@keyframes xmSleigh {
    0%   { transform: translateX(-35vw); }
    42%  { transform: translateX(120vw); }
    100% { transform: translateX(120vw); }
}
@keyframes xmBob { from { transform: translateY(-14px) rotate(-2deg); } to { transform: translateY(14px) rotate(2deg); } }
@keyframes xmGallop { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }

/* ---- Jingle Bells button -------------------------------------------- */
#xm-music {
    position: fixed; left: 14px; bottom: 14px; z-index: 9000;
    width: 46px; height: 46px; padding: 0; margin: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; line-height: 1; cursor: pointer;
    background: linear-gradient(135deg, #c8102e, #146b3f); color: #fff;
    border: 2px solid #ffd166; box-shadow: 0 4px 16px rgba(0, 0, 0, .55);
    text-transform: none; letter-spacing: 0;
}
#xm-music.on { animation: xmRing 1.2s ease-in-out infinite; box-shadow: 0 0 18px rgba(255, 209, 102, .7); }
#xm-music:hover { transform: scale(1.08); }
@keyframes xmRing { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(6deg); } }

/* ---- Respect "reduce motion" settings -------------------------------- */
@media (prefers-reduced-motion: reduce) {
    #xm-bg *, h1, h1::after, #xm-music { animation: none !important; }
    .xm-flake { display: none; }
}

/* music button removed */
#xm-music { display: none !important; }
