/* Christmas (premium, Season Pass): a snowy starry night with a big moon, Santa's sleigh flying past, little houses
   and a twinkling tree; snow piled on buttons, presents for Head to Head tiles, a Santa hat on the title.
   Colours are in theme-flat.css. */

/* ---- the scene (built by buildScene() in app.js) ---- */
[data-theme="christmas"] #stage-bg { background: linear-gradient(#040a1c 0%, #0b1838 45%, #183063 80%, #2a4a86 100%); }
[data-theme="christmas"] .scene .moon { width: 4rem; height: 4rem; top: max(1.4rem, calc(env(safe-area-inset-top) + .8rem)); right: 1.4rem;
  box-shadow: 0 0 50px 14px rgba(220, 235, 255, .25); }

/* fairy lights strung across the top */
.scene .lights { position: absolute; left: 0; right: 0; top: 0; height: 2.6rem; }
.scene .lights svg { width: 100%; height: 100%; }
.scene .lights .bulb { animation: bulb 1.6s ease-in-out infinite; }
.scene .lights .bulb:nth-of-type(2n) { animation-delay: -.8s; }
.scene .lights .bulb:nth-of-type(3n) { animation-delay: -.4s; }
@keyframes bulb { 50% { opacity: .35; } }

/* falling snow */
.scene .flake { position: absolute; top: -2vh; border-radius: 50%; background: #fff; opacity: .85;
  animation: snowfall var(--d) linear infinite; animation-delay: var(--t); }
@keyframes snowfall {
  0% { transform: translate(0, -2vh); }
  50% { transform: translate(var(--sway), 52vh); }
  100% { transform: translate(0, 106vh); } }

/* Santa's sleigh crossing the sky every so often */
.scene .sleigh { position: absolute; top: 9%; left: 0; width: 9rem; animation: sleigh 28s linear infinite; animation-delay: -6s; }
.scene .sleigh svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 0 6px rgba(255, 220, 150, .35)); }
@keyframes sleigh {
  0% { transform: translate(-12rem, 3rem) rotate(-6deg); opacity: 0; }
  2% { opacity: 1; }
  30% { transform: translate(calc(100vw + 2rem), -1.5rem) rotate(-3deg); opacity: 1; }
  31%, 100% { transform: translate(calc(100vw + 2rem), -1.5rem); opacity: 0; } }

