/* ==========================================================================
   Header & Hamburger Button
   ========================================================================== */
.site-header {
  height: 64px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 18px;
  z-index: 2500;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: transparent;
  opacity: 0;
  transition: opacity 1s ease-out 0.4s;
}

.site-header.loaded {
  opacity: 1;
}

.header-logo {
  display: none;
  flex-direction: column;
  color: var(--color-text-dark);
}

.logo-accent {
  font-family: var(--font-circus);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 2px;
  color: #506173;
}

.logo-sub {
  font-family: var(--font-circus);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 1px;
  margin-top: 1px;
  opacity: 0.85;
}

.menu-btn {
  background: var(--color-sub-blue);
  border: 2px solid var(--color-white);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(122, 144, 166, 0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-top: 10px;
  position: relative;
  z-index: 2500;
}

.menu-btn:hover,
.menu-btn:active {
  transform: scale(1.05);
  background: #627991;
}

.menu-btn-icon {
  width: 18px;
  height: 2px;
  background: var(--color-white);
  position: relative;
  transition: background 0.3s;
}

.menu-btn-icon::before,
.menu-btn-icon::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 2px;
  background: var(--color-white);
  left: 0;
  transition: transform 0.3s;
}

.menu-btn-icon::before {
  top: -5px;
}

.menu-btn-icon::after {
  bottom: -5px;
}

.menu-btn-text {
  font-family: var(--font-eng);
  font-size: 7px;
  font-weight: 600;
  color: var(--color-white);
  margin-top: 8px;
  letter-spacing: 0.5px;
}

.menu-btn.is-active .menu-btn-icon {
  background: transparent;
}

.menu-btn.is-active .menu-btn-icon::before {
  transform: rotate(45deg) translate(4px, 3px);
}

.menu-btn.is-active .menu-btn-icon::after {
  transform: rotate(-45deg) translate(4px, -3px);
}

@media (min-width: 769px) {
  .site-header {
    height: auto;
    padding: 24px 40px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2500;
    justify-content: space-between;
  }

  .header-logo {
    display: flex;
  }

  .logo-pc {
    display: block;
    font-family: var(--font-jap);
    font-size: 22px;
    font-weight: 700;
    color: #4a3c31;
    letter-spacing: 1px;
    opacity: 0.95;
  }

  .logo-mobile {
    display: none;
  }

  .menu-btn {
    display: flex;
    width: 62px;
    height: 62px;
    z-index: 2550;
    margin-top: 0;
  }

  .menu-btn-text {
    font-size: 12px;
  }
}

/* ==========================================================================
   Hero Layout, Background & Illustration Overlays
   ========================================================================== */
.hero-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 0;
  position: relative;
  z-index: 10;
  opacity: 0;
  filter: blur(8px);
  transform: scale(1.04);
  transition: opacity 3.2s ease-out, filter 3.2s cubic-bezier(0.16, 1, 0.3, 1), transform 3.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-container.loaded {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

.illustration-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  z-index: 1;
}

.scenery-bg-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  aspect-ratio: 897 / 1370;
  width: 100%;
  height: auto;
}

@media (max-aspect-ratio: 897/1370) {
  .scenery-bg-content {
    width: auto;
    height: 100%;
  }
}

.scenery-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../assets/background_sp.jpg');
  background-size: cover;
  background-position: center bottom;
  z-index: 1;
}

/* Twinkling Stars */
.stars-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  top: -10%;
  fill: var(--color-gold-glitter);
  filter: drop-shadow(0 0 6px rgba(243, 215, 139, 0.8));
  opacity: 0;
  aspect-ratio: 1 / 1;
}

.star-1 {
  left: 5%;
  width: 6.6%;
  animation: fallAndTwinkle 9s infinite linear 1s;
}

.star-2 {
  left: 15%;
  width: 5.4%;
  animation: fallAndTwinkle 11s infinite linear 4s;
}

.star-3 {
  left: 25%;
  width: 7.5%;
  animation: fallAndTwinkle 8s infinite linear 0.5s;
}

.star-4 {
  left: 35%;
  width: 4.5%;
  animation: fallAndTwinkle 12s infinite linear 6s;
}

.star-5 {
  left: 45%;
  width: 6.0%;
  animation: fallAndTwinkle 10s infinite linear 2.5s;
}

.star-6 {
  left: 55%;
  width: 5.1%;
  animation: fallAndTwinkle 8.5s infinite linear 4.5s;
}

.star-7 {
  left: 65%;
  width: 7.2%;
  animation: fallAndTwinkle 11.5s infinite linear 1.5s;
}

.star-8 {
  left: 75%;
  width: 4.8%;
  animation: fallAndTwinkle 9s infinite linear 5.5s;
}

