@media (max-width: 992px) {
  body {
    overflow-x: auto;
  }
}

/**************************************************************************************
*****header*****
**************************************************************************************/
body:not(.ended) header {
  display: none;
}

header.top_page_header {
  height: 100px;
  pointer-events: none;

  .header_nav {
    height: 100%;
  }

  .company_logo {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    padding: 24px;
    background-color: #fff;
    pointer-events: all;
  }

  .replay_button {
    position: absolute;
    right: 0;
    top: 0;
    height: 80px;
    pointer-events: all;
  }
}

@media (max-width: 992px) {
  header.top_page_header {
    height: 60px;
    max-height: 30%;
    .company_logo {
      height: 100%;
      padding: 3%;
      background-color: #fff0;
    }

    .replay_button {
      height: 100%;
      max-height: 88%;
    }
  }
}

header.top_page_header h1 {
  width: auto;
  height: 100%;
}

/**************************************************************************************
*****main*****
**************************************************************************************/

#Top_page_main_section {
  width: 100%;
  height: calc(100dvh - 40px);
  min-height: calc(100dvw * 942 / 1920);
  position: relative;
  margin-bottom: 40px;
  background-image: url(../assets/images/TopPage/bg_erase_apple.png);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

#Top_page_main_section:not(.ended) {
  opacity: 0;
  pointer-events: none;
  cursor: unset;
  display: none;
}

@media (max-width: 992px) {
  #Top_page_main_section {
    min-height: calc(100dvw * 1025 / 750);
    min-width: 250px;
    margin-bottom: 40px;
    background-image: url(../assets/images/TopPage/bg_sp.png);
  }
}

@media (max-width: 576px) {
  #Top_page_main_section {
    height: calc(100dvh - 26px);
    margin-bottom: 26px;
  }
}

body:not(.ended) .loading {
  display: flex;
  text-align: center;
  align-items: center;
  justify-content: center;
}

.loading {
  display: none;

  width: 100dvw;
  height: 100dvh;

  background-repeat: repeat;
  background-image: radial-gradient(#00000022 25%, transparent 25%), radial-gradient(#00000022 25%, transparent 25%);
  background-size: 8px 8px, 8px 8px;
  background-position: 0 0, 4px 4px;
  z-index: -1;

  opacity: 1;
  transition: opacity 1000ms;
}

.loading::before {
  position: absolute;
  z-index: -1;

  top: 0;
  bottom: 20%;
  left: 0;
  right: 0;

  content: "";
  background-image: url(../assets/images/characters/hrs/hrs_ganso_inobookun.png);
  filter: grayscale(100%);
  background-position: center;
  background-size: 30% auto;
}

.loading::after {
  content: "Loading...";
  display: block;

  font-family: "Dela Gothic One";
  font-weight: normal;

  -webkit-text-stroke: #000 2px;
  color: #fff;

  font-size: 32px;
}

#Top_page_main_section .grass_field {
  position: absolute;
  width: 100dvw;
  height: 5%;
  bottom: 0px;
  z-index: 1;
  overflow: hidden;
  background-image: url(../assets/images/TopPage/kusa.png);
  background-repeat: repeat-x;
  background-position: bottom;
  background-size: contain;
  pointer-events: none;
}

#Top_page_main_section .container {
  width: 100%;
  height: 100%;
  margin: auto;
}

#Top_page_main_section .wrapper {
  width: 100%;
  height: 100%;
}

#Top_page_main_section .content {
  width: 100%;
  height: 100%;
}

/*********apples**************************************************************************/

#Top_page_main_section .container.apples {
  max-width: none;
}

#Top_page_main_section .container.apples .content {
  position: relative;
}

#Top_page_main_section .apple_buttons {
  position: absolute;
  display: flex;
  width: 80vh;

  top: calc(30% - 25px);
  left: 50dvw;
  transform: translateX(-50%);

  align-items: center;
  justify-content: center;

  flex-wrap: wrap-reverse;
  row-gap: 15dvh;
  column-gap: 15dvh;

  z-index: 5;
}

#Top_page_main_section .dummy {
  display: none;
}

@media (max-width: 992px) {
  #Top_page_main_section .apple_buttons {
    display: flex;
    width: 80%;
    height: calc(80vw);

    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    align-items: center;
    justify-content: center;

    flex-direction: column;
    flex-wrap: wrap;
    row-gap: 30vw;
    column-gap: 12vw;
    max-height: 60%;
  }

  #Top_page_main_section .dummy {
    display: block;
    visibility: hidden;
    margin-top: -20vw;
  }
}

@media screen and (max-height: calc(100dvw * 942 / 1920)) and (min-width: 993px) {
  #Top_page_main_section .apple_buttons {
    row-gap: 8dvw;
    column-gap: 9dvw;
    width: 50dvw;
  }
}

