/* Christmas season decorations (festive.js turns them on until early January).
   Everything here is decoration only: it never blocks taps or scrolling. */

.festive-snow { position: fixed; inset: 0; z-index: 90; pointer-events: none; }

/* Room at the top for the garland, so it never covers the app's headers */
:root.festive-app { --safe-t: calc(env(safe-area-inset-top, 0px) + 52px); }

/* Pine garland with little hanging stockings and gold stars */
.festive-garland { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 26px; z-index: 91; pointer-events: none; }
.fg-bough { position: absolute; inset: 0; width: 100%; height: 26px; filter: drop-shadow(0 2px 2px rgba(30, 40, 20, .25)); }
.fg-hang { position: absolute; top: 14px; width: 22px; margin-left: -11px; transform-origin: 50% 0; animation: fg-swing 4.5s ease-in-out infinite; animation-delay: var(--d); }
.fg-hang::before { content: ""; display: block; width: 2px; height: var(--len); margin: 0 auto; background: repeating-linear-gradient(180deg, #c62828 0 3px, #fff 3px 6px); border-radius: 1px; }
.fg-sock { display: block; width: 22px; height: 31px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2)); }
.fg-hang-star { width: 16px; margin-left: -8px; }
.fg-hang-orn { width: 24px; margin-left: -12px; }
.fg-orn { display: block; width: 24px; height: 32px; margin-top: -3px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .22)); }
.fg-star { display: block; width: 16px; height: 16px; filter: drop-shadow(0 0 4px rgba(242, 193, 78, .7)); }
@keyframes fg-swing { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.festive-garland svg { stroke-width: 1; fill: none; } /* undo the app-wide icon outline */
.fg-bough, .fg-sock, .fg-star, .fg-orn { stroke: none; }

/* String of twinkling lights along the top edge */
/* Tall enough that each bulb's glow fades out on its own instead of being clipped */
.festive-lights { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 4px); left: 0; right: 0; height: 72px; z-index: 91; pointer-events: none; display: flex; justify-content: space-around; align-items: flex-start; overflow: hidden; }
.festive-lights::before { content: ""; position: absolute; left: -2%; right: -2%; top: -6px; height: 18px; border-bottom: 1.5px solid #4a5a3a; border-radius: 0 0 50% 50% / 0 0 100% 100%; opacity: .75; }
.festive-bulb { position: relative; width: 6px; height: 6px; margin-top: 4px; border-radius: 50%; background: var(--bulb); box-shadow: 0 0 6px 2px var(--bulb), 0 0 16px 4px rgba(255, 196, 92, .45); animation: festive-twinkle 3s ease-in-out infinite; animation-delay: var(--d); }
.festive-bulb:nth-child(3n) { margin-top: 7px; }
.festive-bulb:nth-child(4n+1) { margin-top: 5px; }
/* Coloured C9-style bulbs hanging just below the garland */
.festive-bulb.is-color { width: 9px; height: 14px; margin-top: 17px; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%; box-shadow: 0 3px 10px 2px var(--bulb), 0 4px 22px 6px color-mix(in srgb, var(--bulb) 35%, transparent); animation: festive-twinkle-color 2.4s ease-in-out infinite; animation-delay: var(--d); }
.festive-bulb.is-color::before { content: ""; position: absolute; top: -4px; left: 2px; width: 5px; height: 5px; border-radius: 1px; background: #3d4a36; }
.festive-bulb.is-color::after { content: ""; position: absolute; top: 2px; left: 2px; width: 2.5px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, .6); }
@keyframes festive-twinkle-color { 0%, 100% { opacity: 1; filter: brightness(1.15); } 50% { opacity: .55; filter: brightness(.75); box-shadow: 0 2px 4px 0 var(--bulb); } }
@keyframes festive-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; box-shadow: 0 0 3px 1px var(--bulb); } }

/* Santa hat on the "L" badges */
.brand-mark, .srail-logo, .festive-site .wordmark { position: relative; overflow: visible; }
.brand-mark::after, .srail-logo::after, .festive-site .wordmark::after {
  content: ""; position: absolute; top: -13px; right: -11px; width: 30px; height: 26px; transform: rotate(16deg); pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 52'%3E%3Cpath d='M8 40C10 22 22 6 40 6c8 0 13 6 15 14-6-4-12-4-15 2-3 6 0 12 0 18z' fill='%23c62828'/%3E%3Cpath d='M30 10c6-3 13 0 15 6' stroke='%23e55353' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3Crect x='3' y='37' width='44' height='12' rx='6' fill='%23fff'/%3E%3Ccircle cx='54' cy='22' r='6' fill='%23fff'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
}

