body {
    margin: 0;
    padding: 0;
    background: #2c3e50;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: white;
}

#mainContainer {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
}

#sidePanel {
    width: 200px;
    background: #34495e;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.language-selector {
    margin-bottom: 20px;
    padding: 10px;
    background: #2c3e50;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
}

.language-selector select {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 5px;
    background: #34495e;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.language-selector select:focus {
    outline: none;
    background: #3498db;
}

.stat-item {
    margin-bottom: 20px;
    padding: 10px;
    background: #2c3e50;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-label {
    font-size: 12px;
    color: #bdc3c7;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

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

.progress-container {
    position: relative;
    width: 100%;
    height: 25px;
    background: #2c3e50;
    border-radius: 12px;
    border: 2px solid #34495e;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    border-radius: 10px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 100%;
}

.progress-bar.boss-mode {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    color: #ecf0f1;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

#gameContainer {
    position: relative;
    width: 400px;
    height: 600px;
    background: #34495e;
    border: 3px solid #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    background: #2c3e50;
}

#startScreen, #gameOverScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

button {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 8px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #2980b9;
}

.level-selector {
    margin: 20px 0;
    text-align: center;
}

.level-selector label {
    display: block;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
}

.slider {
    width: 300px;
    height: 8px;
    border-radius: 5px;
    background: #34495e;
    outline: none;
    margin: 10px 0;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: 2px solid #ecf0f1;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: 2px solid #ecf0f1;
}

.level-descriptions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: #bdc3c7;
    width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.level-mark {
    flex: 0 0 auto;
}

.level-mark:first-child {
    text-align: left;
}

.level-mark:last-child {
    text-align: right;
}

.start-btn {
    background: #27ae60;
    width: 250px;
    margin-top: 20px;
    font-size: 18px;
    padding: 15px 25px;
}

.start-btn:hover {
    background: #229954;
}

h1, h2 {
    text-align: center;
    margin: 20px 0;
}


#instructions {
    text-align: center;
    margin: 20px;
    font-size: 14px;
    color: #ecf0f1;
}

.controls-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 15px;
    max-width: 250px;
    margin: 0 auto;
    align-items: center;
}

.keys-group {
    text-align: right;
    display: flex;
    gap: 5px;
    justify-content: flex-end;
}

.key {
    background: linear-gradient(145deg, #ecf0f1, #bdc3c7);
    color: #2c3e50;
    padding: 6px 10px;
    border-radius: 6px;
    border: 2px solid #95a5a6;
    border-bottom: 3px solid #7f8c8d;
    box-shadow: 0 2px 0 #7f8c8d, 0 4px 8px rgba(0,0,0,0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    font-size: 13px;
    min-width: 30px;
    text-align: center;
    display: inline-block;
    transition: all 0.1s ease;
}

.key.small {
    font-size: 10px;
    padding: 4px 6px;
    min-width: 25px;
}

.action-column {
    text-align: left;
    color: #ecf0f1;
}

#scoreForm {
    margin: 20px 0;
    text-align: center;
}

#scoreForm label {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
}

#scoreForm input {
    padding: 8px 12px;
    margin: 0 10px;
    border: 2px solid #3498db;
    border-radius: 5px;
    font-size: 16px;
    text-align: center;
    background: #34495e;
    color: white;
}

#scoreForm input:focus {
    outline: none;
    border-color: #27ae60;
}


#leaderboardPanel {
    width: 220px;
    background: #34495e;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    font-size: 13px;
}

#leaderboardPanel h3 {
    text-align: center;
    margin: 0 0 15px 0;
    color: #ecf0f1;
    font-size: 16px;
}

#liveScoresList {
    max-height: 500px;
    overflow-y: auto;
}

.live-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 5px 0;
    background: rgba(44, 62, 80, 0.6);
    border-radius: 5px;
    border: none;
    border-left: 4px solid #3498db;
}

.live-score-rank {
    font-weight: bold;
    color: #f39c12;
    margin-right: 10px;
    min-width: 25px;
}

.live-score-name {
    flex: 1;
    text-align: left;
    font-size: 12px;
}

.live-score-points {
    font-weight: bold;
    color: #27ae60;
    font-size: 12px;
}

.live-score-level {
    font-size: 10px;
    color: #3498db;
    margin: 0 8px;
}

.live-score-item.last-saved-score {
    background: rgba(46, 204, 113, 0.3);
    border-left: 4px solid #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
    animation: highlight-fade 3s ease-out;
}

@keyframes highlight-fade {
    0% {
        background: rgba(46, 204, 113, 0.6);
        box-shadow: 0 0 15px rgba(46, 204, 113, 0.8);
    }
    100% {
        background: rgba(46, 204, 113, 0.3);
        box-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}