body {
    margin: 0;
    padding: 3px 50px;
    background: #111;
    font-family: 'Segoe UI', sans-serif;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    overflow-y: hidden;
}

.game-description {
    background: rgba(128, 128, 128, 0.5);
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 10px;
    text-align: left;
    font-size: 12px;
    max-width: 80%;
    color: #fff;
    text-shadow: 0 0 10px rgb(255, 242, 253), 0 0 20px rgb(255, 242, 253);
}

.description-title {
    text-align: center !important;
    font-size: 14px !important;
    margin-top: -5px;
}

.game-description ul {
    margin: 0;
    padding-left: 0px;
}

.game-description li {
    margin-bottom: 6px;
}

#gameOverDisplay {
    position: absolute;
    top: 30%;
    left: 0;
    width: 100%;
    /* background: rgba(0, 0, 0, 0.85); */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    display: none;
    z-index: 11;
}

#gameOverText {
    font-size: 24px;
    color: #ff00cc;
    text-shadow: 0 0 10px #ff00cc, 0 0 20px #ff00cc;
    margin-bottom: 10px;
}

#finalScoreText,
#finalLevelText {
    font-size: 18px;
    color: #00ffe7;
    text-shadow: 0 0 10px #00ffe7, 0 0 20px #00ffe7;
    margin-bottom: 20px;
}

#finalLevelText {
    margin-top: -20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 1s ease-in;
}

.game-thumb {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.thumb-left img {
    max-width: 700px;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.thumb-left-special img {
    max-width: 700px;
    width: 100%;
    height: 65px !important;
    border-radius: 10px;
}

.image-title {
    text-align: center;
    margin: 0;
    font-size: 20px;
    color: #fff;
    text-shadow: 0 0 6px #ffa500;
}

.sub-thumb {
    margin-top: 2px;
}

.x-link {
    text-align: center;
    margin: 0;
    font-size: 16px;
    color: #ffa500;
    text-shadow: 0 0 6px #ffa500;
    margin-bottom: 10px;

}

.x-link a {
    color: #00ffe7;
    text-decoration: underline;
}

/* デフォルト：背景なし */
#gameContainer {
    position: relative;
    width: 90vw;
    max-width: 800px;
    height: 75vh;
    max-height: 600px;

    border: 2px solid #00ffe7;
    box-shadow: 0 0 18px #00ffe7;
    border-radius: 10px;

    background: #000; /* START前は黒 */
}

/* ゲーム開始後に背景画像を表示 */
#gameContainer.bg-active {
    background-image: url("../images/sanko/back.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#titleScreen {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    height: 95%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    text-align: center;
}

#titleScreen h1 {
    font-size: 4vw;
    color: #ff00cc;
    text-shadow: 0 0 8px #ff00cc;
    margin-bottom: 20px;
}

#startButton,
#retryButton {
    padding: 12px 24px;
    font-size: 16px;
    font-family: 'Segoe UI', sans-serif;
    background-color: #00ffe7;
    border: none;
    color: #fff;
    font-weight: bold;
    border-radius: 10px;
    box-shadow: 0 0 12px #00ffe7, 0 0 24px #00ffe7;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#startButton:hover,
#retryButton:hover {
    transform: scale(1.05);
    box-shadow: 0 0 16px #00ffe7, 0 0 32px #00ffe7;
}

#scoreDisplay {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 16px;
    color: #00ffe7;
    text-shadow: 0 0 6px #00ffe7;
    z-index: 5;
}

@media (max-width: 600px) {
    #titleScreen h1 {
        font-size: 24px;
    }

    #startButton,
    #retryButton {
        font-size: 14px;
        padding: 10px 20px;
    }

    #gameContainer {
        height: 70vh;
    }

    .image-title {
        font-size: 15px;
        margin-top: -10px;
    }

    .x-link {
        font-size: 15px;
    }

    .thumb-left-special img {
        height: 45px !important;
    }
}

#levelUpText {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    color: #ffff00;
    text-align: center;
    text-shadow: 0 0 10px #ffff00, 0 0 20px #ff00cc;
    opacity: 0;
    pointer-events: none;
    padding: 10px 20px;
    background: rgba(128, 128, 128, 0.6);
    border-radius: 10px;
    z-index: 25;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

#levelUpText.active {
    opacity: 1;
    transform: translateX(-50%) scale(1.2);
    animation: blink 0.8s ease-in-out infinite;
}

#levelUpText.fadeOut {
    animation: fadeWipe 1s forwards;
}

#levelNumber {
    color: #ffa500;
    text-shadow: 0 0 6px #ffa500;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

@keyframes fadeWipe {
    0% {
        opacity: 1;
        transform: translateX(-50%) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }
}

.logo-footer {
    text-align: center;
    margin-top: 30px;
}

.logo-footer a {
    display: inline-block;
}

.logo-footer img {
    max-width: 75px;
    width: 100%;
    height: auto;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.logo-footer img:hover {
    opacity: 1;
}

/* ===== スマホ専用 背景動画（bgVideo）のみ ===== */
.mobile-video-bg {
    display: none;
    /* PCは使わない */
}

/* スマホのみ有効 */
@media (max-width: 600px) {
    .mobile-video-bg {
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;

        z-index: 1;
        object-fit: cover;

        opacity: 0;
        /* 初期は非表示（JSで再生開始時に出す） */
        transition: opacity 0.6s ease;
    }
}

/* Canvasが常に最前面になるように */
#gameContainer canvas {
    position: relative;
    z-index: 5;
}

#gameContainer::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    border-radius: 10px;
    z-index: 2;
    pointer-events: none;

    opacity: 0;                 /* 初期は非表示 */
    transition: opacity 0.6s ease;
}

/* 背景有効時にフェードイン */
#gameContainer.bg-active::before {
    opacity: 1;
}

