/* Container principal */
#catolico-colorir-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Seletor de imagens */
#catolico-image-selector h3 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

#catolico-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

.image-item {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.image-item:hover {
    border-color: #4CAF50;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.2);
}

.image-item img {
    max-width: 100%;
    height: 160px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}

.image-item h4 {
    margin: 15px 0 0 0;
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

.image-item .play-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-item:hover .play-icon {
    opacity: 1;
}

.no-images {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.no-images p {
    font-size: 18px;
    color: #666;
    margin: 10px 0;
}

.loading {
    text-align: center;
    padding: 60px;
    font-size: 18px;
    color: #666;
    background: #f9f9f9;
    border-radius: 12px;
}

/* Área do jogo */
#catolico-game-area {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* Toolbar melhorada */
#catolico-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 12px;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tool-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    font-weight: 600;
    font-size: 16px;
}

.tool-icon {
    font-size: 20px;
}

.tool-text {
    font-size: 14px;
}

/* Botões principais */
.catolico-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.2);
}

.catolico-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(76, 175, 80, 0.3);
}

.catolico-btn:active {
    transform: translateY(0);
}

.back-btn {
    background: #f44336;
    box-shadow: 0 3px 8px rgba(244, 67, 54, 0.2);
}

.back-btn:hover {
    box-shadow: 0 5px 12px rgba(244, 67, 54, 0.3);
}

.action-btn {
    background: #FF9800;
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.2);
}

.action-btn:hover {
    box-shadow: 0 5px 12px rgba(255, 152, 0, 0.3);
}

.btn-icon {
    font-size: 20px;
}

.btn-text {
    font-size: 12px;
    font-weight: 500;
}

/* Tamanhos de pincel com ícones */
.brush-size-container {
    display: flex;
    gap: 12px;
}

.brush-size-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 15px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.brush-size-option:hover {
    border-color: #4CAF50;
    transform: translateY(-2px);
}

.brush-size-option.selected {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

.brush-icon {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brush-size-option.selected .brush-icon {
    color: white;
}

.small-brush {
    font-size: 8px;
}

.medium-brush {
    font-size: 14px;
}

.large-brush {
    font-size: 22px;
}

.brush-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.brush-size-option.selected .brush-label {
    color: white;
}

/* Container do canvas */
#catolico-canvas-container {
    display: flex;
    justify-content: center;
    background: #fafafa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

#coloring-canvas {
    border: 3px solid #e0e0e0;
    border-radius: 8px;
    cursor: crosshair;
    max-width: 100%;
    height: auto;
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

/* Container da paleta de cores */
#catolico-color-palette-container {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.palette-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.palette-icon {
    font-size: 24px;
}

/* Paleta de cores */
#color-palette {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.color-group.skin-tones {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
}

.group-label {
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
}

.color-option {
    width: 40px;
    height: 40px;
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    position: relative;
}

.color-option[data-color="#FFFFFF"] {
    border-color: #ddd;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.color-option.selected {
    border-color: #333;
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.3);
}

.color-option.selected::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.color-option[data-color="#FFFFFF"].selected::after,
.color-option[data-color="#FDE7D6"].selected::after,
.color-option[data-color="#FFCCDD"].selected::after {
    color: #333;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

/* Responsividade */
@media (max-width: 768px) {
    #catolico-colorir-container {
        padding: 15px;
    }

    #catolico-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }

    .image-item {
        padding: 15px;
    }

    .image-item img {
        height: 140px;
    }

    #catolico-toolbar {
        flex-direction: column;
        gap: 20px;
    }

    .tool-group {
        width: 100%;
        justify-content: center;
    }

    .color-group {
        gap: 8px;
    }

    .color-option {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    #catolico-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .image-item {
        padding: 12px;
    }

    .image-item img {
        height: 120px;
    }

    #catolico-canvas-container {
        padding: 15px;
    }

    .catolico-btn {
        padding: 10px 16px;
    }

    .btn-icon {
        font-size: 18px;
    }

    .btn-text {
        font-size: 11px;
    }

    .brush-size-option {
        padding: 8px 12px;
    }

    .color-option {
        width: 30px;
        height: 30px;
    }

    #catolico-color-palette-container {
        padding: 20px 15px;
    }

    .palette-label {
        font-size: 16px;
    }
}

/* Melhorias de acessibilidade */
.catolico-btn:focus,
.color-option:focus,
.brush-size-option:focus {
    outline: 3px solid #4CAF50;
    outline-offset: 2px;
}

/* Estados de carregamento */
.loading::after {
    content: "🎨";
    display: block;
    font-size: 30px;
    margin-top: 15px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Melhorias para dispositivos touch */
@media (hover: none) {
    .image-item:hover {
        transform: none;
    }

    .color-option:hover {
        transform: none;
    }

    .brush-size-option:hover {
        transform: none;
    }
}

/* Animação de entrada */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

#catolico-game-area {
    animation: fadeIn 0.4s ease;
}