/* ==========================================================================
   Places of levels 3-4 + time of day. Loaded after visuals.css.
   - A room whose id has its own .scene block in index.html shows that block
     (app.js showRoom); other rooms keep their shared scene.
   - #house[data-mood] = morning | day | golden | sunset | night, from the
     lesson's position in its room (app.js setMood): the day passes as the
     child moves through a room's five doors.
   Art: assets/scene/*.svg. Only transform/opacity/filter animate.
   ========================================================================== */

.scene[data-room="kitchen"] > *, .scene[data-room="school"] > *, .scene[data-room="park"] > *,
.scene[data-room="jungle"] > *, .scene[data-room="lake"] > *, .scene[data-room="night"] > *,
.scene[data-room="mountain"] > *, .scene[data-room="oasis"] > *, .scene[data-room="harbor"] > *,
.scene[data-room="library"] > *,
.k-counter > span, .p-ferris > span, .j-falls > span, .lk-water > span, .mt-cable > span, .h-light > span { position: absolute; }
/* art defaults at zero specificity, so a part's own background shorthand always wins */
:where(.scene[data-room="kitchen"], .scene[data-room="school"], .scene[data-room="park"],
.scene[data-room="jungle"], .scene[data-room="lake"], .scene[data-room="night"],
.scene[data-room="mountain"], .scene[data-room="oasis"], .scene[data-room="harbor"],
.scene[data-room="library"]) > * {
  background-position: center bottom;
  background-size: contain;
  background-repeat: no-repeat;
}
:where(.k-counter, .p-ferris, .j-falls, .lk-water, .mt-cable, .h-light) > span {
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}
.room--park::before, .room--jungle::before, .room--lake::before, .room--night::before,
.room--mountain::before, .room--oasis::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  background-position: left bottom;
  background-size: auto 100%;
  background-repeat: repeat-x;
}

