/* === ローディング演出 === */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#loading-screen.is-hiding {
    animation: hide-in-circle 1.0s ease-in forwards;
}

#loading-screen img {
    width: 150px;
    height: auto;
}

.loading-text {
    margin-top: 15px;
    animation: bounce-text 1.5s infinite;
}

/* === 基本設定 === */
html {
    scroll-behavior: smooth;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Kosugi Maru', sans-serif;
    color: #5c3b1e;
    line-height: 1.7;
    background-color: #000;
    overflow-x: hidden;
    font-weight: 800;
}

#bg-video {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
    opacity: 0.5;
}

.page-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    background-image: url('bg.png');
    background-size: 100% auto;
    background-repeat: repeat-y;
    background-position: top center;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    background-color: #fff;
}

img {
    max-width: 100%;
    display: block;
}

img.character-main {
    max-width: unset;
}

.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* === セクションの基本スタイル === */
.section {
    padding: 60px 0;
	font-size: clamp(10px, 3vw, 18px);
    position: relative;
    text-align: center;
}

.section-orange {
    background-color: #faa159;
    color: #845636;
    padding: 100px 0;
}

.section--fullbleed {
    padding-top: 60px;
    padding-bottom: 60px;
}

.section-heading-image {
    display: block;
    margin: 0 auto 40px auto;
    height: 70px;
    width: 400px;
	margin-bottom: 5px;
}

.about-text p {
    margin-bottom: 0em;
}

.credit-list p {
    margin-bottom: 0em;
}
.credit-list__heading {
    margin-top: 1.5em;
    font-size: 1.2em;
}

/* === KV === */
.character-area {
    overflow: hidden;
    display: grid;
    place-items: center;
    position: relative;
    height: 95vh;
    min-height: 1000px;
}
.character-area > * {
    grid-area: 1 / 1 / 2 / 2;
}
.character-main {
    position: absolute;
    transform: translateX(-50%);
    height: 90%;
    aspect-ratio: 1 / 1;
    vertical-align: bottom;
    width: auto;
    animation: slow-rotate 240s linear infinite;
}
.title-image {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
}
.promo-image {
    position: absolute;
    top: 0px;
    width: 100%;
    z-index: 5;
    max-height: 30%;
    pointer-events: none;
}
.promo-image-left { left: 0px; }
.promo-image-right { right: 0px; }

.scroll-down {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    opacity: 1;
    transition: opacity 0.5s ease;
}
.scroll-down.is-hidden {
    opacity: 0;
    pointer-events: none;
}
.scroll-down img {
    width: 80px;
    animation: bounce 2s infinite;
}

.btn-pv {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 20;
    display: block;
}
.btn-pv img {
    width: 25vh;
    min-width: 200px;
    max-width: 350px; 
    transition: transform 0.3s ease;
}
.btn-pv:hover img {
    transform: scale(1.05);
}

/* === GALLERY, SYSTEM === */
.gallery, .system-gallery {
    display: grid;
    gap: 15px;
}
.gallery {
    grid-template-columns: repeat(3, 1fr);
}
.system-gallery {
    grid-template-columns: repeat(4, 1fr);
}

