/* ============================================
   GAMES KIDS - ESTILOS DOS JOGOS
   ============================================ */

/* Modal do Jogo */
.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.game-modal-content {
    background: white;
    border-radius: 24px;
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.game-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 2px solid var(--outline-variant);
    flex-shrink: 0;
    background: linear-gradient(135deg, #FF6B35, #FFD700);
    border-radius: 24px 24px 0 0;
}

.game-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.game-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.game-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* ============================================
   ESTATÍSTICAS DOS JOGOS
   ============================================ */

.game-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding: 12px 16px;
    background: var(--surface-container-low);
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 0.95rem;
}

.game-reset-btn {
    padding: 6px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.game-reset-btn:hover {
    transform: scale(1.05);
    background: var(--primary-container);
}

/* ============================================
   JOGO DA MEMÓRIA
   ============================================ */

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.memory-card {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #FF6B35, #FFD700);
    border-radius: 16px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    backface-visibility: hidden;
    font-size: 2.5rem;
}

.memory-card-front {
    background: linear-gradient(135deg, #FF6B35, #FFD700);
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
}

.memory-card-back {
    background: white;
    transform: rotateY(180deg);
    border: 2px solid var(--outline-variant);
}

.memory-card:hover {
    transform: scale(1.05);
}

.memory-card.flipped:hover {
    transform: rotateY(180deg) scale(1.05);
}

/* ============================================
   DESENHO INTERATIVO
   ============================================ */

.game-draw-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.draw-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
    padding: 12px;
    background: var(--surface-container-low);
    border-radius: 12px;
}

.draw-colors {
    display: flex;
    gap: 8px;
}

.draw-color-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.draw-color-btn.active {
    border-color: var(--primary);
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.draw-color-btn:hover {
    transform: scale(1.1);
}

.draw-tools {
    display: flex;
    gap: 8px;
}

.draw-tool-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--outline-variant);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.draw-tool-btn:hover {
    background: var(--surface-container-low);
}

#draw-canvas {
    border-radius: 16px;
    border: 2px solid var(--outline-variant);
    cursor: pointer;
    background: white;
    touch-action: none;
    width: 100%;
    height: 400px;
}

/* ============================================
   PALAVRAS COM SOM
   ============================================ */

.game-words-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.words-card {
    background: white;
    border: 2px solid var(--outline-variant);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.words-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #FF6B35;
}

.words-card.active {
    transform: scale(0.95);
    border-color: #FF6B35;
    background: #FFF0E8;
}

.words-emoji {
    font-size: 3rem;
    margin-bottom: 4px;
}

.words-word {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.words-display {
    text-align: center;
    padding: 20px;
    background: var(--surface-container-low);
    border-radius: 16px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 768px) {
    .game-modal-content {
        max-width: 100%;
        border-radius: 16px;
        max-height: 100vh;
    }
    
    .game-modal-header {
        border-radius: 16px 16px 0 0;
        padding: 12px 16px;
    }
    
    .game-modal-header h3 {
        font-size: 1.2rem;
    }
    
    .game-modal-body {
        padding: 16px;
    }
    
    .memory-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        max-width: 100%;
    }
    
    .memory-card-front,
    .memory-card-back {
        font-size: 1.8rem;
    }
    
    .words-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }
    
    .words-emoji {
        font-size: 2.5rem;
    }
    
    .game-stats {
        font-size: 0.8rem;
        gap: 8px;
    }
    
    .draw-controls {
        flex-direction: column;
        align-items: center;
    }
    
    #draw-canvas {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .memory-card-front,
    .memory-card-back {
        font-size: 1.5rem;
    }
    
    .words-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* ============================================
   GAMES KIDS - ESTILOS APRIMORADOS
   ============================================ */

/* ... estilos anteriores ... */

/* ============================================
   CATEGORIAS - PALAVRAS COM SOM
   ============================================ */

.words-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
}

.category-btn {
    padding: 8px 16px;
    background: var(--surface-container-low);
    border: 2px solid var(--outline-variant);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-main);
}

.category-btn:hover {
    border-color: #FF6B35;
    transform: translateY(-2px);
}

.category-btn.active {
    background: linear-gradient(135deg, #FF6B35, #FFD700);
    border-color: #FF6B35;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

/* ============================================
   FIGURAS PARA COLORIR
   ============================================ */

.draw-figures {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.figure-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--outline-variant);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.figure-btn:hover {
    border-color: #FF6B35;
    transform: translateY(-2px);
}

.figure-btn.active {
    background: linear-gradient(135deg, #FF6B35, #FFD700);
    border-color: #FF6B35;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.draw-canvas-wrapper {
    position: relative;
}

.color-label {
    position: absolute;
    display: none;
    font-weight: 800;
    font-size: 18px;
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.9);
    padding: 4px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: colorLabelPop 0.3s ease;
}

@keyframes colorLabelPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.draw-word-display {
    text-align: center;
    padding: 12px;
    background: var(--surface-container-low);
    border-radius: 12px;
    margin-top: 8px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* ============================================
   BOTÃO DE SOM
   ============================================ */

.game-sound-btn {
    padding: 6px 12px;
    background: var(--surface-container-low);
    border: 1px solid var(--outline-variant);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.game-sound-btn:hover {
    background: var(--surface);
    transform: scale(1.05);
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 768px) {
    .words-categories {
        gap: 6px;
    }
    
    .category-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .draw-figures {
        gap: 6px;
    }
    
    .figure-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

/* ============================================
   JOGO DAS CORES
   ============================================ */

.game-colors-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.color-figures {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.color-figure-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--outline-variant);
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-figure-btn:hover {
    border-color: #FF6B35;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.2);
}

.color-figure-btn.active {
    background: linear-gradient(135deg, #FF6B35, #FFD700);
    border-color: #FF6B35;
    color: white;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

.color-instruction {
    text-align: center;
    padding: 16px;
    background: var(--surface-container-low);
    border-radius: 12px;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 2px solid var(--outline-variant);
    transition: all 0.3s ease;
}

.color-instruction p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
}

.color-parts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 400px;
    margin: 0 auto;
}

.color-part {
    aspect-ratio: 1;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 16px;
    position: relative;
    min-height: 100px;
}

.color-part:hover:not([style*="background"]) {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.color-part .color-part-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.color-word-display {
    text-align: center;
    padding: 12px 16px;
    background: var(--surface-container-low);
    border-radius: 12px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 1rem;
    font-weight: 500;
}

/* Responsividade */
@media (max-width: 768px) {
    .color-parts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        max-width: 100%;
    }
    
    .color-part {
        min-height: 80px;
        padding: 12px;
    }
    
    .color-part div:first-child {
        font-size: 2rem !important;
    }
    
    .color-figure-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .color-instruction {
        min-height: 60px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .color-parts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .color-part {
        min-height: 60px;
        padding: 8px;
        border-radius: 12px;
    }
    
    .color-part div:first-child {
        font-size: 1.5rem !important;
    }
}