/* ========================================
   テーマ色・全体で使うCSS変数
   ======================================== */
:root {
    --bg-color: #f5f2ed;
    --text-color: #5D4037;
    --accent-color: #8b7969;
    --danger-color: #e74c3c;
}

/* ========================================
   ページ全体のレイアウト・ベーススタイル
   ======================================== */
body {
    font-family: 'Noto Serif JP', serif;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
    -webkit-user-select: none; user-select: none;
    overflow: hidden;
}

/* ========================================
   ゲームを包むカード風コンテナ
   ======================================== */
.game-container {
    width: 100%;
    max-width: 500px;
    text-align: center;
    background-color: #fff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

/* ========================================
   タイトル（Orbitronフォント）
   ======================================== */
h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8em;
    margin: 0 0 15px 0;
    color: #4e342e;
}

/* ========================================
   ゲーム描画用キャンバス
   ======================================== */
canvas {
    background: #d3c6b6;
    border-radius: 5px;
    width: 100%;
    height: auto;
    cursor: none;
}

/* ========================================
   スコア・ライフ・ウェーブ表示バー
   ======================================== */
.info-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1em;
    margin: 10px 0;
    padding: 0 5px;
}

#lives { color: var(--danger-color); font-size: 1.5em; }

/* ========================================
   スタート／ゲームオーバーなどのオーバーレイUI
   ======================================== */
#ui-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: var(--text-color);
    font-size: 2em;
    text-align: center;
    background: rgba(245, 242, 237, 0.7);
    pointer-events: none;
}

#ui-layer.hidden { display: none; }

#ui-layer button, #ui-layer a {
    font-family: 'Noto Serif JP', serif;
    font-size: 0.8em;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: var(--accent-color);
    color: white;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-decoration: none;
}

.game-over-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* ========================================
   キャンバス上のコンボ表示テキスト
   ======================================== */
#combo-display {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5em;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
}

#combo-display.active { opacity: 1; transform: translateX(-50%) scale(1.2); }

/* ========================================
   BGM選択ボタン群
   ======================================== */
.music-controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.music-button {
    font-family: 'Noto Serif JP', serif;
    font-size: 0.9em;
    padding: 8px 15px;
    border: 1px solid #d3c6b6;
    background-color: #fff;
    color: var(--text-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.music-button:hover {
    background-color: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.music-button.playing {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    font-weight: bold;
}

/* ========================================
   キャンバスとオーバーレイを重ねるためのラッパー
   ======================================== */
.canvas-wrap {
    position: relative;
}

/* ========================================
   スマホ向け移動・射撃ボタン（767px以下で表示）
   ======================================== */
#mobile-controls {
    display: none;
    width: 100%;
    max-width: 400px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.move-btn { background-color: var(--accent-color); color: white; border: none; border-radius: 8px; width: 80px; height: 60px; font-size: 2em; }

#shootBtn { background-color: #c0392b; border-radius: 50%; width: 80px; height: 80px; font-size: 1.2em; font-weight: bold; }

@media (max-width: 767px) { #mobile-controls { display: flex; } }
