:root {
    --primary-color: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --success-color: #22c55e;
    --error-color: #ef4444;
    --bg-color: #0f172a; /* Slate 900 for modern dark mode */
    --panel-bg: #1e293b; /* Slate 800 */
    --text-color: #f8fafc; /* Slate 50 */
    --text-muted: #94a3b8; /* Slate 400 */
    --border-color: #334155; /* Slate 700 */
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* SIDEBAR */
#sidebar {
    width: 350px;
    background-color: var(--panel-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 1000; /* Nad mapą Leaflet */
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#game-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

#score { color: var(--success-color); }
#timer { color: #facc15; }

#question-container {
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s ease;
}

#question-container p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

#current-question {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
}

/* Animacja pulsowania dla pytania */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
.question-active {
    animation: pulse 2s infinite;
}

#feedback-container {
    min-height: 60px;
    margin-bottom: auto;
    text-align: center;
}

#feedback-message {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}
#feedback-message.show {
    opacity: 1;
}
.feedback-success {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.feedback-error {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-family: inherit;
    margin-top: 1rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}
.btn-primary:active {
    transform: translateY(2px);
}
.btn-primary:disabled {
    background-color: #475569;
    cursor: not-allowed;
    transform: none;
}

/* MAPA */
#map-container {
    flex: 1;
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
    /* Mroczny styl dla pustego tła mapy (gdy poza bounding box) */
    background-color: #0f172a; 
}

/* Kafelki z mrocznym trybem przez filtry CSS */
.leaflet-tile {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* Własne popupy */
.leaflet-popup-content-wrapper {
    background-color: var(--panel-bg);
    color: var(--text-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.leaflet-popup-tip {
    background-color: var(--panel-bg);
}

/* Responsive - wersja mobilna na małych ekranach */
@media (max-width: 768px) {
    #app {
        flex-direction: column;
    }
    #sidebar {
        width: 100%;
        height: auto;
        padding: 1rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    #map-container {
        height: 60vh;
    }
    header h1 {
        font-size: 1.4rem;
    }
    .stat-value {
        font-size: 1.5rem;
    }
    #question-container {
        min-height: 80px;
        margin-bottom: 0.5rem;
    }
    #current-question {
        font-size: 1.2rem;
    }
}
