body {
    margin: 0;
    overflow: hidden; /* スクロールバーを非表示にする */
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #4a90e2;
    color: #fff;
    touch-action: manipulation; /* スマホでのタップ時に画面が動かないようにする */
}

#game-area {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative; /* shape-boxの配置のために必要 */
}

#shape-box {
    width: 150px;
    height: 150px;
    background-color: #FFD700; /* 金色 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: border-radius 0.3s ease, transform 0.3s ease, width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
    animation: float 3s ease-in-out infinite; /* ふわふわ浮くアニメーション */
    overflow: hidden; /* 目と口がはみ出さないように */
}

/* ふわふわ浮くアニメーションの定義 */
@keyframes float {
    0% { transform: translate(-50%, -50%) rotate(var(--rotate, 0deg)); }
    50% { transform: translate(-50%, -55%) rotate(var(--rotate, 0deg)); }
    100% { transform: translate(-50%, -50%) rotate(var(--rotate, 0deg)); }
}

.eye {
    width: 15px; /* 目を小さくする */
    height: 15px; /* 目を小さくする */
    background-color: black; /* 目を黒で塗りつぶす */
    border-radius: 50%;
    position: absolute;
    top: 35%; /* 少し下に移動 */
    transform: translateY(-50%);
}

.left-eye {
    left: 20%; /* 目を離す */
}

.right-eye {
    right: 20%; /* 目を離す */
}

.mouth {
    width: 50px;
    height: 10px; /* 高さを設定して曲線が描けるようにする */
    background-color: black; /* 口の色 */
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    /* border-bottom: 2px solid black; */ /* background-colorを使うので不要 */
    transition: border-radius 0.3s ease, transform 0.3s ease, width 0.3s ease, height 0.3s ease; /* 表情変化のアニメーションにwidthとheightも追加 */
}

#dialogue-box {
    position: absolute;
    top: 20%; /* shape-boxの上あたりに配置 */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    padding: 10px 20px;
    border-radius: 15px;
    font-size: 0.8em;
    white-space: nowrap; /* テキストが折り返さないように */
    opacity: 0; /* 初期状態では非表示 */
    transition: opacity 0.3s ease;
    z-index: 2; /* 他の要素より手前に表示 */
    pointer-events: none; /* クリックイベントを透過させる */
}

/* スマホ横画面での調整 */
@media screen and (orientation: landscape) and (max-height: 600px) {
    #dialogue-box {
        top: 5%; /* 横画面では上部により近く配置 */
        font-size: 0.7em; /* フォントサイズを少し小さく */
        padding: 8px 16px; /* パディングを少し小さく */
    }
    
    /* #shape-box {
        max-width: 120px;
        max-height: 120px;
    } */
}

/* より小さい横画面での追加調整 */
@media screen and (orientation: landscape) and (max-height: 400px) {
    #dialogue-box {
        top: 2%; /* さらに上部に配置 */
        font-size: 0.6em; /* さらに小さく */
        padding: 6px 12px;
    }
    
    /* #shape-box {
        max-width: 100px;
        max-height: 100px;
    } */
}
