/* Základný kontajner */
.mod-interactive-game {
    max-width: 1000px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
}

.game-main-title {
    text-align: center;
    margin-bottom: 25px;
}

/* Rozloženie hracej plochy */
.game-board {
    display: flex;
    flex-direction: column; /* Na mobile pod sebou */
    gap: 20px;
}

@media (min-width: 768px) {
    .game-board {
        flex-direction: row; /* Na počítači vedľa seba */
        justify-content: space-between;
    }
    .game-column {
        flex: 1;
    }
}

.column-title {
    text-align: center;
    background: #f4f6f8;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* Kompaktná mriežka prispôsobená pre väčší počet obrázkov (napr. 10 a viac) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
}

/* Vzhľad hracích kariet (kompaktné odsadenie pre lepší zážitok z hry na mobiloch) */
.game-card {
    background: #fff;
    border: 3px solid #e1e4e8;
    border-radius: 10px;
    padding: 5px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    outline: none;
}

.game-card:hover, .game-card:focus {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-img-wrap {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.card-label {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    color: #333;
}

/* --- VIZUÁLNE STAVY KARIET --- */

/* 1. Vybraná karta (čaká na párovanie) - výrazné zväčšenie */
.game-card.is-selected {
    border-color: #007aff;
    background-color: #f0f8ff;
    transform: scale(1.15); /* Zväčšenie o 15 % (pôvodne bolo 1.04) */
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.5); /* Výraznejší tieň pod kartou */
    z-index: 5; /* Zabezpečí, že zväčšená karta prekryje susedné karty */
    position: relative;
}

/* 2. Správne spárovaná karta */
.game-card.is-correct {
    border-color: #28a745;
    background-color: #e9f7ef;
    pointer-events: none; /* Zablokovanie ďalšieho klikania */
    opacity: 0.85;
}

/* 3. Nesprávny pokus (Zatrasenie) */
.game-card.is-wrong {
    border-color: #dc3545;
    background-color: #fdf2f2;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* --- VZDELÁVACÍ PANEL (Dolu) --- */
.game-edu-panel {
    margin-top: 25px;
    padding: 15px 20px;
    background: #eef2f5;
    border-left: 5px solid #007aff;
    border-radius: 6px;
    animation: fadeIn 0.3s;
}

.game-edu-panel .edu-content {
    font-size: 0.95rem;
    color: #2c3e50;
    line-height: 1.5;
}

/* --- ZÁVEREČNÉ VYHODNOTENIE --- */
.game-win-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    z-index: 10;
    animation: fadeIn 0.5s;
}

.win-box {
    text-align: center;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 2px solid #28a745;
    max-width: 400px;
}

.win-box h4 {
    color: #28a745;
    font-size: 1.8rem;
    margin-top: 0;
}

.win-stats {
    margin: 15px 0 25px;
    font-size: 1.1rem;
    color: #555;
}

.btn-restart {
    background: #007aff;
    color: #fff;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-restart:hover {
    background: #0056b3;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- TLAČIDLÁ VO VYHODNOTENÍ --- */
.win-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-infographic {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s, transform 0.1s;
}

.btn-infographic:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* --- VYSKAKOVACIE OKNO PRE INFOGRAFIKU --- */
.infographic-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 10px;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s;
}

.infographic-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.infographic-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.btn-close-infographic {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #fff;
    color: #333;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 21;
    transition: background 0.2s, color 0.2s;
}

.btn-close-infographic:hover {
    background: #dc3545;
    color: #fff;
}