/* =========================================
   ベース設定（PC版：全体を中央、ロゴは左下固定）
========================================= */
body {
    font-family: 'Zen Maru Gothic', sans-serif;
    background-color: #e5d8c0; 
    margin: 0;
    height: 100dvh; 
    
    /* PC版はタイトルとルーレットをまとめて画面中央に配置 */
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    
    overflow: hidden; 
    overscroll-behavior: none; 
    touch-action: manipulation;
}

/* --- 上部：タイトル --- */
h1 {
    color: #333333;
    font-size: 26px;
    font-weight: 900;
    margin-top: 0;
    margin-bottom: 24px; /* PC版ではルーレットとの間に少し余白をとる */
}

/* --- 中央：ルーレットとボタンのまとまり --- */
.center-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.roulette-wrapper {
    position: relative;
    width: max-content; 
    margin: 0 auto 30px;
}

canvas {
    display: block;
    border-radius: 50%;
    border: 12px solid #ffffff; 
    box-shadow: 0 8px 0 #d1d5db, 0 12px 20px rgba(0,0,0,0.15); 
}

#pointer {
    position: absolute;
    top: -20px; 
    left: 50%;
    transform: translateX(-50%);
    font-size: 38px; 
    color: #e5372e; 
    z-index: 10;
}

#start-btn {
    font-family: 'Zen Maru Gothic', sans-serif;
    background-color: #e5372e; 
    color: white;
    border: none;
    outline: none;
    padding: 12px 48px;
    font-size: 25px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 20px;
}

/* --- 羊と吹き出しのベース設定（PC版） --- */
.sheep-wrapper {
    position: absolute;
    bottom: -15px; 
    right: -150px; 
    /* 変更：ぴょんぴょん跳ねるアニメーションを0.4秒間隔で繰り返す */
    animation: pyonpyon 0.3s ease-out infinite alternate;
    display: inline-block;
    z-index: 100;
}

/* 変更：ふわふわ（fuwafuwa）を消して、ぴょんぴょん（pyonpyon）を追加 */
@keyframes pyonpyon {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-8px); } /* 8pxだけ上にピョコッと跳ねる */
}

.speech-bubble {
    position: absolute;
    bottom: 70px;  
    right: -220px; 
    transform: translateY(15px); 
    width: 100px;  
    height: 100px; 
    background-image: url('bubble.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 56px;
    font-weight: 700;
    color: #333333; 
    padding-bottom: 10px; 
    opacity: 0;
    transition: all 0.5s ease-out;
    z-index: 110;
}
.speech-bubble.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- 下部：会社ロゴ（PC版は左下に固定） --- */
.logo-wrapper {
    position: fixed; 
    bottom: 20px;
    left: 20px;
    margin: 0;
    z-index: 10;
}
.company-logo {
    width: 250px; 
    opacity: 0.8; 
}


/* =========================================
   スマホ用のレイアウト調整（上・中・下に分割）
========================================= */
@media (max-width: 500px) {
    body {
        overflow-x: hidden; 
        /* スマホ版のみ、上下に50pxの余白を取り、空間を均等に分ける */
        justify-content: space-between; 
        padding: 50px 0; 
        box-sizing: border-box;
    }

    h1 {
        margin-bottom: 0; /* Flexboxで配置するためマージンをリセット */
    }

    /* スマホ画面に合わせてルーレットを縮小 */
    .roulette-wrapper {
        width: 280px; 
        margin-bottom: 30px;
    }
    canvas {
        width: 100%; 
        height: auto;
        box-sizing: border-box;
    }
    #pointer {
        font-size: 34px;
        top: -15px;
    }

    /* ボタン・羊たちのバランスは完璧な状態を維持 */
    #start-btn {
        transform: translateX(-50px) translateY(0);
        padding: 10px 36px;
        font-size: 24px;
        margin-bottom: 0px;
    }
    .sheep-wrapper {
        right: -50px;
        bottom: -30px;
        left: auto;
        margin-left: 0;
    }
    .sheep-wrapper img {
        width: 85px; 
    }
    .speech-bubble {
        right: -100px;
        bottom: 30px;
        left: auto;
        margin-left: 0;
        width: 75px;
        height: 75px;
        font-size: 32px;
        padding-bottom: 8px;
    }

    /* スマホ版のみ、ロゴの左下固定を解除して最下部中央へ */
    .logo-wrapper {
        position: static; 
        text-align: center;
    }
    .company-logo {
        width: 130px;
    }
}