/* Base sci-fi layout, simple elements only */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: Arial, Helvetica, sans-serif; color: #cfe8ff; }
body { background: #020512; }

#bg {
  position: fixed;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: blur(6px);
  transform: scale(1.05);
}

#app {
  position: relative;
  max-width: 1100px;
  margin: 5vh auto; /* >=5% margin around */
  padding: 16px;
  background: rgba(2, 10, 30, 0.6);
  border: 1px solid rgba(160, 220, 255, 0.35);
  border-radius: 12px;
  box-shadow: 0 0 24px rgba(120, 200, 255, 0.3), inset 0 0 24px rgba(120,200,255,0.15);
  backdrop-filter: blur(2px);
}

#title { text-align: center; margin: 0 0 12px; letter-spacing: 2px; text-shadow: 0 0 8px #7dd0ff; }

#train {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
#train .train-cart {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 2px solid rgba(125, 208, 255, 0.4);
  border-radius: 6px;
  background: rgba(0,0,0,0.25);
  padding: 4px;
}
#train .train-cart.active {
  border-color: #ff3b3b;
  box-shadow: 0 0 10px rgba(255, 74, 74, 0.8);
}

#stage {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr; /* col-3 col-6 col-3 vibe */
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
#stage img {
  width: 100%;
  aspect-ratio: 1 / 1; /* square for scene, avatars also square */
  object-fit: cover;
  background: rgba(0,0,0,0.35);
  border-radius: 10px;
  border: 1px solid rgba(160, 220, 255, 0.35);
  box-shadow: inset 0 0 18px rgba(120, 200, 255, 0.25);
}

#stage img.img-avatar {
    aspect-ratio: 1 / 2;
}

#scene-image { aspect-ratio: 1 / 1; }

#dialog {
  border: 1px solid rgba(160, 220, 255, 0.35);
  border-radius: 10px;
  padding: 10px;
  background: rgba(5, 14, 40, 0.6);
  box-shadow: inset 0 0 18px rgba(120, 200, 255, 0.2);
}
#dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
#speaker { font-weight: bold; text-shadow: 0 0 6px #7dd0ff; }
#next {
  background: transparent;
  border: 1px solid rgba(160, 220, 255, 0.6);
  color: #cfe8ff;
  padding: 6px 10px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(120,200,255,0.4);
}
#next:hover{ box-shadow: 0 0 14px rgba(120,200,255,0.7); }

#next.btn-disabled { visibility: hidden; }

#dialog-text { min-height: 60px; }
#dialog-text .action { color: #9fe1ff; text-decoration: underline; }

#inventory { margin-top: 12px; opacity: 0.9; }

@media (max-width: 700px){
  #stage { grid-template-columns: 1fr; }
}
