*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000;
  color: #05070a;
}

/* =======================
   Background slideshow
   ======================= */

.background-slideshow {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
}

.bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.bg1 { background-image: url("images/bg1.jpg"); }
.bg2 { background-image: url("images/bg2.jpg"); }
.bg3 { background-image: url("images/bg3.jpg"); }

.bg.visible {
  opacity: 1;
}

/* =======================
   Lobby: frosted wall + doors
   ======================= */

.lobby {
  position: fixed;
  inset: 0;
  z-index: -1;
  transform-origin: 50% 50%;
  transition: transform 1.2s ease-out;
}

/* Full-page frosted white wall */
.frosted-wall {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5); /* 50% */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Banner */
.sp-header {
  position: absolute;
  top: 10vh;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: #111;
}

.sp-logo {
  font-size: 2.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sp-tagline {
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

/* Doors stage & layout */
.door-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10vh; /* roughly 1 unit from bottom */
}

.door-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  /* We simulate: 2 units side, then doors with 1-unit gaps between,
     total 19 units; use flex + gap & padding as approximation */
  padding: 0 10vw; /* ~2 units edges */
  gap: 5vw;        /* ~1 unit between frames */
}

/* Frame around each door (the "hole" in the wall region) */
.door-frame {
  position: relative;
  padding: 10px; /* 10px gap around door */
  border-radius: 10px;
}

/* Doors: 30:80 aspect ratio approximation */
.door {
  position: relative;
  width: min(10vw, 140px);  /* width "3 units" */
  height: calc( (80 / 30) * min(10vw, 140px) ); /* 8 units tall */
  border: 2px solid #c0c3cd; /* 2px grey outline */
  border-radius: 10px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

/* The door panel itself – same frost as wall but independent */
.door-inner {
  position: relative;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.5); /* 50% */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Door label: 30% down from top */
.door-label {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #222;
}

/* Chrome finger slot */
.door-slot {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 4px;
  height: 38%;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    #f8f8f8,
    #b0b4be,
    #f8f8f8
  );
  box-shadow:
    inset 0 0 2px rgba(0,0,0,0.4),
    0 0 4px rgba(0,0,0,0.3);
}

/* Hover: click open, slide 20px to the left */
.door:hover .door-inner {
  transform: translateX(-20px);
  transition: transform 0.18s ease-out;
}

/* =======================
   Zoom-through animation
   ======================= */

body.lobby-zooming {
  overflow: hidden;
}

.lobby.zoom-out {
  /* scale defined in JS via inline style with transform-origin at door center */
  transition: transform 1.2s ease-out;
}

/* =======================
   Rooms
   ======================= */

.room {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 5vw 5vh;
  color: #f5f5f5;
  text-shadow: 0 0 8px rgba(0,0,0,0.85);
  z-index: 2;
}

.room-active {
  display: flex;
}

.room-content {
  max-width: 780px;
  background: rgba(5, 7, 12, 0.78);
  padding: 1.5rem 1.8rem;
  border-radius: 16px;
  margin-bottom: 1rem;
}

.room-content h1 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
}

.room-content p {
  margin: 0;
  font-size: 0.98rem;
}

/* Return to lobby button */
.btn-back {
  align-self: flex-end;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.75);
  background: rgba(0,0,0,0.5);
  color: #f5f5f5;
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

.btn-back:hover {
  background: rgba(255,255,255,0.1);
}

/* Attribution area */
.attribution {
  position: fixed;
  left: 5vw;
  bottom: 3vh;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* =======================
   Responsive tweaks
   ======================= */

@media (max-width: 900px) {
  .sp-logo {
    font-size: 1.7rem;
  }

  .door {
    width: min(16vw, 120px);
  }

  .door-stage {
    padding-bottom: 8vh;
  }

  .door-row {
    padding: 0 6vw;
    gap: 4vw;
  }

  .room-content {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .sp-header {
    top: 7vh;
  }

  .door-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 5vw;
  }

  .door {
    width: 32vw;
  }

  .door-stage {
    align-items: center;
  }
}
