html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background: #222;
    font-family: 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    display: flex;
    justify-content: center; /* 横方向の真ん中寄せ */
    align-items: flex-start; /* 上端を基準にする */
    overflow-x: hidden;
}

/* 360px幅固定のコンテナ */
#game-wrapper {
    width: 360px;
    padding: 0 5px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center; /* 中身のパーツをすべて真ん中に揃える */
}

/* ① タイトルパネル（上から30pxを確保） */
#title-panel {
    width: 100%;
    height: 60px;
    background: #1e90ff;
    border: 5px solid #fff;
    border-radius: 15px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;    /* 画面の一番上から30pxあける */
    margin-bottom: 15px; /* 下に隙間 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

#title-panel h1 {
    color: #fff;
    margin: 0;
    font-size: 28px;
    font-style: italic;
    font-weight: bold;
    letter-spacing: 2px;
}

/* ② メインゲームパネル */
#main-panel {
    width: 100%;
    height: 260px;
    background: #87CEEB;
    border: 5px solid #fff;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

canvas {
    display: block;
}

/* ③ リセットボタン */
#reset-area {
    width: 100%;
    margin-bottom: 12px;
}

#btn-reset {
    width: 100%;
    height: 45px;
    background: #ff4500;
    color: #fff;
    border: 4px solid #fff;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 4px #999;
    box-sizing: border-box;
}

#btn-reset:active {
    box-shadow: 0 1px #999;
    transform: translateY(3px);
}

/* ④ 左右ボタン（高さをとらない） */
#controller {
    width: 100%;
    display: flex;
    justify-content: space-between;
    box-sizing: border-box;
}

.btn {
    width: 165px; 
    height: 60px; /* 高さを抑える */
    background: #fff;
    border: 5px solid #333;
    border-radius: 12px;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    cursor: pointer;
    box-shadow: 0 5px #999;
    box-sizing: border-box;
}

.btn:active {
    box-shadow: 0 1px #999;
    transform: translateY(4px);
}