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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #87CEEB;
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-canvas {
    display: block;
    touch-action: none;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#evolution-chart {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#evolution-chart .evo-item {
    display: flex;
    align-items: center;
}

#evolution-chart .evo-char {
    width: 28px;
    height: 28px;
}

#evolution-chart .evo-char img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#evolution-chart .evo-arrow {
    font-size: 10px;
    color: #666;
    margin: 0 1px;
}

#top-ui {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
}

#game-title {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
    color: #f1c40f;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

#score-display {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 30px;
    border-radius: 25px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#next-display {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

#next-label {
    font-size: 14px;
    font-weight: bold;
    color: #666;
}

#next-character {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#next-character img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#credits {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    text-align: center;
    pointer-events: none;
}

#gameover-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: 100;
}

#gameover-screen.hidden {
    display: none;
}

#gameover-content {
    background: white;
    padding: 40px 60px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#gameover-content h1 {
    font-size: 36px;
    color: #e74c3c;
    margin-bottom: 20px;
}

#gameover-content p {
    font-size: 24px;
    color: #333;
    margin-bottom: 30px;
}

#restart-button {
    padding: 15px 40px;
    font-size: 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
    pointer-events: auto;
}

#restart-button:hover {
    background: #2980b9;
}

#restart-button:active {
    transform: scale(0.98);
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    #evolution-chart {
        padding: 3px 6px;
        gap: 1px;
    }
    
    #evolution-chart .evo-char {
        width: 20px;
        height: 20px;
    }
    
    #evolution-chart .evo-arrow {
        font-size: 8px;
    }
    
    #top-ui {
        top: 38px;
        gap: 10px;
    }
    
    #game-title {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    #score-display {
        font-size: 16px;
        padding: 8px 16px;
    }
    
    #next-display {
        padding: 6px 10px;
    }
    
    #next-label {
        font-size: 12px;
    }
    
    #next-character {
        width: 40px;
        height: 40px;
    }
    
    #credits {
        font-size: 8px;
    }
    
    #gameover-content {
        padding: 30px 40px;
    }
    
    #gameover-content h1 {
        font-size: 28px;
    }
    
    #gameover-content p {
        font-size: 18px;
    }
    
    #restart-button {
        padding: 12px 30px;
        font-size: 16px;
    }
}