/* Christmas layer for the arcade homepage, December 2026. Loaded only by the homepage.
   To revert in January: remove the xmas link, the xmas script and the "xmas" body class from drafts/hub/home.template.html, rebuild, deploy. */

/* palette: poppy red and tree green on top of the arcade tokens; gold (--yellow) and the purple in the artwork stay */
body.xmas { --xmas-red: #f23c3c; --xmas-red-dark: #b3141f; --xmas-green: #22b14c; --xmas-green-dark: #0e6b30; --xmas-green-light: #8be3a8; }

/* hero: red sky, green bricks, green start button */
body.xmas .arcade-hero { background: var(--xmas-red); }
body.xmas .arcade-hero h1 { text-shadow: 0 5px 0 var(--xmas-green-dark), 3px 5px 0 var(--xmas-green-dark); }
body.xmas .arcade-hero h1 .mark { background: var(--xmas-green); }
body.xmas .arcade-hero::after { background: repeating-linear-gradient(90deg, transparent 0 28px, var(--ink) 28px 32px), linear-gradient(var(--xmas-green) 0 7px, var(--xmas-green-dark) 7px 11px, var(--xmas-green) 11px 100%); }
body.xmas .arcade-start { background: var(--xmas-green); box-shadow: 6px 6px 0 var(--ink), inset 0 4px 0 var(--xmas-green-light), inset 0 -5px 0 var(--xmas-green-dark); }
body.xmas .arcade-start:hover,
body.xmas .arcade-start:focus-visible { box-shadow: 4px 4px 0 var(--ink), inset 0 4px 0 var(--xmas-green-light), inset 0 -5px 0 var(--xmas-green-dark); }
body.xmas .arcade-start:active { box-shadow: 0 0 0 var(--ink), inset 0 3px 0 var(--xmas-green-dark); }
body.xmas .arcade-start:focus-visible { outline-color: var(--white); }
body.xmas .arcade-email:focus-visible { outline-color: var(--xmas-green-dark); }
body.xmas .site-head .head-cta .btn-pink { background: var(--xmas-red); }

/* missions: candy-cane rules and red cursors */
body.xmas .arcade-mission-heading h2::before,
body.xmas .arcade-mission-heading h2::after { height: 10px; border: 2px solid var(--ink); background: repeating-linear-gradient(135deg, var(--xmas-red) 0 7px, #ffffff 7px 14px); }
body.xmas .arcade-mission:hover::before,
body.xmas .arcade-mission:focus-visible::before { border-color: var(--xmas-red); }
body.xmas .arcade-mission-cursor { color: var(--xmas-red); }
body.xmas .arcade-mission:focus-visible { outline-color: var(--xmas-green-dark); }

/* lower sections: swap the purple and pink shadows for red and green */
body.xmas .cabinet { box-shadow: 8px 8px 0 var(--xmas-green); }
body.xmas .cabinet .screen { border-color: var(--xmas-green); }
body.xmas .matches { box-shadow: 8px 8px 0 var(--xmas-red); }
body.xmas .matches .m a:hover { color: var(--xmas-red-dark); }
body.xmas .powerups { background: var(--xmas-green-light); }
body.xmas .signup { box-shadow: 8px 8px 0 var(--xmas-red); }
body.xmas .vendor-strip { box-shadow: 8px 8px 0 var(--xmas-green); }
body.xmas .vendor-strip .px { color: var(--xmas-red-dark) !important; }

/* footer gets its own string of lights */
body.xmas .site-foot { position: relative; }
body.xmas .site-foot::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(var(--paper), var(--paper)),
    radial-gradient(circle at 4px 9px, var(--xmas-red) 0 3px, transparent 3.5px),
    radial-gradient(circle at 4px 9px, var(--xmas-green) 0 3px, transparent 3.5px),
    radial-gradient(circle at 4px 9px, var(--yellow) 0 3px, transparent 3.5px),
    radial-gradient(circle at 4px 9px, #ffffff 0 3px, transparent 3.5px);
  background-size: 100% 2px, 96px 14px, 96px 14px, 96px 14px, 96px 14px;
  background-position: 0 2px, 0 0, 24px 0, 48px 0, 72px 0;
  background-repeat: repeat-x;
  animation: xmas-twinkle 1.6s steps(2, end) infinite;
}

/* fairy lights strung under the header */
body.xmas .site-head { position: relative; }
body.xmas .site-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 14px; z-index: 5; pointer-events: none;
  background-image:
    linear-gradient(var(--ink), var(--ink)),
    radial-gradient(circle at 4px 9px, var(--xmas-red) 0 3px, transparent 3.5px),
    radial-gradient(circle at 4px 9px, var(--xmas-green) 0 3px, transparent 3.5px),
    radial-gradient(circle at 4px 9px, var(--yellow) 0 3px, transparent 3.5px),
    radial-gradient(circle at 4px 9px, #ffffff 0 3px, transparent 3.5px);
  background-size: 100% 2px, 96px 14px, 96px 14px, 96px 14px, 96px 14px;
  background-position: 0 2px, 0 0, 24px 0, 48px 0, 72px 0;
  background-repeat: repeat-x;
  animation: xmas-twinkle 1.6s steps(2, end) infinite;
}
@keyframes xmas-twinkle {
  0% { background-position: 0 2px, 0 0, 24px 0, 48px 0, 72px 0; filter: brightness(1); }
  50% { background-position: 0 2px, 0 0, 24px 0, 48px 0, 72px 0; filter: brightness(1.35) saturate(1.2); }
  100% { background-position: 0 2px, 0 0, 24px 0, 48px 0, 72px 0; filter: brightness(1); }
}

/* santa hat on the brand star */
body.xmas .site-head .brand { position: relative; }
body.xmas .xmas-hat-brand { position: absolute; left: -6px; top: -12px; width: 26px; height: auto; pointer-events: none; transform: rotate(-14deg); }

/* festive eyebrow without touching the template text */
body.xmas .arcade-eyebrow::after { content: " · FESTIVE EDITION"; color: var(--xmas-red-dark); }

/* snow caps on the hero's brick strip and the mission cards */
body.xmas .arcade-hero::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 18px; height: 10px; z-index: 2; pointer-events: none;
  background-image: linear-gradient(#ffffff, #ffffff), linear-gradient(#ffffff, #ffffff);
  background-size: 20px 6px, 12px 10px; background-position: 0 4px, 6px 0; background-repeat: repeat-x;
}
body.xmas .arcade-mission-art { position: relative; }
body.xmas .arcade-mission-art::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; pointer-events: none;
  background-image: linear-gradient(#ffffff, #ffffff), linear-gradient(#ffffff, #ffffff);
  background-size: 24px 6px, 12px 12px; background-position: 0 0, 8px 0; background-repeat: repeat-x;
}

/* santa hat on the robot (desktop layouts only, where the illustration box equals the image) */
body.xmas .xmas-hat-robot { display: none; position: absolute; left: 37.3%; top: 29.8%; width: 11.8%; height: auto; transform: rotate(-10deg); transform-origin: 12% 100%; pointer-events: none; }
@media (min-width: 801px) { body.xmas .xmas-hat-robot { display: block; } }

/* snow canvas */
body.xmas .xmas-snow { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  body.xmas .xmas-snow { display: none; }
  body.xmas .site-head::after, body.xmas .site-foot::before { animation: none; }
}

/* small screens: calmer */
@media (max-width: 560px) {
  body.xmas .xmas-hat-brand { left: -4px; top: -10px; width: 22px; }
}
