/* Leapfrog Game Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.game-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

.game-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2em;
    color: #fff;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 1.2em;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
}

.game-stats > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    padding: 15px;
    background: #0f3460;
    border-radius: 15px;
    margin: 0 auto;
    max-width: 450px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.cell {
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    font-weight: bold;
}

.cell.invalid {
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.cell.empty {
    background: #0a2540;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
    color: #fff;
}

.cell.peg {
    background: #16213e;
    color: #fff;
}

.cell.selected {
    background: #ffd93d !important;
    box-shadow: 0 0 15px rgba(255, 217, 61, 0.6);
    color: #000;
}

.cell.valid-target {
    background: #6bcf7f !important;
    color: #000;
    animation: pulse 0.5s ease-in-out infinite alternate;
}

.cell:hover:not(.invalid) {
    transform: scale(1.05);
}

.lily-pad {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    z-index: 0;
    opacity: 0.6;
    pointer-events: none;
}

.frog-emoji {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    z-index: 1;
    pointer-events: none;
}

.position-number {
    position: relative;
    z-index: 2;
    font-size: 1.2em;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.game-message {
    text-align: center;
    margin-top: 20px;
    font-size: 1.1em;
    min-height: 30px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.solution-panel {
    background: #16213e;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid #0f3460;
}

.solution-panel h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #ffd93d;
}

.solution-move {
    padding: 8px 12px;
    background: transparent;
    color: #fff;
    border-radius: 4px;
    margin-bottom: 3px;
    transition: all 0.2s ease;
}

.solution-move.current-move {
    background: #ffd93d;
    color: #000;
    font-weight: bold;
}

.game-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn.new-game {
    background: #4a9eff;
}

.btn.new-game:hover {
    background: #3a8eef;
}

.btn.hint {
    background: #f39c12;
}

.btn.hint:hover {
    background: #e38c02;
}

.btn.solution {
    background: #9b59b6;
}

.btn.solution:hover {
    background: #8b49a6;
}

.btn.shuffle {
    background: #6bcf7f;
}

.btn.shuffle:hover {
    background: #5bbf6f;
}

.btn.reset {
    background: #e94560;
}

.btn.reset:hover {
    background: #d93550;
}

@keyframes pulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.1);
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .game-container {
        padding: 10px;
    }

    .game-title {
        font-size: 1.5em;
    }

    .game-stats {
        font-size: 1em;
        padding: 10px;
    }

    #game-board {
        padding: 10px;
        gap: 2px;
    }

    .frog-emoji {
        font-size: 1.5em;
    }

    .lily-pad {
        font-size: 2em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .game-message {
        font-size: 1em;
    }
}

@media (max-width: 400px) {
    .game-stats {
        flex-direction: column;
        gap: 10px;
    }

    .frog-emoji {
        font-size: 1.2em;
    }

    .lily-pad {
        font-size: 1.5em;
    }

    .btn {
        width: 100%;
    }
}

/* Light theme support */
@media (prefers-color-scheme: light) {
    body.light-theme {
        background: #f5f5f5;
        color: #333;
    }

    body.light-theme #game-board {
        background: #e0e0e0;
    }

    body.light-theme .cell.empty {
        background: #fff;
    }

    body.light-theme .cell.peg {
        background: #ddd;
    }
}
