/* style.css - 没入型 松前スイカ割りLP — スプライトアニメーション版 */

/* ==========================================
   1. デザインシステム
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800;900&family=Zen+Maru+Gothic:wght@400;500;700;900&display=swap');

:root {
    /* — 夏の海辺カラーパレット — */
    --color-bg-deep:    #0a1628;
    --color-bg-mid:     #133051;
    --color-bg-light:   #1a4474;
    --color-ocean:      #00b4d8;
    --color-ocean-light:#48cae4;
    --color-sky:        #90e0ef;
    --color-sunset:     #f4845f;
    --color-sunset-gold:#f4d35e;
    --color-sand:       #fdf0d5;
    --color-watermelon: #e8475f;
    --color-watermelon-dark: #c1292e;
    --color-melon-green:#2d6a4f;
    --color-melon-rind: #52b788;
    --color-text:       #ffffff;
    --color-text-sub:   rgba(255, 255, 255, 0.65);
    --color-glass:      rgba(255, 255, 255, 0.07);
    --color-glass-border: rgba(255, 255, 255, 0.12);

    --font-display: 'Outfit', sans-serif;
    --font-primary: 'Zen Maru Gothic', 'Noto Sans JP', sans-serif;

    --watermelon-width: clamp(200px, 28vw, 380px);
    --stick-width: clamp(300px, 40vw, 550px);

    /* JS更新変数 */
    --scroll-progress: 0;
    --typo-y: 0;
    --shake-x: 0px;
    --shake-y: 0px;
    --flash-opacity: 0;
    --h-scroll: 0px;
}

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

html {
    font-family: var(--font-primary);
    background-color: var(--color-bg-deep);
    color: var(--color-text);
    scroll-behavior: auto;
}

body {
    overflow-x: hidden;
    line-height: 1.6;
    background: var(--color-bg-deep);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ==========================================
   2. ローディング — 軽量即時表示
   ========================================== */
.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: linear-gradient(180deg, var(--color-bg-deep) 0%, var(--color-bg-mid) 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-out, visibility 1s ease-out;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 6px;
    background: linear-gradient(135deg, var(--color-ocean-light), var(--color-sunset-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-sub {
    font-size: 0.8rem;
    color: var(--color-text-sub);
    margin-top: 12px;
    letter-spacing: 1px;
}

/* 波ドット表示ローダー */
.loading-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}

.loading-dots span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--color-ocean-light);
    animation: dotBounce 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ==========================================
   3. ナビゲーション
   ========================================== */
.modern-nav {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    padding: 24px 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    pointer-events: none;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.nav-menu {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.5);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

/* ==========================================
   4. ヒーロー / シネマティック・コンテナ
   ========================================== */
.cinematic-container {
    position: relative;
    width: 100%;
}

.viewport {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

/* ==========================================
   5. ヒーロー背景写真
   ========================================== */
.hero-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 60%;
}

/* 上部と下部のビネット */
.hero-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        linear-gradient(180deg,
            rgba(10, 22, 40, 0.5) 0%,
            transparent 30%,
            transparent 70%,
            rgba(10, 22, 40, 0.7) 100%
        );
    pointer-events: none;
}

/* ==========================================
   6. 太陽光芒
   ========================================== */
.sun-glow {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(244, 211, 94, 0.35) 0%,
        rgba(244, 132, 95, 0.15) 35%,
        transparent 70%
    );
    z-index: 1;
    pointer-events: none;
    animation: sunPulse 8s ease-in-out infinite alternate;
}

@keyframes sunPulse {
    0%   { transform: translateX(-50%) scale(1);   opacity: 0.8; }
    100% { transform: translateX(-50%) scale(1.1);  opacity: 1;   }
}

/* ==========================================
   7. 海面きらめき
   ========================================== */
.ocean-shimmer {
    position: absolute;
    bottom: 5%;
    left: 0;
    width: 100%;
    height: 35%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.shimmer-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    animation: shimmer var(--duration) var(--delay) ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0; transform: scale(0.3); }
    50%      { opacity: 1; transform: scale(1.3); }
}

/* ==========================================
   8. アンビエントグロー
   ========================================== */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.1;
    z-index: 1;
    pointer-events: none;
}

.glow-sunset {
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, var(--color-sunset-gold), var(--color-sunset));
    top: -5%; right: -10%;
    animation: driftSlow 18s infinite alternate ease-in-out;
}

.glow-ocean {
    width: 40vw; height: 40vw;
    background: radial-gradient(circle, var(--color-ocean-light), var(--color-ocean));
    bottom: 5%; left: -5%;
    animation: driftSlow 22s infinite alternate-reverse ease-in-out;
}

@keyframes driftSlow {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 25px) scale(1.05); }
}

/* ==========================================
   9. 波レイヤー
   ========================================== */
