* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    max-width: 1200px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

header {
    background: linear-gradient(to right, #0f9b0f, #3a7d34);
    padding: 20px;
    text-align: center;
    border-bottom: 3px solid #0c7c0c;
}

header h1 {
    font-size: 2.8rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.game-content {
    display: flex;
    padding: 20px;
    gap: 20px;
}

.game-board {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
}

.score-display {
    display: flex;
    gap: 20px;
}

.info-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 1.1rem;
}

.info-box i {
    color: #4CAF50;
    font-size: 1.3rem;
}

.controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #3d8b40;
}

.btn-secondary {
    background-color: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background-color: #0b7dda;
}

.btn-warning {
    background-color: #ff9800;
    color: white;
}

.btn-warning:hover {
    background-color: #e68a00;
}

.btn-success {
    background-color: #4CAF50;
    color: white;
}

.btn-success:hover {
    background-color: #3d8b40;
}

.btn:disabled {
    background-color: #666;
    cursor: not-allowed;
    opacity: 0.7;
}

.game-area {
    position: relative;
    background-color: #000;
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid #333;
}

#game-canvas {
    display: block;
    background-color: #111;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
}

#start-screen h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #4CAF50;
}

.instructions {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    max-width: 80%;
}

.instructions p {
    margin: 10px 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.instructions i {
    color: #4CAF50;
}

#game-over h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ff5252;
}

#game-over p {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.save-score-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 80%;
}

#player-name {
    padding: 12px;
    border-radius: 6px;
    border: 2px solid #4CAF50;
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    width: 200px;
}

.high-score-message {
    background-color: rgba(255, 215, 0, 0.2);
    border: 2px solid #FFD700;
    color: #FFD700;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 80%;
}

.low-score-message {
    background-color: rgba(255, 82, 82, 0.2);
    border: 2px solid #FF5252;
    color: #FF5252;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 80%;
}

.difficulty {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
}

.difficulty h3 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.difficulty-buttons {
    display: flex;
    gap: 15px;
}

.difficulty-btn {
    flex: 1;
    padding: 12px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.difficulty-btn.active {
    background-color: #4CAF50;
}

.difficulty-btn:hover:not(.active) {
    background-color: #555;
}

.scores-panel {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
}

.scores-panel h2 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #FFD700;
}

#scores-container {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.score-item {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-item.highlight {
    background-color: rgba(76, 175, 80, 0.3);
    border-left: 4px solid #4CAF50;
}

.player-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.player-score {
    font-size: 1.2rem;
    color: #FFD700;
    font-weight: bold;
}

.player-date {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 5px;
}

.loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.score-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.score-table-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.score-table-content {
    background-color: #1a1a2e;
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.score-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.score-table-header h2 {
    color: #FFD700;
}

.close-table-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.score-table {
    width: 100%;
    border-collapse: collapse;
}

.score-table th {
    background-color: #0f9b0f;
    padding: 15px;
    text-align: left;
}

.score-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

.score-table tr:hover {
    background-color: rgba(76, 175, 80, 0.1);
}

.rank-cell {
    font-weight: bold;
    color: #FFD700;
    text-align: center;
}

.name-cell {
    font-weight: bold;
}

.score-cell {
    text-align: right;
    font-weight: bold;
    color: #4CAF50;
}

.date-cell {
    font-size: 0.9rem;
    opacity: 0.7;
    text-align: center;
}

footer {
    text-align: center;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsywność */
@media (max-width: 900px) {
    .game-content {
        flex-direction: column;
    }
    
    .game-board, .scores-panel {
        width: 100%;
    }
    
    #game-canvas {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 600px) {
    .game-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .controls {
        width: 100%;
        justify-content: center;
    }
    
    .save-score-form {
        flex-direction: column;
        align-items: center;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .score-display {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .score-actions {
        flex-direction: column;
    }
}
/* Dodaj te style do istniejącego pliku style.css */

.control-options {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.control-option {
    text-align: center;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    min-width: 150px;
}

.control-option h4 {
    margin-bottom: 15px;
    color: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.key-row {
    display: flex;
    gap: 5px;
}

.key {
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, #2c2c2c, #222);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid #444;
    transition: all 0.2s;
}

.key:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

.key-up, .key-w {
    background: linear-gradient(145deg, #4CAF50, #3d8b40);
    color: white;
    border-color: #2E7D32;
}

.key-down, .key-s {
    background: linear-gradient(145deg, #4CAF50, #3d8b40);
    color: white;
    border-color: #2E7D32;
}

.key-left, .key-a {
    background: linear-gradient(145deg, #4CAF50, #3d8b40);
    color: white;
    border-color: #2E7D32;
}

.key-right, .key-d {
    background: linear-gradient(145deg, #4CAF50, #3d8b40);
    color: white;
    border-color: #2E7D32;
}

.key-placeholder {
    width: 50px;
    height: 50px;
    visibility: hidden;
}

.game-rules {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: left;
}

.game-rules p {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.game-rules i {
    color: #4CAF50;
    width: 20px;
}

.instructions h3 {
    color: #FFD700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

/* Responsywność dla sterowania */
@media (max-width: 600px) {
    .control-options {
        flex-direction: column;
        align-items: center;
    }
    
    .control-option {
        width: 100%;
        max-width: 250px;
    }
    
    .key {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .key-placeholder {
        width: 45px;
        height: 45px;
    }
}