* {
  box-sizing: border-box;
  font-family: sans-serif;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  /* overflow: hidden; prevent page scrolling */
}

.screen {
  position: absolute;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

button,
.btn {
  padding: 14px 28px;
  font-size: 18px;
  border: none;
  border-radius: 10px;
  background: white;
}

button{
  cursor: pointer;
}

#menu button {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
}

.bg {
  z-index: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  object-fit: cover; /* cover the screen without stretching */
}

.animation {
  position: absolute;
  /* bottom: 40%; */
  /* left: 50%; */
  /* transform: translateX(-50%); */
  /* max-width: 80%; */
  width: 100vw;
}

.narrator {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 80%;
  text-align: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
}

.gameplay-bottom {
  position: absolute;
  bottom: 2%;
  left: 5%;
  right: 5%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
  width: 90%;
  height: 120px;
}

.narrator-bottom {
  grid-column: 1 / span 3;
  grid-row: 1 / span 2;
  text-align: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.mood-container {
  grid-column: 4;
  grid-row: 1;
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mood {
  width: 100%;
  height: auto;
}

.prev {
  display: none;
}

.next {
  grid-column: 4;
  grid-row: 2;
  width: 100%;
  align-self: end;
  justify-self: center;
}

.retryBtn {
  position: relative;
  left: auto;
  bottom: auto;
  width: 70%;
  /* margin-top: 20px; */
}

.dialog-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  z-index: 2;
}

.dialog {
  position: relative;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 16px;
  border-radius: 12px;
  z-index: 1; /* ← ADD THIS - lower than choices */
}

.dialog-box {
  width: 100%;
  position: relative;
  z-index: 1;
}

.dialog-content {
  /* position: absolute; */
  /* top: 50%;
  left: 50%; */
  align-items: center;
  align-content: center;
  /* remove unexpected offset so content aligns inside the dialog container */
  transform: none;
  width: 85%;
  z-index: 1;
  color: black;
}

.name-box {
  width: 40%;
  margin-bottom: -12px;
}

.name {
  font-weight: bold;
  margin-bottom: 12px;
  font-size: 16px;
  /* background-color: rgba(0, 0, 0, 0.3); */
  color: white;
}

.narrator-inside {
  color: black;
  /* background-color: rgba(0, 0, 0, 0.3); */
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.choices {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 3; /* ← Already have this, good */
  pointer-events: auto; /* ← ADD THIS to be extra sure */
}

.choices button {
  width: 100%;
  padding: 16px;
  text-align: left;
  background-size: cover;
  background-position: center;
  background-color: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  font-size: 14px;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  transition: transform 0.2s ease;
  min-height: 60px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 10;
}

.choices button:hover {
  transform: scale(1.05);
}

#optionNarrator {
  color: white;
  font-size: 16px;
  line-height: 1.6;
}

/* Ensure dialog and choices are above background and receive pointer events */
.dialog-container {
  z-index: 50;
}

.choices button {
  z-index: 60;
}

.dialog-content {
  pointer-events: none; /* ← Dialog content won't block clicks */
}

.ending {
  width: 50vw;
  position: absolute;
  align-items: center;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.endingTitle {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 20px;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.endingText {
  position: relative;
  background: rgba(0, 0, 0, 0.8);
  top: auto;
  width: 100%;
  padding: 24px;
  margin-bottom: 6px;
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
  color: white;
}

.endingBtn {
  position: relative;
  left: auto;
  bottom: auto;
  width: 50%;
  cursor: pointer;
  margin: 2px 0px;
  scale: 0.9;
}

.educationText {
  position: relative;
  background: rgba(0, 0, 0, 0.8);
  top: auto;
  width: 100%;
  padding: 24px;
  margin-bottom: 20px;
  border-radius: 10px;
  color: white;
}