.wave-container {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 12;
    pointer-events: none;
    overflow: hidden;
    transition: transform 0.3s ease-out;
    transform-origin: bottom;
}

.wave-layer {
    position: absolute;
    bottom: 0; left: 0;
    width: 200%;
    height: 100%;
}

.wave-layer svg {
    width: 100%; height: 100%;
}

.wave-layer:nth-child(1) {
    animation: waveDrift 7s ease-in-out infinite alternate;
    opacity: 0.7;
}
.wave-layer:nth-child(2) {
    animation: waveDrift 5s ease-in-out infinite alternate-reverse;
    opacity: 0.5;
    bottom: -8px;
}
.wave-layer:nth-child(3) {
    animation: waveDrift 9s ease-in-out infinite alternate;
    opacity: 0.35;
    bottom: -16px;
}

@keyframes waveDrift {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-25%); }
}

/* ==========================================
   10. 背景タイポグラフィ
   ========================================== */
.bg-typography {
    position: absolute;
    top: 50%; left: 50%;
    width: 100%;
    transform: translate(-50%, calc(-50% + var(--typo-y)));
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: soft-light;
}

.typo-line {
    font-family: var(--font-display);
    font-size: clamp(7rem, 18vw, 26rem);
    font-weight: 900;
    line-height: 0.85;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

/* ==========================================
   11. スプライトステージ — スイカ割りアニメーション
   ========================================== */
.sprite-stage {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

/* 丸ごとスイカ */
.watermelon-whole {
    position: absolute;
    bottom: 18%;
    left: 50%;
    width: var(--watermelon-width);
    transform: translateX(-50%);
    transition: none;
    will-change: transform, opacity;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.4));
    z-index: 15;
}

/* 割れた左半分 */
.watermelon-left {
    position: absolute;
    bottom: 18%;
    left: 50%;
    width: clamp(180px, 25vw, 340px);
    opacity: 0;
    transform: translateX(-50%);
    will-change: transform, opacity;
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.4));
    z-index: 16;
}

/* 割れた右半分 */
.watermelon-right {
    position: absolute;
    bottom: 18%;
    left: 50%;
    width: clamp(180px, 25vw, 340px);
    opacity: 0;
    transform: translateX(-50%);
    will-change: transform, opacity;
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.4));
    z-index: 16;
}

/* 棒 */
.stick {
    position: absolute;
    width: var(--stick-width);
    left: calc(50% - 0.8 * var(--stick-width));
    bottom: calc(18% + var(--watermelon-width) * 0.65);
    opacity: 0;
    transform-origin: 15% 50%;
    transform: rotate(-120deg);
    will-change: transform, opacity;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
    z-index: 20;
}

/* ==========================================
   12. スプラッシュ & パーティクル
   ========================================== */
.mega-splash {
    position: absolute;
    top: 50%; left: 50%;
    width: 100vw; height: 100vh;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 25;
    filter: blur(2px) contrast(1.1);
}

.splash-drop {
    position: absolute;
    top: 50%; left: 50%;
    border-radius: 50%;
    will-change: transform, opacity;
}

.smash-particles {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 26;
    pointer-events: none;
}

.smash-particle {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity;
    opacity: 0;
}

/* スクリーンフラッシュ（ゴールデン） */
.screen-flash {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(
        135deg,
        rgba(244, 211, 94, 0.85),
        rgba(255, 255, 255, 0.6)
    );
    z-index: 999;
    pointer-events: none;
    opacity: var(--flash-opacity);
}

/* ==========================================
   13. シネマティック・キャプション
   ========================================== */
.cinematic-captions {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
}

.caption {
    position: absolute;
    font-family: var(--font-primary);
    font-size: clamp(1.6rem, 4vw, 3.2rem);
    font-weight: 900;
    text-align: center;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    line-height: 1.6;
    top: 15%;
}

.caption-reward {
    position: absolute;
    text-align: center;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    background: rgba(10, 22, 40, 0.85); /* 視認性向上のため、暗く濃い背景に変更 */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 28px 44px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15); /* 枠線を少し際立たせる */
    top: 12%;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5); /* シャドウを強めて立体感と境界を明確にする */
}

.caption-reward h3 {
    font-family: var(--font-primary);
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--color-sunset-gold), var(--color-sunset));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.caption-reward p {
    font-size: clamp(0.85rem, 1.3vw, 1rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8); /* テキストもやや明度を上げて見やすく調整 */
}

.caption.active, .caption-reward.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   14. スクロールインジケーター
   ========================================== */
.scroll-indicator {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.5s;
}

.scroll-indicator.hidden { opacity: 0; }

.indicator-text {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.45);
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.indicator-line {
    width: 1px;
    height: 45px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
    animation: pulseLine 2.5s infinite;
}

