/* Mishap — Seasons: what a season wears. seasons.js sets body[data-season]
   on the screens that follow your theme; screens that are always dark or
   light keep their own look. Loaded last, so a season's tokens beat the
   theme's. Each season has a light look and a dark one, as Appearance says.

   Each season is written out below: Halloween (October), Thanksgiving
   (November), Christmas (December 1 to 25) and New Year's (December 26 to
   January 1).

   Halloween (October): Midnight #0B0A0A, Pumpkin #FF6A00, Witch #8B3DFF,
   Shadow #2A1A3A, Bone #F4E8D9; Sora for the titles; a web in the corner and
   three bats (seasons/halloween-web.svg, seasons/halloween-bats.svg). */

/* ---------- Halloween, light: bone paper, midnight ink ---------- */
body[data-season="halloween"]{
  --paper:#F6EEE3;--surface:#FFFBF5;--ink:#1A1320;
  --ink-60:#1a1320a6;--ink-40:#1a132073;--ink-30:#1a13203d;
  --line:#2a1a3a1f;--hair:#2a1a3a12;--shadow:0 8px 22px #2a1a3a17;
  --fill:#2a1a3a12;--fill-soft:#2a1a3a08;--fill-strong:#2a1a3a21;--line-strong:#2a1a3a2e;
  --card-dark:#2A1A3A;--photo-empty:#ece3ea;--warm:#fff0e2;--warm-2:#ffe6d0;--tip:#fff2d4;
  --tint-base:#FFFBF5;--tint-ink:#1A1320;
  --orange:#FF6A00;--orange-soft:#ff6a0017;
  --note-bad:#c24a00;--note-ok:#6a2bd9;--note-ok-bg:#8b3dff17;
  --st-violet:#8B3DFF;--st-lilac:#efe4ff;--st-lilac-ink:#6a2bd9;--st-wash:#ffffffb8;
  --st-peach:#ffe7d4;--st-peach-ink:#c24a00;
  --display:"Sora","Space Grotesk",sans-serif;
  background:#F6EEE3}

/* a pumpkin glow up in the corner, witch purple down below */
body[data-season="halloween"] .app{
  background:radial-gradient(70% 42% at 100% 0%,#ff6a0017 0%,#0000 65%),
             radial-gradient(80% 50% at 0% 100%,#8b3dff14 0%,#0000 70%),#F6EEE3}

/* ---------- Halloween, dark: midnight, bone ink ---------- */
body[data-season="halloween"][data-theme="dark"]{
  --paper:#0B0A0A;--surface:#17121d;--ink:#F4E8D9;
  --ink-60:#f4e8d9a6;--ink-40:#f4e8d973;--ink-30:#f4e8d93d;
  --line:#f4e8d91f;--hair:#f4e8d914;--shadow:0 8px 22px #00000080;
  --fill:#f4e8d914;--fill-soft:#f4e8d90a;--fill-strong:#f4e8d926;--line-strong:#f4e8d930;
  --card-dark:#2A1A3A;--photo-empty:#221a2b;--warm:#2a170c;--warm-2:#2e1a0c;--tip:#2a2012;
  --tint-base:#17121d;--tint-ink:#F4E8D9;
  --orange-soft:#ff6a0026;
  --note-bad:#ffb07a;--note-ok:#cfb2ff;--note-ok-bg:#8b3dff2e;
  --st-lilac:#2A1A3A;--st-lilac-ink:#cfb2ff;--st-wash:#f4e8d912;
  --st-peach:#2e1a0e;--st-peach-ink:#ffab70;
  background:#0B0A0A}
body[data-season="halloween"][data-theme="dark"] .app{
  background:radial-gradient(70% 42% at 100% 0%,#ff6a001a 0%,#0000 65%),
             radial-gradient(80% 50% at 0% 100%,#8b3dff1c 0%,#0000 70%),#0B0A0A}

/* ---------- a web hanging in the top left corner, three bats top right ---------- */
body[data-season="halloween"] .app::before,
body[data-season="halloween"] .app::after{content:"";position:absolute;z-index:3;pointer-events:none;
  background:no-repeat center/contain}
body[data-season="halloween"] .app::before{top:0;left:0;width:118px;height:118px;
  background-image:url("seasons/halloween-web.svg");opacity:.2;filter:brightness(0)}
body[data-season="halloween"] .app::after{top:calc(env(safe-area-inset-top) + 4px);right:10px;width:72px;height:34px;
  background-image:url("seasons/halloween-bats.svg");opacity:.8;filter:brightness(.35);
  animation:hwBats 6s ease-in-out infinite}
/* on midnight the web and the bats keep their own colours */
body[data-season="halloween"][data-theme="dark"] .app::before{opacity:.26;filter:none}
body[data-season="halloween"][data-theme="dark"] .app::after{opacity:.75;filter:none}
@keyframes hwBats{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}

/* ---------- accents, both looks ---------- */
body[data-season="halloween"] .tab.active{color:var(--orange)}
body[data-season="halloween"] .live-card.hot{box-shadow:0 14px 30px #ff6a004d}
body[data-season="halloween"] .home .next-card.mishaps-card{
  background:radial-gradient(110% 90% at 100% 0%,#b07cff 0%,#0000 55%),linear-gradient(135deg,#8B3DFF 0%,#5a22c8 55%,#2A1A3A 100%);
  box-shadow:0 14px 28px #8b3dff3d}

@media (prefers-reduced-motion:reduce){
  body[data-season="halloween"] .app::after{animation:none}
}


/* ================================================================ Thanksgiving
   November: Cream #FBF3E6, Espresso #2B1A10, Pumpkin spice #D9622B,
   Cranberry #9E2A2B, Harvest gold #E0A43A; Fraunces for the titles; a spray of
   leaves in the top left corner and three more drifting top right
   (seasons/thanksgiving-leaves.svg, seasons/thanksgiving-fall.svg). */

/* ---------- Thanksgiving, light: cream paper, espresso ink ---------- */
body[data-season="thanksgiving"]{
  --paper:#FBF3E6;--surface:#FFFAF2;--ink:#2B1A10;
  --ink-60:#2b1a10a6;--ink-40:#2b1a1073;--ink-30:#2b1a103d;
  --line:#6b4a2e21;--hair:#6b4a2e14;--shadow:0 8px 22px #6b4a2e1c;
  --fill:#6b4a2e14;--fill-soft:#6b4a2e0a;--fill-strong:#6b4a2e24;--line-strong:#6b4a2e33;
  --card-dark:#3A2416;--photo-empty:#f1e4d2;--warm:#fdebd8;--warm-2:#fbe0c6;--tip:#fbecc8;
  --tint-base:#FFFAF2;--tint-ink:#2B1A10;
  --orange:#D9622B;--orange-soft:#d9622b1a;
  --note-bad:#9E2A2B;--note-ok:#5d6b2a;--note-ok-bg:#6b7f3a1c;
  --st-violet:#9E2A2B;--st-lilac:#f8e1dc;--st-lilac-ink:#9E2A2B;--st-wash:#ffffffbd;
  --st-peach:#fbe3cf;--st-peach-ink:#b34d1c;
  --st-yellow:#fbecc8;--st-yellow-ink:#8a5b0e;
  --display:"Fraunces","Space Grotesk",serif;
  background:#FBF3E6}

/* a warm gold glow up in the corner, cranberry down below */
body[data-season="thanksgiving"] .app{
  background:radial-gradient(70% 42% at 100% 0%,#e0a43a24 0%,#0000 65%),
             radial-gradient(80% 50% at 0% 100%,#9e2a2b14 0%,#0000 70%),#FBF3E6}

/* ---------- Thanksgiving, dark: espresso, cream ink ---------- */
body[data-season="thanksgiving"][data-theme="dark"]{
  --paper:#17100B;--surface:#22170F;--ink:#F6E9D6;
  --ink-60:#f6e9d6a6;--ink-40:#f6e9d673;--ink-30:#f6e9d63d;
  --line:#f6e9d61f;--hair:#f6e9d614;--shadow:0 8px 22px #00000080;
  --fill:#f6e9d614;--fill-soft:#f6e9d60a;--fill-strong:#f6e9d626;--line-strong:#f6e9d630;
  --card-dark:#3A2416;--photo-empty:#2b1f16;--warm:#2e1d10;--warm-2:#33200f;--tip:#2e2412;
  --tint-base:#22170F;--tint-ink:#F6E9D6;
  --orange:#E8793F;--orange-soft:#e8793f26;
  --note-bad:#f0a08a;--note-ok:#c4d38a;--note-ok-bg:#6b7f3a2e;
  --st-lilac:#3a1c1b;--st-lilac-ink:#f2a9a0;--st-wash:#f6e9d612;
  --st-peach:#3a2112;--st-peach-ink:#f5a676;
  --st-yellow:#3a2c12;--st-yellow-ink:#f0c46a;
  background:#17100B}
body[data-season="thanksgiving"][data-theme="dark"] .app{
  background:radial-gradient(70% 42% at 100% 0%,#e0a43a1f 0%,#0000 65%),
             radial-gradient(80% 50% at 0% 100%,#9e2a2b26 0%,#0000 70%),#17100B}

/* ---------- leaves: a spray in the top left corner, three drifting top right ---------- */
body[data-season="thanksgiving"] .app::before,
body[data-season="thanksgiving"] .app::after{content:"";position:absolute;z-index:3;pointer-events:none;
  background:no-repeat center/contain}
body[data-season="thanksgiving"] .app::before{top:0;left:0;width:112px;height:112px;
  background-image:url("seasons/thanksgiving-leaves.svg");opacity:.55}
body[data-season="thanksgiving"] .app::after{top:calc(env(safe-area-inset-top) + 6px);right:10px;width:78px;height:40px;
  background-image:url("seasons/thanksgiving-fall.svg");opacity:.8;
  animation:tgDrift 7s ease-in-out infinite}
body[data-season="thanksgiving"][data-theme="dark"] .app::before{opacity:.45}
body[data-season="thanksgiving"][data-theme="dark"] .app::after{opacity:.7}
@keyframes tgDrift{0%,100%{transform:translateY(0) rotate(0deg)}50%{transform:translateY(4px) rotate(-4deg)}}

/* ---------- accents, both looks ---------- */
body[data-season="thanksgiving"] .tab.active{color:var(--orange)}
body[data-season="thanksgiving"] .live-card.hot{box-shadow:0 14px 30px #d9622b4d}
body[data-season="thanksgiving"] .home .next-card.mishaps-card{
  background:radial-gradient(110% 90% at 100% 0%,#e0a43a 0%,#0000 55%),linear-gradient(135deg,#D9622B 0%,#9E2A2B 55%,#3A2416 100%);
  box-shadow:0 14px 28px #9e2a2b3d}

@media (prefers-reduced-motion:reduce){
  body[data-season="thanksgiving"] .app::after{animation:none}
}

/* =================================================================== Christmas
   December 1 to 25: Snow #F7F4EF, Pine #14261D, Berry red #C8102E, Evergreen #1F6B45,
   Gold #D4A437; Playfair Display for the titles; a string of lights along the
   top of the screen and snow falling behind everything
   (seasons/christmas-lights.svg, seasons/christmas-snow.svg). */

/* ---------- Christmas, light: snow paper, pine ink ---------- */
body[data-season="christmas"]{
  --paper:#F7F4EF;--surface:#FFFDF9;--ink:#14261D;
  --ink-60:#14261da6;--ink-40:#14261d73;--ink-30:#14261d3d;
  --line:#14261d1f;--hair:#14261d12;--shadow:0 8px 22px #14261d17;
  --fill:#14261d12;--fill-soft:#14261d08;--fill-strong:#14261d21;--line-strong:#14261d2e;
  --card-dark:#14261D;--photo-empty:#e9ece6;--warm:#fcebe9;--warm-2:#f9dcd8;--tip:#fbf0d2;
  --tint-base:#FFFDF9;--tint-ink:#14261D;
  --orange:#C8102E;--orange-soft:#c8102e17;
  --note-bad:#b00d27;--note-ok:#1F6B45;--note-ok-bg:#1f6b451c;
  --st-violet:#1F6B45;--st-lilac:#e1efe6;--st-lilac-ink:#1F6B45;--st-wash:#ffffffbd;
  --st-peach:#fbe0e2;--st-peach-ink:#b00d27;
  --st-yellow:#fbf0d2;--st-yellow-ink:#8a6a12;
  --display:"Playfair Display","Space Grotesk",serif;
  background:#F7F4EF}

/* a berry glow up in the corner, evergreen down below; isolated, so the snow
   (z-index -1 below) falls in front of the paper and behind the cards */
body[data-season="christmas"] .app{isolation:isolate;
  background:radial-gradient(70% 42% at 100% 0%,#c8102e14 0%,#0000 65%),
             radial-gradient(80% 50% at 0% 100%,#1f6b4514 0%,#0000 70%),#F7F4EF}

/* ---------- Christmas, dark: winter night, snow ink ---------- */
body[data-season="christmas"][data-theme="dark"]{
  --paper:#0C1712;--surface:#13221A;--ink:#F4F1EA;
  --ink-60:#f4f1eaa6;--ink-40:#f4f1ea73;--ink-30:#f4f1ea3d;
  --line:#f4f1ea1f;--hair:#f4f1ea14;--shadow:0 8px 22px #00000080;
  --fill:#f4f1ea14;--fill-soft:#f4f1ea0a;--fill-strong:#f4f1ea26;--line-strong:#f4f1ea30;
  --card-dark:#1B3325;--photo-empty:#1a2a21;--warm:#2a1216;--warm-2:#321418;--tip:#2e2811;
  --tint-base:#13221A;--tint-ink:#F4F1EA;
  --orange:#E0303F;--orange-soft:#e0303f26;
  --note-bad:#ff8a95;--note-ok:#8fd1a8;--note-ok-bg:#1f6b452e;
  --st-violet:#3fae74;--st-lilac:#15301f;--st-lilac-ink:#8fd1a8;--st-wash:#f4f1ea12;
  --st-peach:#3a1318;--st-peach-ink:#ff8a95;
  --st-yellow:#33290f;--st-yellow-ink:#f0cd6a;
  background:#0C1712}
body[data-season="christmas"][data-theme="dark"] .app{
  background:radial-gradient(70% 42% at 100% 0%,#e0303f1f 0%,#0000 65%),
             radial-gradient(80% 50% at 0% 100%,#1f8a5726 0%,#0000 70%),#0C1712}

/* ---------- lights along the top, snow falling behind ---------- */
body[data-season="christmas"] .app::before{content:"";position:absolute;z-index:3;pointer-events:none;
  top:0;left:0;right:0;height:30px;
  background:url("seasons/christmas-lights.svg") repeat-x left top/106px 30px}
body[data-season="christmas"] .app::after{content:"";position:absolute;z-index:-1;pointer-events:none;
  inset:0;background:url("seasons/christmas-snow.svg") repeat 0 0/180px 180px;opacity:.7;
  animation:xmSnow 20s linear infinite}
body[data-season="christmas"][data-theme="dark"] .app::after{opacity:.5}
@keyframes xmSnow{from{background-position:0 0}to{background-position:22px 180px}}

/* ---------- accents, both looks ---------- */
body[data-season="christmas"] .tab.active{color:var(--orange)}
body[data-season="christmas"] .live-card.hot{box-shadow:0 14px 30px #c8102e47}
body[data-season="christmas"] .home .next-card.mishaps-card{
  background:radial-gradient(110% 90% at 100% 0%,#2a9d62 0%,#0000 55%),linear-gradient(135deg,#C8102E 0%,#8E0B20 55%,#14261D 100%);
  box-shadow:0 14px 28px #c8102e38}

@media (prefers-reduced-motion:reduce){
  body[data-season="christmas"] .app::after{animation:none}
}

/* ================================================================== New Year's
   December 26 to January 1: Champagne #F8F5EE, Midnight #14161F, Gold #D4A437
   (a deeper #9A6B12 where white text sits on it), Party pink #E0457B, Silver
   #C9CED6; Cinzel for the titles; a firework in each top corner and confetti
   falling behind everything (seasons/new-years-burst.svg,
   seasons/new-years-confetti.svg). */

/* ---------- New Year's, light: champagne paper, midnight ink ---------- */
body[data-season="new-years-eve"]{
  --paper:#F8F5EE;--surface:#FFFDF8;--ink:#14161F;
  --ink-60:#14161fa6;--ink-40:#14161f73;--ink-30:#14161f3d;
  --line:#14161f1f;--hair:#14161f12;--shadow:0 8px 22px #14161f17;
  --fill:#14161f12;--fill-soft:#14161f08;--fill-strong:#14161f21;--line-strong:#14161f2e;
  --card-dark:#14161F;--photo-empty:#ecebe6;--warm:#f8efd8;--warm-2:#f4e6c4;--tip:#faf0d0;
  --tint-base:#FFFDF8;--tint-ink:#14161F;
  --orange:#9A6B12;--orange-soft:#9a6b1217;
  --note-bad:#b0264f;--note-ok:#2c4fa8;--note-ok-bg:#4f7be01c;
  --st-violet:#E0457B;--st-lilac:#fbe2ea;--st-lilac-ink:#b0264f;--st-wash:#ffffffbd;
  --st-peach:#f6ebcf;--st-peach-ink:#8a5f10;
  --st-yellow:#faf0d0;--st-yellow-ink:#8a5f10;
  --display:"Cinzel","Space Grotesk",serif;
  background:#F8F5EE}

/* a gold glow up in the corner, party pink down below; isolated, so the
   confetti (z-index -1 below) falls behind the cards */
body[data-season="new-years-eve"] .app{isolation:isolate;
  background:radial-gradient(70% 42% at 100% 0%,#d4a43726 0%,#0000 65%),
             radial-gradient(80% 50% at 0% 100%,#e0457b12 0%,#0000 70%),#F8F5EE}

/* ---------- New Year's, dark: midnight, champagne ink ---------- */
body[data-season="new-years-eve"][data-theme="dark"]{
  --paper:#0A0B12;--surface:#141623;--ink:#F5EFE0;
  --ink-60:#f5efe0a6;--ink-40:#f5efe073;--ink-30:#f5efe03d;
  --line:#f5efe01f;--hair:#f5efe014;--shadow:0 8px 22px #00000080;
  --fill:#f5efe014;--fill-soft:#f5efe00a;--fill-strong:#f5efe026;--line-strong:#f5efe030;
  --card-dark:#1c1f33;--photo-empty:#1b1d2b;--warm:#2a2210;--warm-2:#30260f;--tip:#2e2810;
  --tint-base:#141623;--tint-ink:#F5EFE0;
  --orange:#C28A1C;--orange-soft:#d4a43726;
  --note-bad:#ff8fb1;--note-ok:#9db8ff;--note-ok-bg:#4f7be02e;
  --st-violet:#ff6f9c;--st-lilac:#2e1524;--st-lilac-ink:#ff8fb1;--st-wash:#f5efe012;
  --st-peach:#2e2410;--st-peach-ink:#f0c86a;
  --st-yellow:#2e2810;--st-yellow-ink:#f0cd6a;
  background:#0A0B12}
body[data-season="new-years-eve"][data-theme="dark"] .app{
  background:radial-gradient(70% 42% at 100% 0%,#d4a4372e 0%,#0000 65%),
             radial-gradient(80% 50% at 0% 100%,#e0457b1f 0%,#0000 70%),#0A0B12}

/* ---------- a firework in each top corner, confetti falling, both behind ----------
   Behind the content (the .app is isolated), so a back arrow or a header button
   in the corner is drawn over the firework, not under it. */
body[data-season="new-years-eve"] .app::before{content:"";position:absolute;z-index:-1;pointer-events:none;
  top:0;left:0;right:0;height:84px;
  background:url("seasons/new-years-burst.svg") no-repeat left 8px top 6px/56px 56px,
             url("seasons/new-years-burst.svg") no-repeat right 14px top 14px/38px 38px;
  animation:nyTwinkle 3.2s ease-in-out infinite}
body[data-season="new-years-eve"] .app::after{content:"";position:absolute;z-index:-1;pointer-events:none;
  inset:0;background:url("seasons/new-years-confetti.svg") repeat 0 0/160px 160px;opacity:.75;
  animation:nyConfetti 16s linear infinite}
body[data-season="new-years-eve"][data-theme="dark"] .app::after{opacity:.6}
@keyframes nyTwinkle{0%,100%{opacity:.95}50%{opacity:.55}}
@keyframes nyConfetti{from{background-position:0 0}to{background-position:-16px 160px}}

/* ---------- accents, both looks ---------- */
body[data-season="new-years-eve"] .tab.active{color:var(--orange)}
body[data-season="new-years-eve"] .live-card.hot{
  background:radial-gradient(90% 120% at 100% 0%,#f5e6b8a6 0%,#0000 45%),linear-gradient(135deg,#C29A2E 0%,#8A6212 60%,#5E430C 100%);
  box-shadow:0 14px 30px #d4a43759}
body[data-season="new-years-eve"] .home .next-card.mishaps-card{
  background:radial-gradient(110% 90% at 100% 0%,#e0457b 0%,#0000 50%),linear-gradient(135deg,#C9A227 0%,#8C6D1C 45%,#14161F 100%);
  box-shadow:0 14px 28px #8c6d1c40}

@media (prefers-reduced-motion:reduce){
  body[data-season="new-years-eve"] .app::before,
  body[data-season="new-years-eve"] .app::after{animation:none}
}

/* The Halloween pack's page: its quests are in every party in October */
.pd-season{display:flex;align-items:center;gap:6px;margin:8px 0 0;font-size:12.5px;line-height:1.35;color:#ffd2ad}
.pd-season svg{width:14px;height:14px;flex:none;color:#FF6A00}
