:root {
    --primary: #4834D4;
    --secondary: #686DE0;
    --accent: #F0932B;
    --bg: #F4F7FF;
    --text: #333;
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    text-align: center;
    margin: 0;
    padding: 20px;
    color: var(--text);
    /* Prevent oversized scrollbar issues in iframe */
    overflow-y: auto;
}

.game-wrapper {
    max-width: 500px;
    margin: 0 auto;
}

.title {
    font-family: 'Fredoka One', cursive;
    color: var(--primary);
    font-size: 32px;
    margin: 0;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.05);
}

.subtitle {
    color: #888;
    font-weight: 700;
    margin-top: 5px;
    margin-bottom: 20px;
}

.controls {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.moves-box {
    font-weight: 800;
    font-size: 18px;
    color: var(--secondary);
    margin-bottom: 10px;
}

.difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.diff-btn {
    background: #eef2f7;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.diff-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(72, 52, 212, 0.3);
}

.board {
    margin: 0 auto;
    display: grid;
    gap: 4px;
    /* Gap between tiles */
    background: #dde1e7;
    padding: 4px;
    border-radius: 8px;
    width: 320px;
    height: 320px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.tile {
    background-size: 320px 320px;
    /* Must match board size */
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.1s;
    background-repeat: no-repeat;
}

.tile:active {
    transform: scale(0.95);
}

.tile.empty {
    background: #ccc;
    cursor: default;
    opacity: 0.3;
    background-image: none !important;
}

.win-msg {
    margin-top: 20px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
}

.hidden {
    display: none;
}

.play-again-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 18px;
    font-family: 'Fredoka One', cursive;
    cursor: pointer;
    box-shadow: 0 4px 0 #d97f1f;
}

.play-again-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}