/* Game Info */
#game-info {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #ccc;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
}

.card-bar-disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 11; /* Wyżej niż karty */
    border-radius: 10px;
}

.ui-button {
    padding: 5px 15px;
    background: #FF9800;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.ui-button:hover {
    background: #F57C00;
    transform: scale(1.05);
}

/* Licznik czasu gry */
#game-timer {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 20px;
    border-radius: 10px;
    z-index: 100;
    margin-bottom: 10px;
}

#virtual-cursor {
    width: 10px;
    height: 10px;
    background-color: red;
    border: 2px solid white;
    position: absolute;
    z-index: 120;
    pointer-events: none;
    box-sizing: border-box;
}

/* === Pasek Kart === */
#card-bar {
    width: 900px;
    height: 110px;
    background-color: #212121;
    border: 3px solid #424242;
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 100;
    margin-top: 10px;
    justify-content: flex-start;
}
.card {
    width: 100px;
    height: 90px;
    background-color: #424242;
    border: 2px solid #616161;
    border-radius: 8px;
    margin: 0 5px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s ease, border-color 0.1s ease, opacity 0.2s ease;
    flex-shrink: 0;
}
.card:hover { transform: translateY(-5px); }
.card.selected {
    border-color: #FFEB3B;
    box-shadow: 0 0 15px #FFEB3B;
    transform: translateY(-5px);
}

/* Karta "Następna" */
.card.card-next {
    width: 80px;
    height: 70px;
    opacity: 0.7;
    cursor: default;
    border-color: #424242;
    transform: scale(0.9);
    margin-right: 15px;
}
.card.card-next:hover {
    transform: scale(0.9);
}

#card-info-panel {
    position: absolute;
    bottom: 130px; /* Tuż nad paskiem kart */
    right: 20px;
    width: 220px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #616161;
    z-index: 110;
    display: none; /* Domyślnie ukryty */
    font-family: Arial, sans-serif;
    transition: opacity 0.2s ease-in-out;
}

#card-info-panel h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: #FFEB3B;
}

#card-info-panel p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}
/* Karta, na którą nas nie stać */
.card.card-unaffordable {
    opacity: 0.4;
    filter: grayscale(80%);
    cursor: not-allowed;
}


.card-name {
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    padding-top: 5px;
    color: white;
    padding-left: 25px;
    padding-right: 5px;
    box-sizing: border-box;
    pointer-events: none; /* <-- POPRAWKA */
}
.card-cost {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 20px;
    height: 20px;
    background: linear-gradient(to right, #e53935, #ec407a);
    border-radius: 50%;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 1px solid white;
    pointer-events: none; /* <-- POPRAWKA */
}
.card-icon {
    width: 80px;
    height: 50px;
    position: absolute;
    bottom: 5px;
    left: 10px;
    background-color: #757575;
    border-radius: 5px;
    pointer-events: none; /* <-- POPRAWKA */
}
.card.card-next .card-icon {
    width: 60px;
    height: 40px;
    left: 10px;
}
.meerkat-icon { background-color: #8D6E63; }
.monkey-icon { background-color: #6D4C41; }
.mole-icon { background-color: #795548; }
.bat-icon { background-color: #4A148C; }
.test-icon { background-color: #00695C; }
.antelope-icon { background-color: #D32F2F; }
.banana-airstrike-icon { background-color: #FFEB3B; }
.hedgehog-icon { background-color: #A1887F; }
.elephant-icon { background-color: #607D8B; }
.hippo-icon { background-color: #009688; }
.vulture-icon { background-color: #3E2723; }
.badger-icon { background-color: #9E9E9E; }
.snow-storm-icon { background-color: #4FC3F7; }
.turtle-icon { background-color: #004D40; }
.ant-colony-icon { background-color: #795548; }
.red-ant-colony-icon { background-color: #A52A2A; }
.llama-icon { background-color: #D2B48C; }
.gorilla-icon { background-color: #3E2723; border: 2px solid #000; }


/* Eliksir */
#elixir-container {
    margin-left: 15px;
    position: relative;
    width: 250px;
    height: 35px;
    background-color: #263238;
    border: 3px solid #607D8B;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
}
#elixir-bar {
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, #e53935, #ec407a);
    transition: width 0.1s linear;
    border-radius: 20px;
}
#elixir-count {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hp-bar-bg { position: absolute; top: -10px; left: -2px; width: 30px; height: 5px; background-color: #424242; border: 1px solid black; border-radius: 2px; z-index: 20; }
.shell-bar-bg { position: absolute; top: -16px; left: -2px; width: 30px; height: 5px; background-color: #424242; border: 1px solid black; border-radius: 2px; z-index: 20; }
.shell-bar-value { width: 100%; height: 100%; background-color: #BCAAA4; transition: width 0.1s linear; }
.hp-bar-value { width: 100%; height: 100%; background-color: #4CAF50; transition: width 0.1s linear; }
.damage-bar-bg { position: absolute; top: -4px; left: -2px; width: 30px; height: 4px; background-color: #424242; border: 1px solid black; border-radius: 2px; z-index: 20; }
.damage-bar-value { width: 0%; height: 100%; background-color: #FF9800; transition: width 0.2s linear; }

.elephant .hp-bar-bg, .hippo .hp-bar-bg {
    width: 40px;
    left: 0;
}

/* --- CARD DETAILS MODAL --- */

/* Efekt rozmycia tła, gdy modal jest aktywny */
.blur-background {
    filter: blur(5px);
    transition: filter 0.3s ease-in-out;
}

/* Nakładka (tło) dla modala */
#card-details-modal {
    display: none; /* Domyślnie ukryty */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

/* Kontener z zawartością modala ("tył karty") */
.modal-content {
    background-color: #2a2a3e;
    color: #f0f0f0;
    margin: auto;
    padding: 25px;
    border: 3px solid #7a7a8c;
    border-radius: 15px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    position: relative;
    font-family: Arial, sans-serif;
    animation: fadeIn 0.4s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Przycisk zamykania (X) */
.modal-close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close-btn:hover,
.modal-close-btn:focus {
    color: #fff;
    text-decoration: none;
}

/* Nagłówek (nazwa karty) */
.modal-content h3 {
    text-align: center;
    margin-top: 0;
    font-size: 1.8rem;
    color: #FFEB3B;
    text-shadow: 1px 1px 3px #000;
}

/* Opis mechaniki */
.modal-card-description {
    font-size: 1rem;
    margin-bottom: 20px;
    padding: 10px;
    background-color: rgba(0,0,0,0.2);
    border-left: 3px solid #FFEB3B;
    font-style: italic;
}

/* Lista statystyk */
.modal-stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-stats-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #4a4a5c;
    font-size: 1rem;
}
.modal-stats-list li:last-child {
    border-bottom: none;
}

.stat-name {
    font-weight: bold;
    color: #b0b0c0;
}

.stat-value {
    color: #f0f0f0;
}

/* Przycisk "i" na karcie w kreatorze talii */
.card-info-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background-color: #1a73e8;
    color: white;
    border-radius: 50%;
    border: 1px solid white;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    line-height: 18px; /* Dla wyrównania pionowego */
    cursor: pointer;
    z-index: 5;
    transition: transform 0.2s, background-color 0.2s;
}

.card-info-btn:hover {
    background-color: #4285f4;
    transform: scale(1.1);
}

.deploy-timer {
    position: absolute;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.deploy-spinner {
    border: 3px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    width: 100%;
    height: 100%;
    animation: spin linear infinite;
    box-sizing: border-box;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}