.gallery a, .system-gallery a {
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery a:hover, .system-gallery a:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* === ボタン === */
.btn {
    display: inline-block;
    background-color: #f89c47;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 30px;
    text-decoration: none;
    border: 2px solid #f89c47;
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}
.btn:hover {
    background-color: transparent;
    color: #f89c47;
    transform: scale(1.05);
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* === フッター === */
.footer {
    padding: 60px 0 30px;
}
.footer-icons {
    display: flex;
    justify-content: center;
    /* gap: 20px; */
    margin-bottom: 30px;
}
.footer-icons a:not(:last-child) {
    margin-right: 20px;
}
.footer-icons a {
    display: block;
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
}
.footer-icons a:hover {
    transform: scale(1.1);
}
.copyright {
    display: block;
    margin-top: 30px;
    font-size: 12px;
    opacity: 0.8;
    color: #ffffff;
}

/* === 波線 === */
.wave {
    position: absolute;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
    line-height: 0;
    z-index: 0;
}
.wave-top { top: -100px; }
.wave-bottom { bottom: -100px; }
.wave img {
    overflow: hidden;
    width: 100%;
    height: 178px;
}

/* === ハンバーガーメニュー === */
.hamburger-menu {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    background-color: #f89c47;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* gap: 6px; */
}
.hamburger-menu__line {
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    display: block;
    border-radius: 2px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}
.hamburger-menu__line:not(:last-child) {
    margin-bottom: 6px;
}
.hamburger-menu.is-active .hamburger-menu__line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.hamburger-menu.is-active .hamburger-menu__line:nth-child(2) {
    opacity: 0;
}
.hamburger-menu.is-active .hamburger-menu__line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* === モーダルメニュー === */
.modal-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none;
}
.modal-menu.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.modal-menu__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
}
.modal-menu__content {
    position: relative;
    min-height: 10vw;
    min-width: 10vw;
    width: 900px;
    height: 750px;
	min-width: 400px;
	min-height: 400px;
    max-width: 90vw;
    max-height: 90vw;
    background-image: url('menu.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0.8);
    transition: transform 0.4s ease;
}
.modal-menu.is-active .modal-menu__content {
    transform: scale(1);
}
.modal-menu__list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}
.modal-menu__list li {
    margin: 0;
    line-height: 0;
}
.modal-menu__list a img {
    max-width: 300px;
    min-width: 100px;
    width: 40vh;
    transition: transform 0.2s ease;
}
.modal-menu__list a:hover img {
    transform: scale(1.05);
}

/* === PC用の回転アニメーション === */
@keyframes slow-rotate {
    from { transform: scale(1.5) rotate(0deg); }
    to { transform: scale(1.5) rotate(360deg); }
}

/* === キーフレームアニメーション === */
@keyframes bounce-text {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.anim-box.poyopoyo {
  animation: poyopoyo 4s ease-out infinite;
  opacity: 1;
}
@keyframes poyopoyo {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-2px); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-0px); }
    60% { transform: translateY(-0px); }
}

@keyframes hide-in-circle {
    from { clip-path: circle(150%); }
    to { clip-path: circle(0% at 50% 50%); }
}

/* === スライダー基本設定 === */
:root {
    --swiper-theme-color: #E59B3F;
}
.swiper {
    width: 100%;
    height: 100%;
}
.swiper-slide {
    text-align: center;
    font-size: 18px;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}
.swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}
.swiper-button-prev,
.swiper-button-next {
    width: 50px;
    height: 50px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.3s ease;
    top: 50%;
    transform: translateY(-50%);
    display: none; /* 矢印を非表示にする */
}
.swiper-button-prev { background-image: url('arrow_left.png'); }
.swiper-button-next { background-image: url('arrow_right.png'); }
.swiper-button-prev:hover,
.swiper-button-next:hover {
    opacity: 0.7;
}
.swiper-button-prev::after,
.swiper-button-next::after {
    display: none !important;
}

/* === TOPに戻るボタン === */
#back-to-top {
    position: fixed;
    bottom: 200px;
    left: 50%;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translate(-50%, 20px);
}
#back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}
#back-to-top img {
    width: 60px;
    height: auto;
    transition: transform 0.3s ease;
}
#back-to-top:hover img {
    transform: scale(1.1);
}

/* === フローティングダウンロードボタン === */
#download-info-button {
    position: fixed;
    bottom: 10px;
    left: 0px;
    z-index: 998;
    width: 30vw;
    min-width: 300px;
    max-width: 300px;
    transition: opacity 0.4s ease, transform 0.4s ease;
	animation: poyopoyo 2s infinite;
}
#download-info-button.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 0);
}
.dlinfo-bg {
    width: 100%;
    height: auto;
	
}
.store-buttons-on-dlinfo {
    position: absolute;
    bottom: 7px;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    width: 90%;
}
.store-buttons-on-dlinfo a:not(:last-child) {
    margin-right: 3px;
}
.store-buttons-on-dlinfo a {
    width: 50%;
    transition: transform 0.2s ease;
}
.store-buttons-on-dlinfo a:hover {
    transform: scale(1.05);
}

