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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

#gameContainer {
    width: 100%;
    max-width: 800px;
    height: 600px;
    position: relative;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.screen.active {
    display: flex;
}

h1 {
    font-size: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 40px;
    font-weight: bold;
}

h2 {
    font-size: 36px;
    color: #764ba2;
    margin-bottom: 30px;
}

.menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn {
    padding: 14px 36px;
    font-size: 16px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    margin: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
    min-width: 160px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn.small {
    padding: 10px 24px;
    font-size: 14px;
    min-width: auto;
}

#gameHeader {
    width: 100%;
    padding: 16px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}

.stat-label {
    font-weight: 600;
    opacity: 0.9;
}

.stat-value {
    font-weight: bold;
    font-size: 20px;
}

#canvasWrapper {
    flex: 1;
    width: 100%;
    background: #f5f5f5;
    position: relative;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

#gameControls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    gap: 12px;
    background: white;
    border-top: 1px solid #eee;
}

input[type="text"] {
    padding: 14px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    width: 80%;
    max-width: 300px;
    margin: 16px 0;
    outline: none;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    border-color: #667eea;
}

#scoresList {
    width: 90%;
    max-width: 500px;
    max-height: 350px;
    overflow-y: auto;
    margin: 20px 0;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    margin: 8px 0;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 16px;
    transition: transform 0.2s;
}

.score-item:hover {
    transform: translateX(5px);
}

.score-item:nth-child(1) {
    background: linear-gradient(135deg, #667eea20, #764ba220);
    border: 1px solid #667eea;
}

.score-rank {
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
}

.final-stats {
    margin: 20px 0;
    text-align: center;
}

.final-stats p {
    font-size: 22px;
    color: #333;
    margin: 10px 0;
}

#playerName {
    margin: 20px 0;
}

@media (max-width: 600px) {
    #gameContainer {
        height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }
    
    body {
        padding: 0;
    }
    
    h1 {
        font-size: 40px;
    }
    
    #gameHeader {
        padding: 12px 15px;
    }
    
    .stat-item {
        font-size: 14px;
    }
    
    .stat-value {
        font-size: 16px;
    }
}