/* ---------- Kitchen: mint tiles, window, shelf, counter with a steaming pot, fridge ---------- */
.room--kitchen {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .6) .3vmin, transparent .3vmin) 0 0 / 9vmin 9vmin,
    linear-gradient(rgba(255, 255, 255, .6) .3vmin, transparent .3vmin) 0 0 / 9vmin 9vmin,
    linear-gradient(#c6efe3, #a9e3d3);
}
.k-window { left: 50%; top: 3vmin; width: 32vmin; height: 27vmin; translate: -50% 0; background-image: url("../assets/scene/k-window.svg"); }
.k-shelf { left: 3vmin; top: 27%; width: 26vmin; height: 17vmin; background-image: url("../assets/scene/k-shelf.svg"); }
.k-floor {
  left: 0; right: 0; bottom: 0; height: 26%;
  background: repeating-conic-gradient(#fff 0 25%, #ffd6ae 0 50%) 0 0 / 12vmin 12vmin;
  border-top: 1vmin solid #e8b98c;
}
.k-counter {
  left: 0; right: 0; bottom: 26%; height: 20vmin;
  background: url("../assets/scene/k-counter.svg") left bottom / auto 100% repeat-x;
}
.k-pot { left: 6%; bottom: calc(100% - 2.6vmin); width: 17vmin; height: 12vmin; background-image: url("../assets/scene/k-pot.svg"); }
.k-steam {
  left: calc(6% + 4vmin); bottom: calc(100% + 8vmin); width: 9vmin; height: 12vmin;
  background:
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, .85) 0 1.6vmin, transparent 1.8vmin),
    radial-gradient(circle at 35% 45%, rgba(255, 255, 255, .65) 0 2vmin, transparent 2.2vmin),
    radial-gradient(circle at 65% 14%, rgba(255, 255, 255, .45) 0 2.2vmin, transparent 2.4vmin) !important;
  animation: steam 2.6s ease-in-out infinite;
}
@keyframes steam {
  0%   { opacity: 0; translate: 0 2vmin; scale: .8; }
  40%  { opacity: 1; }
  100% { opacity: 0; translate: 1vmin -4vmin; scale: 1.15; }
}
.k-bowl { right: 28%; bottom: calc(100% - 2.6vmin); width: 18vmin; height: 10vmin; background-image: url("../assets/scene/k-bowl.svg"); }
.k-fridge { right: 3vmin; bottom: 24%; width: 22vmin; height: 48vmin; background-image: url("../assets/scene/k-fridge.svg"); }
.room--kitchen .door-frame { fill: #ff8a65; }
.room--kitchen .door-leaf  { fill: #fff3e0; }

/* ---------- School: bunting, blackboard with chalk drawings, desks ---------- */
.room--school { background: linear-gradient(#fff5dc, #ffe8bb); }
.s-bunting { left: 0; right: 0; top: 0; height: 9vmin; background: url("../assets/scene/s-bunting.svg") left top / auto 100% repeat-x !important; }
.s-board { left: 50%; top: 8vmin; width: 58vmin; height: 31vmin; translate: -50% 0; background-image: url("../assets/scene/s-board.svg"); background-position: center top !important; }
.s-wainscot {
  left: 0; right: 0; bottom: 26%; height: 16vmin;
  background: repeating-linear-gradient(90deg, #f2cd8e 0 10vmin, #e9c07e 10vmin 10.4vmin) !important;
  border-top: 1.4vmin solid #d9a560;
}
.s-floor {
  left: 0; right: 0; bottom: 0; height: 26%;
  background: repeating-linear-gradient(90deg, #d8a56c 0 16vmin, #c9955a 16vmin 16.5vmin) !important;
  border-top: 1vmin solid #b88349;
}
.s-desk { left: 2vmin; bottom: 11%; width: 30vmin; height: 22vmin; background-image: url("../assets/scene/s-desk.svg"); }
.s-desk--2 { left: auto; right: 2vmin; transform: scaleX(-1); }
.s-bag { width: 11vmin; left: 34vmin; bottom: 7%; }
.room--school .door-frame { fill: #42a5f5; }
.room--school .door-leaf  { fill: #ffe082; }

/* ---------- Amusement park: turning Ferris wheel, tent, lights, balloons ---------- */
.room--park { background: linear-gradient(#a3dcff, #ffe3f1 70%); }
.room--park::before { bottom: 30%; height: 20%; background-image: url("../assets/scene/p-coaster.svg"); }
.p-ferris { left: -4vmin; bottom: 25%; width: 46vmin; height: 50.6vmin; background-image: url("../assets/scene/p-stand.svg"); }
.p-wheel { left: 0; top: 0; width: 100%; aspect-ratio: 1; background-image: url("../assets/scene/p-wheel.svg"); animation: spin 26s linear infinite; }
.p-tent { right: 2vmin; bottom: 25%; width: 30vmin; height: 31vmin; background-image: url("../assets/scene/p-tent.svg"); }
.p-grass {
  left: 0; right: 0; bottom: 0; height: 28%;
  background: repeating-linear-gradient(100deg, rgba(255, 255, 255, .09) 0 7vmin, transparent 7vmin 14vmin), #8edb72 !important;
  border-top: 1.5vmin solid #6cc257;
  border-radius: 50% 50% 0 0 / 5vmin 5vmin 0 0;
}
.p-lights { left: 0; right: 0; top: 0; height: 7vmin; background: url("../assets/scene/p-lights.svg") left top / auto 100% repeat-x !important; animation: twinkle 1.6s steps(2) infinite; }
.p-balloon { width: 10vmin; left: 30%; bottom: 38%; animation: balloon 10s ease-in-out infinite; }
.p-balloon--2 { left: 66%; width: 8vmin; animation-delay: -5s; filter: hue-rotate(150deg); }
@keyframes balloon {
  0%   { translate: 0 0; opacity: 0; }
  10%, 85% { opacity: 1; }
  100% { translate: 4vmin -55vh; opacity: 0; }
}
.room--park .door-frame { fill: #ff7aa8; }
.room--park .door-leaf  { fill: #fff8fb; }

/* ---------- Jungle: deep greens, waterfall, vines, big leaves, animals ---------- */
.room--jungle { background: linear-gradient(#7fd6a6, #c8f0cf 60%); }
.room--jungle::before { bottom: 26%; height: 30%; background-image: url("../assets/scene/j-far.svg"); }
.j-falls { left: 58%; bottom: 27%; width: 20vmin; height: 30vmin; background-image: url("../assets/scene/j-falls.svg"); }
.j-water {
  left: 35%; width: 30%; top: 15%; bottom: 0;
  background: repeating-linear-gradient(rgba(255, 255, 255, .75) 0 1.2vmin, transparent 1.2vmin 4vmin) 0 0 / 100% 4vmin !important;
  animation: falls .7s linear infinite;
}
@keyframes falls { to { background-position: 0 4vmin; } }
.j-ground {
  left: 0; right: 0; bottom: 0; height: 28%;
  background: radial-gradient(circle, rgba(20, 70, 30, .25) 0 .8vmin, transparent .9vmin) 0 0 / 7vmin 6vmin, #3f9b55 !important;
  border-top: 1.5vmin solid #338447;
  border-radius: 40% 60% 0 0 / 5vmin 5vmin 0 0;
}
.j-vines { left: 0; right: 0; top: 0; height: 26vmin; background: url("../assets/scene/j-vines.svg") left top / auto 100% repeat-x !important; transform-origin: top; animation: vine 5s ease-in-out infinite; }
@keyframes vine { 50% { transform: skewX(3deg); } }
.j-sloth { width: 13vmin; left: 34%; top: 11vmin; transform-origin: 50% 0; animation: sway 6s ease-in-out infinite; }
.j-parrot { width: 11vmin; left: 3%; top: 57%; animation: bob 3s ease-in-out infinite; }
.j-leaf { left: -5vmin; bottom: -3vmin; width: 36vmin; height: 36vmin; background-image: url("../assets/scene/j-leaf.svg"); transform-origin: 0 100%; animation: leaf 6s ease-in-out infinite; }
.j-leaf--r { left: auto; right: -5vmin; transform: scaleX(-1); animation-delay: -3s; }
@keyframes leaf { 50% { rotate: 2.5deg; } }
.j-frog { width: 9vmin; left: 26%; bottom: 7%; animation: hop 3.2s ease-in-out infinite; }
.room--jungle .door-frame { fill: #4e342e; }
.room--jungle .door-leaf  { fill: #8bc34a; }

/* ---------- Lake: hills far away, calm water, lily pads, swan, duck, dock, reeds ---------- */
.room--lake { background: linear-gradient(#a7dcff, #e8f7ff 55%); }
.room--lake::before { bottom: 44%; height: 20%; background-image: url("../assets/scene/lk-far.svg"); }
.lk-water {
  left: 0; right: 0; bottom: 22%; height: 24%;
  background: linear-gradient(#86d0f2, #4fb0e0) !important;
  overflow: hidden;
}
.lk-water::before {   /* glitter */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1.6vmin .4vmin, #fff 55%, transparent 70%) 0 0 / 14vmin 6vmin,
    radial-gradient(1vmin .3vmin, #fff 55%, transparent 70%) 7vmin 3vmin / 11vmin 8vmin;
  opacity: .7;
  animation: twinkle 3s ease-in-out infinite;
}
.lk-pad { left: 10%; top: 56%; width: 10vmin; height: 3.8vmin; border-radius: 50%; background: conic-gradient(from 30deg, transparent 0 28deg, #5cb85c 28deg) !important; }
.lk-pad::after { content: ""; position: absolute; left: 55%; top: -1vmin; width: 2.6vmin; height: 2.6vmin; border-radius: 50%; background: #ff9fc0; box-shadow: inset 0 -.6vmin 0 #ff7aa8; }
.lk-pad--2 { left: 74%; top: 74%; width: 7vmin; height: 2.8vmin; }
.lk-pad--2::after { display: none; }
.lk-swan { width: 14vmin; left: 18%; bottom: 33%; animation: bob 4s ease-in-out infinite; }
.lk-duck { width: 9vmin; right: -12vmin; bottom: 27%; animation: swim 28s linear infinite; }
.lk-dock { right: -2vmin; bottom: 18%; width: 46vmin; height: 21vmin; background-image: url("../assets/scene/lk-dock.svg"); }
.lk-shore {
  left: 0; right: 0; bottom: 0; height: 23%;
  background: #8fd47a !important;
  border-top: 1.5vmin solid #79c463;
  border-radius: 50% 50% 0 0 / 4vmin 4vmin 0 0;
}
.lk-canoe { width: 16vmin; right: 12%; bottom: 23%; animation: bob 3.4s ease-in-out infinite; }
.lk-reeds { left: 1vmin; bottom: 17%; width: 22vmin; height: 20vmin; background-image: url("../assets/scene/lk-reeds.svg"); transform-origin: 50% 100%; animation: kelp 5s ease-in-out infinite; }
.lk-reeds--2 { left: auto; right: 34%; width: 13vmin; height: 12vmin; bottom: 19%; animation-delay: -2s; }
.room--lake .door-frame { fill: #5d4037; }
.room--lake .door-leaf  { fill: #a5d6a7; }

/* ---------- Night: sleepy moon, stars, a town with lit windows, tent and campfire, fireflies ---------- */
.room--night { background: radial-gradient(circle at 75% 15%, #4a5db0, #232d66 55%, #161d47); }
.room--night::before { bottom: 22%; height: 28%; background-image: url("../assets/scene/n-town.svg"); }
.n-stars {
  inset: 0 0 40% 0;
  background:
    radial-gradient(circle, #fff 0 .35vmin, transparent .45vmin) 0 0 / 11vmin 9vmin,
    radial-gradient(circle, #fff7c2 0 .55vmin, transparent .65vmin) 5vmin 4vmin / 17vmin 13vmin !important;
  animation: twinkle 2.4s ease-in-out infinite;
}
.n-moon { left: calc(50% - 9vmin); top: 3vmin; width: 18vmin; height: 18vmin; background-image: url("../assets/scene/n-moon.svg"); animation: float 6s ease-in-out infinite; }
.n-ground {
  left: 0; right: 0; bottom: 0; height: 24%;
  background: #1f5146 !important;
  border-top: 1.5vmin solid #1a463c;
  border-radius: 50% 50% 0 0 / 5vmin 5vmin 0 0;
}
.n-tent { width: 22vmin; right: 4vmin; bottom: 15%; }
.n-fire { left: 5vmin; bottom: 9%; width: 13vmin; height: 13vmin; background-image: url("../assets/scene/n-fire.svg"); transform-origin: 50% 100%; animation: flicker .45s ease-in-out infinite alternate; }
.n-fire::before { content: ""; position: absolute; inset: -60%; border-radius: 50%; background: radial-gradient(rgba(255, 170, 80, .35), transparent 65%); }
@keyframes flicker { to { transform: scale(1.05, .95); } }
.n-flies {
  inset: 30% 0 8% 0;
  background:
    radial-gradient(circle, rgba(230, 255, 140, .95) 0 .45vmin, rgba(230, 255, 140, .25) .9vmin, transparent 1.3vmin) 0 0 / 19vmin 15vmin,
    radial-gradient(circle, rgba(230, 255, 140, .8) 0 .35vmin, rgba(230, 255, 140, .2) .8vmin, transparent 1.1vmin) 9vmin 7vmin / 15vmin 19vmin !important;
  animation: twinkle 1.8s ease-in-out infinite, drift 10s ease-in-out infinite alternate;
}
.room--night .door-frame { fill: #283593; }
.room--night .door-leaf  { fill: #5c6bc0; }
.room--night .door-window { fill: #ffe98a; }

/* ---------- Mountain: big peaks with a flag, alpine hills, cable car, eagle, goat ---------- */
.room--mountain { background: linear-gradient(#8ccfff, #e6f5ff 60%); }
.room--mountain::before { bottom: 30%; height: 36%; background-image: url("../assets/scene/mt-far.svg"); }
.mt-eagle { width: 12vmin; top: 24%; left: -14vmin; animation: fly 26s linear infinite; }
.mt-cable {
  left: 0; right: 0; top: 9%; height: 16%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0L100 100' stroke='%23455a64' stroke-width='1.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat !important;
}
.mt-car { width: 9vmin; height: 11.6vmin; translate: -50% 0; background-image: url("../assets/scene/mt-gondola.svg"); animation: cable 20s linear infinite alternate; }
@keyframes cable { from { left: 4%; top: 4%; } to { left: 96%; top: 96%; } }
.mt-alp { left: 0; right: 0; bottom: 24%; height: 20%; background: url("../assets/scene/mt-alp.svg") left bottom / auto 100% repeat-x !important; }
.mt-meadow {
  left: 0; right: 0; bottom: 0; height: 26%;
  background:
    radial-gradient(circle, #fff 0 .5vmin, transparent .6vmin) 0 0 / 9vmin 7vmin,
    radial-gradient(circle, #ffd84d 0 .5vmin, transparent .6vmin) 4vmin 3vmin / 11vmin 9vmin,
    #8bd06f !important;
  border-top: 1.5vmin solid #74bd5a;
  border-radius: 40% 60% 0 0 / 5vmin 5vmin 0 0;
}
.mt-rock { right: 3vmin; bottom: 17%; width: 26vmin; height: 15vmin; background-image: url("../assets/scene/mt-rock.svg"); }
.mt-goat { width: 13vmin; right: 8vmin; bottom: calc(17% + 11vmin); }
.room--mountain .door-frame { fill: #6d4c41; }
.room--mountain .door-leaf  { fill: #d7ccc8; }

/* ---------- Oasis: far dunes, a pool ringed with grass, palms, tent, camel ---------- */
.room--oasis { background: linear-gradient(#ffd9a0, #fff3dc 60%); }
.room--oasis::before { bottom: 30%; height: 16%; background-image: url("../assets/scene/o-far.svg"); }
.o-sand {
  left: 0; right: 0; bottom: 0; height: 34%;
  background: repeating-linear-gradient(170deg, transparent 0 5vmin, rgba(201, 140, 60, .2) 5vmin 5.6vmin), #f6d08f !important;
  border-radius: 60% 40% 0 0 / 5vmin 5vmin 0 0;
}
.o-pool {
  left: 50%; bottom: 16%; width: min(110vmin, 92vw); height: 15vmin;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #9ae6ff, #3fb0e0 70%) !important;
  box-shadow: 0 0 0 2vmin #7ccf6a, 0 0 0 3.4vmin #5fb84d;
  overflow: hidden;
}
.o-pool::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(1.6vmin .4vmin, #fff 55%, transparent 70%) 0 0 / 13vmin 5vmin;
  opacity: .75;
  animation: twinkle 2.8s ease-in-out infinite;
}
.o-palm { width: 26vmin; left: 0; bottom: 24%; transform-origin: 50% 100%; animation: sway 7s ease-in-out infinite; }
.o-palm--2 { left: 17vmin; width: 18vmin; bottom: 28%; animation-delay: -2s; }
.o-palm--3 { left: auto; right: 1vmin; width: 24vmin; bottom: 20%; animation-delay: -4s; }
.o-reeds { left: 28%; right: auto; bottom: calc(16% + 9vmin); width: 13vmin; height: 11vmin; }
.o-tent { width: 21vmin; right: 22vmin; bottom: 32%; }
.o-camel { width: 18vmin; left: 3vmin; bottom: 5%; }
.room--oasis .door-frame { fill: #c4844a; }
.room--oasis .door-leaf  { fill: #ffe0b2; }

/* ---------- Harbor: sea with waves, ship on the horizon, lighthouse with a sweeping beam,
              crane and containers, wooden pier ---------- */
.room--harbor { background: linear-gradient(#8fd6ff, #e2f5ff 55%); }
.h-sea { left: 0; right: 0; bottom: 22%; height: 26%; background: linear-gradient(#45b0e2, #2a8ac2) !important; overflow: hidden; }
.h-ship { width: 20vmin; right: -22vmin; bottom: 41%; animation: swim 70s linear infinite -20s; }
.h-boat { width: 13vmin; left: 36%; bottom: 28%; animation: bob 3s ease-in-out infinite; }
.h-light { left: 2vmin; bottom: 23%; width: 18vmin; height: 41vmin; background-image: url("../assets/scene/h-lighthouse.svg"); }
.h-beam {
  left: 50%; top: 20.6%; width: 70vmin; height: 12vmin;
  translate: 0 -50%;
  background: linear-gradient(90deg, rgba(255, 245, 160, .75), rgba(255, 245, 160, 0)) !important;
  clip-path: polygon(0 45%, 100% 0, 100% 100%, 0 55%);
  transform-origin: 0 50%;
  animation: beam 4s ease-in-out infinite alternate;
}
@keyframes beam { from { rotate: -16deg; } to { rotate: 8deg; } }
.h-crane { right: 2vmin; bottom: 23%; width: 30vmin; height: 30vmin; background-image: url("../assets/scene/h-crane.svg"); }
.h-pier {
  left: 0; right: 0; bottom: 0; height: 23%;
  background: repeating-linear-gradient(90deg, #c08a55 0 9vmin, #a8743f 9vmin 9.5vmin) !important;
  border-top: 2vmin solid #8d5a3b;
}
.h-bollard { left: 5vmin; bottom: 13%; width: 15vmin; height: 10vmin; background-image: url("../assets/scene/h-bollard.svg"); }
.room--harbor .door-frame { fill: #1565c0; }
.room--harbor .door-leaf  { fill: #e3f2fd; }

/* ---------- Library: shelves of books, lamp, globe, armchair, a floating book ---------- */
.room--library { background: linear-gradient(#f3dcc0, #e9c9a3); }
.lb-shelves { left: 0; right: 0; bottom: 24%; height: 62%; opacity: .72; background: url("../assets/scene/lb-shelves.svg") center bottom / auto 100% repeat-x !important; }
.lb-floor { height: 25%; }
.lb-floor::after { content: none; }
.lb-rug { background: radial-gradient(ellipse, #c5e1a5 0 40%, #9ccc65 40% 55%, #fff59d 55% 62%, #81c784 62% 100%) !important; }
.lb-globe { left: 4vmin; bottom: 17%; width: 15vmin; height: 21vmin; background-image: url("../assets/scene/lb-globe.svg"); }
.lb-chair { right: 3vmin; bottom: 9%; width: 30vmin; height: 25vmin; background-image: url("../assets/scene/lb-chair.svg"); }
.lb-book { width: 12vmin; left: 24%; bottom: 31%; animation: float 4s ease-in-out infinite; }
.room--library .door-frame { fill: #6d4128; }
.room--library .door-leaf  { fill: #c98d5a; }

@media (orientation: landscape) {
  .k-bowl { right: auto; left: 72%; }
  .s-board { left: 38%; }
  .o-tent { right: 30vmin; }
  .lb-book { left: 14%; bottom: 40%; }
  .j-sloth { left: 22%; top: 6vmin; }
  .j-parrot { left: 30%; top: 34%; }
  .n-moon { left: 24vw; top: 6vmin; width: 22vmin; height: 22vmin; }
  .n-fire { left: 13vw; bottom: 7%; }
}

/* ==========================================================================
   Time of day. Outdoor places get a new sky and light; indoor places only
   light; the sea gets deeper; space and the night place stay as they are.
   ========================================================================== */
.scene > * { transition: filter .9s ease; }
.room:is(.room--garden, .room--beach, .room--farm, .room--forest, .room--snow, .room--desert, .room--city,
         .room--park, .room--jungle, .room--lake, .room--mountain, .room--oasis, .room--harbor) {
  --outdoor: 1;
}

/* morning: peach dawn, soft light */
.room[data-mood="morning"]:is(.room--garden, .room--beach, .room--farm, .room--forest, .room--snow, .room--desert, .room--city,
  .room--park, .room--jungle, .room--lake, .room--mountain, .room--oasis, .room--harbor) {
  background: linear-gradient(#ffd8c4, #ffeedd 35%, #e3f4ff 72%);
}
.room[data-mood="morning"] .scene > *, .room[data-mood="morning"]::before { filter: saturate(1.05) brightness(1.04) sepia(.06); }
.room[data-mood="morning"] .sun { top: 18%; }

/* golden afternoon */
.room[data-mood="golden"]:is(.room--garden, .room--beach, .room--farm, .room--forest, .room--snow, .room--desert, .room--city,
  .room--park, .room--jungle, .room--lake, .room--mountain, .room--oasis, .room--harbor) {
  background: linear-gradient(#9fd0f2, #ffe6b0 72%);
}
.room[data-mood="golden"] .scene > *, .room[data-mood="golden"]::before { filter: sepia(.18) saturate(1.2) brightness(1.02); }

/* sunset: the sun sinks behind the hills */
.room[data-mood="sunset"]:is(.room--garden, .room--beach, .room--farm, .room--forest, .room--snow, .room--desert, .room--city,
  .room--park, .room--jungle, .room--lake, .room--mountain, .room--oasis, .room--harbor) {
  background: linear-gradient(#5d4aa0, #e2719c 45%, #ffb56b 72%);
}
.room[data-mood="sunset"] .scene > *:not(.sun), .room[data-mood="sunset"]::before { filter: sepia(.25) saturate(1.25) hue-rotate(-12deg) brightness(.93); }
.room[data-mood="sunset"] .sun { top: auto; bottom: 40%; background: radial-gradient(circle at 45% 40%, #ffe7a8, #ff8a50 70%); box-shadow: 0 0 0 3vmin rgba(255, 140, 80, .3); }
.room[data-mood="sunset"] .sun::before { opacity: .4; }

/* night: dark sky, stars, the sun turns into a crescent moon */
.room[data-mood="night"]:is(.room--garden, .room--beach, .room--farm, .room--forest, .room--snow, .room--desert, .room--city,
  .room--park, .room--jungle, .room--lake, .room--mountain, .room--oasis, .room--harbor) {
  background: linear-gradient(#141b45, #2c3a7a 60%, #45539a);
}
.room[data-mood="night"] .scene > *:not(.sun), .room[data-mood="night"]::before { filter: brightness(.58) saturate(.75) hue-rotate(12deg); }
.room[data-mood="night"] .sun { background: transparent; box-shadow: inset -4.5vmin 2vmin 0 0 #fff3b0, 0 0 5vmin rgba(255, 243, 176, .25); }
.room[data-mood="night"] .sun::before { display: none; }
.room[data-mood="night"]:is(.room--garden, .room--beach, .room--farm, .room--forest, .room--snow, .room--desert, .room--city,
  .room--park, .room--jungle, .room--lake, .room--mountain, .room--oasis, .room--harbor)::after {
  content: "";
  position: absolute;
  inset: 0 0 45% 0;
  z-index: -1;           /* above the sky, below the whole scene */
  pointer-events: none;
  background:
    radial-gradient(circle, #fff 0 .35vmin, transparent .45vmin) 0 0 / 11vmin 9vmin,
    radial-gradient(circle, #fff7c2 0 .5vmin, transparent .6vmin) 5vmin 4vmin / 17vmin 13vmin;
  animation: twinkle 2.4s ease-in-out infinite;
}
.room[data-mood="night"] .door-window { fill: #ffe98a; }

/* Indoors and under the sea: only the light changes (a dim layer over the wall at night) */
.room[data-mood]:is(.room--home, .room--kitchen, .room--school, .room--library, .room--sea) .scene > * { filter: none; }
.room[data-mood="golden"]:is(.room--home, .room--kitchen, .room--school, .room--library) .scene > * { filter: sepia(.12) saturate(1.1); }
.room[data-mood="sunset"]:is(.room--home, .room--kitchen, .room--school, .room--library) .scene > * { filter: sepia(.22) saturate(1.1) brightness(.95); }
.room[data-mood="night"]:is(.room--home, .room--kitchen, .room--school, .room--library) .scene > * { filter: brightness(.78) saturate(.85); }
.room[data-mood="sunset"].room--sea .scene > * { filter: brightness(.88) hue-rotate(-8deg); }
.room[data-mood="night"].room--sea .scene > * { filter: brightness(.62) saturate(.8); }
.room[data-mood="night"]:is(.room--home, .room--kitchen, .room--school, .room--library, .room--sea)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(30, 30, 80, .32);
}
.room[data-mood="night"] .lamp::after { opacity: 1; scale: 1.3; }
.room[data-mood]:is(.room--home, .room--kitchen, .room--school, .room--library, .room--sea) .sun { filter: none; }

/* The places that are always night or in space ignore the time of day */
.room[data-mood]:is(.room--space, .room--night) .scene > *, .room[data-mood]:is(.room--space, .room--night)::before { filter: none; }

@media (prefers-reduced-motion: reduce) {
  .scene[data-room] > *, .scene[data-room] > * > span, .room[data-mood]::after { animation: none !important; }
  .scene > * { transition: none; }
}