#Top_page_main_section .apple_button {
  position: relative;
  cursor: pointer;
  width: 7%;
}

@media (max-width: 992px) {
  #Top_page_main_section .apple_button {
    position: relative;
    cursor: pointer;
    width: 7%;
  }
}

#Top_page_main_section .apple_button.golden.pc {
  width: auto;
  width: 5.6vh;

  position: absolute;

  left: 57%;
  top: 20%;

  transform: translate(-50%, -50%);
  z-index: 5;
}

#Top_page_main_section .apple_button.golden.pc:hover {
  z-index: 6;
}

#Top_page_main_section .apple_button .anchor {
  transform: translateY(-50%);
  animation: swing 2s infinite ease-in-out;
}

@keyframes swing {
  0% {
    transform: translateY(-50%) rotate(0deg);
  }

  25% {
    transform: translateY(-50%) rotate(5deg);
  }

  75% {
    transform: translateY(-50%) rotate(-5deg);
  }

  100% {
    transform: translateY(-50%) rotate(0deg);
  }
}

#Top_page_main_section .apple_button .anchor img {
  transform: translateY(50%);
}

#Top_page_main_section .apple_button img {
  width: 100%;
  height: auto;
}

#Top_page_main_section .apple_button .apple_open {
  position: absolute;
  visibility: hidden;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  width: 100%;
  height: auto;
  opacity: 0;
}

#Top_page_main_section .apple_button:hover .apple_open {
  visibility: visible;
  width: 30dvh;
  /*500%*/
  height: auto;
  transition: opacity 300ms;
  opacity: 1;
}

@media (max-width: 992px) {
  #Top_page_main_section .apple_button:hover .apple_open {
    width: 30dvw;
  }

  #Top_page_main_section .apple_button.golden img {
    width: 100%;
    height: auto;
  }

  #Top_page_main_section .apple_button .apple_open,
  #Top_page_main_section .apple_button.golden .apple_open {
    visibility: visible;
    width: 29dvw;
    height: auto;
    opacity: 1;
  }
}

@media screen and (max-height: calc(100dvw * 942 / 1920)) {
  #Top_page_main_section .apple_button.golden.pc {
    width: 4%;
  }

  #Top_page_main_section .apple_button:hover .apple_open {
    width: 16vw;
    /*500%*/
  }
}

#Top_page_main_section .apple_button:hover .apple_open.image {
  transition: width 300ms, opacity 300ms;
}

#Top_page_main_section .apple_button .apple_open.texts .apple_title {
  position: relative;
  font-size: 30px;
  text-wrap: nowrap;
  color: crimson;
  -webkit-text-fill-color: crimson;
  -webkit-text-stroke: 7px crimson;
}

/* ミエグレヒーローズのフォントサイズ調整 */
#Top_page_main_section .apple_button .apple_open.texts .miegureheroes {
  font-size: 23px;
}

#Top_page_main_section .apple_button .apple_open.texts .apple_title::before {
  position: absolute;
  content: attr(data-text);
  white-space: pre;

  left: 0;
  top: 0;

  color: white;
  -webkit-text-fill-color: white;
  -webkit-text-stroke: 10px white;

  z-index: -1;
}

#Top_page_main_section .apple_button .apple_open.texts .apple_title::after {
  position: absolute;
  content: attr(data-text);
  white-space: pre;

  left: 0;
  top: 0;

  color: white;
  -webkit-text-fill-color: white;
  -webkit-text-stroke: 0px white;

  z-index: 1;
}

#Top_page_main_section .apple_button .apple_open.texts {
  display: flex;
  text-align: center;
  align-items: center;
  justify-content: space-around;
  flex-direction: column;

  padding: 30px 0 0 0;
  height: 30dvh;
  max-height: 200px;

  z-index: 1;
}

@media screen and (max-height: calc(100dvw * 942 / 1920)) {
  #Top_page_main_section .apple_button .apple_open.texts {
    height: 16vw;
    /*500%*/
  }
}

#Top_page_main_section .apple_button .apple_open.texts .arrow_decoration {
  position: relative;
  display: block;

  background-color: black;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

#Top_page_main_section .apple_button .apple_open.texts .arrow_decoration::after {
  position: absolute;
  content: "";

  top: 20%;
  left: 20%;
  bottom: 20%;
  right: 20%;

  background-color: white;
  clip-path: polygon(25% 15%, 75% 50%, 25% 85%);
}

@media (max-width: 992px) {
  #Top_page_main_section .apple_button .apple_open.texts {
    gap: 20px;
    padding: 20px 0 0 0;
    height: auto;
  }

  #Top_page_main_section .apple_button .apple_open.texts .apple_title {
    font-size: 15px;
    /* font-size: 1%; */
    -webkit-text-stroke: 6px crimson;
  }

  #Top_page_main_section .apple_button .apple_open.texts .apple_description {
    display: none;
  }
}

