* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
}

.container {
    position: relative;
    display: inline-block;
}

canvas {
    background-color: #333; /* ステージの背景色 */
    display: block;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* UIレイヤー（キャンバスの上に重ねる） */
.ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    color: white;
    pointer-events: none; /* UIがゲーム操作を邪魔しないように */
}

.health-bar {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 8px;
    min-width: 100px;
    text-align: center;
}

span {
    font-size: 32px;
    font-weight: bold;
}

.p1-health span { color: #ff4d4d; } /* 赤 */
.p2-health span { color: #4d4dff; } /* 青 */

.timer {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}