/* snowy hills, houses with glowing windows, a tree with twinkling lights */
.scene .village { position: absolute; left: 0; right: 0; bottom: calc(var(--tabh) + env(safe-area-inset-bottom)); height: 22vh; }
.scene .village::after { content: ''; position: absolute; left: 0; right: 0; top: calc(100% - 1px); height: 8rem; background: #f4f9ff; }
.scene .village svg { position: absolute; inset: auto 0 0 0; width: 100%; height: 100%; }
.scene .village .twinkle { animation: bulb 1.3s ease-in-out infinite; }
.scene .village .twinkle:nth-of-type(2n) { animation-delay: -.65s; }

/* ---- the app: snow, presents and a Santa hat ---- */
[data-theme="christmas"] .logo .l1 { position: relative; }
[data-theme="christmas"] .logo:not(.small) .l1::before { content: ''; position: absolute; left: -.42em; top: -.5em; width: .95em; height: .8em;
  transform: rotate(-22deg); pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 84'%3E%3Cpath d='M14 66C22 30 44 6 72 8c10 1 18 8 20 18-10-6-20-4-24 6-4 10 2 22 6 34z' fill='%23e63946' stroke='%231b1033' stroke-width='4' stroke-linejoin='round'/%3E%3Crect x='6' y='60' width='76' height='18' rx='9' fill='%23fff' stroke='%231b1033' stroke-width='4'/%3E%3Ccircle cx='90' cy='30' r='9' fill='%23fff' stroke='%231b1033' stroke-width='4'/%3E%3C/svg%3E") center / contain no-repeat; }
[data-theme="christmas"] .logo .l2 { color: #ff4d5e; filter: drop-shadow(0 0 10px rgba(255, 77, 94, .45)); }

/* snow piled on top of every main button */
[data-theme="christmas"] .btn:not(.ghost):not(.small) { position: relative; overflow: visible; }
/* snow piled on top of every main button (user, 2 Nov: the old flat jagged strip looked wrong): a lumpy drift lit on
   top and icy blue underneath, with drips hanging over the front, and its shadow (::after, the same shape a little
   lower). The shape repeats along the button so it never stretches. */
[data-theme="christmas"] .btn:not(.ghost):not(.small)::before, [data-theme="christmas"] .btn:not(.ghost):not(.small)::after {
  content: ''; position: absolute; pointer-events: none; left: -2px; right: -2px; top: -9px; height: 22px; border-radius: inherit;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 22'%3E%3Cpath d='M0 15V9Q8 3 16 7Q24 1 34 6Q44 2 52 7Q62 3 72 6Q82 2 90 9V15H62Q62 20 59 20Q56 20 56 15H30Q30 22 26 22Q22 22 22 15Z'/%3E%3C/svg%3E") 0 0 / 90px 22px repeat-x; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 22'%3E%3Cpath d='M0 15V9Q8 3 16 7Q24 1 34 6Q44 2 52 7Q62 3 72 6Q82 2 90 9V15H62Q62 20 59 20Q56 20 56 15H30Q30 22 26 22Q22 22 22 15Z'/%3E%3C/svg%3E") 0 0 / 90px 22px repeat-x; }
[data-theme="christmas"] .btn:not(.ghost):not(.small)::before { z-index: 3; background: linear-gradient(180deg, #ffffff 25%, #eef5fd 55%, #c9dbf1 100%); }
[data-theme="christmas"] .btn:not(.ghost):not(.small)::after { z-index: 2; top: -6px; background: rgba(6, 18, 52, .38); }
[data-theme="christmas"] .btn:not(.ghost) { color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--hot) 60%, black), 0 0 16px color-mix(in srgb, var(--hot) 35%, transparent); }

/* frosty cards */
[data-theme="christmas"] .panel { backdrop-filter: blur(6px); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 0 18px rgba(170, 210, 255, .08); }
[data-theme="christmas"] :is(.title, .tag, .home .dim) { text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }

/* Head to Head tiles are wrapped presents: ribbon across, bow on top */
[data-theme="christmas"] .topic { position: relative; overflow: visible; border: 0;
  background:
    linear-gradient(90deg, transparent 80%, rgba(255, 224, 140, .95) 80%, rgba(255, 224, 140, .95) 87%, transparent 87%),
    linear-gradient(180deg, rgba(0, 0, 0, .14) 0 16%, rgba(255, 255, 255, .18) 16% calc(16% + 2px), transparent calc(16% + 2px)),
    var(--sc);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--sc) 60%, black), 0 6px 16px rgba(0, 0, 0, .3); }
[data-theme="christmas"] .topic::after { content: ''; position: absolute; left: calc(83.5% - 1.6rem); top: -.55rem; width: 3.2rem; height: 2.3rem; pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3));
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E%3Cpath d='M30 20C18 2 4 6 8 18c3 8 14 6 22 2zM30 20C42 2 56 6 52 18c-3 8-14 6-22 2z' fill='%23ffd76a' stroke='%231b1033' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M28 22l-10 16M32 22l10 16' stroke='%23ffd76a' stroke-width='5' stroke-linecap='round'/%3E%3Ccircle cx='30' cy='20' r='5' fill='%23f2b83a' stroke='%231b1033' stroke-width='3'/%3E%3C/svg%3E") center / contain no-repeat; }
[data-theme="christmas"] .topic span, [data-theme="christmas"] .topic small { text-shadow: 0 1px 3px rgba(0, 0, 0, .45); max-width: 76%; }

/* a snowy ledge along the bottom bar */
[data-theme="christmas"] #tabbar { overflow: visible; }
[data-theme="christmas"] #tabbar::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 14px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 14' preserveAspectRatio='none'%3E%3Cpath d='M0 10Q20 2 50 6t60-2 60 3 60-3 60 3 60-2 50 4V14H0z' fill='%23fff'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; }

@media (prefers-reduced-motion: reduce) {
  [data-theme="christmas"] .scene *, [data-theme="christmas"] .scene *::before { animation: none !important; }
  .scene .flake, .scene .sleigh { display: none; }
}

[data-theme="christmas"] .topicgrid { row-gap: 1rem; padding-top: .4rem; }
