/* === Modal alap === */
#memoryModal.modal.game-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    overflow: auto;
}

#memoryModal .modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 12px;
    width: 400px;
    max-width: 95%;
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    position: relative;
}

/* === Bezáró gomb === */
#memoryModal .close-button {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 1.5rem;
    color: #444;
    cursor: pointer;
}

/* === Játék doboz === */
.memory-container {
    text-align: center;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    flex-wrap: wrap;
    gap: 10px;
}

#reset-memory-btn {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #0077cc;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#reset-memory-btn:hover {
    background-color: #005fa3;
}

#memory-message {
    color: green;
    font-weight: bold;
    font-size: 15px;
    margin-top: 10px;
}

/* === Játék tábla === */
#memory-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-width: 360px;
    margin: 0 auto;
    padding: 5px;
    border: 2px solid #555;
}

/* === Kártyák === */
.tile {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #e0e0e0;
    border-radius: 10px;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    position: relative;
    cursor: pointer;
}

.tile.flip {
    transform: rotateY(180deg);
}

.front, .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.front {
    background-color: #a1a1a1;
}

.back {
    background-color: #fff;
    transform: rotateY(180deg);
}

.back img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 6px;
}

/* === Mobilbarát nézet === */
@media (max-width: 480px) {
    #memory-board {
        max-width: 300px;
        gap: 5px;
    }

    .game-info {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

/* Dark mode színezés mindkét játékhoz */
body.dark-mode h2,
body.dark-mode .info-panel div,
body.dark-mode #step-counter,
body.dark-mode #timer,
body.dark-mode #memory-steps,
body.dark-mode #memoryModal h2,
body.dark-mode .game-info span {
    color: orange;
}

