/* ============================================================
   Site theme — Christmas
   Loaded after style.css on every page while the theme is live
   (or previewed by staff). Colours go through the variables of
   style.css; the animated scenery (snowfall, aurora, stars, Santa's
   sleigh, garland of lights…) is built by js/themes/christmas.js.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@700&display=swap');

:root {
    --bg: #07101a;
    --bg-2: #0a1622;
    --panel: #0f1d2b;
    --panel-2: #142638;
    --border: #1f3549;
    --border-soft: #172a3c;
    --text: #f3f8ff;
    --muted: #a9bacb;
    --faint: #6d8196;
    --brand: #e5383b;
    --brand-2: #1f9d55;
    --brand-hi: #ff7477;
    --accent: #1f9d55;
    --gold: #ffcf5c;
    --gold-hi: #fff0b8;
    --brand-rgb: 229,56,59;
    --brand-2-rgb: 31,157,85;
    --gold-rgb: 255,207,92;
    --bg-rgb: 8,17,27;
    --frost: #d6efff;
    --frost-rgb: 214,239,255;
    --grad: linear-gradient(135deg, #ff4d50 0%, #d62828 50%, #9d0208 100%);
    --shadow: 0 12px 44px -14px rgba(0,0,0,.75), 0 0 0 1px rgba(var(--frost-rgb),.03);
    --xm-font: "Mountains of Christmas", Georgia, "Segoe UI", serif;
}

::selection { background: rgba(var(--brand-rgb),.5); color: #fff; }
html { scrollbar-color: #24405a var(--bg); }

body {
    background:
        radial-gradient(60% 40% at 50% -8%, rgba(31,157,85,.16), transparent 70%),      /* aurora glow */
        radial-gradient(40% 30% at 85% 0%, rgba(120,90,255,.10), transparent 70%),
        radial-gradient(70% 45% at 50% 110%, rgba(var(--frost-rgb),.07), transparent 70%), /* snow light */
        var(--bg);
    background-attachment: fixed;
}

a:hover { color: var(--gold); }

/* ---------- Nav: Santa hat on the logo, garland of lights under the bar ---------- */
.nav { background: rgba(8,17,27,.86);
    border-image: linear-gradient(90deg, transparent, var(--brand), var(--gold), var(--brand-2), transparent) 1; }
