/* ========================================
   MINI-GAMES STYLES
   ======================================== */

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

body {
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.games-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Header */
.games-header {
    background: white;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.games-header h1 {
    font-size: 2em;
    color: #667eea;
}

.back-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.2s;
}

.back-btn:hover {
    transform: scale(1.05);
}

.player-info {
    background: #ecf0f1;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.1em;
}

/* Game Selection */
.game-selection {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.game-selection h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.games-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.game-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.game-card.locked {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.game-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 2em;
}

.game-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.game-name {
    font-size: 1.5em;
    color: white;
    font-weight: bold;
    margin-bottom: 10px;
}

.game-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
    margin-bottom: 15px;
}

.game-progress {
    background: rgba(255, 255, 255, 0.3);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.game-progress-bar {
    background: #2ecc71;
    height: 100%;
    transition: width 0.3s;
}

.game-required {
    color: white;
    font-size: 0.9em;
}

/* Game Screen */
.game-screen {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.game-header h2 {
    font-size: 2em;
    color: #2c3e50;
}

.game-score {
    font-size: 1.5em;
    color: #e74c3c;
    font-weight: bold;
}

.game-header button {
    background: #e74c3c;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.2s;
}

.game-header button:hover {
    transform: scale(1.1);
}

/* Canvas */
canvas {
    display: block;
    margin: 20px auto;
    border: 3px solid #2c3e50;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.game-controls button {
    background: #3498db;
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 10px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.2s;
}

.game-controls button:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.game-controls button:active {
    transform: scale(0.95);
}

/* Block Pieces */
.block-pieces {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.piece {
    font-size: 3em;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 10px;
    border-radius: 10px;
    background: #ecf0f1;
}

.piece:hover {
    transform: scale(1.2);
}

.piece.selected {
    background: #3498db;
    transform: scale(1.3);
}

/* Responsive */
@media (max-width: 768px) {
    .games-header {
        flex-direction: column;
        gap: 15px;
    }

    .games-header h1 {
        font-size: 1.5em;
    }

    .games-list {
        grid-template-columns: 1fr;
    }

    canvas {
        max-width: 100%;
        height: auto;
    }

    .game-controls button {
        width: 50px;
        height: 50px;
        font-size: 1.2em;
    }
}

/* Animations */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.game-card:hover .game-icon {
    animation: bounce 0.5s ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.game-progress-bar {
    animation: pulse 2s infinite;
}

/* Theme Selector */
.theme-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.theme-selector button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-selector button:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.theme-selector button:active {
    transform: scale(0.95);
}

/* Jigsaw Instructions */
.jigsaw-instructions {
    text-align: center;
    margin-top: 15px;
    padding: 15px;
    background: #FFF9C4;
    border-radius: 10px;
    font-size: 1.1em;
    color: #F57C00;
}

.jigsaw-instructions p {
    margin: 0;
    font-weight: bold;
}