/* --- グローバル & タイトル画面スタイル --- */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&display=swap');

body {
    background-color: #1a1a1a;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

#title-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 400;
    background: #111;
}

.title-content h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 5em;
    color: #00ffff;
    margin: 0;
    text-shadow: 0 0 5px #00ffff, 0 0 10px #00ffff, 0 0 20px #008f8f;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.2em;
    color: #a0a0a0;
    margin-top: 5px;
    margin-bottom: 50px;
    letter-spacing: 1px;
}

.title-buttons {
    display: flex;
    flex-direction: column;
    align-items: center; /* ボタンを中央揃えにする */
}

.title-buttons button {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5em;
    padding: 15px 40px;
    margin: 10px;
    cursor: pointer;
    border: 2px solid #00ffff;
    background: transparent;
    color: #00ffff;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
    text-shadow: 0 0 5px #00ffff;
}

.title-buttons button#startButton {
    background: #00ffff;
    color: #111;
    text-shadow: none;
}
.title-buttons button#startButton:hover {
    background: #fff;
    border-color: #fff;
    box-shadow: 0 0 15px #fff;
}

.info-button {
    font-size: 1.2em !important;
    padding: 10px 30px !important;
}

.title-buttons .info-button:hover {
    background-color: #00ffff;
    color: #111;
    text-shadow: none;
}

/* --- ゲーム本体のUI --- */
#game-ui-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
#gameContainer {
    position: relative;
    visibility: hidden;
}
canvas {
    background-color: #000;
    border: 2px solid #555;
    touch-action: none;
}
#scoreDisplay {
    margin-bottom: 15px; 
    font-size: 1.5em;
    font-weight: bold;
}
#rankDisplay {
    margin-bottom: 15px;
    font-size: 1.2em;
    color: #ffd700;
    transition: transform 0.2s ease-out, color 0.2s ease-out;
}
#rankDisplay.rank-up-flash {
    animation: rankFlash 0.3s ease-in-out;
}
@keyframes rankFlash {
    0% { transform: scale(1.0); color: #ffd700; }
    50% { transform: scale(1.3); color: #ff4500; text-shadow: 0 0 10px #ff8c00; }
    100% { transform: scale(1.0); color: #ffd700; text-shadow: none; }
}

/* --- ゲームオーバー画面 --- */
#gameOverScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #888;
    z-index: 100;
    width: 300px;
}
#gameOverScreen h2 {
    color: #ff5555;
    margin-top: 0;
}
#gameOverScreen button {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2em;
    padding: 10px 30px;
    margin-top: 15px;
    border: 2px solid #00ffff;
    background: transparent;
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
    cursor: pointer;
    width: 80%;
}
#gameOverScreen button#restartButton {
    background: #00ffff;
    color: #111;
    text-shadow: none;
}
#gameOverScreen button:hover {
    background: #008f8f;
    color: #111;
    text-shadow: none;
}


/* --- その他のモーダルウィンドウ (ランキング、遊び方など) --- */
#rankingScreen, #howToPlayScreen, #scoreSubmitScreen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 500px;
    max-height: 80%;
    background-color: rgba(20, 20, 20, 0.95);
    padding: 25px;
    border-radius: 10px;
    border: 2px solid #aaa;
    z-index: 500;
    display: flex;
    flex-direction: column;
}
#rankingScreen h2, #howToPlayScreen h2, #scoreSubmitScreen h2 {
    color: #eee;
    margin-top: 0;
    text-align: center;
}
.rules-content { overflow-y: auto; text-align: left; line-height: 1.6; }
.rules-content h3 { color: #00ffff; margin-top: 15px; border-bottom: 1px solid #00ffff; padding-bottom: 5px; }
.rules-content ul { padding-left: 20px; }
.rules-content li { margin-bottom: 10px; }
#rankingList { width: 100%; list-style-type: decimal; padding-left: 0; margin: 0; overflow-y: auto; font-size: 1.1em; }
#rankingList li { display: flex; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid #444; }
.rank-name { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 15px; }
.rank-score { font-weight: bold; color: #ffd700; }
#closeRankingButton, #closeHowToPlayButton { margin-top: 20px; background-color: #f44336; color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; align-self: center; }

/* ... (スコア登録フォームのスタイル) ... */
#scoreSubmitScreen input { width: 80%; padding: 10px; margin-top: 10px; font-size: 1.2em; text-align: center; background-color: #333; color: #eee; border: 1px solid #777; border-radius: 5px; }
#scoreSubmitScreen button { width: 85%; margin-top: 20px; background-color: #ffd700; color: #111; padding: 12px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 1.3em; font-weight: bold; }

/* --- ユーティリティ --- */
.hidden { display: none !important; }