.nav .brand { position: relative; }
.nav .brand::before {
    content: ""; position: absolute; left: -7px; top: -13px; width: 30px; height: 26px; z-index: 1; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 26'%3E%3Cpath d='M4 19C6 9 13 2 22 3c3 0 5 4 5 9-2-3-4-4-6-3l-3 10z' fill='%23d62828'/%3E%3Cpath d='M22 3c3 0 5 4 5 9-2-3-4-4-6-3' fill='%23a4161a'/%3E%3Crect x='1' y='17' width='20' height='6' rx='3' fill='%23f6fbff'/%3E%3Ccircle cx='26.5' cy='13.5' r='3.2' fill='%23f6fbff'/%3E%3C/svg%3E") no-repeat center/contain;
    transform: rotate(-18deg); transform-origin: 30% 90%;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.45));
    animation: xm-hat 4s ease-in-out infinite;
}
.nav .brand::after { content: "🎄"; display: inline-block; margin-left: 6px; font-size: .95em; animation: xm-twinkle 2.4s ease-in-out infinite; }
.nav .brand .ks { background: linear-gradient(135deg, var(--gold-hi), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-center a::after { background: linear-gradient(90deg, var(--brand), var(--gold), var(--brand-2)) !important; }

.xm-lights { position: absolute; left: 0; right: 0; top: 100%; height: 26px; pointer-events: none; z-index: 1; overflow: hidden; }
.xm-lights svg.wire { position: absolute; inset: 0; width: 100%; height: 100%; }
.xm-bulb {
    position: absolute; top: 0; width: 8px; height: 12px; margin-left: -4px; border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
    background: var(--c); box-shadow: 0 0 6px 1px var(--c), 0 0 16px 2px var(--c);
    animation: xm-bulb var(--d, 1.6s) ease-in-out infinite; animation-delay: var(--delay, 0s);
}
.xm-bulb::before { content: ""; position: absolute; left: 1px; top: -3px; width: 6px; height: 4px; border-radius: 1px; background: #3a4a3e; }

/* ---------- Typography ---------- */
.hero h1 .grad, .admin-head h1, .page-head h1 { font-family: var(--xm-font); font-weight: 700; letter-spacing: .01em; }
.hero h1 .grad {
    background: linear-gradient(100deg, #fff0b8 0%, #ffcf5c 30%, #fff 45%, #ffcf5c 60%, #e5a823 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 16px rgba(var(--gold-rgb),.35));
    animation: xm-shimmer 6s linear infinite;
}
.admin-head h1, .page-head h1 { color: var(--gold-hi); text-shadow: 0 0 20px rgba(var(--gold-rgb),.3); }
.kicker { color: var(--frost); background: rgba(var(--frost-rgb),.07); border-color: rgba(var(--frost-rgb),.28); }

/* ---------- Hero: star of Bethlehem + tree glow ---------- */
.hero::before {
    background:
        radial-gradient(30% 50% at 50% 0%, rgba(var(--gold-rgb),.20), transparent 65%),
        radial-gradient(60% 80% at 50% 0%, rgba(var(--brand-2-rgb),.16), transparent 60%);
    animation: xm-breathe 6s ease-in-out infinite;
}
.hero::after {
    content: "★"; position: absolute; z-index: -1; left: 50%; top: 4px; transform: translateX(-50%);
    font-size: 64px; line-height: 1; color: var(--gold-hi);
    text-shadow: 0 0 18px rgba(var(--gold-rgb),.9), 0 0 50px rgba(var(--gold-rgb),.6), 0 0 110px rgba(var(--gold-rgb),.35);
    opacity: .5; animation: xm-star 3.5s ease-in-out infinite; pointer-events: none;
}

/* ---------- Buttons: candy cane on hover ---------- */
.btn { background: var(--grad); box-shadow: 0 8px 26px -8px rgba(var(--brand-rgb),.75), inset 0 1px 0 rgba(255,255,255,.22); position: relative; overflow: hidden; }
.btn:hover {
    background: repeating-linear-gradient(-45deg, #d62828 0 10px, #f2f2f2 10px 20px);
    background-size: 28.28px 28.28px; color: #7a0010; text-shadow: 0 1px 0 rgba(255,255,255,.7);
    animation: xm-cane .8s linear infinite;
    box-shadow: 0 12px 34px -6px rgba(var(--brand-rgb),.9), 0 0 0 1px rgba(255,255,255,.4);
}
.btn.ghost, .btn.ghost:hover { background: transparent; animation: none; color: var(--text); text-shadow: none; }
.btn.ghost:hover { border-color: var(--gold); background: rgba(var(--gold-rgb),.07); }
.btn.discord, .btn.discord:hover { background: #5865f2; animation: none; color: #fff; text-shadow: none; }

/* ---------- Surfaces: frosted top edge, warm glow ---------- */
.card, .panel, .feature, .th-card { border-top-color: rgba(var(--frost-rgb),.32); transition: border-color .25s, box-shadow .25s, transform .25s; }
.card:hover, .panel:hover, .feature:hover {
    border-color: rgba(var(--gold-rgb),.45); border-top-color: rgba(var(--frost-rgb),.7);
    box-shadow: 0 -6px 18px -12px rgba(var(--frost-rgb),.8), 0 14px 40px -18px rgba(var(--gold-rgb),.45);
}
.feature .ico { filter: drop-shadow(0 0 10px rgba(var(--gold-rgb),.45)); }
.card.highlight { box-shadow: 0 0 40px -16px rgba(var(--gold-rgb),.55); }

/* ---------- Admin / member sidebars ---------- */
.admin-side, .member-side { background: linear-gradient(180deg, rgba(var(--brand-2-rgb),.08), transparent 45%), var(--bg-2); }
.admin-nav a.on, .member-nav a.on {
    color: #fff;
    background: linear-gradient(90deg, rgba(var(--brand-rgb),.24), rgba(var(--brand-2-rgb),.08));
    border-color: rgba(var(--brand-rgb),.45);
    box-shadow: inset 3px 0 0 var(--gold), 0 0 18px -8px rgba(var(--brand-rgb),.7);
}

/* ---------- Footer: snowy village with lit windows ---------- */
.site-footer { position: relative; margin-top: auto; padding-top: 58px; background: linear-gradient(180deg, transparent, rgba(var(--frost-rgb),.04)); }
.site-footer::before {
    content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 60px; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='60' viewBox='0 0 520 60'%3E%3Cg fill='%230b1826'%3E%3Cpath d='M30 50 44 22 58 50z'/%3E%3Cpath d='M34 38 44 14 54 38z'/%3E%3Cpath d='M118 50V32l16-12 16 12v18z'/%3E%3Cpath d='M210 50 222 28 234 50z'/%3E%3Cpath d='M300 50V28l22-16 22 16v22z'/%3E%3Crect x='330' y='8' width='6' height='12'/%3E%3Cpath d='M420 50 436 18 452 50z'/%3E%3Cpath d='M425 36 436 10 447 36z'/%3E%3Cpath d='M470 50 480 32 490 50z'/%3E%3C/g%3E%3Cg fill='%23ffcf5c'%3E%3Crect x='126' y='36' width='6' height='6' rx='1'/%3E%3Crect x='138' y='36' width='6' height='6' rx='1'/%3E%3Crect x='310' y='32' width='7' height='7' rx='1'/%3E%3Crect x='327' y='32' width='7' height='7' rx='1'/%3E%3C/g%3E%3Cg fill='%23eef6ff'%3E%3Cpath d='M0 60V48c40-6 90-6 140-2s100 6 160 0 120-8 220-2v16z'/%3E%3Cpath d='M116 33l18-14 18 14-4 1-14-10-14 10z'/%3E%3Cpath d='M298 29l24-18 24 18-5 1-19-14-19 14z'/%3E%3Cpath d='M38 40 44 26 50 40c-2-2-4-2-6 0-2-2-4-2-6 0z'/%3E%3Cpath d='M428 30 436 13 444 30c-3-2-5-2-8 0-3-2-5-2-8 0z'/%3E%3C/g%3E%3C/svg%3E") repeat-x bottom;
    background-size: 520px 60px;
}
.site-footer .brand-logo { filter: drop-shadow(0 0 6px rgba(var(--gold-rgb),.6)); }

input:focus, select:focus, textarea:focus { outline-color: var(--gold); border-color: var(--gold) !important; }

/* ---------- Scenery layers (js/themes/christmas.js) ---------- */
.xm-back, .xm-front { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.xm-back { z-index: -1; }
.xm-front { z-index: 45; }
.xm-snow { position: absolute; inset: 0; width: 100%; height: 100%; }

.xm-stars { position: absolute; left: 0; top: 0; width: 2px; height: 2px; border-radius: 50%; background: transparent; animation: xm-stars 5s ease-in-out infinite alternate; }
.xm-stars.s2 { animation-duration: 7s; animation-delay: -3s; }

.xm-aurora {
    position: absolute; left: -20%; top: -12vh; width: 140%; height: 46vh; opacity: .35; filter: blur(34px);
    background:
        linear-gradient(100deg, transparent 10%, rgba(46,230,140,.55) 28%, transparent 40%, rgba(90,200,255,.40) 55%, transparent 66%, rgba(150,100,255,.40) 80%, transparent 92%);
    transform-origin: 50% 0; animation: xm-aurora 22s ease-in-out infinite alternate;
    mask-image: linear-gradient(180deg, #000 20%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, #000 20%, transparent 100%);
}

.xm-moon {
    position: absolute; top: 74px; right: 8vw; width: 86px; height: 86px; border-radius: 50%;
    background: radial-gradient(circle at 38% 38%, #ffffff, #e6f1ff 60%, #b9cde6 100%);
    box-shadow: 0 0 50px 14px rgba(214,239,255,.18), 0 0 140px 50px rgba(214,239,255,.07);
    opacity: .5;
}

.xm-sleigh { position: absolute; left: 0; top: 0; width: 210px; height: 56px; color: #050b12;
    filter: drop-shadow(0 0 6px rgba(var(--frost-rgb),.35)); }
.xm-sleigh svg { width: 100%; height: 100%; }
.xm-sleigh .nose { fill: #ff3b3b; filter: drop-shadow(0 0 4px #ff3b3b); animation: xm-bulb 1s ease-in-out infinite; }

.xm-shoot { position: absolute; width: 140px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0), #fff); filter: drop-shadow(0 0 6px #fff);
    animation: xm-shoot 1.3s ease-out forwards; }

.xm-burst { position: absolute; font-size: 14px; color: #fff; text-shadow: 0 0 6px rgba(var(--frost-rgb),.9);
    animation: xm-burst .9s ease-out forwards; }

/* ---------- Keyframes ---------- */
@keyframes xm-hat { 0%, 100% { transform: rotate(-18deg); } 50% { transform: rotate(-10deg); } }
@keyframes xm-twinkle { 0%, 100% { filter: drop-shadow(0 0 0 transparent); transform: scale(1); } 50% { filter: drop-shadow(0 0 6px #ffcf5c); transform: scale(1.08); } }
@keyframes xm-bulb { 0%, 100% { opacity: 1; } 50% { opacity: .25; box-shadow: none; } }
@keyframes xm-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes xm-breathe { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
@keyframes xm-star { 0%, 100% { opacity: .45; transform: translateX(-50%) scale(1) rotate(0deg); } 50% { opacity: .7; transform: translateX(-50%) scale(1.12) rotate(8deg); } }
@keyframes xm-cane { from { background-position: 0 0; } to { background-position: 28.28px 0; } }
@keyframes xm-stars { from { opacity: .35; } to { opacity: 1; } }
@keyframes xm-aurora { 0% { transform: skewX(-8deg) translateX(-4%) scaleY(1); } 50% { transform: skewX(6deg) translateX(3%) scaleY(1.15); } 100% { transform: skewX(-3deg) translateX(6%) scaleY(.9); } }
@keyframes xm-shoot { 0% { opacity: 0; transform: translate(0, 0) rotate(var(--a, 20deg)); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 380px), var(--dy, 140px)) rotate(var(--a, 20deg)); } }
@keyframes xm-burst { from { opacity: 1; transform: translate(0, 0) scale(1) rotate(0); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.4) rotate(160deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    .xm-moon { width: 56px; height: 56px; top: 64px; right: 18px; }
    .xm-aurora { height: 34vh; }
    .hero::after { font-size: 46px; }
    .xm-lights { height: 20px; }
}

/* ---------- Motion off: keep the colours, drop the movement ---------- */
@media (prefers-reduced-motion: reduce) {
    .xm-front, .xm-lights, .xm-aurora { display: none; }
    .nav .brand::before, .nav .brand::after, .hero h1 .grad, .hero::before, .hero::after, .btn, .btn:hover, .xm-stars { animation: none; }
}
