/* Background art lives behind the original scene controls and hit targets. */
body {
  background: radial-gradient(ellipse at 50% -20%, #fff9da, #ecfaff 60%, #def1df) !important;
  color: #24455a !important;
}

body > header {
  background: linear-gradient(#fffdf4, #fff0ce) !important;
  border-bottom-color: #dba86b !important;
}

.garage-world .scene { --painting: url("art/painted-garage.webp"); }
.driving-world .map { --painting: url("art/painted-driving.webp"); }
.episode-map { --painting: url("art/painted-episode-map.webp"); }
.garden-scene { --painting: url("art/painted-garden.webp"); }
.orchard-scene { --painting: url("art/painted-orchard.webp"); }
.post-scene { --painting: url("art/painted-post.webp"); }
body.bna-paint-forest .world { --painting: url("art/painted-forest.webp"); }
body.bna-paint-town .scene { --painting: url("art/painted-town.webp"); }
body.bna-paint-bridge .scene { --painting: url("art/painted-bridge.webp"); }
.complete .scene, .celebration .parade { --painting: url("art/painted-celebration.webp"); }

:is(.garage-world .scene, .driving-world .map, .episode-map, .garden-scene,
    .orchard-scene, .post-scene, body.bna-paint-forest .world, body.bna-paint-town .scene,
    body.bna-paint-bridge .scene, .complete .scene, .celebration .parade) {
  background-image: var(--painting) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border-color: #fff9e9 !important;
  box-shadow: 0 0 0 2px #b89362, 0 7px #ad8358, 0 18px 35px #2d52394d !important;
}

.garage-world .scene { background-position: left center !important; }
.driving-world .map, .episode-map { background-size: 100% 100% !important; }

/* Painted scenery replaces the earlier decorative CSS layers. */
.garage-world .scene > :is(.sun, .cloud, .hill, .road, .garage, .tree),
.driving-world .map > :is(.forest-art, .bridge-art, .town-art, .home-art),
.driving-world .map > .benny-ambient-sky .benny-cloud,
.driving-world .map > .benny-road-scenery .benny-scenery-tree,
.driving-world .map .benny-landmark:not(.landmark-chapel),
.episode-map .map-sky,
.garden-scene > :is(.sunshine, .cloud, .hills, .path),
.orchard-scene > :is(.sun, .cloud, .hill, .tree, .orchard-path),
.post-scene > :is(.sun, .cloud, .post-office) {
  display: none !important;
}

.episode-map::before, .episode-map::after,
.complete .scene.finale-illustrated::before,
.celebration .parade::before, .celebration .parade::after {
  content: none !important;
}

.episode-map .map-road {
  background: linear-gradient(#b88958, #edca86);
}

.garage-world .quest {
  background: linear-gradient(155deg, #fffbe9f7, #d7f3e7f5) !important;
}

.garage-world .shape, .episode-map .map-stop, .chapter-card {
  background: linear-gradient(160deg, #fffdf1, #ffe4ab);
  border-color: #fff7df;
  box-shadow: 0 0 0 2px #b47e4f, 0 6px #956b4d, 0 9px 13px #273f4738;
}

.chapter-card.completed {
  background: linear-gradient(160deg, #fbffdc, #d0eaa9);
}

.driving-world .place, .episode-map .benny-map-destination {
  min-height: 44px;
  background: linear-gradient(#fffcec, #ffe0a1);
  color: #29475c;
  box-shadow: 0 4px #976743, 0 7px 13px #20394254;
}

.painted-sprite > :not(.painted-sprite-image) {
  opacity: 0;
}

.painted-sprite-image {
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center bottom;
}

@media (prefers-reduced-motion: no-preference) {
  .benny-speaking .painted-sprite-image,
  .benny-moving .car .painted-sprite-image,
  .episode2-driving .painted-sprite-image {
    animation: painted-benny-bob .32s ease-in-out infinite alternate;
  }

  @keyframes painted-benny-bob {
    to { transform: translateY(-2%) scaleY(.98); }
  }
}

@media (max-width: 690px) {
  .garage-world .scene { background-position: 27% center !important; }
  .episode-map { background-size: auto 100% !important; }
  .episode-map .map-stop { border-width: 3px; }
}

.painted-foreground {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.roadside-character .painted-foreground {
  width: clamp(34px, 5vw, 54px);
  height: clamp(34px, 5vw, 54px);
}

.bna-paint-bridge .friend:has(.painted-foreground) {
  width: clamp(65px, 11vw, 118px);
  height: auto;
}

.bna-paint-bridge .friend .painted-foreground { height: auto; }
