:root {
  color-scheme: dark;
  --ink: #f2eaff;
  --muted: #b5a9cb;
  --night: #080616;
  --panel: rgba(12, 9, 28, 0.72);
  --panel-strong: rgba(18, 12, 38, 0.88);
  --violet: #9d62ff;
  --violet-soft: #d7b7ff;
  --cyan: #69d5d1;
  --rose: #ff8bd8;
  --amber: #f4c872;
  --line: rgba(242, 234, 255, 0.16);
  --shadow: rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 16% 16%, rgba(157, 98, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 82% 28%, rgba(105, 213, 209, 0.1), transparent 24rem),
    linear-gradient(145deg, #05040d 0%, #120b27 54%, #070512 100%);
  color: var(--ink);
  overflow-x: hidden;
}

button {
  font: inherit;
}

.wonder-room {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.lofi-zone {
  width: min(1480px, 100%);
  min-height: min(820px, calc(100vh - 36px));
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
}

.scene-frame {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(215, 183, 255, 0.2);
  border-radius: 8px;
  background: #070512;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  isolation: isolate;
}

.scene-frame::before,
.scene-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition:
    opacity 260ms ease,
    background 260ms ease;
}

.scene-frame::before {
  z-index: 1;
  opacity: 0.18;
  background: radial-gradient(circle at 42% 50%, rgba(105, 213, 209, 0.28), transparent 20rem);
  mix-blend-mode: screen;
}

.scene-frame::after {
  z-index: 1;
  opacity: 0;
}

.scene-frame[data-mood="rain"]::before {
  opacity: 0.24;
  background:
    radial-gradient(circle at 18% 16%, rgba(157, 98, 255, 0.24), transparent 18rem),
    linear-gradient(180deg, rgba(28, 32, 64, 0.28), rgba(6, 8, 18, 0.38));
}

.scene-frame[data-mood="rain"]::after {
  opacity: 0.22;
  background:
    repeating-linear-gradient(112deg, transparent 0 22px, rgba(200, 244, 239, 0.42) 23px, transparent 25px);
  animation: rainSlide 900ms linear infinite;
}

.scene-frame[data-mood="tea"]::before {
  opacity: 0.25;
  background:
    radial-gradient(circle at 28% 69%, rgba(244, 200, 114, 0.34), transparent 12rem),
    radial-gradient(circle at 42% 45%, rgba(255, 139, 216, 0.18), transparent 18rem);
}

.scene-frame[data-mood="focus"]::before {
  opacity: 0.28;
  background:
    radial-gradient(circle at 39% 79%, rgba(105, 213, 209, 0.24), transparent 13rem),
    linear-gradient(90deg, rgba(3, 5, 12, 0.12), rgba(6, 8, 18, 0.48));
}

.scene-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 49% 50%;
  transform: scale(1.01);
  filter: saturate(1.04) contrast(1.03);
  z-index: 0;
}

.scene-vignette,
.window-glow,
.lamp-glow,
.lava-glow,
.dust {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.scene-vignette {
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 68%, rgba(5, 4, 13, 0.72) 100%),
    radial-gradient(circle at 42% 46%, transparent 0 42%, rgba(4, 3, 10, 0.36) 82%);
}

.window-glow {
  left: 10%;
  top: 9%;
  width: 32%;
  height: 38%;
  border-radius: 46%;
  background: rgba(177, 96, 255, 0.18);
  filter: blur(38px);
  animation: breathe 6.5s ease-in-out infinite;
}

.lamp-glow {
  left: 31%;
  top: 39%;
  width: 14%;
  height: 18%;
  border-radius: 50%;
  background: rgba(244, 200, 114, 0.2);
  filter: blur(24px);
  animation: lampPulse 3.8s ease-in-out infinite;
}

.lava-glow {
  left: 47%;
  top: 43%;
  width: 10%;
  height: 28%;
  border-radius: 42%;
  background: rgba(179, 70, 255, 0.23);
  filter: blur(22px);
  animation: breathe 5.5s ease-in-out infinite reverse;
}

.dust {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(242, 234, 255, 0.7);
  box-shadow:
    0 0 10px rgba(242, 234, 255, 0.5),
    56px 32px 0 rgba(105, 213, 209, 0.34),
    116px -18px 0 rgba(255, 139, 216, 0.32),
    174px 70px 0 rgba(244, 200, 114, 0.3);
  opacity: 0.5;
  animation: drift 11s linear infinite;
}

