* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.2px;
    text-align: center;

    background-color: #f2f8fa; 
    background-image: 
        radial-gradient(circle at 85% 30%, rgba(255,255,255,0.7) 0%, transparent 25%),
        radial-gradient(circle at 80% 10%, #a2c4d2 0%, transparent 45%),
        radial-gradient(circle at 15% 25%, #bcecf9 0%, transparent 40%),
        radial-gradient(circle at 50% 85%, rgba(143, 188, 201, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 95% 90%, #aeddf2 0%, transparent 25%);
    background-attachment: fixed;
    
    color: #122630;
}

.hidden { 
    display: none !important; 
}

#pogodaBox {
    position: fixed;
    top: 25px;
    left: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

#pogodaIkona {
    width: 45px;
    height: 45px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

#pogodaTemp {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    line-height: 1;
    color: #122630;
}

#pogodaSeparator {
    width: 1.5px;
    height: 20px;
    background: rgba(18, 38, 48, 0.2);
    margin: 0 5px;
}

#pogodaMiasto {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0;
    color: #122630;
    opacity: 0.5;
}

#rankingWidok, 
.container, 
#wsparcieBox {
    background: rgba(255, 255, 255, 0.05); 
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(143, 188, 201, 0.6); 
    box-shadow: 0 8px 32px 0 rgba(3, 57, 108, 0.08);
    border-radius: 25px;
}

#rankingWidok {
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    padding: 20px;
    width: 220px;
    overflow: hidden;
    transition: transform 0.6s ease, top 0.6s ease, left 0.6s ease;
}

#rankingWidok:hover {
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

#rankingWidok h3 {
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#rankingWidok table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#rankingWidok td {
    padding: 5px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-bottom: 1px solid rgba(143, 188, 201, 0.60);
}

#rankingWidok tr:last-child td {
    border-bottom: none;
}

#rankingWidok tr:nth-child(2) { 
    color: #ffd700; 
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#rankingWidok tr:nth-child(3) { 
    color: #757575; 
    font-weight: bold;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.5);
}

/* --- CIEMNY TRYB --- */
.dark-mode #rankingWidok tr:nth-child(3) { 
    color: #bebebe;
    text-shadow: 0 0 10px rgba(192, 192, 192, 0.4);
}

#rankingWidok tr:nth-child(4) { 
    color: #cd7f32; 
    font-weight: bold;
    text-shadow: 0 0 5px rgba(205, 127, 50, 0.3);
}

.no-data {
    font-style: italic;
    opacity: 0.8;
}

.wszystko {
    flex: 1; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 90%;
    max-width: 480px;
    padding: 40px 25px;
    margin: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#zasadyBox {
    max-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease;
    background: #cce0ff;
    border-radius: 15px;
    padding: 0 10px;
    width: fit-content;
    margin: 15px auto;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

#zasadyBox.active {
    max-height: 260px;
    padding: 20px 25px;
}

ul {
    list-style: none;
}

hr {
    width: 80%;
    max-width: 300px;
    height: 1.5px;
    background: rgba(18, 38, 48, 0.2);
    margin: 15px 0;
}

button {
    margin: 12px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 15px;
    background: linear-gradient(135deg, #5d8b99, #2c4c58);
    color: white;
    box-shadow: 0 4px 15px rgba(44, 76, 88, 0.3), 
                0 0 10px rgba(143, 188, 201, 0.2);
    border: 1px solid rgba(143, 188, 201, 0.3);
    letter-spacing: 0.8px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(44, 76, 88, 0.4), 
                0 0 20px rgba(143, 188, 201, 0.4);
    background: linear-gradient(135deg, #6a99a8, #2c4c58);
}

button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 119, 182, 0.3);
}

button.disabled {
    pointer-events: none;
    opacity: 0.5;
}

#panelGry {
    display: none;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-top: 20px;
    width: 100%;
}

.runda {
    position: absolute;
    top: -20px;
    right: 0;
    font-size: 14px;
    opacity: 0.8;
    font-weight: 400;
}

.aktualnyGracz {
    font-size: 24px;
    margin-bottom: 20px;
}

.karta {
    width: 120px; 
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    background: transparent; 
    border: none;
    position: relative;
}

