/* Spec 227 and its amendment of 2026-10-26 (the owner: "I thought the whole app would get themed: snow, decorations,
   animations"). While the season shows, js/season.js puts data-season="winter" or "summer" on the page's root and one
   fixed layer of falling pieces at the start of the body:
   - the sky: snow in the northern winter, warm confetti and stars in the southern summer; behind every page's content
     (z-index -1, no pointer events), CSS transforms only, 70 pieces (40 on a phone), none for reduced motion, and
     none on the reader, a book's video, the drawing studio or colouring (data-season-still); paused in a hidden tab;
   - the top bar's garland, hanging under the rainbow on every page but the still ones;
   - Home: a snow cap (or a summer bunting) along the sky card's and each tile's top edge, a bauble (or a little sun) on
     Make a story, and the friends' seasonal scene with the greeting;
   - a snowflake (or a sun) beside the Settings, My library and Xocana Books titles.
   Every piece is decoration: aria-hidden or a background, never over a word or a button. */
.season-header[hidden], .season-home[hidden] { display: none; }

/* The garland: a repeating string of lights along the foot of the top bar. */
html[data-season] .topbar { position: relative; }
.season-header {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  height: 26px;
  z-index: 2;
  pointer-events: none;
  background: url("/img/season-garland.svg") left top / auto 26px repeat-x;
}
html[data-season="summer"] .season-header { background-image: url("/img/season-bunting.svg"); height: 22px; background-size: auto 22px; }
html[data-season-still] .season-header { display: none; }
html[data-season]:not([data-season-still]) .view { padding-top: calc(var(--space-5) + 14px); }
@media (max-width: 560px) {
  html[data-season]:not([data-season-still]) .view { padding-top: calc(var(--space-3) + 18px); }
}

/* Home's scene and greeting, under the sky card's words. */
.season-home { grid-column: 1 / -1; position: relative; color: var(--text); padding: 8px 12px 0; }
.season-home img { display: block; width: 100%; height: auto; max-height: 230px; object-fit: contain; }
.season-greeting {
  justify-self: center;
  width: fit-content;
  margin: 6px auto 0;
  padding: 4px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--text);
  font-weight: 700;
  font-size: var(--font-md);
  white-space: pre-line;
  text-align: center;
}
.kid-sky.has-season { padding-bottom: var(--space-4); }
.kid-sky.has-season .kid-friends, .kid-sky.has-season .kid-star { display: none; }

/* A snow cap along the top of the sky card and the tiles; a bunting in the summer. */
html[data-season] .kid-sky::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 22px;
  z-index: 1;
  pointer-events: none;
  background: url("/img/season-snowcap.svg") left top / 120px 22px repeat-x;
}
html[data-season="summer"] .kid-sky::before { background-image: url("/img/season-bunting.svg"); background-size: 120px 26px; height: 26px; }
html[data-season] .tiles > .tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 18px;
  pointer-events: none;
  background: url("/img/season-snowcap.svg") left top / 98px 18px repeat-x;
}
html[data-season="summer"] .tiles > .tile::before { background-image: url("/img/season-bunting.svg"); background-size: 92px 20px; height: 20px; }

/* Make a story: a bauble hangs at its end (a little sun in the summer), inside the button's own box. */
html[data-season] .kid-draw:not([hidden]) {
  background-image: url("/img/season-bauble.svg");
  background-repeat: no-repeat;
  background-size: 18px 25px;
  background-position: right 12px top 0;
  padding-right: 40px;
}
html[data-season="summer"] .kid-draw:not([hidden]) { background-image: url("/img/season-sun.svg"); background-size: 22px 22px; background-position: right 10px center; }

/* The Settings and library titles. */
html[data-season] h1:is([data-i18n="Settings.Title"], [data-i18n="Books.Title"], [data-i18n="StoryLibrary.Heading"])::after {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-inline-start: 0.35em;
  vertical-align: -0.05em;
  background: url("/img/season-flake.svg") center / contain no-repeat;
}
html[data-season="summer"] h1:is([data-i18n="Settings.Title"], [data-i18n="Books.Title"], [data-i18n="StoryLibrary.Heading"])::after { background-image: url("/img/season-sun.svg"); }

/* The sky's falling pieces: 70 (40 on a phone), 6 to 16 px, a third of them real six-armed snowflakes. White with a soft
   periwinkle edge and shadow on the day sky; white with a soft glow on the night sky. */