#Top_page_main_section .apple_button .apple_open.texts .apple_description {
  font-size: 16px;
  padding: 0 10px;
  color: var(--black);
  font-weight: bold;
}

#Top_page_main_section .apple_button::before {
  position: absolute;
  display: inline-block;
  top: 0;
  left: -10%;
  width: 120%;
  height: auto;
  aspect-ratio: 1/1;
  content: "";
  border: 3px solid #ffffff;
  border-radius: 100%;
  animation: circleBorder 2s infinite;
}

@keyframes circleBorder {
  0% {
    opacity: 0;
    transform: scale(1.05, 1.05);
  }

  10% {
    opacity: 1;
    transform: scale(1, 1);
  }

  100% {
    opacity: 0;
    transform: scale(1.5, 1.5);
  }
}

/*********birds****************/

.birds {
  position: absolute;
  height: 10%;
  aspect-ratio: 1/1;
  background-size: contain;
}

#bird {
  animation: 500ms linear infinite 0ms Bird1, 10000ms linear infinite 0ms Moves;
}

#bird2 {
  animation: 500ms linear infinite 100ms Bird2, 10000ms linear infinite -2000ms Moves;
}

@keyframes Bird2 {
  0% {
    top: 37%;
    background-image: url("../assets/images/TopPage/bird_01.png");
  }

  49% {
    top: 37%;
    background-image: url("../assets/images/TopPage/bird_01.png");
  }

  50% {
    top: 41%;
    background-image: url("../assets/images/TopPage/bird_02.png");
  }

  99% {
    top: 41%;
    background-image: url("../assets/images/TopPage/bird_02.png");
  }

  100% {
    top: 37%;
    background-image: url("../assets/images/TopPage/bird_01.png");
  }
}

@keyframes Bird1 {
  0% {
    top: 6%;
    background-image: url("../assets/images/TopPage/bird_01.png");
  }

  49% {
    top: 6%;
    background-image: url("../assets/images/TopPage/bird_01.png");
  }

  50% {
    top: 10%;
    background-image: url("../assets/images/TopPage/bird_02.png");
  }

  99% {
    top: 10%;
    background-image: url("../assets/images/TopPage/bird_02.png");
  }

  100% {
    top: 6%;
    background-image: url("../assets/images/TopPage/bird_01.png");
  }
}

@keyframes Moves {
  0% {
    left: -200px;
  }

  100% {
    left: 100%;
  }
}

/*********running*************************************************************************/

#Top_page_main_section .running {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: auto;
  height: auto;
  pointer-events: none;
}

#Top_page_main_section .running .character {
  cursor: pointer;
  pointer-events: all;
  right: 100vw;
  width: 100%;
  height: 15%;
  bottom: 2%;
  position: absolute;
  background-size: contain;
  background-image: url(../assets/images/TopPage/jr_run_2.png);
  background-position: right bottom;
}

#Top_page_main_section .running.reset {
  animation: transform 10s linear 0s infinite forwards;
  animation-play-state: running;
}

#Top_page_main_section .running.reset .character {
  animation: image_change 10s linear 0s 1, slip 10s linear 0s 1;
  animation-fill-mode: none, none;
  animation-play-state: paused, paused;
}

#Top_page_main_section .running.reset.stop {
  animation-play-state: paused;
}

#Top_page_main_section .running.reset.stop .character {
  animation-fill-mode: forwards, forwards;
  animation-play-state: running, running;
}

@media (max-width: 992px) {
  #Top_page_main_section .running .character {
    height: 10%;
  }
}

@keyframes transform {
  0% {
    right: -50dvw;
    left: 0;
  }

  100% {
    right: 100dvw;
    left: -150dvw;
  }
}

@keyframes image_change {
  0% {
    background-image: url(../assets/images/TopPage/jr_run_2.png);
  }

  0.5%,
  9.5% {
    background-image: url(../assets/images/TopPage/jr_stop_2.png);
  }

  10%,
  49.5% {
    background-image: url(../assets/images/TopPage/jr_stand_2.png);
  }

  50%,
  100% {
    background-image: url(../assets/images/TopPage/jr_run_2.png);
  }
}

@keyframes slip {
  0% {
    right: 0vw;
  }

  10% {
    right: 5vw;
  }

  50% {
    right: 5vw;
  }

  100% {
    right: 100vw;
  }
}

/******video******************************************************/

video {
  position: fixed;
  top: 50dvh;
  left: 50dvw;
  width: 177.77777778vh;
  /* 16:9 の幅→16 ÷ 9＝ 177.77% */
  height: 56.25vw;
  /* 16:9の幅 → 9 ÷ 16 = 56.25% */
  transform: translate(-50%, -50%);
  min-height: 100dvh;
  min-width: 100dvw;
  pointer-events: none;
  z-index: 100;
}

