/* ==========================================================================
   GAME-VOCABULARY.CSS - Vizuální styl herního pole a módů
    Version: 1.1.1 (2026-03-24)
   ========================================================================== */

/* --- 1. HORNÍ PŘEPÍNAČ MÓDŮ --- */
.mode-switcher {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: fit-content;
    margin: 0 auto 30px;
}

.mode-switcher button,
.mode-switcher .button {
    padding: 8px 20px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    color: #3b3b3b;
}

.mode-switcher button.active,
.mode-switcher .button.active {
    background: #00D1B2;
    color: #001F1A;
    border-color: #00D1B2;
}

/* --- 2. HLAVNÍ HERNÍ WRAPPER --- */
.game-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    min-height: 400px;
}

/* --- 2.1 LEVÁ STRANA: OTÁZKA --- */
.question-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.question-box h1 {
    font-size: 3.5rem;
    margin-top: var(--h1-margin-y);
    margin-bottom: var(--h1-margin-y);
    color: #212529;
}

.main-image {
    width: min(100%, 200px);
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
    display: block;
    border-radius: 12px;
    margin-bottom: 0;
    box-shadow: none;
}

/* --- 2.2 PRAVÁ STRANA: MŘÍŽKA ODPOVĚDÍ --- */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* --- 3. HERNÍ KARTY (DLAŽDICE S OBRÁZKY/TEXTEM) --- */
.card {
    width: 230px;
    min-width: 230px;
    aspect-ratio: 5 / 4;
    height: auto;
    background: white !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 15px;
    box-sizing: border-box;
    position: relative;
}

@media (hover: hover) and (pointer: fine) {
    .card:hover {
        transform: translateY(-4px);
        border-color: #48c78e !important;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
}

.card img {
    width: min(100%, 200px);
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
}

.card span {
    font-size: 1.3rem;
    font-weight: 700;
    color: #363636;
}

.image-card,
.pair-card.img {
    padding: 10px;
}

.prompt-card {
    cursor: default;
    position: relative;
    overflow: visible;
}

.btn-audio.floating {
    position: absolute;
    right: -12px;
    bottom: -12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #e9ecef;
    background: #ffffff;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    z-index: 3;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-audio.floating svg {
    width: 21px;
    height: 21px;
    fill: #495057;
    transition: fill 0.2s ease;
}

.btn-audio.floating:hover {
    border-color: #48c78e;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.btn-audio.floating:hover svg {
    fill: #2f9e69;
}

.btn-audio.floating:active {
    transform: scale(0.96);
}

.btn-audio.floating:focus-visible {
    outline: 2px solid #48c78e;
    outline-offset: 2px;
}

/* --- 3.1 STAVY SPRÁVNĚ / ŠPATNĚ --- */
.card.correct, input.correct {
    border: 3px solid #48c78e !important;
    background-color: #f6fdf9 !important;
    pointer-events: none;
}

.card.wrong, input.wrong {
    border: 3px solid #f14668 !important;
    background-color: #fff5f7 !important;
    animation: shake 0.4s;
}

/* --- 4. SPECIFICKÉ PRO PAIRS (PEXESO) --- */
.mode-pairs .game-wrapper {
    flex-direction: column;
}

.pairs-grid {
    display: grid;
    grid-template-columns: repeat(4, 230px);
    gap: 15px;
    justify-content: center;
}

.mode-pairs .pair-card {
    width: 100%;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 5 / 4;
}

.mode-pairs .pair-card img {
    width: min(100%, 200px);
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
}

.pair-card.selected {
    border-color: #3273dc !important;
    background-color: #f0f5ff !important;
}

.pair-card.matched {
    visibility: hidden;
    pointer-events: none;
}

/* --- 5. SPECIFICKÉ PRO WRITING (PSANÍ) --- */
.input-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 350px;
}

#writing-input {
    padding: 15px;
    font-size: 1.5rem;
    border: 3px solid #dee2e6;
    border-radius: 12px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

#writing-input:focus {
    border-color: #48c78e;
}

/* --- 5.1 TLAČÍTKO "CHECK" --- */

