/* ================================================= */
/* 1. PANEL DOSTĘPNOŚCI - UI (Prawy bok strony)      */
/* ================================================= */

.a11y-toggle-btn {
    position: fixed !important;
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background-color: #03234d !important; 
    border: 2px solid #ffffff !important;
    border-radius: 50% !important;
    width: 60px !important;
    height: 60px !important;
    z-index: 99999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.a11y-panel {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    transform: translateX(100%);
    width: 320px !important;
    height: 100vh !important;
    background-color: #f8f9fa !important;
    z-index: 100000 !important;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    font-family: Arial, sans-serif !important;
}

.a11y-panel.open { transform: translateX(0) !important; }

.a11y-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px; 
    background-color: #03234d; 
    color: white; 
}

.a11y-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.a11y-content button {
    width: 100%;
    margin-bottom: 10px;
    background: #ffffff;
    border: 2px solid #03234d;
    color: #03234d;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.a11y-content button:hover { background: #e9ecef; }

.a11y-reset {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

/* ================================================= */
/* 2. POWIĘKSZANIE TEKSTU (Naprawione)               */
/* ================================================= */

/* Celujemy w każdy element wewnątrz page-content, aby przebić style px */
body.wcag-text-1 #page-content, 
body.wcag-text-1 #page-content * { 
    font-size: 1.2rem !important; 
    line-height: 1.5 !important; 
}

body.wcag-text-2 #page-content, 
body.wcag-text-2 #page-content * { 
    font-size: 1.4rem !important; 
    line-height: 1.6 !important; 
}

body.wcag-text-3 #page-content, 
body.wcag-text-3 #page-content * { 
    font-size: 1.6rem !important; 
    line-height: 1.7 !important; 
}

/* ================================================= */
/* 3. ROZJAŚNIANIE TŁA (Naprawione)                  */
/* ================================================= */

body.wcag-light-bg #page-content,
body.wcag-light-bg #page-content * {
    background-color: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

/* Ukrywamy grafiki tła, które mogłyby przeszkadzać */
body.wcag-light-bg .top-decor,
body.wcag-light-bg .game-path-svg,
body.wcag-light-bg [class*="blob"] {
    display: none !important;
}

/* ================================================= */
/* 4. TRYBY KOLORYSTYCZNE I INNE                     */
/* ================================================= */

/* Skala szarości */
body.wcag-grayscale #page-content {
    filter: grayscale(100%) !important;
}

/* Negatyw (Inwersja) */
body.wcag-invert #page-content {
    filter: invert(100%) hue-rotate(180deg) !important;
    background-color: #000 !important;
}
body.wcag-invert img, body.wcag-invert video {
    filter: invert(100%) hue-rotate(180deg) !important;
}

/* Wysoki Kontrast (Żółty na czarnym) */
body.wcag-contrast #page-content {
    background-color: #000000 !important;
}
body.wcag-contrast #page-content *:not(img):not(video):not(svg) {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
    background-image: none !important;
}

/* Podkreślanie linków */
body.wcag-links #page-content a {
    text-decoration: underline !important;
    background-color: #ffff00 !important;
    color: #000000 !important;
    font-weight: bold !important;
}

/* Czytelna czcionka sans-serif */
body.wcag-font #page-content,
body.wcag-font #page-content * {
    font-family: Arial, Helvetica, sans-serif !important;
}