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

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f5f5f8;
  background: #050811;
  overflow: hidden;
}

/* Banner */
.banner {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 32px;
  background: #050811;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
  width: 120px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e0ecff;
}

.brand .title {
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand .tagline {
  font-size: 11px;
  opacity: 0.75;
}

/* Viewport */
#viewport {
  position: relative;
  height: calc(100vh - 56px);
  width: 100vw;
  overflow: hidden;
}

/* Cosmic background behind everything */
#cosmos {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(1.1);
  transition: opacity 800ms ease-in-out;
}

/* Frosted glass wall filling the viewport */
#glass-wall {
  position: absolute;
  inset: 0;
  padding: 40px 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.wall-inner {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  background: radial-gradient(circle at 20% 0%, rgba(255,255,255,0.08), transparent 55%),
              radial-gradient(circle at 80% 100%, rgba(255,255,255,0.08), transparent 55%),
              rgba(40, 44, 56, 0.55);
  backdrop-filter: blur(18px);
  box-shadow:
    0 40px 80px rgba(0,0,0,0.65),
    inset 0 0 0 1px rgba(255,255,255,0.09);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 32px 56px 40px;
}

.portal-title {
  font-size: 20px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-top: 8px;
}

.portal-subtitle {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.8;
}

/* Doors row */
#doors-row {
  margin-top: 46px;
  width: 100%;
  max-width: 1100px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
}

.door {
  position: relative;
  flex: 1 1 0;
  border: none;
  border-radius: 26px;
  padding: 32px 18px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.85), rgba(230,234,242,0.85));
  color: #1d2434;
  cursor: pointer;
  box-shadow:
    0 20px 40px rgba(0,0,0,0.4),
    inset 0 0 0 1px rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  transition:
    transform 180ms ease-out,
    box-shadow 180ms ease-out,
    background 180ms ease-out;
}

.door::before {
  /* subtle frame inset that matches wall, makes the door feel 'cut into' the wall */
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.08);
  pointer-events: none;
  mix-blend-mode: multiply;
}

.door-label {
  font-size: 15px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.door-copy {
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.85;
}

.door.hover-crack {
  transform: translateX(-14px); /* small left slide */
  box-shadow:
    0 24px 48px rgba(0,0,0,0.55),
    inset 0 0 0 1px rgba(255,255,255,0.9);
}

/* subtle highlight at the exposed crack (right edge) */
.door.hover-crack::after {
  content: "";
  position: absolute;
  top: 18px;
  right: -8px;
  width: 14px;
  bottom: 18px;
  border-radius: 10px;
  background: linear-gradient(to right, rgba(255,255,255,0.0), rgba(255,255,255,0.9));
  opacity: 0.85;
}

/* Full slide open */
.door.open {
  transform: translateX(-120%);
  box-shadow: none;
}

/* Room overlay (cosmic room) */
#room-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 60px;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 450ms ease-in-out;
}

.room-content {
  max-width: 640px;
  margin-top: 40px;
}

.room-content h2 {
  font-size: 26px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.room-content p {
  font-size: 14px;
  max-width: 560px;
  line-height: 1.6;
  opacity: 0.9;
}

.room-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  opacity: 0.9;
}

#return-lobby {
  background: rgba(5, 8, 17, 0.75);
  border-radius: 999px;
  padding: 8px 18px;
  border: 1px solid rgba(255,255,255,0.65);
  color: #e6ecff;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

/* --- State: room open vs lobby --- */

body.room-open #glass-wall {
  opacity: 0;
  transform: translateY(10px) scale(1.01);
  transition:
    opacity 380ms ease-in-out,
    transform 380ms ease-in-out;
  pointer-events: none;
}

body.room-open #room-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile-ish */
@media (max-width: 960px) {
  #glass-wall {
    padding: 16px;
  }

  .wall-inner {
    padding: 18px 20px 26px;
  }

  #doors-row {
    flex-direction: column;
    gap: 16px;
  }

  .door {
    padding: 22px 14px;
  }
}
