* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #000000;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  font-family: 'Comic Sans MS', 'Arial', sans-serif;
}

#backgroundImage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.1;
  transition: opacity 0.5s ease-in-out;
}

#content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#friendly-character {
  position: absolute;
  top: 25%;
  left: 11%;
  width: 50px;
  height: 60px;
}

/* Turn #captions into a dialogue bubble with an arrow */
#captions {
  position: absolute;
  left: 25%;
  top: 10%;
  transform: translate(-50%, 0);
  width: fit-content;
  text-align: center;
  background: #000000;          /* same light bubble color */
  border: 4px solid #ffffff;    /* teal border */
  border-radius: 12px;          /* rounded corners for the box only */
  color: hsl(0, 0%, 100%);
  font-size: 1.5em;
  padding: 16px 20px;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(235, 235, 235, 0.5);
  z-index: 1;
  transition: opacity 0.7s ease-in-out;
}

/* sharp arrow at the bottom */
#captions::before {
  content: "";
  position: absolute;
  left: 30%;
  top: 100%;
  transform: translateX(-50%) translateY(4px);
  width: 0;
  height: 0;
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  border-top: 26px solid #ffffff; /* border color */
  z-index: -1;
}

/* Keep your fade-in animation for showing the caption */
#captions.fadeIn {
  opacity: 1;
}

#captions p {
  margin: 0 1.2em;
}

#choices {
  position: absolute;
  top: 45%;
  left: 67%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  width: 800px;
  height: 600px;
  row-gap: 30px;
  column-gap: 80px;
}

#choices:has(.option:nth-child(3):last-child) {
  display: grid;
  grid-template-areas:
    "top top"
    "left right";
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

/* Top button centered */
#choices:has(.option:nth-child(3):last-child) .option:nth-child(1) {
  grid-area: top;
  place-self: center;
}

/* Bottom-left button aligned to left */
#choices:has(.option:nth-child(3):last-child) .option:nth-child(2) {
  grid-area: left;
  place-self: center start; /* center vertically, stick to left */
}

/* Bottom-right button aligned to right */
#choices:has(.option:nth-child(3):last-child) .option:nth-child(3) {
  grid-area: right;
  place-self: center end;   /* center vertically, stick to right */
}


#choices:has(.option:nth-child(4):last-child) {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.option {
  width:  320px;
  height: 320px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 3px solid #1E90FF;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option img, .option video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.option .option-text {
  position: absolute;
  bottom: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 1.2em;
  padding: 8px 12px;
  border-radius: 10px;
  text-align: center;
  width: 80%;
  opacity: 0;
  transition: opacity 0.3s;
}

.option:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.6);
}

.option:hover .option-text {
  opacity: 1;
}

#restart {
  display: none;
  background: linear-gradient(135deg, #32CD32, #228B22);
  color: #fff;
  padding: 20px 40px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-size: 1.4em;
  margin-top: 20px;
  transition: background 0.3s, transform 0.2s;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

#restart:hover {
  background: linear-gradient(135deg, #228B22, #006400);
  transform: scale(1.08);
}

.option-enter {
  animation: slideIn 0.5s ease-out forwards;
}

.fadeOut {
  animation: fadeOut 0.5s ease-in forwards;
}

@keyframes slideIn {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}