/* === スマホ用フローティングボタン === */
#download-info-button-sf {
    display: none;
    position: fixed;
    z-index: 998;
    transition: opacity 0.4s ease, transform 0.4s ease;
    animation: poyopoyo 2s infinite;
}
#download-info-button-sf.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}
#download-info-button-sf img {
    width: 100%;
    height: auto;
    transition: transform 0.2s ease;
}
#download-info-button-sf:hover img {
    transform: scale(1.05);
}


/* === CHARACTERセクション === */
#character {
    position: relative;
}
.character-info-display {
    position: absolute;
    bottom: 120px;
    right: 150px;
    width: 200px;
    z-index: 10;
}
.info-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(50px);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    cursor: pointer;
}
.character-info-display.is-visible .info-image {
    opacity: 1;
    transform: translateY(0);
}
.character-swiper {
    margin-top: -50px;
    width: 100%;
    height: 100%;
    padding: 0px;
    overflow: hidden; /* はみ出し防止 */
}
.character-swiper .swiper-slide {
    width: 500px;
    height: 100%;
    transition: transform 0.2s ease-in-out;
    transform: scale(0.75);
}
.character-swiper .swiper-slide.swiper-slide-active {
    transform: scale(1);
}
.character-stand-img {
    max-height: 80vh;
    height: 100%;
    width: auto;
    cursor: grab;
    transition: filter 0.2s ease;
}
#character .swiper-button-prev {
    left: calc(50% - 400px);
}
#character .swiper-button-next {
    right: calc(50% - 400px);
}

/* === サムネイル用スライダー共通設定 === */
.thumbs-swiper {
    height: auto;
    max-width: 80vw;
    padding: 10px;
    margin-top: 10px;
    background-color: #ffffff; 
    border-radius: 30px;
    box-sizing: border-box;
}
.thumbs-swiper .swiper-wrapper { 
    display: flex;
    align-items: center;
}
.thumbs-swiper .swiper-slide {
    opacity: 0.4;
    cursor: pointer;
    transition: opacity 0.3s ease;
    width: auto;
    height: 30px;
}
.thumbs-swiper .swiper-slide:hover { 
    opacity: 0.7; 
}
.thumbs-swiper .swiper-slide-thumb-active { 
    opacity: 1; 
    transform: none;
}
.thumbs-swiper .swiper-slide img {
    display: block;
    height: 50px;
    width: auto;
    object-fit: contain;
}

/* 個別サムネイルスライダー設定 */
.world-thumbs-swiper {
    width: 300px;
}
.character-thumbs-swiper {
    display: inline-block;
    width: 500px;
}

/* === テキスト選択時のハイライト無効 === */
::-moz-selection {
    background-color: transparent;
}