.dust--one {
  left: 18%;
  top: 30%;
}

.dust--two {
  right: 22%;
  top: 46%;
  animation-duration: 14s;
}

.dust--three {
  left: 62%;
  bottom: 22%;
  animation-duration: 16s;
}

.hotspot {
  position: absolute;
  z-index: 2;
  display: block;
  border: 0;
  padding: 0;
  color: transparent;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.sprite {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 1px solid rgba(242, 234, 255, 0.24);
  border-radius: 8px;
  background-image: url("./assets/cabinet-scene-v2.png");
  background-repeat: no-repeat;
  background-size: 540% auto;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(105, 213, 209, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  opacity: 0.64;
  transform: translate(-50%, -50%) scale(0.92);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.hotspot:hover .sprite,
.hotspot:focus-visible .sprite,
.hotspot.is-active .sprite {
  opacity: 1;
  transform: translate(-50%, -56%) scale(1.04);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.42),
    0 0 28px rgba(105, 213, 209, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  filter: saturate(1.08) brightness(1.08);
}

.hotspot--raven .sprite {
  width: 74px;
  height: 82px;
  background-position: 5% 58%;
}

.hotspot--board .sprite {
  width: 82px;
  height: 54px;
  background-position: 34% 86%;
}

.hotspot--servo .sprite {
  width: 66px;
  height: 58px;
  background-position: 63% 88%;
}

.hotspot--plant .sprite {
  width: 70px;
  height: 88px;
  background-position: 70% 63%;
}

.hotspot--cup .sprite {
  width: 58px;
  height: 58px;
  background-position: 23% 84%;
}

.hotspot--note .sprite {
  width: 76px;
  height: 58px;
  background-position: 54% 30%;
}

.hotspot__label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(242, 234, 255, 0.18);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(9, 6, 22, 0.72);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
  font-size: 12px;
  line-height: 1.2;
  opacity: 0;
  white-space: nowrap;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.hotspot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(105, 213, 209, 0.72);
  box-shadow:
    0 0 16px rgba(105, 213, 209, 0.85),
    0 0 42px rgba(157, 98, 255, 0.4);
  opacity: 0;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.hotspot:hover::after,
.hotspot:focus-visible::after,
.hotspot.is-active::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.18);
}

.hotspot:hover .hotspot__label,
.hotspot:focus-visible .hotspot__label,
.hotspot.is-active .hotspot__label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hotspot:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 6px;
  border-radius: 999px;
}

.hotspot.is-active {
  animation: tapGlow 520ms ease;
}

.hotspot--raven {
  left: 9%;
  top: 43%;
  width: 20%;
  height: 29%;
}

.hotspot--board {
  left: 27%;
  top: 72%;
  width: 22%;
  height: 17%;
}

.hotspot--servo {
  left: 47%;
  top: 77%;
  width: 13%;
  height: 15%;
}

.hotspot--plant {
  left: 54%;
  top: 57%;
  width: 17%;
  height: 31%;
}

.hotspot--cup {
  left: 21%;
  top: 74%;
  width: 9%;
  height: 16%;
}

.hotspot--note {
  left: 44%;
  top: 24%;
  width: 19%;
  height: 20%;
}

.scene-frame[data-active="raven"] .window-glow {
  background: rgba(177, 96, 255, 0.24);
}

.scene-frame[data-active="board"] .lava-glow {
  background: rgba(105, 213, 209, 0.26);
}

.scene-frame[data-active="servo"] .lamp-glow {
  background: rgba(244, 200, 114, 0.28);
}

.scene-frame[data-active="plant"]::before {
  background:
    radial-gradient(circle at 64% 62%, rgba(117, 214, 153, 0.24), transparent 12rem),
    radial-gradient(circle at 42% 50%, rgba(105, 213, 209, 0.18), transparent 20rem);
}

.scene-frame[data-active="cup"] .lamp-glow {
  filter: blur(30px);
}

.scene-frame[data-active="note"]::before {
  background:
    radial-gradient(circle at 54% 28%, rgba(244, 200, 114, 0.2), transparent 10rem),
    radial-gradient(circle at 42% 50%, rgba(105, 213, 209, 0.18), transparent 20rem);
}

