/* ===========================================================
   Rainbow Dash · interactive homepage scene
   A flying RD sprite roams the room header; the guitar, books
   and poster are hover hotspots that label + link to a page and
   make her fly over with a speech bubble.
   The stage matches the room background image (2545x1200) via
   aspect-ratio so the % hotspot coords line up at any width.
   =========================================================== */
.rd-scene {
  position: absolute;
  top: 26px;          /* = hero-scene padding-top (where the bg image starts) */
  left: 18px;         /* = hero-scene padding-left */
  right: 18px;
  aspect-ratio: 2545 / 1200;
  z-index: 2;
  pointer-events: none;   /* only hotspots + nothing else catch the mouse */
}

/* ---- hover hotspots over room objects ---- */
.rd-hot {
  position: absolute;
  display: block;
  pointer-events: auto;
  border-radius: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .2s ease, background .2s ease;
}
.rd-hot:hover,
.rd-hot:focus-visible {
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 0 0 3px rgba(255, 79, 200, .6), 0 0 24px rgba(120, 220, 255, .85);
  outline: none;
}
.rd-hot__label {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, -4px) scale(.92);
  transform-origin: bottom center;
  white-space: nowrap;
  padding: 4px 11px;
  font: 700 13px/1.2 "Courier New", monospace;
  color: #143a8f;
  background: rgba(255, 255, 255, .97);
  border: 2px solid #6db0ee;
  border-radius: 9px;
  box-shadow: 0 3px 8px rgba(11, 79, 160, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.rd-hot__label span { color: #be4cff; }
.rd-hot:hover .rd-hot__label,
.rd-hot:focus-visible .rd-hot__label {
  opacity: 1;
  transform: translate(-50%, -9px) scale(1);
}

/* ---- the flying pony ---- */
.rd-sprite {
  position: absolute;
  left: 0;
  top: 0;
  width: 112px;
  height: 100px;
  pointer-events: none;
  z-index: 3;
  will-change: transform;
}
.rd-sprite[hidden] { display: none; }
.rd-sprite__layer {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  max-width: 112px;
  max-height: 100px;
  opacity: 0;
  filter: drop-shadow(0 4px 5px rgba(20, 60, 140, .3));
  transition: opacity .12s linear;
}
.rd-sprite__layer.is-active { opacity: 1; }

/* ---- speech bubble ---- */
.rd-bubble {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, -2px);
  width: max-content;
  max-width: 200px;
  padding: 6px 11px;
  font: 700 12.5px/1.3 "Courier New", monospace;
  text-align: center;
  color: #173bbd;
  background: #fff;
  border: 2px solid #6db0ee;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(11, 79, 160, .3);
  pointer-events: none;
}
.rd-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #fff;
  filter: drop-shadow(0 2px 0 #6db0ee);
}
.rd-bubble[hidden] { display: none; }

@media (max-width: 760px) {
  .rd-scene {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    order: 3;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 7;
    min-height: 142px;
    margin: 12px 0 10px;
    overflow: hidden;
    border: 2px solid #73b7ee;
    border-radius: 8px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(37, 114, 205, .12)),
      url("background.webp") center top / cover no-repeat,
      linear-gradient(180deg, #bdecff, #73b8f2);
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, .45),
      0 5px 14px rgba(11, 79, 160, .18);
    pointer-events: auto;
  }

  .rd-scene::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      linear-gradient(180deg, transparent 42%, rgba(14, 61, 136, .18)),
      radial-gradient(ellipse at 50% 18%, rgba(255, 255, 255, .28), transparent 42%);
  }

  .rd-hot {
    top: auto !important;
    bottom: 8px;
    width: auto !important;
    height: auto !important;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    z-index: 5;
    border-radius: 8px;
  }

  .rd-hot[data-zone="music"] {
    left: 7% !important;
  }

  .rd-hot[data-zone="greens"] {
    left: 50% !important;
    transform: translateX(-50%);
  }

  .rd-hot[data-zone="art"] {
    left: auto !important;
    right: 7%;
  }

  .rd-hot__label {
    position: static;
    transform: none;
    opacity: 1;
    padding: 5px 8px;
    color: #123c88;
    font-size: 10.5px;
    line-height: 1.1;
    background: rgba(255, 255, 255, .94);
    border-color: #74b6ec;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(11, 79, 160, .22);
  }

  .rd-hot:hover .rd-hot__label,
  .rd-hot:focus-visible .rd-hot__label {
    transform: none;
  }

  .rd-sprite {
    width: 82px;
    height: 74px;
    z-index: 4;
  }

  .rd-sprite__layer {
    max-width: 82px;
    max-height: 74px;
  }

  .rd-bubble {
    max-width: 132px;
    padding: 5px 8px;
    font-size: 10.5px;
    border-radius: 9px;
  }
}
