/* Container */
#fifteen-puzzle-container {
    max-width: 420px;
    margin: 40px auto;
    font-family: Arial, sans-serif;
    text-align: center;
}

/* Header */
.puzzle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Stats */
.puzzle-stats span {
    margin-right: 15px;
    font-size: 16px;
}

/* Buttons */
.puzzle-buttons button {
    padding: 7px 14px;
    margin-left: 5px;
    border: none;
    background: linear-gradient(145deg,#0073aa,#005177);
    color: white;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.puzzle-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

/* Difficulty buttons */
.puzzle-levels {
    margin-bottom: 12px;
}

.puzzle-levels button {
    padding: 6px 12px;
    margin: 0 4px;
    border: none;
    background: #444;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.puzzle-levels button:hover {
    background: #222;
}

/* Puzzle board */
.puzzle-board {
    width: 400px;
    height: 400px;
    margin: 0 auto;
    position: relative;
    background: #e5e5e5;
    border-radius: 12px;
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.15);
}

/* Tiles */
.puzzle-tile {

    position: absolute;

    width: 25%;
    height: 25%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
    font-weight: bold;

    background: linear-gradient(145deg,#ffffff,#eaeaea);

    border-radius: 10px;

    box-shadow:
        4px 4px 8px rgba(0,0,0,0.2),
        -4px -4px 8px rgba(255,255,255,0.7);

    cursor: pointer;

    user-select: none;

    transition: transform 0.22s cubic-bezier(.22,.61,.36,1), 
                box-shadow 0.2s ease;

    will-change: transform;
}

/* Hover effect */
.puzzle-tile:hover {
    box-shadow:
        6px 6px 12px rgba(0,0,0,0.25),
        -6px -6px 12px rgba(255,255,255,0.8);
}

/* Game message */
.game-message {
    margin-top: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #2e7d32;
}

/* Leaderboard modal */
.lb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.6);

    display: none;
    align-items: center;
    justify-content: center;

    z-index: 9999;
}

.lb-content {
    background: #0c0c0c;
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    width: 300px;
}

.lb-content input {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
}

.lb-content button {
    padding: 8px 12px;
    margin: 5px;
    cursor: pointer;
}

/* Mobile support */
@media (max-width: 480px) {

    .puzzle-board {
        width: 320px;
        height: 320px;
    }

    .puzzle-tile {
        font-size: 18px;
    }

    .puzzle-header {
        flex-direction: column;
        gap: 10px;
    }

}