#check-btn {
    background-color: #4258ff; 
    border: none;
    color: #ffffff;
    
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 25px;
    width: auto;
    min-width: 120px;
    
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    
    display: block;
}

#check-btn:hover {
    background-color: #3e56b6;
}

#check-btn:active {
    transform: scale(0.96);
}

#check-btn:disabled {
    background-color: #dbdbdb;
    cursor: not-allowed;
    color: #7a7a7a;
    opacity: 0.7;
}

/* --- 6. ZÁVĚREČNÁ OBRAZOVKA --- */
.final-screen {
    text-align: center;
    padding: 60px 40px;
    animation: fadeInScale 0.6s ease-out;
}

.final-screen h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #212529;
    font-weight: 800;
}

.congrats-icon {
    animation: bounce 1s ease-in-out infinite !important;
}

.result-stats-box {
    background: #faf9f6;
    border: 2px solid #48c78e;
    border-radius: 15px;
    padding: 30px 20px;
    margin: 30px auto;
    max-width: 450px;
    text-align: center;
}

.final-stat {
    margin: 20px 0;
    font-size: 1.2rem;
}

.final-stat strong {
    color: #212529;
}

.final-stat-results {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.final-stat-results .result-pill {
    gap: 6px;
}

.final-cat-icons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    margin-top: 10px;
}

.final-cat-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.final-actions {
    margin-top: 30px;
    width: 100%;
}

.final-screen .buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 10px;
}

.final-actions a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.2;
    min-height: 48px;
    white-space: nowrap;
    box-sizing: border-box;
    max-width: 100%;
}

/* --- 6.2 ANIMACE: CHYBA --- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* --- 6.3 ANIMACE: BOUNCE IKONY --- */
@keyframes bounce {
    0% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0); }
}

/* --- 6.4 ANIMACE: FADE-IN + SCALE --- */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- 7. RESPONZIVITA --- */
@media (max-width: 800px) {
    .mode-switcher {
        width: 100%;
        max-width: 100%;
        flex-wrap: nowrap;
        gap: 8px;
        margin: 0 auto 20px;
    }

    .mode-switcher button,
    .mode-switcher .button {
        flex: 1 1 0;
        min-width: 0;
        padding: 6px 8px;
        font-size: 1rem;
        border-radius: 16px;
        white-space: nowrap;
    }

    .game-wrapper {
        --mobile-card-width: clamp(132px, 42vw, 170px);
        flex-direction: column;
        gap: 30px;
    }

    .options-grid {
        grid-template-columns: repeat(2, var(--mobile-card-width));
        gap: 12px;
        justify-content: center;
    }

    .card {
        width: var(--mobile-card-width);
        min-width: var(--mobile-card-width);
        padding: 10px;
    }

    .pairs-grid {
        grid-template-columns: repeat(2, var(--mobile-card-width));
    }

    .question-box h1 { font-size: 2.5rem; }

    .final-screen {
        padding: 40px 16px;
    }

    .final-screen .buttons {
        flex-direction: column;
        align-items: center;
    }

    .final-actions a.button {
        width: min(100%, 320px);
        margin-left: auto;
        margin-right: auto;
    }
}

/* --- 8. SJEDNOCENÍ VŠECH TYPŮ KARET (PICTURE, WORD, PAIRS) --- */

.image-card, 
.pair-card, 
.text-card {
    min-height: 0;
}

/* --- 8.1 OBRÁZKY KARET --- */
.image-card img, 
.pair-card img,
.text-card img {
    display: block;
    width: min(100%, 200px);
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
}

/* --- 8.2 TEXTOVÉ KARTY --- */
.text-card, 
.pair-card.text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #363636;
    text-align: center;
}

/* --- 8.3 HOVER EFEKT KARET --- */
@media (hover: hover) and (pointer: fine) {
    .image-card:hover, 
    .pair-card:hover, 
    .text-card:hover {
        transform: scale(1.05);
        border-color: #48c78e;
    }
}

.prompt-card:hover {
    transform: none !important;
    border-color: #dee2e6 !important;
    box-shadow: none !important;
}