body {
    margin: 0;
    padding: 0;
    background-color: #111;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: -5vh;
    overflow: hidden;
    font-family: 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;

}




#game-container {
    position: relative;
    border: 2px solid #555;
    /* コントローラーが裏に隠れないように */
    z-index: 1;
}

canvas {
    display: block;
    background-color: #333;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 2.5em;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    visibility: hidden; /* 初期状態は非表示 */
    z-index: 100; /* 最前面に表示 */
}

/* --- スマホ用コントローラー (新レイアウト) --- */
#mobile-controls {
    display: none; /* PCでは非表示 */
    z-index: 10;
}

.control-panel {
    position: fixed;
    top: 0;
    height: 100vh;
    width: 25vw; /* 画面幅の25%を操作エリアに */
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none; /* Safari用 */
}

#left-controls {
    left: 0;
}

#right-controls {
    right: 0;
}

#mobile-controls button {
    /* パネル内のスペースを均等に埋める */
    flex-grow: 1;
    
    font-size: 4em; /* アイコンを大きく */
    color: rgba(85, 85, 85, 0.3);
    background-color: rgba(50, 50, 50, 0.2);
    border: none;
    margin: 10px;
    border-radius: 20px;
    
    display: flex;
    justify-content: center;
    align-items: center;

    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1); /* タップ時のハイライト */
}

/* 横画面のスマホで表示 */
@media (orientation: landscape) and (max-width: 900px) and (hover: none) and (pointer: coarse) {
    #mobile-controls {
        display: block;
    }
}