/* 全体のリセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

/* ゲームコンテナ */
.game-container {
    background: #f7fafc;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 900px;
    width: 100%;
}

/* タイトル */
h1 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* ゲーム情報表示エリア */
.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    border: 1px solid #e9d5ff;
}

.score, .high-score {
    color: #2d3748;
}

/* ゲームキャンバス */
#gameCanvas {
    border: 3px solid #4a5568;
    border-radius: 10px;
    background: linear-gradient(to bottom, #87ceeb, #98fb98);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    position: relative;
}

/* スタート画面 */
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.start-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease-in;
    border: 1px solid #e9d5ff;
}

.start-content h2 {
    color: #4a5568;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.start-content p {
    font-size: 1.3em;
    margin-bottom: 30px;
    color: #718096;
    line-height: 1.6;
}

/* スタートボタン */
.start-button {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #38a169, #2f855a);
}

.start-button:active {
    transform: translateY(0);
}

/* ゲームオーバー画面 */
.game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease-in;
    border: 1px solid #e9d5ff;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.game-over-content h2 {
    color: #e53e3e;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.game-over-content p {
    font-size: 1.3em;
    margin-bottom: 30px;
    color: #4a5568;
}

/* リスタートボタン */
.restart-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #4c51bf, #553c9a);
}

.restart-button:active {
    transform: translateY(0);
}

/* ゲーム説明 */
.instructions {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #e9d5ff;
    border: 1px solid #e9d5ff;
}

.instructions h3 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.instructions p {
    color: #718096;
    line-height: 1.6;
}

/* ユーティリティクラス */
.hidden {
    display: none !important;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
}
