/* Time-of-day sky. Colors and dimming come from CSS variables set by sky.js. */
.sky { background: linear-gradient(var(--sky-top, #6FB4EA) 0%, var(--sky-mid, #A9D6F5) 55%, var(--sky-bot, #DDF0FB) 100%); }
.sky .cloud, .sky .cloud::before, .sky .cloud::after { background: var(--cloud, #fff); }
.sky .cloud { opacity: var(--cloud-op, .75); }
.sky .cloud.c3 { opacity: calc(var(--cloud-op, .75) * .7); }
.far:not(.far-lit), .street { filter: var(--scene-filter, none); }
#walkers { filter: var(--walker-fx, none); }
.far-lit { opacity: var(--lit2, 0); pointer-events:none; transition: opacity 1.2s ease; }
/* Buildings dim through their base art only, so the lit-window overlays stay at full warmth. */
#mid .item > img:not(.lit), #front .item > img:not(.lit) { filter: var(--scene-fx, none); }
#mid .bld.locked > img:not(.lit), #front .bld.locked > img:not(.lit) { filter: var(--scene-fx, none) saturate(.55) brightness(.92); }
.sky-body { position: absolute; border-radius: 50%; pointer-events: none; }
.sky-sun { width: calc(var(--P) * .7); height: calc(var(--P) * .7); background: #FFF3C4;
  box-shadow: 0 0 0 calc(var(--P) * .14) rgba(255, 240, 190, .32), 0 0 calc(var(--P) * .9) calc(var(--P) * .25) rgba(255, 226, 150, .35);
  opacity: var(--sun-op, 0); }
.sky-moon { width: calc(var(--P) * .55); height: calc(var(--P) * .55); background: #F4F1E4;
  box-shadow: inset calc(var(--P) * -.09) calc(var(--P) * -.05) 0 rgba(150, 160, 190, .35), 0 0 calc(var(--P) * .6) calc(var(--P) * .12) rgba(210, 220, 255, .25);
  opacity: var(--moon-op, 0); }
.sky-stars { position: absolute; inset: 0 0 38% 0; pointer-events: none; opacity: var(--stars, 0); }
.sky-stars i { position: absolute; width: calc(var(--P) * .035); height: calc(var(--P) * .035); min-width: 2px; min-height: 2px; background: #FFF; border-radius: 50%; }

/* Night lights. Overlays are brightened by 1/dim so the scene dimming doesn't mute them. */
.item > img.lit { position: absolute; left: 0; top: 0; opacity: var(--lit2, 0); pointer-events: none; transition: opacity 1.2s ease; }
.lamp-glow, .lamp-pool { position: absolute; pointer-events: none; opacity: var(--lit, 0); }
.bld.locked > img.lit { filter: saturate(.8); }
.lamp-glow { left: 50%; top: 15.5%; width: calc(var(--P) * .75); height: calc(var(--P) * .75); transform: translate(-50%, -50%); mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 236, 170, .95) 0%, rgba(255, 214, 120, .6) 16%, rgba(255, 196, 90, .22) 38%, rgba(255, 196, 90, 0) 60%); }
.lamp-pool { left: 50%; bottom: calc(var(--P) * -.06); width: calc(var(--P) * 1.7); height: calc(var(--P) * .2); transform: translateX(-50%); mix-blend-mode: screen;
  background: radial-gradient(ellipse, rgba(255, 214, 125, .5) 0%, rgba(255, 200, 105, .3) 48%, rgba(255, 200, 105, 0) 66%); }
/* The lamp is the day/night switch. */
.item[data-id="lamp"] { pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.item[data-id="lamp"]::before { content: ""; position: absolute; left: -60%; right: -60%; top: 0; bottom: 0; }
.item[data-id="lamp"]:focus-visible { outline: 3px solid #FFD36B; outline-offset: 4px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { .item > img.lit { transition: none; } }
.item > img.lit.day { opacity: calc(1 - var(--lit2, 0)); }

/* Warm spill from lit buildings and lamps across the street, lifting this side of the block at night. */
.block-glow { pointer-events: none; mix-blend-mode: soft-light; opacity: var(--lit, 0); transition: opacity 1.2s ease;
  background: linear-gradient(to top, rgba(255, 170, 50, .72) 0%, rgba(255, 170, 50, .4) 30%, rgba(255, 170, 50, .13) 62%, rgba(255, 170, 50, 0) 90%); }

/* Post office tunnel: painted passage behind the see-through archway. */
/* DOM order does the layering: the passage comes first, so the (positioned) base art paints over it. No stacking context here, so walkers and the street strip order against the whole building as usual. */
.item.has-tunnel > img:not(.lit) { position: relative; }
.tunnel { position: absolute; display: block; pointer-events: none; overflow: hidden; }
.tunnel img { filter: var(--scene-fx, none); }
.tunnel img { position: absolute; left: 0; top: 0; }
.tunnel img.tn { opacity: var(--lit2, 0); transition: opacity 1.2s ease; }
.tglow { position: absolute; left: 50%; top: 33.5%; width: 100%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; mix-blend-mode: screen; pointer-events: none; opacity: var(--lit2, 0);
  background: radial-gradient(circle, rgba(255, 236, 170, .95) 0%, rgba(255, 214, 120, .6) 12%, rgba(255, 196, 90, .22) 30%, rgba(255, 196, 90, 0) 55%); transition: opacity 1.2s ease; }

/* Lights-on switch (class set by sky.js): window lights, decal and tunnel change over a few seconds instead of following the slow sunset. */
.item > img.lit.day { opacity: 1; transition: opacity 3s ease; }
.item > img.lit.night { opacity: 0; transition: opacity 3s ease; }
html.lights-on .item > img.lit.day { opacity: 0; }
html.lights-on .item > img.lit.night { opacity: 1; }
.decor .decal-day { opacity: 1; transition: opacity 3s ease; }
.decor .decal-night { opacity: 0; transition: opacity 3s ease; }
.decor .dglow { opacity: 0; transition: opacity 3s ease; }
html.lights-on .decor .decal-day { opacity: 0; }
html.lights-on .decor .decal-night { opacity: 1; }
html.lights-on .decor .dglow { opacity: 1; }
.tunnel img.tn { opacity: 0; transition: opacity 3s ease; }
.tglow { opacity: 0; transition: opacity 3s ease; }
html.lights-on .tunnel img.tn { opacity: 1; }
html.lights-on .tglow { opacity: 1; }
html.folk-init .item > img.lit, html.folk-init .decor .decal-day, html.folk-init .decor .decal-night, html.folk-init .decor .dglow, html.folk-init .tunnel img.tn, html.folk-init .tglow { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .item > img.lit, .decor .decal-day, .decor .decal-night, .decor .dglow, .tunnel img.tn, .tglow { transition: none; } }

/* Sign lettering on the post office plaque. */
.psign { position: absolute; pointer-events: none; overflow: visible; filter: var(--scene-fx, none); }
.psign text { font-family: var(--font-headline, "Bevan", serif); font-size: 31px; letter-spacing: 2.4px; fill: #F3E7C6; transition: fill 3s ease; }
html.lights-on .psign { filter: drop-shadow(0 0 2px rgba(255, 222, 89, .55)); }
html.lights-on .psign text { fill: #FFDE59; }
html.folk-init .psign text { transition: none !important; }
/* About park: "About" lettering on the little blank wooden sign by the gate (dark brown, no night glow). */
.item[data-id="park"] .psign text { font-size: 19px; letter-spacing: 1.2px; fill: #4A2F1B; }
html.lights-on .item[data-id="park"] .psign { filter: none; }
html.lights-on .item[data-id="park"] .psign text { fill: #4A2F1B; }
