:root {
  --navy: #0a1224;
  --navy-2: #10182e;
  --velvet: #0c1a3a;
  --gold: #c9a46a;
  --gold-bright: #e8d5a3;
  --ivory: #f4ead7;
  --dim: #8a7d66;
  --danger: #8b3a3a;
  --ok: #3d6b4f;
  --shadow: rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #05070e;
  color: var(--ivory);
  font-family: "Cormorant Garamond", Georgia, serif;
  overflow: hidden;
}

button, input { font-family: inherit; }

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #05070e;
  overflow: hidden;
  perspective: 1400px;
}

#fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}

.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s ease;
}

.scene.active {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- ENTER ---------- */
#scene-enter {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 80%, #1a1630 0%, #05070e 70%);
}

.enter-card {
  text-align: center;
  z-index: 2;
}

.house-mark {
  letter-spacing: 0.55em;
  font-size: 0.72rem;
  color: var(--gold);
  text-transform: uppercase;
  font-family: Cinzel, serif;
  margin-bottom: 1.2rem;
}

h1.brand {
  font-family: Cinzel, serif;
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: 0.18em;
  color: var(--gold-bright);
}

.brand-sub {
  margin-top: 0.6rem;
  font-style: italic;
  color: var(--dim);
  font-size: 1.15rem;
}

.btn-gold {
  margin-top: 2.4rem;
  background: transparent;
  color: var(--gold-bright);
  border: 1px solid var(--gold);
  padding: 0.85rem 2.2rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: Cinzel, serif;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.btn-gold:hover {
  background: var(--gold);
  color: #1a1208;
  box-shadow: 0 0 24px rgba(201, 164, 106, 0.35);
}

.disclaimer {
  margin-top: 1.6rem;
  font-size: 0.78rem;
  color: #5c5346;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* ---------- INTRO ---------- */
#scene-intro {
  background: #05070e;
}

.full-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  filter: contrast(1.05) saturate(1.05);
  transform: scale(1.04);
  transition: opacity 0.8s ease, transform 6s ease;
}

#curtain-bg {
  background-image: url("../assets/images/n2sXn.jpg");
}

#butler-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#butler-layer img {
  height: 108%;
  width: auto;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,0.7));
  transition: opacity 0.55s ease, transform 0.8s ease;
}

#butler-layer img.hidden { opacity: 0; position: absolute; pointer-events: none; }

.subtitle {
  position: absolute;
  left: 50%;
  bottom: 6.5%;
  transform: translateX(-50%);
  max-width: min(720px, 88vw);
  text-align: center;
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--ivory);
  text-shadow: 0 2px 18px #000;
  z-index: 5;
  min-height: 3.2em;
}

/* ---------- REVEAL / CABINET ---------- */
#scene-reveal, #scene-cabinet {
  background: #08060c;
}

.cabinet-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 55%;
  transition: transform 2.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.cabinet-wrap.zoomed {
  transform: scale(1.55) translateY(4%);
}

.cabinet-frame {
  position: relative;
  height: min(92vh, 980px);
  width: auto;
}

.cabinet-frame img.cab {
  height: min(92vh, 980px);
  width: auto;
  display: block;
  filter: drop-shadow(0 30px 50px rgba(0,0,0,0.75));
}

.curtain-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52%;
  background: url("../assets/images/n2sXn.jpg") center/cover;
  z-index: 8;
  transition: transform 2.6s cubic-bezier(0.45, 0.02, 0.2, 1);
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

.curtain-panel.left { left: 0; transform-origin: left center; }
.curtain-panel.right { right: 0; transform-origin: right center; }
.curtains-open .curtain-panel.left { transform: translateX(-102%); }
.curtains-open .curtain-panel.right { transform: translateX(102%); }

#hand-pull, #hands-open, #hand-reach {
  position: absolute;
  pointer-events: none;
  z-index: 12;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.9s ease;
}

#hand-pull {
  width: min(70vw, 920px);
  right: 4%;
  bottom: 8%;
}

#hands-open {
  width: min(72vw, 980px);
  left: 50%;
  top: 38%;
  transform: translate(-50%, -40%);
}

#hand-reach {
  width: min(36vw, 420px);
  left: 18%;
  top: 30%;
}

.show-fx { opacity: 1 !important; }

/* hotspots over open cabinet */
#hotspots {
  position: absolute;
  inset: 18% 18% 28% 18%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3% 4%;
  z-index: 6;
}

.spot {
  position: relative;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.spot img {
  max-height: 88%;
  max-width: 88%;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.6));
  transition: filter 0.25s, transform 0.25s;
}