:root {
  --season-flake-edge: rgb(100 114 200 / 90%);
  --season-flake-shadow: rgb(56 72 156 / 55%);
}
:root[data-theme="dark"] {
  --season-flake-edge: rgb(255 255 255 / 35%);
  --season-flake-shadow: rgb(255 255 255 / 80%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]):not([data-theme="bedtime"]) {
    --season-flake-edge: rgb(255 255 255 / 35%);
    --season-flake-shadow: rgb(255 255 255 / 80%);
  }
}
.season-sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.season-sky i {
  position: absolute;
  top: -32px;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 0 1.5px var(--season-flake-edge), 0 1px 6px var(--season-flake-shadow);
  opacity: var(--o);
  animation: season-fall var(--d) linear var(--t) infinite;
  will-change: transform;
}
.season-sky i:nth-child(3n) {
  width: calc(var(--s) * 1.6);
  height: calc(var(--s) * 1.6);
  border-radius: 0;
  box-shadow: none;
  background: url("/img/season-flake.svg") center / contain no-repeat;
  filter: drop-shadow(0 1px 2px var(--season-flake-shadow));
}
html[data-season="summer"] .season-sky i {
  width: calc(var(--s) * 0.9);
  height: calc(var(--s) * 1.7);
  border-radius: 0;
  box-shadow: 0 0 0 1px rgb(27 43 75 / 28%);
  filter: none;
  background: var(--crayon-pink);
  animation-duration: calc(var(--d) * 1.3);
}
html[data-season="summer"] .season-sky i:nth-child(4n+1) { background: var(--crayon-yellow); }
html[data-season="summer"] .season-sky i:nth-child(4n+2) { background: var(--crayon-teal); }
html[data-season="summer"] .season-sky i:nth-child(4n+3) { background: var(--crayon-purple); }
html[data-season="summer"] .season-sky i:nth-child(4n) {
  width: calc(var(--s) * 2);
  height: calc(var(--s) * 2);
  box-shadow: none;
  background: url("/img/art/star.svg") center / contain no-repeat;
  filter: drop-shadow(0 1px 1.5px rgb(27 43 75 / 30%));
  animation: season-fall calc(var(--d) * 1.3) linear var(--t) infinite, season-twinkle 2.6s ease-in-out var(--t) infinite;
}
@keyframes season-fall {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(var(--w), 55vh, 0) rotate(120deg); }
  to { transform: translate3d(0, calc(100vh + 64px), 0) rotate(240deg); }
}
@keyframes season-twinkle { 0%, 100% { opacity: var(--o); } 50% { opacity: 0.35; } }
@media (max-width: 600px) { .season-sky i:nth-child(n+41) { display: none; } }
html.is-still .season-sky i { animation-play-state: paused; }
html[data-season-still] .season-sky { display: none; }
@media (prefers-reduced-motion: reduce) { .season-sky { display: none; } }
@media print { .season-sky, .season-header { display: none; } }