/* === ダウンロードセクション === */
.download-banners {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* gap: 25px; */ /* MODIFIED: Removed gap for Safari compatibility */
}
.banner-container {
    width: 100%;
    max-width: 650px;
}
/* ADDED START: Replaced gap with margin for download banners */
.banner-container:not(:last-child) {
    margin-bottom: 25px;
}
/* ADDED END */
.white-frame {
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    padding: 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.app-info-top {
    display: flex;
    align-items: center;
    justify-content: center;
    /* gap: 20px; */
    width: 100%;
    flex-wrap: wrap;
}
.app-icon {
    /* height: 40%; */
	min-height: 70px;
    max-height: 130px;
    border-radius: 15%;
    margin-right: 20px;
    margin-bottom: 15px;
}
.app-logo {
    /* height: 40%; */
	min-height: 70px;
    max-height: 130px;
    margin-bottom: 15px;
}
.sales-info-container {
    width: 100%;
    margin-top: 10px;
}
.sales-info-image {
    margin-top: -20px;
    margin-bottom: 0px;
    width: 100%;
    height: auto;
    border-radius: 10px;
}
.text-info-container {
    text-align: center;
    line-height: 1.5;
    font-size: 15px;
    color: #3e456d;
	margin-bottom: 10px;
}
.text-info-container p {
	font-size: clamp(10px, 2.8vw, 18px);
    margin: -2px 0;
}
.store-buttons-on-banner {
    display: flex;
    /* gap: 10px; */
    width: 80%;
    max-width: 400px;
    margin-top: 0px;
    margin-bottom: -10px;
}
.store-buttons-on-banner a:not(:last-child) {
    margin-right: 10px;
}
.store-buttons-on-banner a {
    width: 50%;
    transition: transform 0.2s ease;
}
.store-buttons-on-banner a:hover {
    transform: scale(1.05);
}

/* === オーバーレイ（モーダルウィンドウ） === */
#custom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000; 
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    cursor: pointer; 
}
#custom-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
#custom-overlay .letter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    cursor: default; 
    transform: scale(0.9); 
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); 
}
#custom-overlay.is-visible .letter-container {
    transform: scale(1);
}
#custom-overlay-image {
    max-width: 100%;
    width: auto;

    height: auto;
    object-fit: contain;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); 
    border-radius: 12px;
    min-height: 0;
}
.dialog-close-button {
    margin-top: 20px; 
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

/* === テキストセクションの背景 === */
#about .container,
#credit .container {
    background-image: url('text_bg.svg');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 700px 900px;
    min-height: 900px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 30px;
    padding-bottom: 30px;
    margin-top: -100px;
    margin-bottom: -100px;
}

/* === モーダルメニュー表示時のボタン非表示 === */
body.modal-is-active #back-to-top,
body.modal-is-active #download-info-button,
body.modal-is-active #download-info-button-sf {
    opacity: 0;
    pointer-events: none;
}

/* === ダウンロードボタンの表示切り替え === */
.mobile-only-button {
    display: none;
}

/* === レスポンシブ対応 (〜768px) === */
@media (max-width: 768px) {
    #bg-video { display: none; }
    .gallery, .system-gallery { grid-template-columns: repeat(2, 1fr); }
    .character-area { height: 85vh; min-height: 550px; }
    .section-heading-image { height: auto; }
    .scroll-down { bottom: 0; }
    .scroll-down img { width: 75px; }
    .btn-pv { right: 0; bottom: 10px; }
    .btn-pv img { width: 25vh; min-width: 150px; max-width: 200px; }    

    .modal-menu__list a img { max-width: 250px; width: 20vh; }
    .pre-reg-button img { width: 320px; }
    .pre-reg-button { margin-top: 15px; }
    .title-image { width: 80%; }

    #character .swiper-button-prev { left: 10px; }
    #character .swiper-button-next { right: 10px; }

    .character-info-display {
        width: 180px;
        bottom: 120px;
        right: 10px;
    }

    #download-info-button {
        display: none;
    }

    /* ▼▼▼ 修正箇所 ▼▼▼ */
    #download-info-button-sf {
        display: block;
        width: 15vw;
        min-width: 160px;
        max-width: 160px;
        bottom: 10px;
        left: 0px;
    }
    /* ▲▲▲ 修正箇所 ▲▲▲ */

    #back-to-top {
        bottom: 170px;
    }

    .text-info-container {
        font-size: 14px;
        line-height: 1.6;
    }

    .store-buttons-on-dlinfo {
        justify-content: center;
    }
}

/* === PC表示のスクロール設定 (769px〜) === */
@media (min-width: 769px) {
    html, body {
        height: 100%;
        overflow: hidden;
    }
    .page-wrapper {
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
    .page-wrapper::-webkit-scrollbar {
        width: 5px;
    }
    .page-wrapper::-webkit-scrollbar-track {
        background: #ffffff;
    }
    .page-wrapper::-webkit-scrollbar-thumb {
        background: #f89c47;
        border-radius: 3px;
    }
    .page-wrapper::-webkit-scrollbar-thumb:hover {
        background: #f89c47;
    }

}