/* ===== Alapbeállítások javítása ===== */
#gameRoot.game-screen.aknakereso {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    /* Kevesebb padding mobilon */
    box-sizing: border-box;
}

#gameRoot.game-screen.aknakereso .game-container {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 30px;
    /* Kicsit finomabb lekerekítés */
    padding: clamp(15px, 5vw, 40px);
    /* Dinamikus padding */
    max-width: 100%;
    /* Ne legyen fix max-szélesség korlát mobilon */
    width: min(650px, 95vw);
    /* Felveszi a szélességet, de nem megy 650px fölé */
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Statisztikák finomítása */
.game-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}

.minesweeper-stat {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    /* Rugalmas betűméret */
    font-weight: 800;
    color: #6366f1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

/* ===== A TÁBLA RESPONSIVE JAVÍTÁSA ===== */
.minesweeper-board {
    display: grid;
    /* A gap is legyen dinamikus, hogy sok cellánál ne vegyen el túl sok helyet */
    gap: clamp(4px, 1.5vw, 10px);
    background: rgba(255, 255, 255, 0.4);
    padding: clamp(8px, 2vw, 20px);
    border-radius: 20px;
    margin: 0 auto 25px;
    width: 100%;
    /* Kitölti a konténert */
    max-width: 500px;
    /* Ésszerű maximum méret */
    box-sizing: border-box;
    /* Biztosítja, hogy a rács ne nyomja szét a szülőt */
    justify-content: center;
}

.minesweeper-cell {
    aspect-ratio: 1 / 1;
    width: 100%;
    min-width: 0;
    border-radius: clamp(4px, 1.2vw, 12px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.8rem, 4vw, 1.4rem);
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    border: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.minesweeper-cell.hidden {
    background: linear-gradient(145deg, #f7f0fb, #f4eaf3);
    border: 2px solid #eadcf3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.minesweeper-cell.hidden:hover {
    transform: translateY(-2px) scale(1.02);
    background: linear-gradient(145deg, #f1e6fa, #f6dde9);
    border-color: #b152e0;
}

.minesweeper-cell.revealed {
    background: rgba(255, 255, 255, 0.25);
    cursor: default;
    border: 2px dashed rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 3px 6px hsl(280 70% 60% / .2);
}

.minesweeper-cell.mine {
    background: linear-gradient(135deg, hsl(350 80% 60%), hsl(25 95% 60%));
    border: 2px solid #ff4d6d;
    font-size: clamp(0.7rem, 3.5vw, 1.2rem);
    animation: cellPop 0.3s ease-out;
}

.minesweeper-cell.flagged {
    background: linear-gradient(145deg, #fff9e5, #ffe7d6);
    border: 2px solid #fa8938;
    box-shadow: 0 4px 12px rgba(255, 183, 197, 0.2);
}

.minesweeper-cell.number-1 {
    color: #2563eb;
}

.minesweeper-cell.number-2 {
    color: #059669;
}

.minesweeper-cell.number-3 {
    color: #dc2626;
}

.minesweeper-cell.number-4 {
    color: #7c3aed;
}

.minesweeper-cell.number-5 {
    color: #f97316;
}

.minesweeper-cell.number-6 {
    color: #14b8a6;
}

.minesweeper-cell.number-7 {
    color: #4b5563;
}

.minesweeper-cell.number-8 {
    color: #6b7280;
}


.game-controls {
    width: 100%;
    display: flex;
    justify-content: center;
}

.button.green {
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    background: #10b981;
    color: white;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    font-weight: 700;
}

.button.green:hover {
    transform: scale(1.05);
}

@media (max-width: 400px) {
    .minesweeper-board {
        gap: 4px;
        padding: 6px;
    }

    .minesweeper-cell {
        border-width: 1px;

    }
}

@keyframes cellPop {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}