.star-9 {
  left: 85%;
  width: 6.3%;
  animation: fallAndTwinkle 10.5s infinite linear 3s;
}

.star-10 {
  left: 95%;
  width: 5.7%;
  animation: fallAndTwinkle 12.5s infinite linear 0.2s;
}

/* Swaying Balloons */
.balloons-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

.balloon {
  position: absolute;
  width: 11vw;
  max-width: 48px;
  aspect-ratio: 30 / 90;
  height: auto;
  transform-origin: bottom center;
}

.balloon-left-blue {
  left: 10%;
  top: 20%;
  animation: floatBalloon 6s infinite ease-in-out;
}

.balloon-left-yellow {
  left: 16.5%;
  top: 12%;
  animation: floatBalloon 7s infinite ease-in-out 0.8s;
}

.balloon-right-yellow {
  right: 19.5%;
  top: 8%;
  animation: floatBalloon 6.5s infinite ease-in-out 0.3s;
}

.balloon-right-blue {
  right: 14.5%;
  top: 13%;
  animation: floatBalloon 5.8s infinite ease-in-out 1.2s;
}

/* Gate Title SVG */
.gate-texts {
  position: absolute;
  top: 12.5%;
  left: 50%;
  transform: translateX(-50%);
  width: 65.5%;
  text-align: center;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gate-main-title {
  width: 100%;
  height: auto;
  display: block;
}

.gate-title-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.title-name-svg {
  font-family: var(--font-circus);
  font-size: 44px;
  font-weight: 400;
  fill: #5c4a38;
  letter-spacing: 5px;
  text-shadow: 2px 2px 0 var(--color-white);
}

.title-sub-svg {
  font-family: var(--font-circus);
  font-size: 17px;
  font-weight: 400;
  fill: #5c4a38;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 1.5px 1.5px 0 var(--color-white);
}

br.sp-only {
  display: none;
}

/* Speech Bubble & Chibi Character */
.character-bubble {
  position: absolute;
  bottom: 105%;
  right: 30%;
  background: #fffdf7;
  border: 2px solid #5c4a38;
  border-radius: 16px 14px 12px 18px / 14px 16px 12px 18px;
  padding: 8px 14px;
  font-family: var(--font-jap);
  font-size: 11px;
  font-weight: 700;
  color: #5c4a38;
  white-space: nowrap;
  box-shadow: 3px 3px 0px #dfd9c4;
  z-index: 10;
  pointer-events: none;
}

.character-bubble::before {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 22px;
  border-width: 10px 10px 0 0;
  border-style: solid;
  border-color: #5c4a38 transparent transparent transparent;
  display: block;
  width: 0;
}

.character-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  right: 23px;
  border-width: 8px 8px 0 0;
  border-style: solid;
  border-color: #fffdf7 transparent transparent transparent;
  display: block;
  width: 0;
}

.character-wrapper {
  position: absolute;
  bottom: 10%;
  left: 76%;
  transform: translateX(-50%);
  width: 90%;
  z-index: 150;
  pointer-events: none;
}

.chibi-character {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(99, 80, 60, 0.25));
}

/* Interactive Signboards */
.interactive-signs {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 9;
}

