/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #1f6173;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    width: 70%;
    max-width: none;
}

@media (min-width: 768px) {
    .loading-content {
        width: 35%;
    }

    .loading-text {
        font-size: 2rem;
    }

    .loading-bar-container {
        height: 20px;
        border: 4px solid #ffffff;
    }
}

.loading-image {
    margin-bottom: 30px;
    position: relative;
    width: 100%;
}

.loading-image .load-frame {
    width: 100%;
    height: auto;
    display: none;
    margin: 0 auto;
}

.loading-image .load-frame.active {
    display: inline-block;
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0;
    margin-bottom: 20px;
}

.loading-bar-container {
    width: 100%;
    height: 15px;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #ffffff;
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: #1f6173;
    transition: width 0.3s ease;
}

/* 画像のダウンロード防止 */
img {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    pointer-events: auto;
}

body {
    font-family: sans-serif;
    line-height: 1.6;
    color: #02333e;
    background-image: url('../images/top/KV.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
}

/* Typekit フォント読み込み完了後に適用 */
.wf-active body {
    font-family: "senobi-gothic", sans-serif;
    font-weight: 400;
}

/* Container - SP版サイズの中央カラム */
.container {
    max-width: 390px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    background: #5ea0b1;
    min-height: 100vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

/* Top Image */
.top-image {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.parallax-background {
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.parallax-background img {
    width: 100%;
    height: auto;
    display: block;
}

.parallax-foreground {
    position: relative;
    width: 100%;
    z-index: 2;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.parallax-foreground img {
    width: 100%;
    height: auto;
    display: block;
}

.top-kusa {
    position: absolute;
    bottom: -40px;
    left: 0;
    width: 100%;
    z-index: 10;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* SNS Buttons */
.sns-buttons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    z-index: 20;
}

.sns-btn {
    display: block;
    transition: all 0.3s ease;
}

.sns-btn img {
    width: 45px;
    height: 45px;
    display: block;
}

.sns-btn:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Top Buttons */
.top-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 30px 20px;
    background: #5ea0b1;
    overflow: visible;
}

.top-btn {
    flex: 1;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    overflow: visible;
}

.top-btn img {
    width: 100%;
    height: auto;
    display: block;
}

.top-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* World Introduction Section */
.world-intro {
    padding: 40px 20px;
    background: #5ea0b1;
}

.world-intro-title {
    text-align: center;
    margin-bottom: 30px;
}

.world-intro-title img {
    max-width: 80%;
    height: auto;
}

.world-intro-text {
    text-align: center;
    color: #02333e;
    line-height: 1.6;
}

.world-intro-text p {
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.25em;
}

/* Character Slider Section */
.character-slider {
    position: relative;
    padding: 0 20px 0;
    background: #5ea0b1;
}

.slider-images-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-container {
    flex: 1;
    overflow: visible;
    max-width: 100%;
    padding: 30px 0;
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease;
}

.slide {
    min-width: 100%;
    display: none;
}

.slide.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide img {
    width: 100%;
    height: auto;
    display: block;
    transform: scale(1.3);
    transform-origin: center center;
}

.slider-text-wrapper {
    width: 100%;
    margin-top: 20px;
}

.chara-text {
    display: none;
    text-align: center;
    color: #02333e;
    line-height: 1.6;
}

.chara-text.active {
    display: block;
}

.chara-text p {
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.25em;
}

.chara-text .chara-name {
    font-size: 3rem;
    margin-bottom: 20px;
}

.slider-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0 10px;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
    transform: translateY(30px);
}

.slider-btn:hover {
    opacity: 0.7;
}

.slider-btn img {
    width: 45px;
    height: auto;
    display: block;
}

/* Movie Background - Bridge between sections */
.movie-bg {
    position: relative;
    width: 100%;
    margin-top: -80px;
    margin-bottom: -80px;
    z-index: 1;
}

.movie-bg img {
    width: 100%;
    height: auto;
    display: block;
}

/* Movie Section */
.movie-section {
    position: relative;
    background: #000;
    padding: 40px;
    z-index: 2;
}

.movie-title {
    text-align: center;
    position: relative;
    margin-top: -120px;
    margin-bottom: 30px;
    z-index: 10;
}

.movie-title img {
    width: 35%;
    height: auto;
}

.movie-item {
    margin-bottom: 30px;
    position: relative;
    z-index: 3;
}

.movie-thumbnail {
    width: 100%;
    margin-bottom: 10px;
    position: relative;
}

.movie-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.play-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(50%, -50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.play-btn:hover {
    opacity: 0.8;
}

.play-btn img {
    display: block;
    height: 80px;
    width: auto;
}

.movie-info {
    text-align: center;
    position: relative;
}

.movie-info p {
    color: #5ea0b1;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.episode-number,
.episode-title {
    font-size: 1.5rem;
}

/* Goods Section */
.goods-section {
    position: relative;
    background: #1f6274;
    padding: 0 0 130px 0;
    z-index: 2;
}

.goods-top-image {
    width: 100%;
    margin: 0 0 50px 0;
}

.goods-top-image img {
    width: 100%;
    height: auto;
    display: block;
}

.goods-title {
    text-align: center;
    margin: 30px 0;
    padding: 0 40px;
    z-index: 10;
}

.goods-title img {
    width: 35%;
    height: auto;
}

.goods-item {
    margin: 20px;
    border: 5px solid #02333e;
    border-radius: 12px;
    display: flex;
    overflow: visible;
    background: #5e9fb2;
    position: relative;
}

.goods-image {
    flex: 1;
    min-width: 0;
    position: relative;
    overflow: visible;
}

.goods-overlay-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: 140%;
    max-width: none;
    z-index: 5;
    pointer-events: none;
}

.goods-details {
    flex: 1;
    padding: 12px 12px 20px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #02333e;
    letter-spacing: -0.4em;
    line-height: 1.3;
}

.goods-details .goods-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.goods-details .goods-type {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.goods-details .goods-divider {
    height: 2px;
    background-image: repeating-linear-gradient(
        to right,
        #02333e 0,
        #02333e 10px,
        transparent 10px,
        transparent 14.5px
    );
    margin: 2px 5px 2px 0;
    border: none;
}

.goods-details .goods-price {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.15em;
}

.goods-shop-btn {
    position: absolute;
    bottom: 0;
    right: 20px;
    transform: translateY(calc(50% + 5px));
    display: block;
    transition: all 0.3s ease;
    z-index: 10;
}

.goods-shop-btn img {
    display: block;
    height: 45px;
    width: auto;
}

.goods-shop-btn:hover {
    transform: translateY(calc(50% + 5px)) scale(1.05);
    opacity: 0.9;
}

/* Contact Background - Bridge between sections */
.contact-bg {
    position: relative;
    width: 100%;
    margin-top: -80px;
    margin-bottom: -80px;
    z-index: 3;
}

.contact-bg img {
    width: 100%;
    height: auto;
    display: block;
}

/* Contact Section */
.contact-section {
    position: relative;
    background: #5ea0b1;
    padding: 40px;
    z-index: 4;
}

.contact-title {
    text-align: center;
    position: relative;
    margin-top: -120px;
    margin-bottom: 30px;
    z-index: 10;
}

.contact-title img {
    width: 50%;
    height: auto;
}

.contact-text {
    text-align: center;
    color: #02333e;
    margin-bottom: 30px;
}

.contact-text p {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.25em;
    line-height: 1.6;
    margin: 0;
}

.contact-button {
    text-align: center;
    margin-bottom: 0;
}

.contact-btn {
    display: inline-block;
    transition: all 0.3s ease;
}

.contact-btn img {
    width: auto;
    height: 150px;
    display: block;
}

.contact-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
}

header p {
    font-size: 1rem;
    opacity: 0.9;
    color: white;
}

/* Main Content */
main {
    background: white;
    padding: 20px;
}

/* Card Styles */
.card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: #667eea;
    margin-bottom: 15px;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    color: #666;
}

/* Site Footer */
.site-footer {
    position: relative;
    background: #5ea0b1;
    padding: 0 30px 30px 30px;
    text-align: center;
    z-index: 4;
}

.footer-top {
    margin-bottom: 20px;
}

.footer-top img {
    width: 100%;
    height: auto;
    display: block;
}

.footer-timelines {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
    padding: 0;
}

.timeline-x,
.timeline-instagram {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.timeline-x {
    border-radius: 0;
    clip-path: inset(0 0 0 0);
}

/* Instagram埋め込みの横幅制御 */
.timeline-instagram .instagram-media,
.timeline-instagram iframe {
    max-width: 100% !important;
    min-width: auto !important;
    border-radius: 12px !important;
    overflow: hidden !important;
}

/* X埋め込みツイートのマージン調整 */
.twitter-tweet,
.twitter-tweet.twitter-tweet-rendered,
.timeline-x .twitter-tweet,
.timeline-x iframe {
    margin-top: 0 !important;
    border-radius: 12px !important;
    border: none !important;
    overflow: hidden !important;
}

.twitter-tweet.twitter-tweet-rendered iframe,
.timeline-x .twitter-tweet iframe {
    border-radius: 12px !important;
    border: none !important;
}

/* X埋め込み内部の要素も角丸を適用 */
.timeline-x * {
    border-radius: 12px !important;
}

/* ボーダーを白にする場合はこちらをコメント解除
.twitter-tweet,
.twitter-tweet.twitter-tweet-rendered,
.timeline-x iframe {
    border: 1px solid #ffffff !important;
}
*/

.timeline-header {
    width: 100%;
    max-width: 350px;
    height: auto;
    display: block;
    margin-bottom: 0;
}

.footer-sns-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.footer-sns-btn {
    width: 50%;
    display: flex;
    transition: all 0.3s ease;
}

.footer-sns-btn:first-child {
    justify-content: flex-end;
    padding-right: 12.5px;
}

.footer-sns-btn:last-child {
    justify-content: flex-start;
    padding-left: 12.5px;
}

.footer-sns-btn img {
    width: 50%;
    height: auto;
    display: block;
}

.footer-sns-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.footer-content {
    color: #02333e;
}

.footer-copyright {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.25em;
    margin: 0 0 10px 0;
}

.footer-credit {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.1em;
    margin: 0;
}

.footer-bottom {
    margin-top: 0;
    position: relative;
}

.footer-bottom img {
    width: 100%;
    height: auto;
    display: block;
}

.footer-policy {
    position: absolute;
    bottom: 95px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.footer-policy p {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.1em;
    margin: 2.5px 0;
}

.footer-policy a {
    color: #02333e;
    text-decoration: underline;
    text-decoration-color: #02333e;
    transition: opacity 0.3s ease;
}

.footer-policy a:hover {
    opacity: 0.7;
}

/* Responsive */

/* iPhone 14 Pro Max (430px) 対応 - 400〜430pxの幅で中央カラムを拡張 */
@media (min-width: 400px) and (max-width: 430px) {
    .container {
        max-width: 430px;
    }
}

@media (max-width: 390px) {
    .container {
        max-width: 100%;
    }

    header h1 {
        font-size: 1.5rem;
    }

    main {
        padding: 15px;
    }
}

/* iPhone SE (375px) 対応 - テキストサイズ調整 */
@media (max-width: 375px) {
    .world-intro-text p {
        font-size: 1.4rem;
    }

    .chara-text p {
        font-size: 1.4rem;
    }

    .chara-text .chara-name {
        font-size: 2.8rem;
    }
}
