:root {
  --ink: #061a18;
  --deep: #041d1b;
  --white: #f8fffb;
  --mint: #65ffd0;
  --gold: #f7cf78;
  --coral: #ff756f;
}

* { box-sizing: border-box; }
html, body, #house-root { width: 100%; min-height: 100%; }
body { margin: 0; min-width: 0; color: var(--white); font-family: Inter, system-ui, sans-serif; background: var(--deep); overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.house-page {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 700px;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(135deg, #031714, #082d28 58%, #17131b);
}

.house-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: grab;
  touch-action: none;
}
.house-page.is-gated .house-canvas { pointer-events: none; }
.house-canvas.is-dragging { cursor: grabbing; }
.house-canvas canvas { display: block; width: 100%; height: 100%; }

.house-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(2,20,18,.82) 0%, rgba(2,20,18,.2) 31%, transparent 48%, rgba(2,20,18,.18) 100%);
}

.house-nav {
  position: fixed;
  inset: 16px clamp(18px, 4vw, 64px) auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(2,31,29,.84);
  box-shadow: 0 18px 54px rgba(0,0,0,.3);
  backdrop-filter: blur(22px);
}
.house-brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.house-brand-mark { width: 52px; height: 52px; flex: 0 0 52px; }
.house-brand-mark img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 15px rgba(101,255,208,.35)); }
.house-brand strong, .house-brand small { display: block; }
.house-brand strong { font-size: 1rem; white-space: nowrap; }
.house-brand small { margin-top: 3px; color: rgba(248,255,251,.62); font-size: .72rem; }
.house-back { min-height: 44px; display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 0 16px; color: rgba(248,255,251,.8); font-size: .76rem; font-weight: 800; }