.season-sky i:nth-child(1) { --x: 0.6%; --s: 10px; --d: 13s; --t: -14s; --w: -14px; --o: 0.94; }
.season-sky i:nth-child(2) { --x: 2.0%; --s: 7px; --d: 16s; --t: -5s; --w: 41px; --o: 0.83; }
.season-sky i:nth-child(3) { --x: 4.0%; --s: 11px; --d: 12s; --t: -7s; --w: 0px; --o: 0.86; }
.season-sky i:nth-child(4) { --x: 4.9%; --s: 8px; --d: 19s; --t: -18s; --w: -14px; --o: 0.85; }
.season-sky i:nth-child(5) { --x: 6.3%; --s: 8px; --d: 12s; --t: -3s; --w: -26px; --o: 0.86; }
.season-sky i:nth-child(6) { --x: 8.5%; --s: 11px; --d: 15s; --t: -22s; --w: 2px; --o: 0.8; }
.season-sky i:nth-child(7) { --x: 9.8%; --s: 7px; --d: 18s; --t: -17s; --w: -31px; --o: 0.89; }
.season-sky i:nth-child(8) { --x: 10.1%; --s: 6px; --d: 19s; --t: -16s; --w: -2px; --o: 0.89; }
.season-sky i:nth-child(9) { --x: 12.0%; --s: 10px; --d: 22s; --t: -5s; --w: -28px; --o: 0.97; }
.season-sky i:nth-child(10) { --x: 12.9%; --s: 10px; --d: 21s; --t: -3s; --w: 6px; --o: 0.9; }
.season-sky i:nth-child(11) { --x: 15.0%; --s: 8px; --d: 16s; --t: -20s; --w: 42px; --o: 0.8; }
.season-sky i:nth-child(12) { --x: 16.8%; --s: 8px; --d: 13s; --t: -15s; --w: -14px; --o: 0.82; }
.season-sky i:nth-child(13) { --x: 17.8%; --s: 8px; --d: 14s; --t: -15s; --w: 31px; --o: 0.82; }
.season-sky i:nth-child(14) { --x: 19.6%; --s: 8px; --d: 17s; --t: -21s; --w: -23px; --o: 0.85; }
.season-sky i:nth-child(15) { --x: 21.0%; --s: 6px; --d: 12s; --t: -6s; --w: 16px; --o: 0.82; }
.season-sky i:nth-child(16) { --x: 21.9%; --s: 10px; --d: 17s; --t: -15s; --w: -6px; --o: 0.86; }
.season-sky i:nth-child(17) { --x: 24.2%; --s: 6px; --d: 19s; --t: -22s; --w: 9px; --o: 0.84; }
.season-sky i:nth-child(18) { --x: 25.6%; --s: 7px; --d: 16s; --t: -15s; --w: -25px; --o: 0.84; }
.season-sky i:nth-child(19) { --x: 27.0%; --s: 6px; --d: 13s; --t: -5s; --w: -20px; --o: 0.99; }
.season-sky i:nth-child(20) { --x: 27.4%; --s: 6px; --d: 15s; --t: -3s; --w: -29px; --o: 0.83; }
.season-sky i:nth-child(21) { --x: 28.9%; --s: 8px; --d: 13s; --t: -19s; --w: -18px; --o: 0.84; }
.season-sky i:nth-child(22) { --x: 31.1%; --s: 8px; --d: 21s; --t: -1s; --w: -39px; --o: 0.84; }
.season-sky i:nth-child(23) { --x: 31.7%; --s: 7px; --d: 15s; --t: -20s; --w: -38px; --o: 0.9; }
.season-sky i:nth-child(24) { --x: 34.2%; --s: 10px; --d: 16s; --t: -6s; --w: 38px; --o: 0.95; }
.season-sky i:nth-child(25) { --x: 35.0%; --s: 6px; --d: 19s; --t: -1s; --w: 33px; --o: 1.0; }
.season-sky i:nth-child(26) { --x: 36.8%; --s: 11px; --d: 19s; --t: 0s; --w: 34px; --o: 0.83; }
.season-sky i:nth-child(27) { --x: 38.5%; --s: 11px; --d: 18s; --t: -17s; --w: 21px; --o: 0.91; }
.season-sky i:nth-child(28) { --x: 39.3%; --s: 10px; --d: 14s; --t: -1s; --w: 6px; --o: 0.82; }
.season-sky i:nth-child(29) { --x: 40.6%; --s: 8px; --d: 20s; --t: -22s; --w: 32px; --o: 0.92; }
.season-sky i:nth-child(30) { --x: 42.5%; --s: 11px; --d: 18s; --t: -8s; --w: -27px; --o: 0.85; }
.season-sky i:nth-child(31) { --x: 43.5%; --s: 7px; --d: 16s; --t: -4s; --w: -18px; --o: 0.8; }
.season-sky i:nth-child(32) { --x: 45.2%; --s: 10px; --d: 16s; --t: 0s; --w: -2px; --o: 0.93; }
.season-sky i:nth-child(33) { --x: 46.4%; --s: 7px; --d: 19s; --t: -21s; --w: 4px; --o: 0.87; }
.season-sky i:nth-child(34) { --x: 47.5%; --s: 10px; --d: 12s; --t: -19s; --w: 19px; --o: 0.8; }
.season-sky i:nth-child(35) { --x: 49.1%; --s: 10px; --d: 18s; --t: -16s; --w: -19px; --o: 0.92; }
.season-sky i:nth-child(36) { --x: 51.1%; --s: 8px; --d: 14s; --t: -18s; --w: 14px; --o: 0.94; }
.season-sky i:nth-child(37) { --x: 52.5%; --s: 10px; --d: 15s; --t: -18s; --w: -7px; --o: 0.83; }
.season-sky i:nth-child(38) { --x: 53.4%; --s: 8px; --d: 16s; --t: -5s; --w: 35px; --o: 1.0; }
.season-sky i:nth-child(39) { --x: 54.9%; --s: 11px; --d: 19s; --t: -17s; --w: -9px; --o: 0.8; }
.season-sky i:nth-child(40) { --x: 55.9%; --s: 11px; --d: 14s; --t: -11s; --w: -24px; --o: 0.78; }
.season-sky i:nth-child(41) { --x: 57.4%; --s: 8px; --d: 12s; --t: -16s; --w: 32px; --o: 0.83; }
.season-sky i:nth-child(42) { --x: 59.0%; --s: 10px; --d: 22s; --t: -4s; --w: 39px; --o: 0.85; }
.season-sky i:nth-child(43) { --x: 60.2%; --s: 8px; --d: 22s; --t: -18s; --w: 43px; --o: 0.86; }
.season-sky i:nth-child(44) { --x: 62.4%; --s: 8px; --d: 20s; --t: -6s; --w: 22px; --o: 0.91; }
.season-sky i:nth-child(45) { --x: 63.4%; --s: 11px; --d: 13s; --t: -17s; --w: -14px; --o: 0.89; }
.season-sky i:nth-child(46) { --x: 64.5%; --s: 10px; --d: 21s; --t: -17s; --w: 23px; --o: 0.83; }
.season-sky i:nth-child(47) { --x: 66.8%; --s: 8px; --d: 15s; --t: -14s; --w: -16px; --o: 1.0; }
.season-sky i:nth-child(48) { --x: 67.9%; --s: 10px; --d: 19s; --t: -21s; --w: -26px; --o: 0.91; }
.season-sky i:nth-child(49) { --x: 69.4%; --s: 11px; --d: 19s; --t: -10s; --w: 33px; --o: 0.82; }
.season-sky i:nth-child(50) { --x: 70.1%; --s: 7px; --d: 15s; --t: -20s; --w: 10px; --o: 0.78; }
.season-sky i:nth-child(51) { --x: 72.8%; --s: 11px; --d: 14s; --t: -8s; --w: 36px; --o: 0.83; }
.season-sky i:nth-child(52) { --x: 74.2%; --s: 8px; --d: 15s; --t: -15s; --w: 34px; --o: 0.86; }
.season-sky i:nth-child(53) { --x: 74.7%; --s: 6px; --d: 22s; --t: -9s; --w: 41px; --o: 0.89; }
.season-sky i:nth-child(54) { --x: 76.8%; --s: 9px; --d: 16s; --t: -22s; --w: -36px; --o: 0.8; }
.season-sky i:nth-child(55) { --x: 78.5%; --s: 8px; --d: 19s; --t: -7s; --w: -27px; --o: 0.85; }
.season-sky i:nth-child(56) { --x: 78.6%; --s: 11px; --d: 17s; --t: -4s; --w: 14px; --o: 0.95; }
.season-sky i:nth-child(57) { --x: 81.4%; --s: 8px; --d: 21s; --t: -12s; --w: -30px; --o: 0.84; }
.season-sky i:nth-child(58) { --x: 82.8%; --s: 8px; --d: 21s; --t: -14s; --w: -23px; --o: 0.92; }
.season-sky i:nth-child(59) { --x: 83.3%; --s: 8px; --d: 22s; --t: -20s; --w: -21px; --o: 0.86; }
.season-sky i:nth-child(60) { --x: 84.7%; --s: 10px; --d: 12s; --t: -4s; --w: 36px; --o: 0.92; }
.season-sky i:nth-child(61) { --x: 87.0%; --s: 6px; --d: 18s; --t: -3s; --w: 13px; --o: 0.86; }
.season-sky i:nth-child(62) { --x: 87.3%; --s: 8px; --d: 20s; --t: -18s; --w: -29px; --o: 0.88; }
.season-sky i:nth-child(63) { --x: 89.9%; --s: 8px; --d: 14s; --t: -3s; --w: 33px; --o: 0.81; }
.season-sky i:nth-child(64) { --x: 90.6%; --s: 9px; --d: 18s; --t: -15s; --w: -22px; --o: 0.81; }
.season-sky i:nth-child(65) { --x: 92.1%; --s: 10px; --d: 21s; --t: -2s; --w: 10px; --o: 0.84; }
.season-sky i:nth-child(66) { --x: 93.6%; --s: 11px; --d: 22s; --t: -10s; --w: -3px; --o: 0.87; }
.season-sky i:nth-child(67) { --x: 94.4%; --s: 8px; --d: 14s; --t: -8s; --w: -36px; --o: 0.94; }
.season-sky i:nth-child(68) { --x: 95.7%; --s: 11px; --d: 14s; --t: -20s; --w: -42px; --o: 0.93; }
.season-sky i:nth-child(69) { --x: 97.3%; --s: 11px; --d: 16s; --t: 0s; --w: -5px; --o: 1.0; }
.season-sky i:nth-child(70) { --x: 99.7%; --s: 10px; --d: 21s; --t: -11s; --w: -15px; --o: 0.99; }
