/* --- FUNDAMENTY I KOLORYSTYKA --- */
:root {
    --primary-orange: #ff8c00;
    --evil-red: #b30000;
    --dark-bg: #0a0a0a;
    --text-color: #f0f0f0;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--dark-bg);
    color: var(--text-color);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;

    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- DISCLAIMER / MODAL --- */
#disclaimer-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal-content {
    background: #1a1a1a;
    padding: 30px;
    border: 2px solid var(--primary-orange);
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 140, 0, 0.3);
}

.modal-content h1 {
    color: var(--primary-orange);
    margin-top: 0;
    line-height: 1.15;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: transform 0.2s;
}

#accept-btn {
    background-color: var(--primary-orange);
    color: black;
}

#exit-btn {
    background-color: #444;
    color: white;
}

button:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

/* --- KONTENER REKLAMY (RESPONSYWNY) --- */
#main-content {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

#ad-container {
    position: relative;
    width: 95%;
    max-width: 900px;
    background: #000;
    border: 3px solid #333;

    /* WAŻNE: nie zabijaj line-height całego kontenera,
       bo overlay dziedziczy i tekst się nakłada */
    line-height: normal;
}

/* Usuwa lukę pod wideo bez psucia overlay */
#videoAd {
    width: 100%;
    height: auto;
    display: block;
    line-height: 0;
    max-height: 80vh;
    object-fit: contain;
}

/* --- SYSTEM ALERT (EVIL OVERLAY) --- */
#evil-alert {
    position: absolute;
    inset: 0;
    background: rgba(180, 0, 0, 0.85);
    display: none; /* Sterowane przez JS */
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 50;
    animation: flash 0.5s infinite;

    text-align: center;
    line-height: normal;
}

@keyframes flash {
    0% { background: rgba(180, 0, 0, 0.85); }
    50% { background: rgba(255, 0, 0, 0.95); }
    100% { background: rgba(180, 0, 0, 0.85); }
}

.alert-content {
    position: relative; /* rodzic dla scanner-line */
    width: min(92vw, 900px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.alert-content h1 {
    margin: 0;
    color: white;
    text-shadow: 2px 2px 10px black;
    font-weight: 800;

    /* Responsywnie i bez nachodzenia */
    line-height: 1.05;
    font-size: clamp(28px, 7vw, 72px);
    word-break: break-word;
}

#alert-message {
    margin: 0;
    color: white;
    font-weight: bold;

    line-height: 1.25;
    font-size: clamp(14px, 3.5vw, 22px);
    max-width: 60ch;
}

/* Linia skanera (efekt Ludovico) */
.scanner-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 15px white;
    top: 0;
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { top: 0%; }
    100% { top: 100%; }
}

/* --- PODGLĄD KAMERY --- */
#camera-preview {
    margin-top: 20px;
    width: 200px;
    position: relative;
    border: 2px solid var(--primary-orange);
    background: #000;
}

#webcam {
    width: 100%;
    height: auto;
    display: block;
    transform: scaleX(-1); /* Efekt lustra */
}

#status {
    background: rgba(0, 0, 0, 0.8);
    color: var(--primary-orange);
    font-size: 10px;
    padding: 5px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- MEDIA QUERIES (MOBILE) --- */
@media (max-width: 600px) {
    #main-content {
        padding: 12px 0;
    }

    #videoAd {
        max-height: 70vh;
    }

    #camera-preview {
        width: 140px;
        position: fixed;
        bottom: 10px;
        right: 10px;
        z-index: 100;
        margin-top: 0;
    }

    .modal-content {
        padding: 20px;
    }

    button {
        width: 100%;
        max-width: 320px;
    }
}
