:root {
  --dialogue-size: 22px; /* DEFAULT */
}

html, body {
  margin: 0;
  height: 100%;
  background: #0b0d12;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #ffffff;
}

#scene {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* BACKGROUND */
#bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

/* CHARACTERS */
#stage {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 4vw;
  pointer-events: none;
  z-index: 2;
}

.char {
  width: min(32vw, 480px);
  max-height: 90vh;
  opacity: 0;
}

.char.show {
  opacity: 1;
}

/* DIALOGUE */
#dialogueBox {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  width: min(960px, calc(100% - 32px));
  background: rgba(20, 24, 38, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 22px;
  padding: 20px 24px;
  z-index: 6;
  cursor: pointer;
}

#nameplate {
  font-size: 20px;
  font-weight: 700;
  color: #ffd6e9;
  margin-bottom: 6px;
}

#text {
  font-size: var(--dialogue-size);
  line-height: 1.55;
  color: #ffffff;
  min-height: 64px;
}

#continue {
  position: absolute;
  right: 18px;
  bottom: 14px;
  font-size: 20px;
  opacity: 0.8;
}

/* CHOICES */
#choices {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 160px;
  width: min(760px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 7;
}

.choiceBtn {
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(28, 32, 48, 0.8);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.18);
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
}

/* MENU */
#menuBtn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 8;
}

#menuOverlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

#menuOverlay.hidden {
  display: none;
}

.menuCard {
  background: rgba(24, 28, 44, 0.9);
  backdrop-filter: blur(14px);
  padding: 24px;
  border-radius: 22px;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #ffffff;
}

/* START */
#tapToStart {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11;
}

.startCard {
  text-align: center;
}

/* MEAL */
#mealPicker {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mealPicker.hidden {
  display: none;
}

/* FADE */
#fadeOverlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, #ff9fcf 0%, #000 70%);
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
  z-index: 9;
}

#fadeOverlay.show {
  opacity: 1;
}

/* TITLE SCREEN BACKGROUND */
#scene.title-bg #bg {
  filter: blur(6px) brightness(0.6);
  transform: scale(1.05);
}

/* Smooth transition when game starts */
#bg {
  transition: filter 0.6s ease, transform 0.6s ease;
}
