/* Winter. A seasonal layer over /style.css, which stays untouched.
   It only applies while /core/season.js sets <html data-season="winter">; see docs/SEASONS.md. */
:root[data-season="winter"] {
  --paper:#eef3f8; --ink:#14213a; --muted:#55637a; --line:#d2dce8; --surface:#f8fbfe; --surface-hover:#e1e9f3; --card-art:#e2eaf4; --card-shadow:#d3dfec; --button-hover:#2b3f60; --focus:#2463a8; --accent-ink:#0d1b31; --lime:#8fd0ff; --haze:#d9e7f5; --haze-2:#e4ebf8; --ice:#a3c8e8a8; --ice-tip:#a3c8e800; --snow:#8db6dd; --drift:#ffffff; --drift-rim:#c8dbee; --glow:#ffffffd9; --wool:#d9583b; --trim:var(--ink); --twinkle:#3a8bd6; --stamp-edge:var(--ink);
  &[data-theme="dark"] { --paper:#0d1424; --ink:#e7eef8; --muted:#9dafc6; --line:#24324b; --surface:#141e33; --surface-hover:#1d2a45; --card-art:#19253d; --card-shadow:#050a14; --button-hover:#cfdcee; --focus:#8fd0ff; --haze:#15384a; --haze-2:#272559; --ice:#d4e9fb33; --ice-tip:#d4e9fb00; --snow:#eaf4ff9e; --drift:#1a2740; --drift-rim:#304568; --glow:#8fd0ff1c; --wool:#ff7a59; --twinkle:#bfe6ff; --stamp-edge:#6d9fd4; }

  & body { background:radial-gradient(900px 380px at 26% -130px,var(--haze),transparent 75%) no-repeat,radial-gradient(1000px 420px at 78% -170px,var(--haze-2),transparent 75%) no-repeat,var(--paper); }
  & .button.lime:hover { background:#b8e2ff; }
  & dialog::backdrop { background:#08101fa6; }

  /* Icicles hang from the top corners behind everything and scroll away with the page. */
  & body::before,& body::after { content:''; position:absolute; top:0; z-index:-1; width:clamp(120px,15vw,200px); aspect-ratio:172/136; background:linear-gradient(var(--ice) 35%,var(--ice-tip)); pointer-events:none; -webkit-mask:url(icicles.svg) no-repeat 0 0/100%; mask:url(icicles.svg) no-repeat 0 0/100%; }
  & body::before { left:0; }
  & body::after { right:0; transform:scaleX(-1); width:clamp(90px,11vw,150px); }

  /* A knitted beanie with a pompom pulled onto the logo. */
  & .wordmark { position:relative; }
  & .wordmark::before { content:''; position:absolute; left:-3px; top:-19px; width:33px; height:30px; transform:rotate(-10deg); background:linear-gradient(to top,var(--trim) 0 31%,var(--wool) 31% 46%,var(--trim) 46% 53%,var(--wool) 53% 70%,var(--trim) 70%); -webkit-mask:url(beanie.svg) no-repeat center/contain; mask:url(beanie.svg) no-repeat center/contain; pointer-events:none; }

  /* The home hero: a pale winter glow, snow drifts and two layers of flakes falling behind the text. */
  & .hero { position:relative; background:radial-gradient(ellipse 290px 80px at calc(100% - 290px) 100%,var(--drift) 0 95%,var(--drift-rim) 96% 99%,transparent 100%),radial-gradient(ellipse 200px 42px at calc(100% - 600px) 100%,var(--drift) 0 94%,var(--drift-rim) 95% 99%,transparent 100%),radial-gradient(circle 240px at calc(100% - 140px) 46%,var(--glow),transparent 100%); }
  & .hero::before,& .hero::after { content:''; position:absolute; top:0; bottom:0; right:0; z-index:-1; width:min(52%,640px); background:var(--snow); pointer-events:none; -webkit-mask:url(snow.svg) 0 0/240px auto,linear-gradient(to right,transparent 8%,#000 55%),linear-gradient(transparent,#000 70px); -webkit-mask-composite:source-in,source-in; mask:url(snow.svg) 0 0/240px auto,linear-gradient(to right,transparent 8%,#000 55%),linear-gradient(transparent,#000 70px); mask-composite:intersect,intersect; animation:winter-snowfall 18s linear infinite; }
  & .hero::after { opacity:.38; -webkit-mask-size:400px auto,auto,auto; mask-size:400px auto,auto,auto; -webkit-mask-position:120px -60px,0 0,0 0; mask-position:120px -60px,0 0,0 0; animation:winter-snowfall-near 13s linear infinite,winter-sway 5s ease-in-out infinite alternate; }
  &[data-theme="dark"] .highlight { box-shadow:0 0 28px #8fd0ff55; }

  /* The stamp becomes a snowball resting on the drift, with a snowflake for its face. */
  & .hero-stamp { position:relative; align-self:flex-end; width:170px; height:164px; border-radius:50% 48% 47% 51% / 52% 50% 48% 47%; background:radial-gradient(circle at 36% 30%,#fff 0 22%,#eef6fd 46%,#cfe2f3 78%,#b3cfe8); border-color:var(--stamp-edge); box-shadow:5px 5px 0 var(--stamp-edge); transform:rotate(-8deg); gap:6px; }
  & .hero-stamp::before { content:''; position:absolute; right:-34px; top:-20px; width:42px; height:42px; background:var(--twinkle); -webkit-mask:url(sparkle.svg) no-repeat center/contain; mask:url(sparkle.svg) no-repeat center/contain; pointer-events:none; animation:winter-twinkle 3.4s ease-in-out infinite; }
  & .hero-stamp span { width:38px; height:38px; font-size:0; background:#2c78c0; -webkit-mask:url(flake.svg) no-repeat center/contain; mask:url(flake.svg) no-repeat center/contain; animation:winter-spin 30s linear infinite; }

  /* Game cards catch a cold blue shimmer. */
  & .game-card:hover { box-shadow:0 8px 0 var(--card-shadow),0 10px 30px #8fd0ff33; }

  /* The player frame trades its green for a night navy; the games inside keep their own art. */
  & .player { --focus:#8fd0ff; background:#0c1322; border-color:#26385a; }
  & .player:fullscreen,& .player.is-expanded { background:#0c1322; }
  & .player-toolbar { background:#16213a; }
  & .player-category { border-color:#3d5b88; }
  & .player-actions .button { border-color:#33496f; background:#1c2944; }
  & .player-actions .button:hover { background:#2a3d62; }

  @media (prefers-reduced-motion:reduce) { & .hero::before,& .hero::after,& .hero-stamp::before,& .hero-stamp span { animation:none; } }
  @media (max-width:700px) {
    & .hero { background:radial-gradient(ellipse 160px 54px at calc(100% - 160px) 100%,var(--drift) 0 94%,var(--drift-rim) 95% 99%,transparent 100%),radial-gradient(circle 120px at calc(100% - 55px) 50%,var(--glow),transparent 100%); }
    & .hero::before,& .hero::after { width:56%; }
    & .hero-stamp { width:100px; height:97px; gap:3px; box-shadow:3px 3px 0 var(--stamp-edge); }
    & .hero-stamp::before { right:-20px; top:-12px; width:26px; height:26px; }
    & .hero-stamp span { width:22px; height:22px; }
    & .wordmark::before { left:-3px; top:-16px; width:28px; height:26px; }
  }
  @media (max-width:500px) {
    & .hero { background:radial-gradient(ellipse 130px 28px at calc(100% - 130px) 100%,var(--drift) 0 94%,var(--drift-rim) 95% 99%,transparent 100%); }
    & .hero::before { width:72%; opacity:.7; -webkit-mask-image:url(snow.svg),linear-gradient(to bottom left,#000,transparent 60%),linear-gradient(transparent,#000 40px); mask-image:url(snow.svg),linear-gradient(to bottom left,#000,transparent 60%),linear-gradient(transparent,#000 40px); }
    & .hero::after { display:none; }
  }
}

@keyframes winter-snowfall { to { -webkit-mask-position:0 288px,0 0,0 0; mask-position:0 288px,0 0,0 0; } }
@keyframes winter-snowfall-near { to { -webkit-mask-position:120px 420px,0 0,0 0; mask-position:120px 420px,0 0,0 0; } }
@keyframes winter-sway { from { transform:translateX(-8px); } to { transform:translateX(8px); } }
@keyframes winter-twinkle { 0%,100% { opacity:1; transform:scale(1) rotate(0); } 50% { opacity:.35; transform:scale(.72) rotate(20deg); } }
@keyframes winter-spin { to { transform:rotate(360deg); } }
