* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  background: #05070f;
  overflow: hidden;
  font-family: 'Jost', sans-serif;
}

#rotate-wrapper {
  position: absolute;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  overflow: hidden;
}
@media screen and (max-aspect-ratio: 1/1) {
  #rotate-wrapper {
    width: 100vh;
    height: 100vw;
    transform: rotate(90deg);
    transform-origin: top left;
    top: 0;
    left: 100%;
  }
}

#stage {
  position: absolute;
  top: 0; left: 0;
  width: 1600px; height: 900px;
  transform-origin: 0 0;
  overflow: hidden;
  cursor: pointer;
}

/* ---------- background ---------- */
#bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-color: #12142f;
  background-size: cover;
  background-position: center;
  transition: background-image 0.25s ease;
}

/* ---------- characters ---------- */
.char-slot {
  position: absolute;
  bottom: 260px;
  height: 780px;
  width: auto;
  opacity: 0;
  transition: opacity 0.25s ease, filter 0.25s ease;
  filter: brightness(0.55) drop-shadow(0 28px 16px rgba(0,0,0,0.55));
}
.char-slot.visible { opacity: 1; }
.char-slot.speaking { filter: brightness(1) drop-shadow(0 28px 16px rgba(0,0,0,0.55)); }
#char-left   { left: 60px; }
#char-center { left: 50%; transform: translateX(-50%); }
#char-right  { right: 60px; }

/* ---------- dialogue box ---------- */
#dialogue-box {
  position: absolute;
  left: 60px;
  right: 60px;
  bottom: 40px;
  min-height: 170px;
  background: rgba(11, 15, 46, 0.85);
  border: 1px solid rgba(184, 169, 224, 0.35);
  border-radius: 10px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 26px 34px;
  z-index: 10;
}
#name-tag {
  display: inline-block;
  margin: -46px 0 12px 0;
  padding: 8px 22px;
  background: rgba(242, 200, 121, 0.18);
  border: 1px solid rgba(242, 200, 121, 0.55);
  border-radius: 6px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 22px;
  color: #f2c879;
}
#name-tag:empty { display: none; }
#dialogue-text {
  font-size: 21px;
  line-height: 1.6;
  color: #f5f3fa;
  white-space: pre-wrap;
}
#advance-hint {
  position: absolute;
  right: 26px;
  bottom: 18px;
  color: #b8a9e0;
  animation: bob 1.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ---------- choices ---------- */
#choices {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(5, 7, 15, 0.6);
}
#choices.visible { display: flex; }
.choice-btn {
  width: 620px;
  padding: 18px 26px;
  font-family: 'Jost', sans-serif;
  font-size: 20px;
  letter-spacing: 1px;
  color: #f5f3fa;
  background: rgba(46, 31, 94, 0.75);
  border: 1px solid rgba(184, 169, 224, 0.4);
  border-radius: 8px;
  cursor: pointer;
}
.choice-btn:hover {
  background: rgba(74, 52, 138, 0.9);
  border-color: #f2c879;
}
