/* Autumn. A seasonal layer over /style.css, which stays untouched.
   It only applies while /core/season.js sets <html data-season="autumn">; see docs/SEASONS.md. */
:root[data-season="autumn"] {
  --paper:#f6eee0; --ink:#2b1e14; --muted:#6c5a48; --line:#e2d2bb; --surface:#fbf6ec; --surface-hover:#f0e3cd; --card-art:#efdfc6; --card-shadow:#e5cfaa; --button-hover:#4d3626; --focus:#a3421a; --accent-ink:#2b1e14; --lime:#eda33b; --rust:#c4552b; --amber:#e39f36; --olive:#8a8a38; --nut:#e5a24a; --cap:#7a4b27; --glow:#f5d5a1; --haze:#f1dcbb; --corner:.42;
  &[data-theme="dark"] { --paper:#1a1711; --ink:#f3e9d9; --muted:#bfae96; --line:#3b3226; --surface:#231f16; --surface-hover:#30291d; --card-art:#2b261a; --card-shadow:#0d0b07; --button-hover:#e8d6ba; --focus:#f0a947; --rust:#cf6234; --amber:#d99631; --olive:#8f9140; --cap:#9a6436; --glow:#e39f3626; --haze:#272c19; --corner:.36; }

  & body { background:radial-gradient(1400px 520px at 50% -140px,var(--haze),transparent 75%) no-repeat,var(--paper); }
  & .button.lime:hover { background:#f6bf68; }
  & dialog::backdrop { background:#1a120b99; }

  /* Leafy twigs caught in the top corners sit behind everything and scroll away with the page. */
  & body::before,& body::after { content:''; position:absolute; top:0; z-index:-1; width:clamp(110px,16vw,210px); aspect-ratio:1; background:radial-gradient(circle at 0 0,var(--cap),var(--rust) 34%,var(--amber) 62%,var(--olive)); opacity:var(--corner); pointer-events:none; -webkit-mask:url(branch.svg) no-repeat 0 0/100%; mask:url(branch.svg) no-repeat 0 0/100%; }
  & body::before { left:0; }
  & body::after { right:0; transform:scaleX(-1); width:clamp(80px,11vw,150px); }

  /* An acorn perched on the logo. */
  & .wordmark { position:relative; }
  & .wordmark::before { content:''; position:absolute; left:13px; top:-15px; width:15px; height:18px; transform:rotate(-16deg); background:linear-gradient(var(--cap) 0 45%,var(--nut) 45%); -webkit-mask:url(acorn.svg) no-repeat center/contain; mask:url(acorn.svg) no-repeat center/contain; pointer-events:none; }

  /* The home hero: a drift of leaves and one maple leaf falling behind the words. */
  & .hero { position:relative; }
  & .hero::before { content:''; position:absolute; right:clamp(200px,22vw,330px); top:12px; width:clamp(150px,18vw,250px); aspect-ratio:2; background:linear-gradient(100deg,var(--rust),var(--amber) 55%,var(--olive)); -webkit-mask:url(leaves.svg) no-repeat center/contain; mask:url(leaves.svg) no-repeat center/contain; pointer-events:none; animation:autumn-drift 9s ease-in-out infinite; }
  & .hero::after { content:''; position:absolute; top:0; left:clamp(320px,50%,680px); z-index:-1; width:34px; aspect-ratio:1; background:var(--rust); -webkit-mask:url(maple.svg) no-repeat center/contain; mask:url(maple.svg) no-repeat center/contain; pointer-events:none; animation:autumn-fall 12s ease-in-out infinite; }
  &[data-theme="dark"] .highlight { box-shadow:0 0 28px #eda33b4d; }

  /* The stamp becomes a glowing acorn, keeping its sticker outline; the cap and stem sit on top. */
  & .hero-stamp { position:relative; width:160px; height:172px; margin-top:44px; padding-top:34px; border-radius:46% 46% 50% 50% / 30% 30% 70% 70%; background:radial-gradient(ellipse 70% 60% at 36% 40%,#f8c886,var(--lime) 50%,#c97c22); box-shadow:5px 5px 0 var(--ink),0 0 90px 36px var(--glow); transform:rotate(10deg); gap:6px; }
  & .hero-stamp::before { content:''; position:absolute; left:-13px; right:-13px; top:-30px; height:76px; border:2px solid var(--ink); border-radius:50% 50% 18px 18px / 86% 86% 18px 18px; background:repeating-linear-gradient(45deg,transparent 0 8px,#00000026 8px 10px),repeating-linear-gradient(-45deg,transparent 0 8px,#00000026 8px 10px),var(--cap); box-shadow:0 4px 0 #2b1e1433; }
  & .hero-stamp::after { content:''; position:absolute; top:-50px; left:calc(50% - 6px); width:12px; height:26px; border:2px solid var(--ink); border-radius:6px 6px 2px 2px; background:var(--cap); transform:rotate(14deg); z-index:-1; }
  & .hero-stamp span { width:34px; height:34px; font-size:0; background:var(--accent-ink); -webkit-mask:url(maple.svg) no-repeat center/contain; mask:url(maple.svg) no-repeat center/contain; transform:rotate(-14deg); }

  /* Game cards warm up like a lamp-lit window. */
  & .game-card:hover { box-shadow:0 8px 0 var(--card-shadow),0 10px 30px #c4552b26; }

  /* The player frame trades its green for a walnut brown; the games inside keep their own art. */
  & .player { --focus:#f0a947; background:#18130d; border-color:#3f3122; }
  & .player:fullscreen,& .player.is-expanded { background:#18130d; }
  & .player-toolbar { background:#271f15; }
  & .player-category { border-color:#77592f; }
  & .player-actions .button { border-color:#5a4630; background:#30261a; }
  & .player-actions .button:hover { background:#443624; }

  @media (prefers-reduced-motion:reduce) { & .hero::before,& .hero::after { animation:none; } }
  @media (max-width:700px) {
    & .hero::before { right:118px; top:4px; width:118px; }
    & .hero::after { left:auto; right:34%; top:8px; width:24px; animation-name:autumn-sway; }
    & .hero-stamp { width:88px; height:94px; margin-top:24px; padding-top:18px; box-shadow:3px 3px 0 var(--ink),0 0 50px 18px var(--glow); gap:3px; }
    & .hero-stamp::before { left:-7px; right:-7px; top:-16px; height:41px; border-radius:50% 50% 10px 10px / 86% 86% 10px 10px; box-shadow:0 2px 0 #2b1e1433; }
    & .hero-stamp::after { top:-27px; left:calc(50% - 4px); width:8px; height:14px; }
    & .hero-stamp span { width:18px; height:18px; }
    & .wordmark::before { left:11px; top:-13px; width:13px; height:15px; }
  }
  @media (max-width:500px) {
    & .hero::before { right:2%; top:2px; width:92px; }
    & .hero::after { right:30%; top:4px; width:20px; }
  }
}

@keyframes autumn-drift { 0%,100% { transform:translate(0,0) rotate(0); } 35% { transform:translate(-12px,7px) rotate(-3deg); } 70% { transform:translate(9px,-4px) rotate(2deg); } }
@keyframes autumn-sway { 0%,100% { transform:translate(0,0) rotate(-14deg); } 50% { transform:translate(-10px,6px) rotate(16deg); } }
@keyframes autumn-fall { 0% { transform:translate(0,-12px) rotate(-20deg); opacity:0; } 10% { opacity:1; } 35% { transform:translate(-26px,90px) rotate(30deg); } 65% { transform:translate(18px,190px) rotate(-25deg); } 88% { opacity:1; } 100% { transform:translate(-8px,280px) rotate(40deg); opacity:0; } }
