/* =====================================================================
   CHRISTMAS OVERLAY — loaded after styles.css.
   The cowboy theme is untouched underneath: to revert, remove the
   <link href="/christmas.css"> line and the #snow div from index.html
   (and the HOLIDAY block at the top of app.js).
   ===================================================================== */

:root {
  /* Pine-night base instead of saloon brown */
  --bg-0:         #06100b;
  --bg-1:         #0a1610;
  --panel:        #0f1f16;
  --panel-2:      #14291c;
  --border:       #1f3d2b;
  --border-bright:#2f5a40;
  --text:         #f5f0e4;   /* fresh snow */
  --muted:        #9db3a3;   /* frosted sage */

  /* Gold stays — it's tinsel now */
  --gold-1:       #ffe08a;
  --gold-2:       #e3b341;
  --gold-3:       #9a7419;

  --rust:         #d0283a;   /* holly berry */
  --rust-deep:    #7d1220;
  --sky:          #2f7a4d;
  --cactus:       #3fae6a;

  --flag-red:      #d0283a;
  --flag-red-deep: #7d1220;
  --flag-cream:    #f5f0e4;
  --flag-blue:     #1e5a3a;
  --flag-blue-deep:#0d2a1b;

  --oxblood:       #8e1b24;
  --tobacco:       #f5f0e4;  /* headings → snow white */
  --tobacco-deep:  #b9c6bb;
  --gunmetal:      #1e4a32;  /* card borders → evergreen */
  --gunmetal-deep: #0d2a1b;
  --brass:         #e3b341;
  --brass-deep:    #8a6416;
  --rope:          #f5f0e4;  /* rope → candy cane (white … */
  --rope-deep:     #d0283a;  /*                  … and red) */
  --lantern:       rgba(255, 214, 120, 0.10);  /* fireplace glow */
}

body {
  background:
    radial-gradient(1400px 700px at 50% -300px, rgba(208, 40, 58, 0.24), transparent 65%),
    radial-gradient(1000px 600px at 88% 15%, rgba(227, 179, 65, 0.10), transparent 60%),
    radial-gradient(900px 600px at 10% 80%, rgba(47, 122, 77, 0.18), transparent 60%),
    var(--bg-0);
}