.img-karty {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: none;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5), 
        0 0 15px 5px rgba(0, 229, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cardIn {
    0% { transform: scale(0.5) translateY(50px) rotate(-10deg); opacity: 0; }
    100% { transform: scale(1) translateY(0) rotate(0deg); opacity: 1; }
}

.animacja-karty {
    animation: cardIn 0.4s ease-out forwards;
}

.punktyGraczy {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 18px;
}

.akcje {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.suma {
    font-size: 16px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modalBox {
    background: rgba(255, 255, 255, 0.9); 
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    text-align: center;
    max-width: 400px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: modalPojawienie 0.3s ease-out;
}

.modalInput {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #3399ff;
    margin-top: 10px;
    width: 80%;
    font-size: 16px;
}

@keyframes modalPojawienie {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#wsparcieBox {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    padding: 20px;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.6s ease, box-shadow 0.3s ease;
}

#wsparcieBox:hover {
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.wsparcieContent {
    display: contents; 
}

.wsparcieTytul {
    order: 1;
    font-weight: bold;
    font-size: 25px;
    margin: 0 0 15px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.wsparcieImg {
    order: 2;
    width: 100%;
    margin-bottom: 20px;
    object-fit: cover;
}

.wsparcieBtn {
    order: 3;
    display: block;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #ff7e5f, #feb47b) !important;
    box-shadow: 0 4px 15px rgba(255, 126, 95, 0.3) !important;
    border-radius: 15px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.wsparcieBtn::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    transform: rotate(45deg) scale(0);
    transition: transform 0.5s ease;
    border-radius: 50%;
}

.wsparcieBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 105, 135, 0.5);
}

.wsparcieBtn:hover::before {
    transform: rotate(45deg) scale(1);
}

.wsparcieDziekuje {
    order: 4;
    font-size: 16px;
    margin: 15px 0 0 0;
    font-style: italic;
    opacity: 0.9;
}

#retroContainer {
    display: none;
    position: absolute; 
    top: 100px;
    left: 200px;
    width: 75%; 
    max-width: 1200px;   
    border-radius: 20px;
    border: 3px solid #339999;
    z-index: 9000;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    margin-bottom: 100px;
    
}

.retro-iframe {
    width: 100%;
    height: 75vh; 
    min-height: 500px;
    max-height: 800px;
    border: none;
    display: block;
}

@media (max-width: 480px) {
    .darkMode {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    .footer-menu {
        flex-direction: column;
        gap: 15px;
    }
}

@media (min-width: 1400px) {
    #rankingWidok {
        width: 350px;
        left: 50px;
        transition: transform 0.6s ease, left 0.6s ease, width 0.6s ease, padding 0.6s ease;
    }
}

@media (min-width: 1700px) {
    #rankingWidok {
        width: 450px;
        padding: 30px;
        transition: transform 0.6s ease, left 0.6s ease, width 0.6s ease, padding 0.6s ease;
    }
}

@media (min-width: 1900px) {
    #rankingWidok {
        width: 500px;
        padding: 30px;
        transition: transform 0.6s ease, left 0.6s ease, width 0.6s ease, padding 0.6s ease;
    }
}

@media (max-width: 1150px) {
    .wszystko {
        padding: 20px 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        box-sizing: border-box;
    }

    #rankingWidok {
        width: 90%;
    }

    #rankingWidok, #wsparcieBox {
        position: relative;
        left: 0 !important;
        right: 0 !important;
        top: auto;
        transform: none;
        width: 90%;
        max-width: 480px;
        margin: 20px auto !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        box-sizing: border-box;

        transition: transform 0.6s ease, top 0.6s ease, width 0.6s ease, margin 0.6s ease, left 0.6s ease;
    }

    #rankingWidok:hover, #wsparcieBox:hover {
        transform: scale(1.02);
    }

    #wsparcieBox {
        flex-direction: row;
        padding: 15px;
        text-align: left;
        width: 90%;
    }    

    .wsparcieImg {
        order: 1;
        width: 100px;
        height: auto;
        margin-left: 20px;
        margin-bottom: 0;
    }

    .wsparcieTytul {
        order: unset;
        font-size: 18px;
        margin: 0 0 10px 0;
    }

    .wsparcieBtn {
        width: auto;
        min-width: 140px;
        padding: 10px 20px;
        margin: 5px 0;
        order: unset;
    }

    .wsparcieDziekuje {
        order: unset;
        font-size: 14px;
        margin-top: 10px;
    }
    
    .wsparcieContent {
        display: flex;
        flex-direction: column;
        align-items: center;
        order: 2;
        flex: 1;
    }

    #retroContainer {
        width: 95%;
        margin: 40px auto !important;
        top: 0 !important;
    }
    
    #retroContainer iframe {
        height: 600px;
    }

    footer {
        position: relative;
        margin-top: auto;
        width: 100%;
    }
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.stopkaSrodek {
    font-weight: bold;
}