.sign-deco {
  position: absolute;
  left: 31.7%;
  bottom: 12.5%;
  width: 4.5%;
  height: 8%;
  transform: rotate(-3deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ticket-sign-text {
  font-family: var(--font-eng);
  font-size: 9px;
  font-weight: 700;
  color: #63503c;
  line-height: 1.1;
  text-align: center;
  opacity: 0.8;
}

.sign-button {
  position: absolute;
  right: 31.4%;
  bottom: 13.5%;
  width: 7.3%;
  height: 15%;
  transform: rotate(2deg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.sign-btn-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #5c4a38;
  font-weight: 700;
  line-height: 1.2;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: #fffdf7;
  border: 2px solid #5c4a38;
  border-radius: 12px 16px 10px 14px / 14px 10px 16px 11px;
  box-shadow: 3px 3px 0px #dfd9c4;
  padding: 10px 8px 6px 8px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  position: relative;
  overflow: visible;
}

.sign-btn-text::before {
  content: '';
  position: absolute;
  top: 31%;
  left: 6px;
  right: 6px;
  border-top: 2px dashed #b8ad9c;
  height: 0;
  pointer-events: none;
}

.sign-btn-notch-l,
.sign-btn-notch-r {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4e6171;
  border: 2px solid #5c4a38;
  top: 31%;
  transform: translateY(-50%);
  z-index: 2;
  transition: border-color 0.25s ease;
  box-sizing: border-box;
}

.sign-btn-notch-l {
  left: -7px;
}

.sign-btn-notch-r {
  right: -7px;
}

.sign-button:hover .sign-btn-text,
.sign-button:active .sign-btn-text {
  transform: scale(1.06) rotate(-2deg);
  background: #fffefb;
  border-color: #d87a60;
  box-shadow: 4px 4px 0px #e2beaf;
  color: #d87a60;
}

.sign-button:hover .sign-btn-notch-l,
.sign-button:hover .sign-btn-notch-r {
  border-color: #d87a60;
}

.sign-btn-small {
  font-family: var(--font-eng);
  font-size: 8px;
  letter-spacing: 0.5px;
  color: #d87a60;
  background: #fdf1e8;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #f6dcd0;
  margin-bottom: 8px;
  font-weight: 700;
  transition: all 0.25s ease;
  z-index: 3;
}

.sign-button:hover .sign-btn-small {
  background: #d87a60;
  color: #ffffff;
  border-color: #d87a60;
}

.sign-btn-main {
  font-size: 13px;
  letter-spacing: 0.2px;
  z-index: 3;
}

.sign-btn-arrow {
  font-size: 10px;
  margin-top: 2px;
  color: #d87a60;
  z-index: 3;
}

/* Hero Footer Container */
.hero-footer {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translate(-50%, 0);
  width: 95%;
  max-width: 320px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}

.welcome-message {
  font-size: 13px;
  font-weight: 500;
  color: #6d7b8a;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

/* Hero Area PC Overrides */
@media (min-width: 769px) {
  .hero-container {
    display: block;
    padding: 0;
    width: 100%;
    height: 100%;
  }

  .illustration-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background-color: transparent;
    overflow: hidden;
  }

  .scenery-bg-content {
    width: 100%;
    height: auto;
    aspect-ratio: 1672 / 941;
  }

  .scenery-bg {
    background-image: url('../assets/background_v2.jpg');
  }

  .gate-texts {
    top: 19%;
    width: 39.4%;
  }

  .character-bubble {
    font-size: max(14px, 0.9vw);
    padding: 0.6vw 1.0vw;
    border-radius: 1.2vw 1.0vw 0.9vw 1.3vw / 1.0vw 1.2vw 0.9vw 1.3vw;
    box-shadow: 0.2vw 0.2vw 0px #dfd9c4;
    border-width: 0.15vw;
  }

  .character-wrapper {
    bottom: 0;
    left: 76%;
    width: 40%;
    z-index: 150;
  }

  .balloon {
    width: 5.5vw;
    max-width: 80px;
    height: auto;
  }

  .balloon-left-blue {
    left: 3%;
  }

  /* Hide Gate Arch Texts & Balloons on Ending Page */
  .illustration-area.is-ending .gate-texts,
  .illustration-area.is-ending .balloons-overlay,
  .illustration-area.is-ending .balloon {
    display: none !important;
  }

  .balloon-left-yellow {
    left: 8.5%;
  }

  .balloon-right-yellow {
    right: 14.5%;
  }

  .balloon-right-blue {
    right: 8.5%;
  }

  .star-1 {
    width: 2.2%;
  }

  .star-2 {
    width: 1.8%;
  }

  .star-3 {
    width: 2.5%;
  }

  .star-4 {
    width: 1.5%;
  }

  .star-5 {
    width: 2.0%;
  }

  .star-6 {
    width: 1.7%;
  }

  .star-7 {
    width: 2.4%;
  }

  .star-8 {
    width: 1.6%;
  }

  .star-9 {
    width: 2.1%;
  }

  .star-10 {
    width: 1.9%;
  }

  .hero-footer {
    display: flex;
    position: absolute;
    bottom: 5%;
    left: 49.5%;
    transform: translate(-50%, 0);
    width: 90%;
    max-width: 440px;
    margin: 0;
    padding: 0 20px;
    z-index: 100;
    pointer-events: auto;
    flex-direction: column;
    align-items: center;
  }

  .welcome-message {
    font-size: 19px;
    margin-bottom: 12px;
  }
}

/* --- Handwritten Decorative Overlay Text (Matching Share & Countdown Aesthetics) --- */
.hero-hw-top-left {
  position: absolute;
  top: 17%;
  left: 12%;
  font-size: 32px;
  transform: rotate(-10deg);
  z-index: 1500;
  pointer-events: none;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .hero-hw-top-left {
    top: 28px;
    left: 60px;
    font-size: 21px;
    transform: rotate(-8deg);
  }
}

@media (min-width: 769px) and (max-aspect-ratio: 1672/941) {
  .scenery-bg-content {
    width: auto;
    height: 100%;
  }
}