/* ---------- String of lights across the top (replaces bunting) ---------- */
.bunting-bar {
  height: 26px; opacity: 1; filter: none; box-shadow: none;
  background:
    /* the wire: a gentle sag between every bulb */
    radial-gradient(ellipse 30px 10px at 24px -2px, transparent 8px, #1a2a1f 8.5px 10px, transparent 10.5px) 0 0 / 48px 26px repeat-x;
}
.bunting-bar::after {
  /* bulbs — four colours on a 192px cycle, each with a soft halo */
  inset: 0; opacity: 1; mix-blend-mode: normal;
  background-image:
    radial-gradient(ellipse 4px 6px at 24px 14px,  #ff4d5e 0 100%, transparent 101%),
    radial-gradient(ellipse 4px 6px at 72px 14px,  #ffd34d 0 100%, transparent 101%),
    radial-gradient(ellipse 4px 6px at 120px 14px, #4dd681 0 100%, transparent 101%),
    radial-gradient(ellipse 4px 6px at 168px 14px, #5fb6ff 0 100%, transparent 101%),
    radial-gradient(circle 14px at 24px 14px,  rgba(255, 77, 94, 0.45), transparent),
    radial-gradient(circle 14px at 72px 14px,  rgba(255, 211, 77, 0.45), transparent),
    radial-gradient(circle 14px at 120px 14px, rgba(77, 214, 129, 0.45), transparent),
    radial-gradient(circle 14px at 168px 14px, rgba(95, 182, 255, 0.45), transparent);
  background-size: 192px 26px;
  animation: twinkle 2.4s ease-in-out infinite alternate;
}
/* second copy offset by half a cycle so alternate bulbs twinkle out of phase */
.hero::before {
  content: ""; position: absolute; top: 0; left: 96px; right: 0; height: 26px;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 4px 6px at 24px 14px,  #5fb6ff 0 100%, transparent 101%),
    radial-gradient(ellipse 4px 6px at 72px 14px,  #ff4d5e 0 100%, transparent 101%),
    radial-gradient(circle 14px at 24px 14px,  rgba(95, 182, 255, 0.45), transparent),
    radial-gradient(circle 14px at 72px 14px,  rgba(255, 77, 94, 0.45), transparent);
  background-size: 192px 26px;
  animation: twinkle 2.4s ease-in-out infinite alternate-reverse;
}
@keyframes twinkle {
  0%   { opacity: 1;    filter: brightness(1.15); }
  100% { opacity: 0.55; filter: brightness(0.8); }
}

/* ---------- Title: snow-capped letters ---------- */
.title-line-1 { color: var(--text); }
.title-line-2 {
  background: linear-gradient(180deg, #ff8a94, #e8394b 50%, #b81d30 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none;   /* the cowboy letterpress shadow bleeds through the clip and muddies the red */
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 0 16px rgba(232, 57, 75, 0.35));
}
.kicker { color: var(--gold-2); }
.vs-divider { color: var(--gold-2); }

/* ---------- Section badges: sheriff star → red bauble ---------- */
.section-head h2::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs><radialGradient id='b' cx='0.35' cy='0.35' r='0.75'><stop offset='0' stop-color='%23ff7a85'/><stop offset='0.55' stop-color='%23d0283a'/><stop offset='1' stop-color='%236a0f1a'/></radialGradient></defs><rect x='12.5' y='2' width='7' height='5' rx='1' fill='%23e3b341' stroke='%238a6416' stroke-width='0.8'/><circle cx='16' cy='19' r='12' fill='url(%23b)'/><path d='M6 17 Q16 21 26 17' stroke='%23e3b341' stroke-width='1.4' fill='none'/><path d='M6.5 22 Q16 26 25.5 22' stroke='%23f5f0e4' stroke-width='1' fill='none' opacity='0.7'/><ellipse cx='11.5' cy='13.5' rx='2.4' ry='1.4' fill='white' opacity='0.55' transform='rotate(-35 11.5 13.5)'/></svg>");
}

/* ---------- Leaderboard cards: evergreen planks, gold rivets → snow ---------- */
.lb-card {
  background:
    radial-gradient(60% 80% at 50% 20%, var(--lantern) 0%, transparent 65%),
    linear-gradient(180deg, var(--panel) 0%, var(--bg-1) 100%);
  border-top: 3px solid rgba(245, 240, 228, 0.85);   /* snow on the roofline */
}
.lb-card.champion {
  background:
    linear-gradient(135deg, rgba(227, 179, 65, 0.10), transparent 50%),
    linear-gradient(180deg, var(--panel) 0%, var(--bg-1) 100%);
}

/* ---------- Falling snow ---------- */
#snow {
  position: fixed; inset: -10vh 0 0 0; pointer-events: none; z-index: 2;
}
#snow::before, #snow::after {
  content: ""; position: absolute; inset: 0;
  background-repeat: repeat;
  will-change: transform;
}
#snow::before {
  background-image:
    radial-gradient(2px 2px at 20px 30px,  rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 140px 90px, rgba(255,255,255,0.7), transparent),
    radial-gradient(3px 3px at 260px 160px,rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 80px 220px, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 200px 280px,rgba(255,255,255,0.75),transparent);
  background-size: 300px 300px;
  animation: snowfall 22s linear infinite;
}
#snow::after {
  background-image:
    radial-gradient(1.5px 1.5px at 50px 60px,  rgba(255,255,255,0.55), transparent),
    radial-gradient(1.5px 1.5px at 170px 140px,rgba(255,255,255,0.45), transparent),
    radial-gradient(1px 1px at 110px 190px,    rgba(255,255,255,0.5),  transparent),
    radial-gradient(1.5px 1.5px at 30px 170px, rgba(255,255,255,0.4),  transparent);
  background-size: 200px 200px;
  animation: snowfall-slow 34s linear infinite;
}
@keyframes snowfall      { from { transform: translate(0, -300px); } to { transform: translate(40px, 0); } }
@keyframes snowfall-slow { from { transform: translate(0, -200px); } to { transform: translate(-30px, 0); } }

/* Snowdrift along the bottom of the page */
body::after {
  content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 28px;
  pointer-events: none; z-index: 2;
  background:
    radial-gradient(60px 22px at 30px 28px,  #e9eef0 98%, transparent) 0 0 / 120px 28px repeat-x,
    radial-gradient(80px 18px at 90px 30px,  #f5f8f9 98%, transparent) 0 0 / 160px 28px repeat-x;
  opacity: 0.18;
}

@media (prefers-reduced-motion: reduce) {
  #snow::before, #snow::after, .bunting-bar::after, .hero::before { animation: none; }
}

/* ---------- A dash of the reason for the season ---------- */
/* Star of Bethlehem over the title — long vertical ray, soft pulse */
.bethlehem {
  width: 64px; height: 64px; margin: 0 auto 6px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><defs><radialGradient id='g'><stop offset='0' stop-color='%23fff8dc'/><stop offset='0.5' stop-color='%23ffe08a'/><stop offset='1' stop-color='%23e3b341' stop-opacity='0'/></radialGradient></defs><circle cx='32' cy='28' r='18' fill='url(%23g)' opacity='0.55'/><path d='M32 0 L35 25 L56 28 L35 31 L32 64 L29 31 L8 28 L29 25 Z' fill='%23ffe9a8'/><path d='M32 12 L33.6 26.4 L44 28 L33.6 29.6 L32 44 L30.4 29.6 L20 28 L30.4 26.4 Z' fill='white'/></svg>") center / contain no-repeat;
  filter: drop-shadow(0 0 10px rgba(255, 224, 138, 0.7));
  animation: star-pulse 4s ease-in-out infinite;
}
@keyframes star-pulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 8px rgba(255, 224, 138, 0.55)); }
  50%      { transform: scale(1.06); filter: drop-shadow(0 0 16px rgba(255, 224, 138, 0.9)); }
}
.verse {
  margin: 10px auto 0; max-width: 640px;
  font-family: Georgia, "Times New Roman", serif; font-style: italic;
  color: var(--gold-1); opacity: 0.85; font-size: 0.98rem;
}
.verse cite {
  display: inline-block; margin-left: 6px; font-style: normal;
  font-family: "Inter", sans-serif; font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.verse-inline {
  display: block; margin-top: 2px;
  font-family: Georgia, serif; font-style: italic; color: var(--gold-2); opacity: 0.8;
}
.nativity { display: block; width: min(320px, 80vw); height: auto; margin: 0 auto 8px; }
.nativity .nat-sil { fill: #2a3b30; }
.nativity .nat-star path:first-child { fill: #ffe08a; filter: drop-shadow(0 0 6px rgba(255, 224, 138, 0.9)); }
.nativity .nat-beam { stroke: rgba(255, 224, 138, 0.35); stroke-width: 2; fill: none; }
.footer-verse { margin-bottom: 10px; }
footer { text-align: center; }
@media (prefers-reduced-motion: reduce) { .bethlehem { animation: none; } }

/* ---------- Nativity landscape across the bottom of the page ----------
   Layers, back to front: far hills (stretched), Bethlehem (right), mid hills
   (stretched), then the stable scene on its own near hill (left).
   --nbw is the scene width; it's sized so the stable (≈40% of the scene)
   fits the gutter beside the 1100px content column, and everything else
   scales off it so the layers stay in proportion. */
#nativity-bg {
  --nbw: clamp(340px, calc((100vw - 1100px) * 1.15), 640px);
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--nbw) * 320 / 610);
  z-index: 0; pointer-events: none; overflow: hidden;
}
#nativity-bg svg { position: absolute; bottom: 0; display: block; }
#nativity-bg .nb-layer { left: 0; width: 100%; height: 100%; }
#nativity-bg .nb-town  { right: 2vw; width: calc(var(--nbw) * 260 / 610); height: auto; }
#nativity-bg .nb-scene { left: 0; width: var(--nbw); height: auto; }
#nativity-bg .nb-star { opacity: 0.85; filter: drop-shadow(0 0 3px rgba(240, 220, 160, 0.5)); animation: nb-star-pulse 5s ease-in-out infinite; transform-origin: 150px 22px; transform-box: view-box; }
@keyframes nb-star-pulse {   /* gentler than the hero star's pulse */
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 2px rgba(240, 220, 160, 0.4)); }
  50%      { transform: scale(1.03); filter: drop-shadow(0 0 5px rgba(240, 220, 160, 0.6)); }
}
#nativity-bg .nb-interior { animation: lamplight 5s ease-in-out infinite alternate; }
@keyframes lamplight { from { opacity: 0.8; } to { opacity: 0.88; } }
body::after { display: none; }       /* hills replace the old drift */
@media (max-width: 1300px) { #nativity-bg .nb-town { display: none; } }
/* recessed at every width — it reads as part of the night rather than a picture on top of it */
#nativity-bg .nb-scene { opacity: 0.32; }
@media (prefers-reduced-motion: reduce) { #nativity-bg .nb-star, #nativity-bg .nb-interior { animation: none; } }

/* ---------- Title typeface: Mountains of Christmas instead of Rye ---------- */
.title {
  font-family: "Mountains of Christmas", "Rye", serif; font-weight: 700;
  letter-spacing: 0.01em; line-height: 0.92;
  font-size: clamp(3rem, 9vw, 6.6rem);
}
.title-line-1 { text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6), 0 0 22px rgba(255, 255, 255, 0.12); }

/* ---------- Santa's sleigh: faint silhouette drifting across the sky ----------
   Behind content (z 0), under the snow. One slow pass every ~80s with a gentle
   rise and dip; parked mid-sky when reduced motion is requested. */
#sleigh-bg {
  position: fixed; top: 9vh; left: 0;
  width: clamp(240px, 24vw, 430px);
  z-index: 0; pointer-events: none;
  opacity: 0.13;
  animation: sleigh-fly 80s linear infinite;
  will-change: transform;
}
#sleigh-bg svg { display: block; width: 100%; height: auto; overflow: visible; }
@keyframes sleigh-fly {
  0%   { transform: translate(-35vw, 6vh)  rotate(-4deg); }
  25%  { transform: translate(15vw, 0vh)   rotate(-2deg); }
  50%  { transform: translate(55vw, -2vh)  rotate(0deg); }
  75%  { transform: translate(90vw, 1vh)   rotate(2deg); }
  100% { transform: translate(130vw, -3vh) rotate(-1deg); }
}
@media (prefers-reduced-motion: reduce) {
  #sleigh-bg { animation: none; transform: translate(60vw, 0); }
}