@keyframes pulseLine {
    0%    { transform: scaleY(0); transform-origin: top; }
    50%   { transform: scaleY(1); transform-origin: top; }
    50.1% { transform: scaleY(1); transform-origin: bottom; }
    100%  { transform: scaleY(0); transform-origin: bottom; }
}

/* ==========================================
   15. 横スクロールセクション
   ========================================== */
.horizontal-section {
    position: relative;
    width: 100%;
}

.horizontal-sticky {
    position: sticky;
    top: 0;
    width: 100%; height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, var(--color-bg-deep) 0%, var(--color-bg-mid) 100%);
}

.horizontal-content {
    display: flex;
    height: 100vh;
    width: max-content;
    transform: translateX(var(--h-scroll));
    will-change: transform;
}

.h-panel {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 10vw;
    position: relative;
}

/* イントロ */
.panel-intro {
    background: linear-gradient(135deg, var(--color-bg-deep) 0%, var(--color-bg-mid) 50%, #1a4474 100%);
}

.h-title {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 9vw, 7rem);
    font-weight: 900;
    line-height: 0.95;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.text-accent {
    background: linear-gradient(135deg, var(--color-watermelon), var(--color-sunset));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.h-price {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-ocean-light), var(--color-sunset-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 36px;
    letter-spacing: 2px;
}

.swipe-hint {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.3);
}

/* グラスモーフィズム */
.card-glass {
    background: var(--color-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--color-glass-border);
}

.panel-num {
    font-family: var(--font-display);
    font-size: 10rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.03);
    position: absolute;
    top: 10%; right: 10%;
    line-height: 1;
}

.h-panel h3 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: 2px;
}

.h-panel p {
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    font-weight: 500;
    color: var(--color-text-sub);
    line-height: 2;
}

/* 画像パネル */
.panel-image {
    background-image: url('assets/bg_summer.png');
    background-size: cover;
    background-position: center;
    position: relative;
}

.panel-image::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to right,
        var(--color-bg-deep) 0%,
        rgba(10, 22, 40, 0.5) 50%,
        var(--color-bg-deep) 100%
    );
}

.image-overlay {
    position: relative;
    z-index: 1;
}

/* 報酬パネル */
.panel-reward {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6vw;
    padding: 0 8vw;
}

.panel-reward .reward-text {
    flex: 1;
}

.panel-reward .reward-image {
    flex: 0 0 auto;
    max-width: 360px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.3);
}

.panel-reward .reward-image img {
    width: 100%;
    height: auto;
}

/* CTA */
.panel-cta {
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, var(--color-bg-mid) 0%, var(--color-bg-deep) 100%);
}

.btn-summer {
    display: inline-block;
    margin-top: 36px;
    padding: 16px 48px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-bg-deep);
    background: linear-gradient(135deg, var(--color-sunset-gold), var(--color-sunset));
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 4px 20px rgba(244, 132, 95, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-summer::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-summer:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 30px rgba(244, 132, 95, 0.5), 0 0 0 6px rgba(244, 211, 94, 0.15);
}

.btn-summer:hover::before {
    width: 400px; height: 400px;
}

/* ==========================================
   16. フッター
   ========================================== */
.minimal-footer {
    padding: 50px 0;
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.2);
    background: var(--color-bg-deep);
}

.footer-notice {
    font-family: var(--font-primary);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 16px;
    letter-spacing: 1px;
}

/* ==========================================
   17. レスポンシブ
   ========================================== */
@media (max-width: 768px) {
    .typo-line { font-size: 22vw; }

    .h-panel { padding: 0 6vw; }

    .sun-glow { width: 300px; height: 300px; }

    .wave-container { height: 80px; }

    .watermelon-whole { width: clamp(160px, 40vw, 260px); bottom: 20%; }
    .watermelon-left,
    .watermelon-right { width: clamp(140px, 35vw, 220px); bottom: 20%; }
    .stick { width: clamp(220px, 55vw, 380px); }

    .caption-reward { padding: 20px 24px; margin: 0 16px; }

    .modern-nav { padding: 16px 20px; }
    .nav-logo { font-size: 0.9rem; }

    .btn-summer { padding: 14px 36px; font-size: 1.1rem; }

    .h-title { font-size: clamp(3rem, 12vw, 5rem); }

    .panel-reward {
        flex-direction: column;
        padding: 0 6vw;
    }

    .panel-reward .reward-image {
        max-width: 260px;
    }
}

@media (max-width: 480px) {
    .caption {
        font-size: clamp(1.3rem, 5.5vw, 1.8rem);
        padding: 0 16px;
    }

    .caption-reward {
        padding: 16px 20px;
        border-radius: 16px;
    }

    .scroll-indicator { bottom: 35px; }
}