.menuDodatki, #kontenerPowrotu, #kontenerZamknijRetro {
    position: absolute;
    right: 20px;
}

.listaProjektow {
    display: none; 
    position: absolute;
    bottom: 110%;
    right: 0;
    background: #fff;
    min-width: 190px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
}

.listaProjektow a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
}

.listaProjektow a:hover {
    background: #f0f0f0;
}

.aktywneMenu {
    display: block;
}

.przyciskMenu {
    background: #4a6775;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
}

.ukryty {
    display: none !important;
}


/* --- DARK MODE --- */


.dark-mode #pogodaBox {
    background: transparent;
    border: none;
    box-shadow: none;
}

.dark-mode #pogodaTemp {
    color: #00e5ff;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
}

.dark-mode #pogodaMiasto {
    color: #e0e6ed;
    opacity: 0.8;
}

.dark-mode #pogodaSeparator {
    background: rgba(0, 229, 255, 0.3);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.dark-mode #pogodaIkona {
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.4));
}

.dark-mode {
    background-color: #010407;
    background-image: 
        radial-gradient(circle at 85% 30%, rgba(0, 229, 255, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 80% 10%, rgba(13, 50, 65, 0.4) 0%, transparent 45%),
        radial-gradient(circle at 15% 25%, rgba(0, 150, 199, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 50% 85%, rgba(10, 25, 41, 0.6) 0%, transparent 50%),
        radial-gradient(circle at 95% 90%, rgba(0, 119, 182, 0.2) 0%, transparent 25%);
    background-attachment: fixed;
    color: #e0e6ed;
}

.dark-mode #rankingWidok, 
.dark-mode .container, 
.dark-mode #wsparcieBox {
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.07) 0%, 
        rgba(255, 255, 255, 0.02) 100%
    );
    
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5), 
        inset 0 1px 0px rgba(255, 255, 255, 0.1);
    
    border-radius: 30px;
}

.dark-mode #rankingWidok td {
        border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dark-mode #zasadyBox {
    background: rgba(20, 35, 45, 0.8);
    color: #b0c4de;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

.dark-mode button {
    background: linear-gradient(135deg, #00e5ff, #025757);
    border: 1px solid rgba(0, 229, 255, 0.6);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3), 
                0 0 30px rgba(0, 229, 255, 0.1);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.dark-mode button:hover {
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.6), 
                0 0 50px rgba(0, 229, 255, 0.2);
    transform: translateY(-2px);
}

.dark-mode .img-karty {
    box-shadow: 
        0 0 15px 5px rgba(0, 229, 255, 0.65),
        0 15px 40px rgba(0, 0, 0, 0.8);
}

.dark-mode .graczPkt,
.dark-mode .suma span,
.dark-mode #aktualnyGraczInfo {
    color: #00e5ff;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.dark-mode hr {
    background: rgba(0, 229, 255, 0.2);
}


.dark-mode footer {
    background: rgba(10, 15, 20, 0.6);
    border-top: 1px solid rgba(0, 200, 200, 0.2);
    color: #8f9ba8;
}

.dark-mode .modalBox {
    background: rgba(20, 30, 40, 0.95);
    color: white;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.darkMode {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
    position: fixed;
    isolation: isolate;
    top: 15px;
    right: 25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(143, 188, 201, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
}

.darkMode:hover {
    transform: scale(1.15) rotate(15deg);
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 20px rgba(143, 188, 201, 0.4);
}

.dark-mode .darkMode {
    background: rgba(15, 25, 35, 0.6);
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(0, 229, 255, 0.1);
}

.dark-mode .darkMode:hover {
    background: rgba(15, 25, 35, 0.9);
    border: 1px solid rgba(0, 229, 255, 0.6);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 229, 255, 0.4);
}