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

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

.game-container {
    text-align: center;
    padding: 20px;
}

.game-header {
    margin-bottom: 20px;
}

.game-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #3498db;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2em;
}

.game-menu {
    background-color: #34495e;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.game-menu h2 {
    margin-bottom: 20px;
    color: #3498db;
}

.game-menu input {
    padding: 10px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    margin-bottom: 15px;
    width: 200px;
}

.game-menu button, .game-over button {
    padding: 10px 30px;
    font-size: 18px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.3s;
}

.game-menu button:hover, .game-over button:hover {
    background-color: #2980b9;
}

#gameCanvas {
    border: 2px solid #3498db;
    background-color: #87CEEB;
    display: block;
    margin: 0 auto;
}

.highscores {
    margin-top: 30px;
}

.highscores h3 {
    margin-bottom: 10px;
}

.highscores ul {
    list-style: none;
    text-align: left;
    max-width: 300px;
    margin: 0 auto;
}

.highscores li {
    padding: 5px 0;
    border-bottom: 1px solid #556983;
}

.game-over {
    background-color: #34495e;
    padding: 30px;
    border-radius: 10px;
}

.game-over h2 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.game-over p {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.controls {
    margin-top: 20px;
    font-size: 14px;
    color: #bdc3c7;
}

/* Level Editor Styles */
.level-editor {
    background-color: #34495e;
    padding: 20px;
    border-radius: 10px;
}

.editor-header {
    margin-bottom: 20px;
}

.editor-header h2 {
    color: #3498db;
    margin-bottom: 15px;
}

.editor-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.editor-btn {
    padding: 8px 20px;
    font-size: 16px;
    background-color: #7f8c8d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.editor-btn:hover {
    background-color: #95a5a6;
}

.editor-btn.active {
    background-color: #3498db;
}

.editor-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.editor-actions input {
    padding: 8px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    width: 200px;
}

.editor-actions button {
    padding: 8px 20px;
    font-size: 16px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.editor-actions button:hover {
    background-color: #229954;
}

#editorCanvas {
    border: 2px solid #3498db;
    background-color: #ecf0f1;
    display: block;
    margin: 0 auto;
    cursor: crosshair;
}

.editor-info {
    margin-top: 10px;
    font-size: 14px;
    color: #bdc3c7;
}

/* Custom Levels */
.custom-levels {
    background-color: #34495e;
    padding: 30px;
    border-radius: 10px;
}

.custom-levels h2 {
    color: #3498db;
    margin-bottom: 20px;
}

#customLevelsList {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.custom-level-item {
    background-color: #2c3e50;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    text-align: left;
}

.custom-level-item h3 {
    color: #3498db;
    margin-bottom: 5px;
}

.custom-level-item p {
    font-size: 14px;
    margin-bottom: 5px;
}

.custom-level-item button {
    padding: 8px 20px;
    font-size: 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.custom-level-item button:hover {
    background-color: #2980b9;
}

.custom-levels > button {
    padding: 10px 30px;
    font-size: 18px;
    background-color: #7f8c8d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.custom-levels > button:hover {
    background-color: #95a5a6;
}

/* Login/Register styles */
.login-menu, .register-menu {
    background-color: #34495e;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.login-menu h2, .register-menu h2 {
    margin-bottom: 20px;
    color: #3498db;
}

.login-form, .register-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.login-form input, .register-form input {
    padding: 10px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    width: 200px;
}

.login-form button, .register-form button {
    padding: 10px 30px;
    font-size: 18px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.3s;
}

.login-form button:hover, .register-form button:hover {
    background-color: #2980b9;
}

.logout-btn {
    background-color: #e74c3c !important;
}

.logout-btn:hover {
    background-color: #c0392b !important;
}

/* Game mode selection */
.game-mode-selection {
    margin-bottom: 15px;
}

.game-mode-selection label {
    font-size: 16px;
    cursor: pointer;
}

.game-mode-selection input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

/* Highscores view */
.highscores-view {
    background-color: #34495e;
    padding: 30px;
    border-radius: 10px;
}

.highscores-view h2 {
    color: #3498db;
    margin-bottom: 20px;
}

.highscores-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.tab-btn {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #7f8c8d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tab-btn:hover {
    background-color: #95a5a6;
}

.tab-btn.active {
    background-color: #3498db;
}

.highscore-table {
    background-color: #2c3e50;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.highscore-table h3 {
    color: #3498db;
    margin-bottom: 15px;
    text-align: center;
}

.highscore-table table {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

.highscore-table th {
    background-color: #34495e;
    padding: 12px;
    text-align: left;
    color: #3498db;
    border-bottom: 2px solid #3498db;
}

.highscore-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #556983;
}

.highscore-table tr:nth-child(even) {
    background-color: rgba(52, 73, 94, 0.3);
}

.highscore-table tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.highscores-view > button {
    padding: 10px 30px;
    font-size: 18px;
    background-color: #7f8c8d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.highscores-view > button:hover {
    background-color: #95a5a6;
}

/* Speedrun timer styling */
.speedrun-timer {
    background-color: #e74c3c;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.3em;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
    border: 2px solid #c0392b;
    animation: timerPulse 2s infinite;
}

.timer-icon {
    margin-right: 5px;
    font-size: 1.1em;
}

@keyframes timerPulse {
    0%, 100% { 
        box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.6);
        transform: scale(1.02);
    }
}

/* Level progression indicator */
.level-progress {
    background-color: #34495e;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #7f8c8d;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

/* Visual feedback for powerups */
.powerup-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(45deg, #f1c40f, #f39c12);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.5);
    z-index: 1000;
    animation: powerupNotification 2s ease-out forwards;
    display: none;
}

@keyframes powerupNotification {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}