/* ---------- Map of rooms (one travel sign opens it) ---------- */
.room-map { flex-wrap: wrap; gap: 3vmin; align-content: center; padding: 24px; }
.map-room {
  position: relative;
  width: clamp(72px, 17vmin, 104px);
  height: clamp(72px, 17vmin, 104px);
  padding: clamp(10px, 3vmin, 18px);   /* % would resolve against the modal */
  border: 5px solid var(--tier, #ffd84d);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 5px 0 rgba(74, 63, 122, .3);
}
.map-room img { display: block; width: 100%; height: 100%; pointer-events: none; }
.map-room.tier-1 { --tier: #7fd36b; }
.map-room.tier-2 { --tier: #6ec6ff; }
.map-room.tier-3 { --tier: #ffb347; }
.map-room.tier-4 { --tier: #b9a7ff; }
.map-room.is-here { animation: door-glow 1.6s ease-in-out infinite; box-shadow: 0 0 0 5px #fff, 0 5px 0 rgba(74, 63, 122, .3); }
.map-room.is-locked img { filter: grayscale(.85); opacity: .6; }
.map-room.is-locked::after,
.map-room.is-done::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #ffd84d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a5 5 0 0 0-5 5v1H6a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1h-1V7a5 5 0 0 0-5-5Z' fill='%23b89a10'/%3E%3Ccircle cx='12' cy='14' r='2.2' fill='%23fff'/%3E%3C/svg%3E") center / 62% no-repeat;
}
.map-room.is-done::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3 6.5 7 .8-5.2 4.8 1.4 7L12 17.6 5.8 21.1l1.4-7L2 9.3l7-.8Z' fill='%23fff' stroke='%23b89a10' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* The map sign has no arrow: it is a place, not a direction */
.door--map .travel-sign::after { display: none; }
.door--map .travel-sign { background: #fff6d8; }

/* A locked door is now a key quiz: a small key instead of the padlock look */
.door.is-locked .door-lock { fill: #ffd84d; }

@media (prefers-reduced-motion: reduce) {
  .map-room { animation: none !important; }
}

/* ---------- Scene: home (inside the house) ---------- */
.room--home { background: linear-gradient(#ffe9d2, #ffd9b8 62%); }
.wall-band {
  position: absolute;
  inset: auto 0 30% 0;
  height: 6vmin;
  background: repeating-linear-gradient(90deg, #f7c79a 0 4vmin, #f3bb88 4vmin 8vmin);
  border-top: 1vmin solid #e8a873;
}
.floor {
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: repeating-linear-gradient(90deg, #c98d5a 0 14vmin, #b97d4c 14vmin 14.6vmin);
  border-top: 1.2vmin solid #a86d3f;
}
.rug {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: 70vmin;
  height: 14vmin;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(ellipse, #ff9fc0 0 40%, #ff7aa8 40% 55%, #ffd84d 55% 62%, #6ec6ff 62% 100%);
  opacity: .9;
}
.home-window { width: 24vmin; left: 6vmin; top: 8vmin; }
.home-frame {
  position: absolute;
  right: 8vmin;
  top: 10vmin;
  width: 18vmin;
  height: 14vmin;
  border: 1.6vmin solid #a86d3f;
  border-radius: 1vmin;
  background: linear-gradient(#9fdcff 60%, #7fd36b 60%);
}
.home-frame::after {   /* a tiny sun in the painting */
  content: "";
  position: absolute;
  top: 1.5vmin;
  left: 2vmin;
  width: 4vmin;
  height: 4vmin;
  border-radius: 50%;
  background: var(--sun);
}
.home-plant { width: 16vmin; left: 4vmin; bottom: 22%; }
.lamp {
  position: absolute;
  right: 10vmin;
  bottom: 28%;
  width: 3vmin;
  height: 26vmin;
  background: #8d6e63;
  border-radius: 1vmin;
}
.lamp::before {   /* shade */
  content: "";
  position: absolute;
  left: -7vmin;
  top: -8vmin;
  width: 17vmin;
  height: 10vmin;
  background: #ffd84d;
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
}
.lamp::after {    /* soft glow, breathing */
  content: "";
  position: absolute;
  left: -14vmin;
  top: -6vmin;
  width: 31vmin;
  height: 31vmin;
  border-radius: 50%;
  background: radial-gradient(rgba(255, 230, 140, .45), transparent 65%);
  animation: glow 4s ease-in-out infinite;
}
@keyframes glow { 50% { opacity: .5; } }
.room--home .door-frame { fill: #fff; }
.room--home .door-leaf  { fill: #c98d5a; }

/* ---------- Scene: farm ---------- */
.room--farm { background: linear-gradient(#a8e2ff, #eaf8ff 60%); }
.field {
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background:
    repeating-linear-gradient(170deg, #9ed36b 0 4vmin, #8cc65a 4vmin 8vmin);
  border-top: 1.5vmin solid #79b74a;
  border-radius: 60% 40% 0 0 / 5vmin 5vmin 0 0;
}
.barn {
  position: absolute;
  right: 6vmin;
  bottom: 31%;
  width: 30vmin;
  height: 22vmin;
  background:
    linear-gradient(45deg, transparent 46%, #fff 46% 54%, transparent 54%) center 70% / 10vmin 10vmin no-repeat,
    linear-gradient(-45deg, transparent 46%, #fff 46% 54%, transparent 54%) center 70% / 10vmin 10vmin no-repeat,
    linear-gradient(#fff, #fff) center 70% / 11vmin 11vmin no-repeat,
    #d9453d;
  border-bottom: 1vmin solid #a8302a;
}
.barn::before {   /* roof */
  content: "";
  position: absolute;
  left: -3vmin;
  right: -3vmin;
  top: -12vmin;
  height: 13vmin;
  background: #8d3a2f;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.farm-tractor { width: 16vmin; left: 6vmin; bottom: 18%; animation: chug 1s ease-in-out infinite; }
@keyframes chug { 50% { translate: 0 -.6vmin; } }
.farm-hay { width: 11vmin; left: 30%; bottom: 25%; }
.farm-hay--2 { left: auto; right: 12%; bottom: 8%; width: 9vmin; }
.room--farm .door-frame { fill: #a8302a; }
.room--farm .door-leaf  { fill: #ffe0b2; }

/* ---------- Scene: forest ---------- */
.room--forest { background: linear-gradient(#8fd1b4, #d8f2d2 60%); }
.forest-floor {
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background:
    radial-gradient(circle, rgba(40, 90, 40, .25) 0 .6vmin, transparent .7vmin) 0 0 / 6vmin 5vmin,
    #5aa14a;
  border-top: 1.5vmin solid #4a8a3c;
  border-radius: 40% 60% 0 0 / 5vmin 5vmin 0 0;
}
.ray {
  position: absolute;
  top: -10%;
  width: 14vmin;
  height: 80%;
  background: linear-gradient(rgba(255, 255, 220, .5), transparent);
  transform: rotate(18deg);
  transform-origin: top;
  animation: glow 6s ease-in-out infinite;
}
.ray--1 { left: 30%; }
.ray--2 { left: 58%; width: 9vmin; animation-delay: -3s; }
.pine { bottom: 26%; transform-origin: 50% 100%; animation: sway 7s ease-in-out infinite; }
.pine--1 { width: 34vmin; left: -6vmin; }
.pine--2 { width: 22vmin; left: 22vmin; bottom: 30%; opacity: .85; animation-delay: -2s; }
.pine--3 { width: 28vmin; right: -4vmin; animation-delay: -4s; }
.pine--4 { width: 18vmin; right: 22vmin; bottom: 31%; opacity: .8; }
.forest-mushroom { width: 8vmin; left: 18%; bottom: 12%; }
.forest-squirrel { width: 10vmin; right: 14%; bottom: 14%; animation: hop 3s ease-in-out infinite; }
@keyframes hop { 0%, 70%, 100% { translate: 0 0; } 80% { translate: -2vmin -4vmin; } 90% { translate: -4vmin 0; } }
.room--forest .door-frame { fill: #5d4037; }
.room--forest .door-leaf  { fill: #a1887f; }

/* ---------- Scene: under the sea ---------- */
.room--sea { background: linear-gradient(#5cc6f0, #1f7fb8 70%, #17669a); }
.light {
  position: absolute;
  top: 0;
  width: 18vmin;
  height: 70%;
  background: linear-gradient(rgba(255, 255, 255, .35), transparent);
  transform: skewX(-12deg);
  animation: glow 5s ease-in-out infinite;
}
.light--1 { left: 18%; }
.light--2 { left: 62%; width: 10vmin; animation-delay: -2.5s; }
.seabed {
  position: absolute;
  inset: auto 0 0 0;
  height: 22%;
  background:
    radial-gradient(circle, rgba(201, 150, 80, .4) 0 .6vmin, transparent .7vmin) 0 0 / 7vmin 6vmin,
    #f0cf8a;
  border-radius: 50% 50% 0 0 / 6vmin 6vmin 0 0;
}
.bubble-up {
  position: absolute;
  bottom: 18%;
  width: 3vmin;
  height: 3vmin;
  border: .5vmin solid rgba(255, 255, 255, .8);
  border-radius: 50%;
  animation: rise 6s linear infinite;
}
.bubble-up--1 { left: 20%; }
.bubble-up--2 { left: 72%; width: 2vmin; height: 2vmin; animation-delay: -2s; }
.bubble-up--3 { left: 46%; animation-delay: -4s; animation-duration: 8s; }
@keyframes rise { to { translate: 2vmin -70vh; opacity: 0; } }
.sea-fish { width: 12vmin; top: 30%; right: -14vmin; animation: swim 16s linear infinite; }
.sea-fish--2 { width: 9vmin; top: 50%; animation-duration: 22s; animation-delay: -8s; }
@keyframes swim { to { translate: calc(-100vw - 30vmin) 0; } }
.coral { width: 16vmin; bottom: 14%; left: 4vmin; }
.coral--2 { left: auto; right: 6vmin; width: 12vmin; bottom: 12%; }
.room--sea .door-frame { fill: #ff8a65; }
.room--sea .door-leaf  { fill: #ffe0d6; }

/* ---------- Scene: snow ---------- */
.room--snow { background: linear-gradient(#bfe3ff, #eef8ff 65%); }
.snow-hill {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: 22%;
  height: 22%;
  border-radius: 50% 50% 0 0;
  background: #e3f1fb;
}
.snow-ground {
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: #fff;
  border-top: 1.5vmin solid #d6ebf8;
  border-radius: 50% 50% 0 0 / 6vmin 6vmin 0 0;
}
.flake { width: 5vmin; top: -6vmin; animation: fall 9s linear infinite; opacity: .9; }
.flake--1 { left: 12%; }
.flake--2 { left: 38%; width: 3.5vmin; animation-delay: -3s; animation-duration: 11s; }
.flake--3 { left: 64%; animation-delay: -6s; }
.flake--4 { left: 86%; width: 3vmin; animation-delay: -1.5s; animation-duration: 13s; }
@keyframes fall { to { translate: 4vmin 110vh; rotate: 1turn; } }
.snowman { width: 22vmin; left: 4vmin; bottom: 20%; }
.snow-penguin { width: 11vmin; right: 10%; bottom: 10%; animation: waddle 2.4s ease-in-out infinite; }
@keyframes waddle { 0%, 100% { rotate: -8deg; } 50% { rotate: 8deg; } }
.room--snow .door-frame { fill: #6ec6ff; }
.room--snow .door-leaf  { fill: #fff; }

/* ---------- Scene: desert ---------- */
.room--desert { background: linear-gradient(#ffd59e, #fff1d6 60%); }
.dune {
  position: absolute;
  bottom: 18%;
  height: 26%;
  border-radius: 50% 50% 0 0;
  background: #f2c27a;
}
.dune--1 { left: -20%; width: 80%; }
.dune--2 { right: -25%; width: 85%; bottom: 14%; background: #eab365; }
.sand-floor {
  position: absolute;
  inset: auto 0 0 0;
  height: 26%;
  background:
    repeating-linear-gradient(170deg, transparent 0 5vmin, rgba(201, 140, 60, .25) 5vmin 5.6vmin),
    #f6d08f;
  border-radius: 60% 40% 0 0 / 5vmin 5vmin 0 0;
}
.desert-camel { width: 20vmin; right: 8%; bottom: 20%; animation: walk 30s linear infinite alternate; }
@keyframes walk { to { translate: -40vw 0; } }
.desert-palm { width: 26vmin; left: 2vmin; bottom: 20%; transform-origin: 50% 100%; animation: sway 6s ease-in-out infinite; }
.desert-cactus { width: 10vmin; left: 40%; bottom: 8%; }
.room--desert .door-frame { fill: #c4844a; }
.room--desert .door-leaf  { fill: #ffe3b3; }

/* ---------- Scene: city ---------- */
.room--city { background: linear-gradient(#9fdcff, #e4f6ff 60%); }
.skyline {
  position: absolute;
  inset: auto 0 30% 0;
  height: 34%;
  background:
    linear-gradient(#b0bec5, #b0bec5) 4% 100% / 12% 70% no-repeat,
    linear-gradient(#90a4ae, #90a4ae) 18% 100% / 10% 95% no-repeat,
    linear-gradient(#b0bec5, #b0bec5) 32% 100% / 14% 55% no-repeat,
    linear-gradient(#cfd8dc, #cfd8dc) 50% 100% / 10% 80% no-repeat,
    linear-gradient(#90a4ae, #90a4ae) 66% 100% / 13% 65% no-repeat,
    linear-gradient(#b0bec5, #b0bec5) 84% 100% / 12% 90% no-repeat;
  opacity: .8;
}
.road {
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background:
    linear-gradient(90deg, #fff 0 50%, transparent 50%) 0 45% / 10vmin 1vmin repeat-x,
    #6d7b84;
  border-top: 2vmin solid #b0bec5;
}
.city-bus { width: 22vmin; bottom: 8%; right: -24vmin; animation: drive 14s linear infinite; }
@keyframes drive { to { translate: calc(-100vw - 50vmin) 0; } }
.city-office { width: 18vmin; left: 4vmin; bottom: 29%; }
.city-house { width: 14vmin; right: 6vmin; bottom: 29%; }
.room--city .door-frame { fill: #546e7a; }
.room--city .door-leaf  { fill: #cfe8ff; }

/* ---------- Scene: space ---------- */
.room--space { background: radial-gradient(circle at 70% 20%, #3b2f7a, #120d33 70%); }
.stars {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, #fff 0 .35vmin, transparent .45vmin) 0 0 / 11vmin 13vmin,
    radial-gradient(circle, rgba(255, 255, 255, .7) 0 .25vmin, transparent .35vmin) 5vmin 6vmin / 9vmin 8vmin;
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: .55; } }
.moon-ground {
  position: absolute;
  inset: auto -10% 0 -10%;
  height: 28%;
  background:
    radial-gradient(circle at 20% 40%, #9e9eb8 0 3vmin, transparent 3.2vmin),
    radial-gradient(circle at 70% 60%, #9e9eb8 0 4vmin, transparent 4.2vmin),
    radial-gradient(circle at 45% 80%, #9e9eb8 0 2vmin, transparent 2.2vmin),
    #c5c5d8;
  border-radius: 50% 50% 0 0 / 8vmin 8vmin 0 0;
}
.space-planet { width: 22vmin; right: 4vmin; top: 6vmin; animation: spin 60s linear infinite; }
.space-rocket { width: 14vmin; right: 8vmin; bottom: 30%; animation: float 4s ease-in-out infinite; }
.space-ufo { width: 12vmin; top: 30%; left: -14vmin; animation: fly 20s linear infinite; }
@keyframes float { 50% { translate: 0 -3vmin; } }
@keyframes fly { to { translate: calc(100vw + 30vmin) -6vh; } }
.room--space .door-frame { fill: #7e57c2; }
.room--space .door-leaf  { fill: #d1c4e9; }
/* bubble and buttons stay readable on the dark sky */
.room--space .bubble { box-shadow: 0 0 0 3px #b9a7ff; }
