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

body {
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ぼかし対象のラッパー */
.blur-target {
    transition: filter 0.3s ease;
    transform: scale(1.05); /* 常に5%拡大してブラー時の縮小を補正 */
    width: 100%;
    height: 100%;
}

.blur-target.blurred {
    filter: blur(4px);
}

/* 背景画像 */
.background-image {
    position: fixed;
    top: -0.4%;
    left: -0.4%;
    width: 101%;
    height: 101%;
    background-image: url('../images/enter_bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
    transition: filter 0.3s ease-in-out;
    will-change: transform;
    animation: wiggle 8s ease-in-out infinite;
}

/* 星のパーティクルCanvas */
#starCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* スモークエフェクト用Canvas */
#smokeCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0; /* girl-image(-2)の前面に配置 */
}

/* 蛍エフェクトCanvas */
#fireflyCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1; /* smokeCanvas(0)とgirl-image(-2)の間に配置 */
    opacity: 0;
    animation: fadeIn 2s ease-in forwards;
    animation-delay: 1s;
}

/* グレアエフェクトCanvas */
#glareCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1; /* girl-image(-2)の前面に配置 */
    opacity: 0;
    animation: fadeIn 2s ease-in forwards;
    animation-delay: 4s; /* girl.pngと同時にフェードイン */
}

/* スポットライト/ライトリークエフェクトCanvas */
#spotlightCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    animation: fadeIn 2s ease-in forwards;
    animation-delay: 4s;
    filter: blur(30px); /* グラデーションをなめらかに */
}

/* グリッチエフェクトCanvas */
#chromaticCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998; /* 他のエフェクトより上に配置 */
    mix-blend-mode: screen; /* グリッチ効果を強調（screenで視認性向上） */
}

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0 20px;
    z-index: 1;
}

/* Logo */
.logo {
    margin-top: 100px;
    margin-bottom: 110px;
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
    animation-delay: 1s;
}

.logo img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Logo Shineエフェクト */
.shine-container {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.shine-container img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Canvas Shineエフェクト用 */
#logoShineCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Buttons Container */
.buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
    animation-delay: 2s;
}

.btn {
    padding: 10px 10px;
    font-size: 24px;
    font-family: 'Times New Roman', Times, serif;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    z-index: 10000; /* 最前面に配置 */
}

.btn-enter {
    background-color: transparent;
    color: #555;
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn-enter span {
    display: inline-block;
    transition: color 0.5s ease;
}

.btn-enter .arrow {
    opacity: 0;
    margin-bottom: 5px;
    transition: opacity 0.3s ease;
    position: absolute;
    right: -30px;
}

.btn-enter:hover {
    background-color: transparent;
    transform: scale(1.05);
}

.btn-enter span:nth-child(1) {
    animation: colorChangeLoop 5s ease infinite;
    animation-delay: 5s;
}

.btn-enter span:nth-child(2) {
    animation: colorChangeLoop 5s ease infinite;
    animation-delay: 5.2s;
}

.btn-enter span:nth-child(3) {
    animation: colorChangeLoop 5s ease infinite;
    animation-delay: 5.4s;
}

.btn-enter span:nth-child(4) {
    animation: colorChangeLoop 5s ease infinite;
    animation-delay: 5.6s;
}

.btn-enter span:nth-child(5) {
    animation: colorChangeLoop 5s ease infinite;
    animation-delay: 5.8s;
}

@keyframes showArrow {
    to {
        opacity: 1;
    }
}

.btn-enter .arrow {
    animation: showArrow 0s ease forwards, colorChangeLoop 5s ease infinite, arrowBlink 1s ease-in-out infinite;
    animation-delay: 6.2s, 6.2s, 6.2s;
}

.btn-exit {
    background-color: transparent;
    color: #555;
}

.btn-exit:hover {
    background-color: transparent;
    transform: scale(1.05);
}

/* 18禁画像 */
.age-restriction {
    margin-top: 150px;
    text-align: center;
}

.age-restriction img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
    animation-delay: 3s;
}

/* テキストボックス */
.notice-text {
    padding: 20px;
    text-align: center;
    font-family: "Yu Mincho", "YuMincho";
    color: #555;
    font-size: 14px;
    line-height: 1.8;
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
    animation-delay: 3s;
}

/* Girl画像 */
.girl-image {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
    animation-delay: 4s;
    pointer-events: none;
    z-index: -2;
    transition: filter 0.3s ease-in-out;
}

.girl-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Girl画像グリッチCanvas */
#girlGlitchCanvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center center;
}

/* ENTERホバー時の背景画像 */
.hover-background {
    position: fixed;
    top: 0px;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    z-index: 9997; /* ボタン(10000)の下、星エフェクト(9999)の下 */
    transition: opacity 0s;
    mix-blend-mode: overlay; /* オーバーレイ効果 */
}

.hover-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hover-background.show {
    opacity: 1;
}

.hover-background.blink-hidden {
    opacity: 0 !important;
}

/* フェードインアニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ENTERボタン カラー変更アニメーション */
@keyframes colorChangeLoop {
    0% {
        color: #555;
    }
    10% {
        color: #ffb3d1;
    }
    50% {
        color: #ffb3d1;
    }
    60% {
        color: #555;
    }
    100% {
        color: #555;
    }
}

/* 矢印点滅アニメーション */
@keyframes arrowBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* 背景Wiggleアニメーション（GPU最適化版） */
@keyframes wiggle {
    0% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(0.3%, -0.3%);
    }
    50% {
        transform: translate(-0.3%, 0.3%);
    }
    75% {
        transform: translate(-0.3%, -0.3%);
    }
    100% {
        transform: translate(0, 0);
    }
}

/* レスポンシブ対応 */
/* タブレット */
@media screen and (max-width: 1024px) {
    .logo {
        margin-top: 80px;
        margin-bottom: 80px;
    }

    .logo img {
        max-width: 80%;
    }

    .btn {
        padding: 12px 50px;
        font-size: 20px;
    }

    .buttons {
        gap: 30px;
    }

    .age-restriction {
        margin-top: 100px;
    }

    .age-restriction img {
        max-width: 80%;
    }

    .notice-text {
        font-size: 13px;
    }
}

/* スマートフォン */
@media screen and (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .logo {
        margin-top: 60px;
        margin-bottom: 60px;
    }

    .logo img {
        max-width: 70%;
    }

    .btn {
        padding: 10px 40px;
        font-size: 18px;
    }

    .buttons {
        gap: 25px;
    }

    .age-restriction {
        margin-top: 80px;
    }

    .age-restriction img {
        max-width: 70%;
    }

    .notice-text {
        font-size: 12px;
        padding: 15px;
    }
}

/* 小さいスマートフォン */
@media screen and (max-width: 480px) {
    .logo {
        margin-top: 40px;
        margin-bottom: 40px;
    }

    .logo img {
        max-width: 60%;
    }

    .btn {
        padding: 8px 30px;
        font-size: 16px;
    }

    .buttons {
        gap: 20px;
    }

    .age-restriction {
        margin-top: 60px;
    }

    .age-restriction img {
        max-width: 60%;
    }

    .notice-text {
        font-size: 11px;
        padding: 10px;
    }
}