video.ended {
  opacity: 0;
  transition: opacity 500ms;
}

.overlay {
  width: 100%;
  height: 100vh;
}

#Button {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 301;
}

#Button.ended {
  opacity: 0;
  transition: all 0.5s;
  visibility: hidden;
}

/******subtitle**********/

#subTitle {
  color: #000;
  position: absolute;
  writing-mode: vertical-rl;
  top: 10%;
  right: 15%;
  z-index: 1;
  pointer-events: none;
  font-size: 70px;
  opacity: 0;
}

#subTitle.ended {
  opacity: 1;
  transition: all 0.5s;
}

@media (max-width: 992px) {
  #subTitle {
    top: 60px;
    right: 50%;
    transform: translateX(50%);
    font-size: 35px;
  }
}

/******characters*********************************************************************/
#Top_page_main_section .container.characters {
  position: absolute;
  height: 70%;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  max-width: none;
  pointer-events: none;
  width: 120vh;
}

#Top_page_main_section .container.characters * {
  pointer-events: none;
}

@media screen and (max-height: calc(100dvw * 942 / 1920)) {
  #Top_page_main_section .container.characters {
    width: 50dvw;
  }
}

.charas {
  position: absolute;
  bottom: 2%;
  width: 25%;
  opacity: 1;
  pointer-events: none;
}

.charas img {
  opacity: 0;
  height: 100%;
  position: absolute;
  width: auto;
}

.charas :nth-child(1) {
  left: 0%;
}

.charas :nth-child(2) {
  left: 33%;
}

.charas :nth-child(3) {
  left: 66%;
}

#charas1 {
  left: 15%;
  height: 55%;
  width: auto;
  aspect-ratio: 1/1;
}

#charas1 img.bg_apple {
  opacity: 1;

  width: auto;
  height: 10%;

  top: -10%;
  left: 100%;
}

#charas2 {
  left: 35%;
  height: 40%;
}

#charas2 :nth-child(2),
#charas2 :nth-child(3) {
  height: 90%;
  bottom: 0%;
}

#charas3 {
  right: 10%;
  height: 45%;
}

#charas4 {
  left: 0;
  height: 25%;
}

.charas.appear1 .Character1st {
  opacity: 1;
  transition: all 500ms;
}

.charas.appear2 .Character2nd {
  opacity: 1;
  transition: all 500ms;
}

.charas.appear3 .Character3rd {
  opacity: 1;
  transition: all 500ms;
}

@media (max-width: 992px) {
  #Top_page_main_section .container.characters {
    height: 50%;
    width: 100%;
  }
}

/**********sidecharacters**********/
#charas5 {
  position: absolute;
  left: 0%;
  top: 0;
  width: 100vw;
  height: 100vh;
}

.side_container {
  position: absolute;
  pointer-events: all;
  height: 40%;
  bottom: 0;
}

.side_container.left_side {
  left: 0;
  right: 70%;
}

.side_container.right_side {
  left: 70%;
  right: 0;
}

.charas .CharacterSideL,
.charas .CharacterSideR {
  opacity: 1;
  bottom: -100%;
  z-index: 10;
  transition: right 500ms, left 500ms, bottom 500ms, rotate 500ms, opacity 100ms;
  height: 200%;
  pointer-events: none;
}

.charas .CharacterSideL {
  right: auto;
  left: -50%;
  rotate: 20deg;
}

.charas .CharacterSideR {
  left: auto;
  right: -50%;
  rotate: -20deg;
}

.charas .side_container:hover .CharacterSideL {
  left: calc(-1000px - 50%);
  rotate: -20deg;
}

.charas .CharacterSideL.hidden {
  left: calc(-1000px - 50%);
  rotate: -20deg;
  transition: right 500ms, left 500ms, bottom 500ms, rotate 500ms, opacity 1000ms;
  opacity: 0;
}

.charas .side_container:hover .CharacterSideR {
  right: calc(-1000px - 50%);
  rotate: 20deg;
}

.charas .CharacterSideR.hidden {
  right: calc(-1000px - 50%);
  rotate: 20deg;
  transition: right 500ms, left 500ms, bottom 500ms, rotate 500ms, opacity 1000ms;
  opacity: 0;
}

/********************************************************************
*************footer**************************************************
********************************************************************/

footer {
  width: 100%;
}

body:not(.ended) footer {
  display: none;
}

/* ズーム500%まで対応レスポンシブ */
@media (max-width: 240px) {
  #Top_page_main_section .apple_button .apple_open.texts .apple_title {
    font-size: 10px;
    -webkit-text-stroke: 3px crimson;
  }

  #Top_page_main_section .apple_button .apple_open.texts .apple_title::before {
    -webkit-text-stroke: 5px white;
  }
}
