* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #000;
    position: relative;
}

.bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
}

.bg-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.title {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25%;
    height: 50%;
    overflow: hidden;
}

.title-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Plane starts near bottom; no 'top:50%' */
.airplane {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: min(15%, 540px);
    /* adjust size to taste */
    bottom: 39%;
    /* parked position on load */
    z-index: 2;
    pointer-events: none;
    will-change: bottom, transform;
}

.airplane-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.left{
  position: absolute;
  top: 50%;
  left: 33%;
  width: 15%;
}
.right{
  position: absolute;
  top: 50%;
  left: 52%;
  width: 15%;
}

/* Fly on click */
.airplane.fly {
    animation: fly-up 1.8s cubic-bezier(.2, .65, .3, 1) forwards;
    will-change: bottom, transform;
}

@keyframes fly-up {
    from {
        bottom: 0%;
        transform: translateX(-50%);
    }

    to {
        bottom: 40%;
        transform: translateX(-50%);
    }
}

/* keep button above plane for easy clicking */
.button-start {
    z-index: 3;
}

.button-start {
    position: absolute;
    top: 85%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15%;
    height: 50%;
    overflow: hidden;
    border: none;
    background: none;
    outline: none;
}

.button-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Fade & hide base UI when modal is open */
.modal-open .title,
.modal-open .airplane,
.modal-open .button-start{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease;
}

/* (optional) ensure default state is visible */
.title, .airplane, .button-start { opacity: 1; visibility: visible; }


/* Modal overlay (update) */
.modal{
  position: fixed;
  inset: 0;
  display: grid;                 /* keep layout, control visibility via opacity */
  place-items: center;
  background: rgba(0,0,0,.6);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease-out, visibility 0s linear .25s;
}
.modal.show{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .25s ease-out;
}

.modal-dialog {
    position: relative;
    width: 20%;
    height: 60vh;
    pointer-events: auto;
}
.modal-bg {
    width: 100%;
    display: block;
}
.cta-again {
    position: absolute;
    left: 50%;
    bottom: 0%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    width: min(70%, 420px);
}

.cta-again:focus {
    outline: none;
    border: none;
}

.button-start:focus {
    outline: none;
    border: none;
}

.cta-again img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===========================
   Responsive (≤ 768px)
   =========================== */
@media (max-width: 768px) {

  /* Use full width canvas on mobile */
  .content { width: 100%; }
.bg{
    width: 100%;
}
.bg-img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}
  /* Title bigger and a bit lower */
  .title{
    top: 12%;
    width: 95vw;
    height: auto;
    transform: translate(-50%, -50%);
  }
  .title-img{ height: auto; }

  /* Plane larger and sits a bit lower before takeoff */
  .airplane{
    width: 55vw;
    bottom: 45%;
    transform: translateX(-50%);
  }

.left{
  left: 1%;
  width: 50%;
}
.right{
  left: 50%;
  width: 50%;
}


  /* Slightly longer flight feels smoother on small screens */
  .airplane.fly{
    animation-duration: 2.0s;
  }

  /* Override keyframes for mobile so stop point feels centered */
  @keyframes fly-up{
    from { bottom: 0%;  transform: translateX(-50%); }
    to   { bottom: 42%; transform: translateX(-50%); }
  }

  /* Start button wider and a touch lower */
  .button-start{
    top: 80%;
    width: 68vw;
    height: auto;
  }
  .button-img{ height: auto; }

  /* Popup: use most of the width and auto height */
  .modal-dialog{
    width: 90vw;
    height: 75vh;
  }
  .modal-bg{ width: 100%; }

  /* CTA area sized for thumbs */
  .cta-again{
    width: 64vw;
    bottom: 4%;
  }
}

/* ===========================
   Extra-small (≤ 420px)
   =========================== */
@media (max-width: 420px) {

  .title{
    top: 11%;
    width: 76vw;
  }

  .airplane{
    width: 55vw;
    bottom: 40%;
  }
.left{
  left: 1%;
  width: 50%;
}
.right{
  left: 50%;
  width: 50%;
}
  .button-start{
    top: 90%;
    width: 72vw;
  }

  .modal-dialog{ width: 80vw; }
  .cta-again{ width: 70vw; bottom: 3.5%; }
}