/* Snowman scene: fills the free space under the side cards on bigger screens */
.festive-scene { flex: 1 1 auto; min-height: 260px; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; padding: 14px 10px 0; border-radius: var(--radius, 18px); overflow: hidden;
  background: radial-gradient(120% 70% at 78% 22%, rgba(255, 210, 130, .45), transparent 60%), linear-gradient(180deg, #f3e7d3 0%, #eadcc4 78%, #b98a5a 78.5%, #8f6542 100%); box-shadow: inset 0 0 0 1px rgba(138, 98, 25, .12); }
.festive-scene svg { width: 100%; max-width: 300px; height: 100%; max-height: 560px; }
@media (prefers-color-scheme: dark) { .festive-scene { background: radial-gradient(120% 70% at 78% 22%, rgba(255, 190, 100, .35), transparent 60%), linear-gradient(180deg, #2a2219 0%, #231c14 78%, #4a3322 78.5%, #3a281b 100%); } }
/* Phones: the snowman and his lantern stand beside the holiday greeting */
.festive-greet-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.festive-peek { flex: none; width: 96px; margin: -18px -4px 0 0; pointer-events: none; }
.festive-peek svg { width: 100%; height: auto; display: block; overflow: hidden; }
@media (min-width: 768px) { .festive-peek { display: none; } }
/* The app gives every icon svg a thin outline; the scene draws its own. */
.festive-scene svg, .festive-peek svg { stroke: none; stroke-width: 1; fill: none; }
.fs-flake { stroke: #c9d9ee; stroke-width: 1.6; fill: none; stroke-linecap: round; }
.fs-window { fill: #ffd36b; filter: drop-shadow(0 0 3px #ffb84d); }
.fs-lights { animation: fs-shimmer 2.6s ease-in-out infinite; }
.fs-sparkle { animation: fs-travel 3.2s linear infinite; }
.fs-flame { animation: fs-flicker 1.4s ease-in-out infinite; transform-origin: 206px 140px; }
.fs-lamp-glow { animation: fs-glow 2.2s ease-in-out infinite; }
@keyframes fs-shimmer { 0%, 100% { opacity: 1; } 50% { opacity: .7; } }
@keyframes fs-travel { to { stroke-dashoffset: -54; } }
@keyframes fs-flicker { 0%, 100% { transform: scale(1, 1); opacity: 1; } 30% { transform: scale(.85, 1.08); opacity: .85; } 60% { transform: scale(1.08, .92); } }
@keyframes fs-glow { 0%, 100% { opacity: 1; } 50% { opacity: .75; } }

/* Holiday greeting on the welcome screen */
.festive-greeting { display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 10px; padding: 6px 12px; border-radius: 999px; font-size: .86rem; font-weight: 500; color: #8a1c1c; background: linear-gradient(90deg, #fdecec, #eef7ec); box-shadow: inset 0 0 0 1px rgba(198, 40, 40, .18); }
@media (prefers-color-scheme: dark) { .festive-greeting { color: #ffd6d6; background: linear-gradient(90deg, #3a1515, #16301a); } }

/* Music on/off */
/* Phones: just above the message box. Larger screens: bottom-right corner, clear of the cards. */
.festive-music { position: fixed; right: 14px; bottom: calc(var(--tabbar-h, 74px) + env(safe-area-inset-bottom, 0px) + 78px); z-index: 92; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 1.15rem; cursor: pointer; background: linear-gradient(135deg, #c62828, #8e1515); color: #fff; box-shadow: 0 4px 14px rgba(142, 21, 21, .35); }
@media (min-width: 768px) { .festive-music { bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); right: 18px; } }
.festive-music[aria-pressed="false"] { background: linear-gradient(135deg, #2e7d32, #1b5e20); box-shadow: 0 4px 14px rgba(27, 94, 32, .3); }
.festive-music[aria-pressed="true"] { animation: festive-ring 1.2s ease-in-out infinite; }
@keyframes festive-ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

@media (prefers-reduced-motion: reduce) {
  .fg-hang, .festive-bulb, .festive-music[aria-pressed="true"], .fs-lights, .fs-sparkle, .fs-flame, .fs-lamp-glow { animation: none; }
}

/* ---------- homepages: decorations hang inside the hero photo, under the header ---------- */
.festive-site .hero > .festive-lights, .festive-site .hero > .festive-garland { position: absolute; top: 0; z-index: 3; }
.festive-site .festive-lights::before { border-bottom-color: rgba(255, 240, 210, .7); }
.festive-site .wordmark::after { right: auto; left: -14px; top: -14px; transform: rotate(-20deg); }
.festive-greeting-hero { margin: 0 0 14px; position: relative; z-index: 2; color: #fff; background: rgba(140, 20, 20, .55); box-shadow: inset 0 0 0 1px rgba(255, 220, 160, .45); backdrop-filter: blur(4px); }
.festive-scene-hero { position: absolute; right: clamp(8px, 3vw, 40px); bottom: 0; z-index: 2; width: clamp(150px, 17vw, 230px); height: auto; min-height: 0; padding: 0; background: none; box-shadow: none; }
.festive-scene-hero svg { max-height: none; height: auto; }
@media (max-width: 760px) { .festive-scene-hero { display: none; } }
.festive-site .festive-music { bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); }
@media (min-width: 768px) { .festive-site .festive-music { bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); } }