.oracle {
  position: relative;
  min-height: 100%;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(215, 183, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 28%),
    radial-gradient(circle at 30% 8%, rgba(157, 98, 255, 0.22), transparent 14rem),
    var(--panel);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.oracle::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 38px 38px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 80%);
  pointer-events: none;
}

.oracle__top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.oracle__label {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 260px;
  margin-bottom: 0;
  font-size: clamp(32px, 4.4vw, 54px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  position: relative;
  margin-bottom: 12px;
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: 0;
}

.oracle p {
  position: relative;
  color: var(--muted);
  line-height: 1.6;
}

.icon-button {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(105, 213, 209, 0.34);
  border-radius: 8px;
  color: #d8fffb;
  background: rgba(105, 213, 209, 0.1);
  cursor: pointer;
  box-shadow: 0 0 24px rgba(105, 213, 209, 0.08);
}

.icon-button:hover {
  background: rgba(105, 213, 209, 0.16);
}

.icon-button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.oracle__chips {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(105, 213, 209, 0.24);
  border-radius: 999px;
  color: #d8fffb;
  background: rgba(105, 213, 209, 0.1);
  font-size: 12px;
}

.mood-switcher {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 24px;
}

.mood-button {
  min-height: 36px;
  border: 1px solid rgba(215, 183, 255, 0.22);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.mood-button:hover,
.mood-button:focus-visible,
.mood-button.is-active {
  border-color: rgba(105, 213, 209, 0.48);
  background: rgba(105, 213, 209, 0.12);
  box-shadow: 0 0 24px rgba(105, 213, 209, 0.1);
}

.mood-button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.collection {
  position: relative;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(242, 234, 255, 0.12);
}

.collection__title {
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.collection__items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.collection__empty,
.keepsake {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}

.collection__empty {
  border: 1px dashed rgba(242, 234, 255, 0.18);
  color: rgba(242, 234, 255, 0.58);
}

.keepsake {
  border: 1px solid rgba(244, 200, 114, 0.32);
  color: #ffe7ab;
  background: rgba(244, 200, 114, 0.1);
  box-shadow: 0 0 18px rgba(244, 200, 114, 0.08);
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes lampPulse {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(22px, -46px, 0);
  }
}

@keyframes rainSlide {
  from {
    transform: translate3d(0, -24px, 0);
  }
  to {
    transform: translate3d(-22px, 24px, 0);
  }
}

@keyframes tapGlow {
  0%,
  100% {
    filter: none;
  }
  45% {
    filter: drop-shadow(0 0 18px rgba(105, 213, 209, 0.8));
  }
}

@media (max-width: 980px) {
  .lofi-zone {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .scene-frame {
    min-height: auto;
    aspect-ratio: 16 / 9;
  }

  .oracle {
    min-height: auto;
  }

  h1 {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .wonder-room {
    padding: 10px;
  }

  .lofi-zone {
    gap: 10px;
  }

  .scene-frame {
    aspect-ratio: 4 / 5;
  }

  .scene-art {
    object-position: 34% 50%;
  }

  .scene-vignette {
    background:
      linear-gradient(180deg, transparent 0 62%, rgba(5, 4, 13, 0.66) 100%),
      radial-gradient(circle at 44% 46%, transparent 0 40%, rgba(4, 3, 10, 0.44) 82%);
  }

  .hotspot__label {
    display: none;
  }

  .sprite {
    width: 52px;
    height: 52px;
    opacity: 0.58;
  }

  .hotspot--raven .sprite {
    width: 58px;
    height: 66px;
  }

  .hotspot--board .sprite {
    width: 66px;
    height: 44px;
  }

  .hotspot--servo .sprite,
  .hotspot--cup .sprite {
    width: 48px;
    height: 48px;
  }

  .hotspot--plant .sprite {
    width: 56px;
    height: 72px;
  }

  .hotspot--note .sprite {
    width: 58px;
    height: 46px;
  }

  .hotspot::after {
    width: 16px;
    height: 16px;
    opacity: 0.42;
  }

  .hotspot--raven {
    left: 12%;
    top: 44%;
    width: 28%;
    height: 26%;
  }

  .hotspot--board {
    left: 28%;
    top: 73%;
    width: 28%;
    height: 15%;
  }

  .hotspot--servo {
    left: 54%;
    top: 78%;
    width: 18%;
    height: 13%;
  }

  .hotspot--plant {
    left: 60%;
    top: 56%;
    width: 25%;
    height: 32%;
  }

  .hotspot--cup {
    left: 21%;
    top: 75%;
    width: 14%;
    height: 14%;
  }

  .hotspot--note {
    left: 43%;
    top: 20%;
    width: 26%;
    height: 22%;
  }

  .oracle {
    padding: 16px;
  }

  .oracle__top {
    margin-bottom: 20px;
  }

  .mood-switcher {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mood-button {
    min-height: 34px;
    padding: 0 6px;
    font-size: 12px;
  }

  h1 {
    font-size: 34px;
  }
}

/* Final scene overrides must stay below the legacy responsive prototype rules. */
.room-scene {
  min-height: auto;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(90deg, rgba(8, 6, 16, 0.12), rgba(8, 6, 16, 0.02) 55%, rgba(8, 6, 16, 0.42)),
    url("./assets/cabinet-scene-v2.png") center / cover no-repeat;
}

.window,
.back-shelf,
.desk,
.artifact span {
  display: none;
}

.artifact {
  border-radius: 8px;
  outline: 1px solid transparent;
}

.artifact::before,
.artifact::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.artifact::before {
  inset: 0;
  border: 1px solid rgba(200, 244, 239, 0.42);
  border-radius: inherit;
  background: rgba(95, 185, 183, 0.05);
  box-shadow:
    0 0 0 1px rgba(125, 92, 255, 0.12),
    0 0 28px rgba(95, 185, 183, 0.18);
}

.artifact::after {
  right: 8px;
  bottom: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c8f4ef;
  box-shadow:
    0 0 0 4px rgba(95, 185, 183, 0.18),
    0 0 18px rgba(95, 185, 183, 0.65);
}

.artifact.is-active {
  animation: none;
}

.artifact:hover,
.artifact:focus-visible,
.artifact.is-active {
  transform: none;
  filter: none;
}

.artifact:hover::before,
.artifact:hover::after,
.artifact:focus-visible::before,
.artifact:focus-visible::after,
.artifact.is-active::before,
.artifact.is-active::after {
  opacity: 1;
}

.artifact:hover::after,
.artifact:focus-visible::after,
.artifact.is-active::after {
  transform: scale(1.15);
}

.artifact--raven {
  left: 9%;
  bottom: 21%;
  top: auto;
  right: auto;
  width: 23%;
  height: 39%;
}

.artifact--board {
  left: 25%;
  bottom: 4%;
  top: auto;
  right: auto;
  width: 28%;
  height: 17%;
}

.artifact--servo {
  left: 61%;
  bottom: 3%;
  top: auto;
  right: auto;
  width: 16%;
  height: 18%;
}

.artifact--plant {
  left: 57%;
  bottom: 14%;
  top: auto;
  right: auto;
  width: 18%;
  height: 32%;
}

.artifact--cup {
  left: 22%;
  bottom: 7%;
  top: auto;
  right: auto;
  width: 12%;
  height: 18%;
}

.artifact--note {
  left: 49%;
  top: 15%;
  right: auto;
  bottom: auto;
  width: 17%;
  height: 23%;
  transform: none;
}

@media (max-width: 860px) {
  .cabinet {
    grid-template-rows: auto auto auto;
  }
}

@media (max-width: 780px) {
  .room-scene {
    min-height: auto;
    aspect-ratio: 4 / 5;
    background-position: 35% center;
  }

  .artifact--raven {
    left: 10%;
    bottom: 25%;
    width: 32%;
    height: 32%;
  }

  .artifact--board {
    left: 26%;
    bottom: 6%;
    width: 40%;
    height: 14%;
  }

  .artifact--servo {
    left: 62%;
    bottom: 5%;
    width: 22%;
    height: 15%;
  }

  .artifact--plant {
    left: 62%;
    bottom: 19%;
    width: 24%;
    height: 26%;
  }

  .artifact--cup {
    left: 23%;
    bottom: 9%;
    width: 18%;
    height: 14%;
  }

  .artifact--note {
    left: 51%;
    top: 17%;
    width: 24%;
    height: 16%;
  }
}
