html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: #050808;
  overflow: hidden;
}

body {
  position: relative;
  font-family: monospace;
}

@font-face {
  font-family: "AnimalCrossing";
  src: url("./fonts/animal-crossing-font.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* Centers the entire 1200 x 1100 scene */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Taller canvas so the buttons are part of the scene */
.intro-wrap {
  position: relative;
  width: 1200px;
  height: 1100px;
  flex: 0 0 auto;
  transform: scale(1);
  transform-origin: center center;
}

/* Character */
.me-cutout {
  position: absolute;
  left: 528px;
  top: 504px;
  width: 400px;
  height: auto;
  display: block;
  z-index: 2;
  transform: translate(-50%, -50%) rotate(-2deg);
  transform-origin: center center;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.me-cutout:hover {
  transform: translate(-50%, -50%) rotate(-4deg);
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.38));
}

/* Computer */
.computer-cutout {
  position: absolute;
  left: 618px;
  top: 486px;
  width: 700px;
  height: auto;
  display: block;
  z-index: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
}

/* Eye */
.eye-link {
  position: absolute;
  left: 708px;
  top: 324px;
  width: 140px;
  display: block;
  cursor: pointer;
  z-index: 5;
  transform: translate(-50%, -50%) rotate(-6deg);
}

.eye-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.construction-gif {
  position: absolute;
  width: 300px;
  height: auto;
  z-index: 3;
  pointer-events: none;
  user-select: none;
}

.construction-left {
  left: 0px;
  top: 530px;
  transform: translate(-50%, -50%);
}

.construction-right {
  left: 1200px;
  top: 530px;
  transform: translate(-50%, -50%);
}

/* Optional reference image */
.reference-bg {
  position: absolute;
  left: 624px;
  top: 477px;
  width: 680px;
  height: auto;
  z-index: 0;
  transform: translate(-50%, -50%);
  opacity: 0.28;
  pointer-events: none;
  user-select: none;
}

/* Optional enter text */
.enter-text {
  position: absolute;
  left: 600px;
  bottom: 70px;
  z-index: 10;
  transform: translateX(-50%);
  color: #000000;
  font-family: monospace;
  font-size: 1.5rem;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  opacity: 0.85;
  pointer-events: none;
  white-space: nowrap;
}

/* Fade */
.fade {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #050808;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.fade.show {
  opacity: 1;
}

/* Flash */
.flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at center,
      rgba(255,255,255,1) 0%,
      rgba(255,255,255,.95) 8%,
      rgba(255,255,255,.65) 18%,
      rgba(255,255,255,.18) 35%,
      rgba(255,255,255,0) 60%
    ),
    linear-gradient(
      to bottom,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,.95) 50%,
      rgba(255,255,255,0) 100%
    );
  mix-blend-mode: screen;
}

.flash-overlay.flash {
  animation: beamFlash 1.4s ease-in-out forwards;
}

/* Dialogue bubble */
.dialog-box {
  position: absolute;
  left: 600px;
  top: 720px;
  width: 600px;
  z-index: 20;
  transform: translate(-50%, -50%);
}

.dialog-bubble {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  user-select: none;
  pointer-events: none;
}

/* Dialogue text */
.dialog-text-area {
  position: absolute;
  left: 13%;
  top: 56%;
  width: 70%;
  z-index: 21;
}

.dialog-text {
  color: #000000 !important;
  font-family: "AnimalCrossing", monospace;
  font-size: 2rem;
  line-height: 1.25;
  min-height: 3.5em;
  text-transform: none;
  cursor: pointer;
  overflow-wrap: break-word;
}

/* Dialogue choices */
.dialog-choices-area {
  position: absolute;
  left: 6%;
  top: 90%;
  width: 88%;
  z-index: 21;
  display: none;
}

.dialog-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.dialog-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 90px;
  padding: 0 16px;
  border: none;
  background: url("./images/button1.png") center center / 100% 100% no-repeat;
  color: #2f2a35;
  font-family: "AnimalCrossing", monospace;
  font-size: 2rem;
  text-align: center;
  text-transform: none;
  cursor: pointer;
  image-rendering: pixelated;
}

.dialog-choice:hover {
  transform: translateY(-1px);
}

.dialog-choice:focus {
  outline: none;
}

@keyframes beamFlash {
  0% {
    opacity: 0;
    transform: scale(.85);
  }
  12% {
    opacity: .35;
    transform: scale(.95);
  }
  25% {
    opacity: 1;
    transform: scale(1.02);
  }
  38% {
    opacity: .55;
    transform: scale(1.08);
  }
  52% {
    opacity: 1;
    transform: scale(1.12);
  }
  68% {
    opacity: .7;
    transform: scale(1.18);
  }
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}