/* ============================
   RESET I PODSTAWOWE USTAWIENIA
   ============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Globalny fix dla niebieskiego podświetlenia na urządzeniach mobilnych */
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: #0c1445 !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0c1445 !important;
    background-image: linear-gradient(180deg, #0c1445 0%, #1e3c72 30%, #2a5298 70%, #1a237e 100%) !important;
    min-height: 100vh;
    color: white;
    position: relative;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    animation: nightSkyGlow 8s ease-in-out infinite alternate;
}

/* Wydruk: czysty biały, bez tła animacji i elementów dekoracyjnych */
@media print {
    @page { size: A4 portrait; margin: 15mm; }
    html, body { background: #ffffff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; color: #000; }
    .stars-layer, .moon, #staticStarsContainer { display: none !important; }
    .container { max-width: auto; padding: 0; }
    .section { background: #fff !important; border: 0; box-shadow: none; backdrop-filter: none; color: #000; page-break-inside: avoid; break-inside: avoid; }
    .results-section, .start-section, .statistics-section { display: block !important; }
}

/* Scroll behavior */
html {
    scroll-behavior: smooth;
}

/* ============================
   LAYOUT I KONTENER
   ============================ */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
}

/* ============================
   HEADER
   ============================ */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: titleGlow 4s ease-in-out infinite alternate;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================
   SEKCJE GŁÓWNE
   ============================ */
.section {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 40px 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 50px rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(102, 126, 234, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Strona startowa */
.start-section {
    text-align: center;
}

.start-section h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #fff;
}

/* Sekcja pytań (ukryta na początku) */
.question-section {
    display: none;
    text-align: center;
}

/* Sekcja wyników (ukryta na początku) */
.results-section {
    display: none;
}

/* ============================
   NOCNE NIEBO - ELEMENTY STATYCZNE
   ============================ */
.stars-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 5;
    background: transparent;
}

/* Księżyc */
.moon {
    position: fixed;
    top: 10%;
    right: 15%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #f8f8ff 0%, #e6e6fa 50%, #d3d3d3 100%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(248, 248, 255, 0.3);
    pointer-events: none;
    z-index: 1;
    animation: moonGlow 4s ease-in-out infinite alternate;
}

.moon::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 25%;
    width: 8px;
    height: 8px;
    background: rgba(169, 169, 169, 0.4);
    border-radius: 50%;
}

.moon::after {
    content: '';
    position: absolute;
    top: 60%;
    left: 45%;
    width: 5px;
    height: 5px;
    background: rgba(169, 169, 169, 0.3);
    border-radius: 50%;
}

/* Statyczne gwiazdy */
.static-star {
    position: fixed;
    width: 4px;
    height: 4px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 5;
    animation: twinkle 3s ease-in-out infinite;
}

/* ============================
   RESPONSYWNOŚĆ
   ============================ */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 1rem;
    }

    .section {
        padding: 25px 20px;
        margin-bottom: 20px;
    }

    .moon {
        width: 40px;
        height: 40px;
        top: 8%;
        right: 10%;
    }
    
    .static-star {
        width: 3px;
        height: 3px;
        box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .question-text {
        font-size: 1.2rem;
    }
}

/* ============================
   ULEPSZENIA DLA HIGH-DPI
   ============================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .static-star {
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
    }
    
    .moon {
        box-shadow: 0 0 25px rgba(248, 248, 255, 0.4);
    }
}

/* ============================
   PREFERS REDUCED MOTION
   ============================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}