.house-intro {
  position: absolute;
  left: clamp(22px, 5vw, 76px);
  top: 50%;
  z-index: 6;
  width: min(430px, 34vw);
  transform: translateY(-50%);
  pointer-events: none;
}
.house-eyebrow { margin: 0; color: var(--mint); font-size: .72rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.house-intro h1 { margin: 18px 0 0; font-family: "Playfair Display", Georgia, serif; font-size: 4.8rem; line-height: .88; letter-spacing: 0; text-shadow: 0 24px 80px rgba(0,0,0,.5); }
.house-intro > p:last-of-type { max-width: 410px; margin: 26px 0 0; color: rgba(248,255,251,.68); line-height: 1.65; }
.explore-hint { display: inline-flex; align-items: center; gap: 11px; margin-top: 26px; color: rgba(248,255,251,.66); font-size: .72rem; font-weight: 700; }
.explore-hint i { width: 34px; height: 34px; border: 1px solid rgba(101,255,208,.46); border-radius: 50%; background: rgba(101,255,208,.1); animation: hintPulse 1.8s ease-in-out infinite; }

.radius-badge {
  position: absolute;
  right: clamp(22px, 5vw, 76px);
  top: 112px;
  z-index: 7;
  display: grid;
  grid-template-columns: 42px auto;
  gap: 11px;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid rgba(247,207,120,.34);
  border-radius: 8px;
  background: rgba(5,29,27,.72);
  backdrop-filter: blur(16px);
}
.radius-badge i { position: relative; width: 42px; height: 42px; border: 1px solid var(--gold); border-radius: 50%; }
.radius-badge i::before, .radius-badge i::after { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(247,207,120,.5); border-radius: 50%; animation: radiusPulse 2.4s ease-out infinite; }
.radius-badge i::after { inset: 14px; animation-delay: .8s; }
.radius-badge strong, .radius-badge span { display: block; }
.radius-badge strong { color: var(--gold); font-size: .78rem; }
.radius-badge span { margin-top: 3px; color: rgba(248,255,251,.56); font-size: .65rem; }

.scene-gate {
  position: absolute;
  right: clamp(22px, 7vw, 110px);
  top: 50%;
  z-index: 12;
  width: min(510px, 45vw);
  min-height: 430px;
  display: grid;
  place-items: center;
  transform: translateY(-47%);
}
.scene-gate::before {
  content: "";
  position: absolute;
  width: min(430px, 34vw);
  aspect-ratio: 1;
  border: 1px solid rgba(101,255,208,.25);
  border-radius: 50%;
  box-shadow: inset 0 0 80px rgba(101,255,208,.06), 0 0 70px rgba(101,255,208,.08);
  animation: gateBreath 3.4s ease-in-out infinite;
}
.scene-gate-orbit {
  position: absolute;
  width: min(410px, 33vw);
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  animation: gateOrbit 24s linear infinite;
}
.scene-gate-orbit::before, .scene-gate-orbit::after {
  content: "";
  position: absolute;
  inset: 16%;
  border: 1px dashed rgba(247,207,120,.22);
  border-radius: 50%;
}
.scene-gate-orbit::after { inset: 34%; border-style: solid; border-color: rgba(201,168,255,.25); }
.scene-gate-orbit span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid color-mix(in srgb, var(--gate-color) 64%, transparent);
  border-radius: 50%;
  color: #032421;
  background: var(--gate-color);
  box-shadow: 0 0 26px color-mix(in srgb, var(--gate-color) 38%, transparent);
  font-size: .62rem;
  font-weight: 900;
}
.scene-gate-orbit span:nth-child(1) { transform: rotate(0deg) translateX(192px) rotate(0deg); }
.scene-gate-orbit span:nth-child(2) { transform: rotate(60deg) translateX(192px) rotate(-60deg); }
.scene-gate-orbit span:nth-child(3) { transform: rotate(120deg) translateX(192px) rotate(-120deg); }
.scene-gate-orbit span:nth-child(4) { transform: rotate(180deg) translateX(192px) rotate(-180deg); }
.scene-gate-orbit span:nth-child(5) { transform: rotate(240deg) translateX(192px) rotate(-240deg); }
.scene-gate-orbit span:nth-child(6) { transform: rotate(300deg) translateX(192px) rotate(-300deg); }
.scene-gate-copy {
  position: relative;
  z-index: 2;
  width: min(330px, 78%);
  padding: 28px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(3,29,27,.86);
  box-shadow: 0 34px 100px rgba(0,0,0,.42);
  backdrop-filter: blur(22px);
}
.scene-gate-copy > p { margin: 0; color: var(--mint); font-size: .66rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.scene-gate-copy h2 { margin: 14px 0 0; font-family: "Playfair Display", Georgia, serif; font-size: 2.7rem; line-height: .94; letter-spacing: 0; }
.scene-gate-copy > span { display: block; margin-top: 16px; color: rgba(248,255,251,.64); font-size: .78rem; line-height: 1.55; }
.scene-start {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  margin-top: 22px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  color: #032421;
  text-align: left;
  background: linear-gradient(135deg, var(--mint), #fff0a4 65%, var(--coral));
  box-shadow: 0 14px 36px rgba(101,255,208,.18);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease;
}
.scene-start:hover { transform: translateY(-3px); box-shadow: 0 20px 46px rgba(101,255,208,.3); }
.scene-start i {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  display: block;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}
.scene-start i::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 10px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
}
.scene-start strong { align-self: end; font-size: .78rem; }
.scene-start small { align-self: start; margin-top: 2px; opacity: .65; font-size: .62rem; font-weight: 700; }

.hotspot-layer { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.hotspot-tag {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  padding: 5px 11px 5px 6px;
  color: var(--white);
  background: rgba(3,30,27,.86);
  box-shadow: 0 12px 34px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: opacity .18s ease, border-color .2s ease, background .2s ease, scale .2s ease;
  white-space: nowrap;
}
.hotspot-tag:hover, .hotspot-tag.is-active { border-color: var(--tag-color); background: color-mix(in srgb, var(--tag-color) 20%, rgba(3,30,27,.9)); scale: 1.06; }
.hotspot-tag.is-hidden { opacity: 0; pointer-events: none; }
.hotspot-tag b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #04221f; background: var(--tag-color); font-size: .62rem; }
.hotspot-tag span { font-size: .7rem; font-weight: 800; }

.detail-panel {
  position: absolute;
  right: clamp(22px, 5vw, 76px);
  bottom: 34px;
  z-index: 10;
  width: min(390px, calc(100% - 44px));
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  padding: 24px;
  background: rgba(3,29,27,.9);
  box-shadow: 0 34px 100px rgba(0,0,0,.45);
  backdrop-filter: blur(22px);
  animation: panelIn .42s cubic-bezier(.16,1,.3,1) both;
}
.detail-panel::before { content: ""; position: absolute; inset: 0; border-top: 2px solid var(--panel-color); border-radius: inherit; pointer-events: none; }
.detail-topline { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.detail-topline span { color: var(--panel-color); font-size: .68rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.detail-close { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: var(--white); background: rgba(255,255,255,.06); cursor: pointer; }
.detail-panel h2 { margin: 16px 0 0; font-family: "Playfair Display", Georgia, serif; font-size: 2.45rem; line-height: .96; letter-spacing: 0; }
.detail-panel > p { margin: 15px 0 0; color: rgba(248,255,251,.66); font-size: .88rem; line-height: 1.6; }
.detail-reference {
  position: relative;
  min-height: 108px;
  display: grid;
  grid-template-columns: 112px 1fr 28px;
  align-items: end;
  gap: 13px;
  margin-top: 18px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 7px;
  padding: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.055);
  transition: border-color .22s ease, transform .22s ease, background .22s ease;
}
.detail-reference:hover { border-color: var(--panel-color); background: rgba(255,255,255,.09); transform: translateY(-2px); }
.detail-reference img { width: 112px; height: 86px; grid-row: 1; object-fit: cover; border-radius: 5px; }
.detail-reference span { align-self: center; min-width: 0; }
.detail-reference small, .detail-reference strong { display: block; }
.detail-reference small { color: var(--panel-color); font-size: .58rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.detail-reference strong { margin-top: 7px; font-size: .8rem; line-height: 1.25; }
.detail-reference b { align-self: center; color: var(--panel-color); font-size: 1.1rem; }
.task-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.task-list span { border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 8px 10px; color: rgba(248,255,251,.74); background: rgba(255,255,255,.05); font-size: .64rem; font-weight: 700; }
.detail-link { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 20px; border-radius: 999px; padding: 0 18px; color: #032421; background: linear-gradient(135deg, var(--panel-color), #fff0a4 64%, var(--coral)); font-size: .74rem; font-weight: 900; }

.room-dock {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 9;
  display: flex;
  gap: 7px;
  max-width: min(720px, 54vw);
  padding: 6px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(3,27,25,.78);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
  scrollbar-width: none;
}
.room-dock::-webkit-scrollbar { display: none; }
.room-dock button { min-height: 42px; border: 0; border-radius: 999px; padding: 0 13px; color: rgba(248,255,251,.62); background: transparent; cursor: pointer; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.room-dock button:hover, .room-dock button.is-active { color: #032421; background: var(--dock-color, var(--mint)); }

.loading-scene { position: absolute; inset: 0; z-index: 25; display: grid; place-items: center; color: rgba(248,255,251,.7); background: var(--deep); transition: opacity .5s ease, visibility .5s ease; }
.loading-scene.is-ready { opacity: 0; visibility: hidden; }
.loading-scene span { font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; animation: loadingBlink 1s ease-in-out infinite alternate; }

@keyframes hintPulse { 50% { box-shadow: 0 0 0 10px rgba(101,255,208,.06), 0 0 24px rgba(101,255,208,.2); } }
@keyframes radiusPulse { from { opacity: .9; transform: scale(.65); } to { opacity: 0; transform: scale(1.6); } }
@keyframes panelIn { from { opacity: 0; transform: translateY(28px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes loadingBlink { from { opacity: .45; } to { opacity: 1; } }
@keyframes gateBreath { 50% { scale: 1.04; opacity: .72; } }
@keyframes gateOrbit { to { rotate: 360deg; } }

@media (max-width: 1050px) {
  .house-intro { width: min(380px, 38vw); }
  .house-intro h1 { font-size: 4rem; }
  .room-dock { left: 22px; transform: none; max-width: 56vw; overflow-x: auto; }
  .scene-gate { right: 18px; width: 46vw; }
  .scene-gate-orbit span:nth-child(n) { transform: none; }
  .scene-gate-orbit span:nth-child(1) { left: 50%; top: -18px; }
  .scene-gate-orbit span:nth-child(2) { left: 89%; top: 22%; }
  .scene-gate-orbit span:nth-child(3) { left: 89%; top: 72%; }
  .scene-gate-orbit span:nth-child(4) { left: 50%; top: calc(100% - 18px); }
  .scene-gate-orbit span:nth-child(5) { left: 4%; top: 72%; }
  .scene-gate-orbit span:nth-child(6) { left: 4%; top: 22%; }
}

@media (max-width: 700px) {
  body { overflow: hidden; }
  .house-page { min-height: 640px; }
  .house-page::before { background: linear-gradient(180deg, rgba(2,20,18,.72), transparent 38%, rgba(2,20,18,.42)); }
  .house-nav { inset: 10px 10px auto; gap: 8px; padding: 7px 8px; }
  .house-brand { gap: 8px; }
  .house-brand-mark { width: 44px; height: 44px; flex-basis: 44px; }
  .house-brand strong { font-size: .82rem; }
  .house-brand small { font-size: .62rem; }
  .house-back { min-height: 44px; padding: 0 11px; font-size: .66rem; }
  .house-intro { left: 16px; top: 90px; width: calc(100% - 32px); transform: none; }
  .house-intro h1 { max-width: 320px; margin-top: 10px; font-size: 2.8rem; }
  .house-intro > p:last-of-type, .explore-hint { display: none; }
  .radius-badge { right: 14px; top: 250px; grid-template-columns: 34px auto; padding: 8px 10px; }
  .radius-badge i { width: 34px; height: 34px; }
  .hotspot-tag { min-height: 34px; padding-right: 7px; }
  .hotspot-tag b { width: 23px; height: 23px; }
  .hotspot-tag span { display: none; }
  .hotspot-tag.is-active span { display: inline; }
  .detail-panel { right: 12px; bottom: 78px; width: calc(100% - 24px); max-height: calc(100svh - 168px); overflow-y: auto; padding: 18px; }
  .detail-panel h2 { font-size: 2rem; }
  .detail-panel > p { font-size: .8rem; }
  .detail-reference { min-height: 84px; grid-template-columns: 88px 1fr 24px; margin-top: 13px; padding: 7px; }
  .detail-reference img { width: 88px; height: 68px; }
  .detail-reference strong { margin-top: 4px; font-size: .72rem; }
  .task-list { margin-top: 13px; }
  .detail-link { min-height: 46px; margin-top: 15px; }
  .room-dock { left: 10px; right: 10px; bottom: 10px; max-width: none; overflow-x: auto; transform: none; }
  .room-dock button { min-height: 44px; }
  .house-page.is-gated .radius-badge { display: none; }
  .scene-gate {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 22px;
    width: auto;
    min-height: 0;
    transform: none;
  }
  .scene-gate::before { width: min(82vw, 340px); }
  .scene-gate-orbit { width: min(78vw, 320px); opacity: .66; }
  .scene-gate-copy { width: min(100%, 350px); padding: 20px; }
  .scene-gate-copy h2 { font-size: 2.15rem; }
  .scene-gate-copy > span { font-size: .72rem; }
  .scene-start { min-height: 62px; margin-top: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
