/* BAZOWY STYL I EFEKT CRT */
body {
    background-color: #050505;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 100;
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
}

.terminal {
    max-width: 950px;
    width: 100%;
    padding: 20px;
    position: relative;
}

.hidden { display: none !important; }

/* KOLORY I FORMATOWANIE TEKSTU */
.red-alert { color: #ff0000; font-weight: bold; }
.blue-info { color: #66b2ff; }
del { text-decoration-color: #66b2ff; }
.censored { background-color: #00ff00; color: #000; padding: 0 5px; }

/* NAGŁÓWEK SYSTEMOWY */
.header-box {
    border: 1px solid #00ff00;
    padding: 10px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.system-log { 
    margin-bottom: 20px; 
    line-height: 1.5; 
    min-height: 120px; /* Rezerwuje miejsce na wpisywanie */
}

/* MENU NAWIGACYJNE (PRZYCISKI ZAKŁADEK) */
.nav-menu {
    border-top: 1px solid #005500;
    border-bottom: 1px solid #005500;
    padding: 15px 0;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-btn {
    background-color: transparent;
    color: #00ff00;
    border: 1px solid #00ff00;
    padding: 8px 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.nav-btn:hover { background-color: #003300; }
.nav-btn.active { background-color: #00ff00; color: #000; }

/* UKRYWANIE I POKAZYWANIE ZAKŁADEK */
.tab-content { display: none; animation: glitch 0.3s ease-out; }
.tab-content.active { display: block; }

.tab-title {
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 18px;
}

@keyframes glitch {
    0% { opacity: 0; transform: translateX(-5px); }
    50% { opacity: 0.5; transform: translateX(5px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* TABELA IDENTYFIKACYJNA (ZAKŁADKA 1) */
.id-section {
    display: flex;
    border: 1px solid #00ff00;
    margin-bottom: 30px;
}

.image-column {
    padding: 20px;
    border-right: 1px solid #00ff00;
    display: flex;
    align-items: flex-start;
}

.id-photo {
    border: 2px solid #ff0000;
    max-width: 250px;
    display: block;
}

.table-column { flex-grow: 1; padding: 20px; }

.id-table { width: 100%; border-collapse: collapse; }
.id-table td { border: 1px solid #00ff00; padding: 12px; vertical-align: top; }
.id-table .label { font-weight: bold; width: 35%; }

/* BLOKI DANYCH (POZOSTAŁE ZAKŁADKI) */
.data-block {
    border: 1px solid #00ff00;
    padding: 20px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.data-header {
    color: #00ff00;
    font-weight: bold;
    border-bottom: 1px dashed #005500;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* STOPKA */
.footer-log {
    margin-top: 50px;
    border-top: 1px dashed #005500;
    padding-top: 20px;
    line-height: 1.5;
}

.cursor { display: inline-block; width: 10px; height: 20px; background: #00ff00; animation: blink 1s infinite; vertical-align: middle; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ========================================= */
/* EFEKTY WYLOGOWANIA I PRZYCISK             */
/* ========================================= */

.logout-btn {
    background-color: #220000;
    color: #ff0000;
    border: 2px solid #ff0000;
    padding: 15px 30px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.2);
}

.logout-btn:hover {
    background-color: #ff0000;
    color: #000;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.8);
    text-shadow: none;
}

#shutdown-screen {
    width: 100%;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 18px;
    color: #ff0000;
    padding: 20px;
}

.shutdown-text {
    margin-bottom: 12px;
    line-height: 1.5;
}

/* ========================================= */
/* EFEKTY SPECJALNE (GLITCH & EASTER EGG)    */
/* ========================================= */

/* Usterka na zdjęciu OPR-04 */
.glitch-anim {
    animation: img-glitch 0.2s cubic-bezier(.25, .46, .45, .94) both infinite;
}

@keyframes img-glitch {
    0% { transform: translate(0); filter: drop-shadow(0px 0px 0px rgba(255,0,0,1)); }
    20% { transform: translate(-5px, 2px); filter: drop-shadow(-5px 0px 0px rgba(255,0,0,0.8)) drop-shadow(5px 0px 0px rgba(0,0,255,0.8)); }
    40% { transform: translate(5px, -2px); filter: drop-shadow(5px 0px 0px rgba(255,0,0,0.8)) drop-shadow(-5px 0px 0px rgba(0,0,255,0.8)); }
    60% { transform: translate(-2px, 5px); filter: none; }
    80% { transform: translate(2px, -5px); filter: drop-shadow(-2px 0px 0px rgba(255,0,0,0.8)); }
    100% { transform: translate(0); filter: none; }
}

/* Ukryty ekran Lambda */
#lambda-egg {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000; z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    animation: flash-red 0.1s infinite alternate;
}

.creepy-photo {
    max-width: 80%; border: 5px solid #ff0000;
    filter: sepia(1) hue-rotate(-50deg) saturate(5) contrast(2) brightness(0.5);
}

.creepy-text {
    color: #ff0000; font-size: 45px; font-weight: bold; margin-top: 30px; 
    font-family: 'Courier New', monospace; text-shadow: 0 0 20px #ff0000;
}

@keyframes flash-red { from { background-color: #050000; } to { background-color: #220000; } }


/* ========================================= */
/* OSTATECZNE SMACZKI WIZUALNE               */
/* ========================================= */

/* Efekt włączenia starego monitora CRT */
.terminal {
    animation: turn-on 1s ease-out forwards;
}

@keyframes turn-on {
    0% { transform: scale(1, 0.001); filter: brightness(3); opacity: 0; }
    50% { transform: scale(1, 0.001); opacity: 1; }
    100% { transform: scale(1, 1); filter: brightness(1); opacity: 1; }
}

/* Drżenie całego ekranu (Screen Shake) */
.screen-shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* ========================================= */
/* RESPONSIVE DESIGN (WERSJA MOBILNA)        */
/* ========================================= */
@media (max-width: 768px) {
    body { 
        padding: 5px; 
    }
    
    .terminal { 
        padding: 10px; 
    }
    
    /* Przyciski nawigacji: 2 w rzędzie, żeby palcem łatwiej było trafić */
    .nav-btn {
        flex: 1 1 45%; 
        font-size: 12px; 
        padding: 12px 5px; 
    }

    /* Zdjęcie i tabela pod spodem, zamiast obok siebie */
    .id-section {
        flex-wrap: wrap; 
    }
    
    .image-column {
        border-right: none;
        border-bottom: 1px solid #00ff00;
        width: 100%;
        justify-content: center;
        padding: 15px;
    }
    
    .table-column {
        width: 100%;
        padding: 10px;
    }

    /* Mniejsze czcionki, żeby teksty i tabele nie wychodziły za ekran telefonu */
    .id-table td { 
        font-size: 12px; 
        padding: 8px; 
    }
    
    .header-box, .system-log, .data-block { 
        font-size: 13px; 
    }
    
    /* Zmniejszenie gigantycznych napisów na małych ekranach */
    .creepy-text { 
        font-size: 28px; 
        text-align: center; 
    }
    
    .logout-btn { 
        width: 100%; 
        font-size: 14px; 
    }

    #shutdown-screen {
        font-size: 14px;
    }
}

/* GŁÓWNY UKŁAD */
.medical-panel {
    display: flex;
    gap: 30px;
    background-color: #4a4a4a;
    padding: 20px;
    border-radius: 10px;
    color: white;
    font-family: 'Roboto', sans-serif;
}

/* SYLWETKA SVG */
.body-container {
    width: 200px;
    height: 400px;
    background-color: #333;
    border: 3px solid #111;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#body-map {
    width: 90%;
    height: 90%;
}

.body-part {
    fill: #111; /* Podstawowy kolor (czarny/cień) */
    stroke: #4a4a4a;
    stroke-width: 2;
    cursor: pointer;
    transition: fill 0.3s;
}

.body-part:hover {
    fill: #555;
}

/* KLASY STANÓW (To one zmieniają kolor kończyny!) */
.body-part.status-bleeding { fill: #b91c1c; } /* Czerwony */
.body-part.status-broken { fill: #d97706; } /* Pomarańczowy */
.body-part.status-bandaged { 
    fill: #f3f4f6; /* Biały bandaż */
    stroke: #9ca3af;
    stroke-width: 4;
    stroke-dasharray: 4; /* Robi paski na wzór bandaża! */
}
.body-part.selected { stroke: #3b82f6; stroke-width: 4; } /* Niebieska obwódka wyboru */

/* PRZYCISKI I MENU */
.med-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    color: white;
}
.btn-bleed { background-color: #b91c1c; }
.btn-broken { background-color: #d97706; }
.btn-bandage { background-color: #f3f4f6; color: #111; }
.btn-clear { background-color: #10b981; }

.status-box { background: #222; padding: 10px; border-radius: 5px; margin-bottom: 15px; }
.diseases-box { background-color: #4a4a4a; padding: 20px; border: 3px solid #111; border-radius: 10px; color: white; margin-top: 20px; }

/* =========================================
   SYSTEM MEDYCZNY - NOX
   ========================================= */
.medical-panel { display: flex; gap: 20px; align-items: flex-start; }
.body-container { width: 180px; height: 380px; background-color: #111; border: 2px solid #333; display: flex; justify-content: center; align-items: center; flex-shrink: 0;}
#body-map { width: 90%; height: 90%; }
.body-part { fill: #222; stroke: #444; stroke-width: 2; cursor: pointer; transition: 0.2s; }
.body-part:hover { fill: #333; }
.body-part.selected { stroke: #00f0ff; stroke-width: 4; }

/* KOLORY STANÓW NA SYLWETCE */
.body-part.stat-krwawienie { fill: #ff0000; }
.body-part.stat-krwotok { fill: #8b0000; }
.body-part.stat-bol { fill: #808080; }
.body-part.stat-siniaki { fill: #a9a9a9; }
.body-part.stat-zlamanie { fill: #ffa500; }
.body-part.stat-zwichniecie { fill: #ffff00; }
.body-part.stat-skrecenie { fill: #800080; }
.body-part.stat-ugryzienie { fill: #008000; }
.body-part.stat-postrzal { fill: #ff00ff; }

/* OPATRUNKI (Kreskowania / Ramki) */
.body-part.stat-bandaz { fill: #222; stroke: #ffffff; stroke-width: 4; stroke-dasharray: 5; }
.body-part.stat-tkanina { fill: #222; stroke: #adff2f; stroke-width: 4; stroke-dasharray: 8; }
.body-part.stat-usztywnienie { fill: #00ffff; stroke: #00ffff; stroke-width: 3; opacity: 0.7;}

/* KONTROLKI */
.medical-controls { flex: 1; }
.status-box { background: rgba(0, 240, 255, 0.1); padding: 10px; border: 1px solid #00f0ff; margin-bottom: 15px; }
.controls-grid { display: flex; gap: 20px; }
.controls-column { flex: 1; display: flex; flex-direction: column; }
.ctrl-title { font-weight: bold; font-size: 12px; margin-bottom: 5px; }
.med-btn { background: #111; border: 1px solid #333; padding: 6px; margin-bottom: 4px; font-family: 'Courier Prime', monospace; font-weight: bold; cursor: pointer; text-align: left; transition: 0.2s; }
.med-btn:hover { background: #222; border-color: #555; }
.nox-input { background: #000; border: 1px solid #00f0ff; color: #00f0ff; padding: 8px; font-family: inherit; width: 100%; box-sizing: border-box; }

/* KAFELKI CHORÓB */
.tiles-container { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.log-tile {
    background: #111;
    border: 1px solid #333;
    padding: 8px 12px;
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.tile-remove {
    color: #ff0000;
    cursor: pointer;
    font-weight: bold;
    background: none; border: none; font-family: inherit;
}
.tile-remove:hover { color: #fff; background: #ff0000; }