body {
    background-color: #050505;
    color: #b0b0b0;
    font-family: 'Times New Roman', serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    background-image: url('../../images/background_dark.png');
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    overflow: hidden;
    /* Kluczowe dla gestów: zapobiega domyślnym reakcjom przeglądarki na dotyk */
    touch-action: none; 
}
h1 {
    color: #8a0f0f;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0px 0px 10px rgba(138, 15, 15, 0.4);
    margin-bottom: 20px;
    margin-top: 0;
    z-index: 5;
}
canvas {
    border: 1px solid #333;
    background-color: #080808;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.95);
    display: block;
}
#score {
    margin-top: 20px;
    font-size: 1.2em;
    color: #999;
}
.controls {
    margin-top: 10px;
    font-size: 0.8em;
    color: #444;
    font-style: italic;
}
.container {
    border: 1px solid #333;
    padding: 50px;
    background-color: rgba(8, 8, 8, 0.9);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.95);
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}
.container::after {
    content: "";
    position: absolute;
    top: 6px; left: 6px; right: 6px; bottom: 6px;
    border: 1px solid #5e0b0b;
    pointer-events: none;
    opacity: 0.5;
}

/* --- PRZYCISK POWROTU --- */
.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 0.9rem;
    padding: 5px 10px;
    color: #999;
    text-decoration: none;
    border: 1px solid #333;
    background-color: transparent;
    transition: all 0.3s;
    z-index: 20;
}
.back-button:hover {
    color: #ff3333;
    border-color: #8a0f0f;
    box-shadow: 0 0 10px #8a0f0f;
}

/* --- PRZYCISK ZMIANY MOTYWU (ODWRÓCONY) --- */
.theme-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    z-index: 20;
    text-decoration: none;
    text-transform: uppercase;
    padding: 5px 10px;
    transition: all 0.3s;
    font-weight: bold;
    text-align: center;
    background-color: #e0e0e0;
    color: #1a1a1a;
    border: 1px solid #ccc;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.theme-switch:hover {
    background-color: #fff;
    color: #000;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    border-color: #fff;
}

/* --- LIGHT MODE --- */
body.light-mode {
    background-image: url('../../images/background_light.png');
}
body.light-mode .container {
    background-color: rgba(240, 240, 240, 0.9);
    border-color: #bbb;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
}
body.light-mode .container::after {
    border-color: #8a0f0f;
    opacity: 0.3;
}
body.light-mode h1 {
    text-shadow: 0px 0px 5px rgba(138, 15, 15, 0.2);
}
body.light-mode .back-button {
    color: #555;
    border-color: #bbb;
}
body.light-mode .back-button:hover {
    color: #cc0000;
    border-color: #cc0000;
    box-shadow: 0 0 5px rgba(204, 0, 0, 0.3);
}

body.light-mode .theme-switch {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border-color: #000;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

body.light-mode .theme-switch:hover {
    background-color: #000;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
    border-color: #000;
}

.game-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}
.scoreboard {
    border: 1px solid #333;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    min-width: 200px;
    text-align: left;
}
.scoreboard h3 {
    color: #8a0f0f;
    margin-top: 0;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    font-size: 1.1em;
}
.scoreboard ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.scoreboard li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #222;
    font-size: 0.9em;
    color: #999;
}
body.light-mode .scoreboard {
    background-color: rgba(255, 255, 255, 0.5);
    border-color: #bbb;
}
body.light-mode .scoreboard h3 {
    border-bottom-color: #ccc;
}
body.light-mode .scoreboard li {
    border-bottom-color: #ddd;
    color: #555;
}

/* --- MOBILE SPECIFIC --- */
.mobile-hint {
    display: none;
    margin-top: 10px;
    font-size: 0.85em;
    color: #777;
    font-style: italic;
    border: 1px solid #333;
    padding: 5px 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 5px;
}

@media (max-width: 768px) {
    .container {
        padding-top: 70px; 
        padding-bottom: 20px;
        padding-left: 10px;
        padding-right: 10px;
        justify-content: flex-start;
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
        margin-top: 0;
    }

    .game-wrapper {
        flex-direction: column;
        align-items: center;
    }
    
    .controls {
        display: none;
    }
    
    .mobile-hint {
        display: block; /* Pokaż podpowiedź na mobile */
    }

    .back-button {
        top: 15px;
        left: 15px;
        font-size: 0.8rem;
    }

    .theme-switch {
        top: 15px;
        right: 15px;
        font-size: 0.8rem;
    }
}