.spot::after {
  content: "";
  position: absolute;
  inset: -6%;
  border: 1px solid transparent;
  border-radius: 6px;
  box-shadow: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.spot:hover {
  transform: translateY(-4px) scale(1.04);
  z-index: 2;
}

.spot:hover::after {
  border-color: rgba(232, 213, 163, 0.7);
  box-shadow: 0 0 22px rgba(201, 164, 106, 0.35);
}

.spot.sold {
  pointer-events: none;
  filter: grayscale(0.6) brightness(0.55);
}

.spot.sold::before {
  content: "ACQUIRED";
  position: absolute;
  z-index: 3;
  font-family: Cinzel, serif;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: var(--gold);
}

.tooltip {
  position: absolute;
  left: 50%;
  bottom: 108%;
  transform: translateX(-50%);
  background: rgba(8, 8, 14, 0.92);
  border: 1px solid var(--gold);
  padding: 0.55rem 0.8rem 0.65rem;
  min-width: 160px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  text-align: center;
}

.spot:hover .tooltip { opacity: 1; }

.tooltip strong {
  display: block;
  font-family: Cinzel, serif;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  font-weight: 500;
}

.tooltip span {
  display: block;
  font-size: 0.82rem;
  color: #cfc3ad;
  margin-top: 0.15rem;
}

/* ---------- EXAMINE ---------- */
#scene-examine {
  background:
    radial-gradient(ellipse at 50% 40%, #1c140c 0%, #07060a 70%);
}

.examine-layout {
  height: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0;
}

.examine-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.palm {
  position: absolute;
  width: min(46vw, 520px);
  bottom: 4%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.85;
  z-index: 1;
}

.piece-turntable {
  position: relative;
  z-index: 2;
  width: min(42vw, 460px);
  height: min(62vh, 620px);
  perspective: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.piece-turntable .spin {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: filter 0.4s;
}

.piece-turntable img.gem {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,0.7));
  user-select: none;
  pointer-events: none;
}

.shine-overlay {
  position: absolute;
  inset: 8%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,245,210,0.45), transparent 42%);
  mix-blend-mode: screen;
  transition: opacity 0.4s;
}

.shine-overlay.on {
  opacity: 1;
  animation: sweep 2.8s ease-in-out infinite;
}

@keyframes sweep {
  0% { background-position: 0% 0%; filter: brightness(0.9); }
  50% { filter: brightness(1.35); }
  100% { filter: brightness(0.9); }
}

.examine-copy {
  padding: 7vh 4vw 4vh 2vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(201,164,106,0.22);
  background: linear-gradient(90deg, rgba(0,0,0,0.15), rgba(0,0,0,0.45));
}

.examine-copy h2 {
  font-family: Cinzel, serif;
  font-weight: 400;
  font-size: 1.7rem;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
}

.meta {
  margin: 0.4rem 0 1.1rem;
  color: var(--dim);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.lore {
  font-size: 1.12rem;
  line-height: 1.55;
  color: #e6dcc8;
  max-width: 38rem;
}

.actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.actions button {
  background: transparent;
  color: var(--ivory);
  border: 1px solid rgba(201,164,106,0.45);
  padding: 0.62rem 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.64rem;
  cursor: pointer;
  font-family: Cinzel, serif;
  transition: 0.25s;
}

.actions button:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(201,164,106,0.08);
}

.actions button.primary {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.actions button.ghost { opacity: 0.75; }

/* HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  pointer-events: none;
}

#hud button, #hud .mark {
  pointer-events: auto;
}

#hud .mark {
  font-family: Cinzel, serif;
  letter-spacing: 0.32em;
  font-size: 0.62rem;
  color: var(--gold);
  text-transform: uppercase;
}

.icon-btn {
  background: transparent;
  border: 1px solid rgba(201,164,106,0.35);
  color: var(--gold);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 0.85rem;
}

.skip {
  position: absolute;
  right: 1.4rem;
  bottom: 1.3rem;
  z-index: 50;
  background: transparent;
  border: none;
  color: #7a6f5c;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.62rem;
  font-family: Cinzel, serif;
  cursor: pointer;
}

.skip:hover { color: var(--gold); }

/* modal */
.modal {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 8, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.modal.open { display: flex; }

.modal-card {
  width: min(420px, 90vw);
  background: #121018;
  border: 1px solid var(--gold);
  padding: 1.8rem 1.6rem 1.5rem;
  text-align: center;
}

.modal-card h3 {
  font-family: Cinzel, serif;
  letter-spacing: 0.16em;
  color: var(--gold-bright);
  font-weight: 400;
  margin-bottom: 0.8rem;
}

.modal-card p { color: #d7ccb6; line-height: 1.5; margin-bottom: 1.1rem; }

.modal-card input {
  width: 100%;
  background: #0b0b10;
  border: 1px solid #4a3f2c;
  color: var(--ivory);
  padding: 0.55rem 0.7rem;
  font-size: 1.05rem;
  margin-bottom: 1rem;
  text-align: center;
}

.toast {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(10,10,16,0.92);
  border: 1px solid var(--gold);
  padding: 0.7rem 1.1rem;
  opacity: 0;
  pointer-events: none;
  transition: 0.4s;
  z-index: 70;
  font-size: 1.05rem;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 860px) {
  .examine-layout { grid-template-columns: 1fr; }
  .examine-copy {
    border-left: none;
    border-top: 1px solid rgba(201,164,106,0.22);
    padding: 1.2rem 1.2rem 2rem;
  }
  .piece-turntable { height: 42vh; width: 80vw; }
  .palm { display: none; }
}
