/* Estilos modernizados para o jogo Combine */
#maincombine {
    position: relative;
    min-height: 40%;
    max-height: 70%;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 20px;
    /* background: linear-gradient(135deg, var(--neutral-200) 0%, var(--neutral-100) 100%); */
    border-radius: 16px;
    /* box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05); */
}

#colA, #colB {
    width: 40%;
    padding: 20px;
    transition: all 0.3s ease;
}

#colA {
    float: left;
}

#colB {
    float: right;
    text-align: right;
}

#enunciado {
    position: absolute;
    width: calc(20% + 60px);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    line-height: 1.3em;
    font-size: 16px;
    color: var(--neutral-900);
    /* background-color: var(--neutral-100); */
    padding: 15px;
    border-radius: 15px;
    /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); */
    /* border: 2px dashed var(--neutral-300); */
    animation: pulseEnunciado 2s infinite alternate ease-in-out;
    font-weight: 400;
}

@keyframes pulseEnunciado {
    0% {
        /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); */
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        /* box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15); */
        transform: translate(-50%, -50%) scale(1.02);
    }
}

#controles {
    height: 50px;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.peca {
    width: 90%;
    height: auto;
    min-height: 80px;
    padding: 15px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: white;
    border-radius: 15px;
    /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); */
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid transparent;
    overflow: visible;
}

.peca:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
    scale: 1.02;
}

/* Peça fêmea (lado A) - com concavidade */
.peca[tipo="A"] {
    /* background: linear-gradient(135deg, var(--neutral-100) 0%, var(--neutral-200) 100%); */
    background: var(--neutral-200);
    border-radius: 15px;
    border-right: none;
    margin-right: 20px;
    position: relative;
    overflow: visible;
}

/* Concavidade da peça fêmea */
.peca[tipo="A"]::after {
    content: "";
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: var(--neutral-100);
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    /* box-shadow: inset 2px 0 2px rgba(0, 0, 0, 0.1); */
    /* border: 2px solid var(--neutral-300); */
    border-left: none;
    transition: all 0.3s ease;
    z-index: 5;
}

/* Peça macho (lado B) - com saliência */
.peca[tipo="B"] {
    /* background: linear-gradient(135deg, var(--neutral-200) 0%, var(--neutral-100) 100%); */
    background: var(--neutral-200);
    border-radius: 15px;
    border-left: none;
    margin-left: 20px;
    position: relative;
    overflow: visible;
}

/* Saliência da peça macho */
.peca[tipo="B"]::after {
    content: "";
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: var(--neutral-200);
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    /* box-shadow: -2px 0 2px rgba(0, 0, 0, 0.1); */
    /* border: 2px solid var(--neutral-300); */
    border-right: none;
    transition: all 0.3s ease;
    z-index: 5;
}

.peca .conteudo {
    position: relative;
    line-height: 1.4em;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: var(--neutral-800);
    width: calc(100% - 30px);
    transition: all 0.3s ease;
}

.peca[tipo="A"] .conteudo {
    text-align: right;
    padding-right: 30px;
}

.peca[tipo="B"] .conteudo {
    text-align: left;
    /* padding-left: 30px; */
}

.peca[tipo="A"]:hover::after {
    /* box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25); */
    /* border-color: var(--primary); */
}

.peca[tipo="B"]:hover::after {
    /* background: var(--primary); */
    /* box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25); */
    /* border-color: var(--primary); */
}

.ativo {
    font-weight: 600;
    box-shadow: 0 6px 14px rgba(43, 217, 226, 0.3);
    animation: selectionPulse 1.5s infinite alternate;
}

@keyframes selectionPulse {
    0% {
        box-shadow: 0 4px 10px rgba(43, 217, 226, 0.3);
    }
    100% {
        box-shadow: 0 6px 20px rgba(43, 217, 226, 0.5);
    }
}

.ativo[tipo="B"] {
    border-right: 6px solid var(--primary);
}

.ativo[tipo="A"] {
    border-left: 6px solid var(--primary);
}

.ativo .conteudo {
    color: var(--primary-dark);
}

.ativo[tipo="A"]::after {
    /* background: white; */
    /* border-color: var(--primary); */
    /* box-shadow: inset 3px 0 8px rgba(43, 217, 226, 0.3); */
}

.ativo[tipo="B"]::after {
    /* background: var(--primary); */
    /* border-color: var(--primary); */
    /* box-shadow: 0 0 10px var(--primary), 0 2px 4px rgba(0, 0, 0, 0.2); */
}

/* button {
    margin: 0 5px;
    font-size: 16px;
    padding: 10px 20px;
    border-radius: 50px;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--primary-dark);
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-weight: 700;
} */

button:hover {
    /* background: var(--primary-light); */
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--primary-dark);
}

button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--primary-dark);
}

#btn_limpar {
    background: white;
    color: var(--neutral-800);
    border: 1px solid var(--neutral-200);
    box-shadow: 0 4px 0 var(--neutral-200);
}

#btn_limpar:hover {
    background: var(--neutral-400);
    box-shadow: 0 6px 0 var(--neutral-500);
}

#btn_conferir {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, -150%);
    animation: btnPulse 2s infinite alternate;
}


@keyframes btnPulse {
    0% {
        transform: translate(-50%, -150%) scale(1);
    }
    100% {
        transform: translate(-50%, -150%) scale(1.05);
    }
}

#animaA, #animaB {
    width: calc(40% - 40px);
    position: absolute;
    z-index: 100;
}

#centro {
    position: absolute;
    left: 50%;
    top: 50%;
    opacity: 0;
}

#selecionados {
    min-height: 150px;
    overflow-y: auto;
    border-top: 3px dashed var(--neutral-400);
    /* background: linear-gradient(135deg, var(--neutral-100) 0%, var(--neutral-200) 100%); */
    padding: 30px;
    text-align: center;
    border-radius: 0 0 16px 16px;
    /* box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05); */
}

.juncao {
    display: inline-flex;
    width: calc(50% - 20px);
    margin: 0 10px 15px 0;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.juncao:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.ladoA, .ladoB {
    width: 50%;
    padding: 12px 10px;
    background: var(--primary);
    color: white;
    font-size: 16px;
    line-height: 1.3em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

/* Lado A da junção (concavidade) */
.ladoA {
    border-radius: 15px 0 0 15px;
    text-align: right;
    padding-right: 15px;
    background: #3700FE;
    border-right: none;
}

/* Lado B da junção (saliência) */
.ladoB {
    border-radius: 0 15px 15px 0;
    text-align: left;
    padding-left: 15px;
    background: #2700B4;
    border-left: none;
}

/* Junção encaixada - área de encontro */
.ladoA::after, .ladoB::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    transform: translateY(-50%);
    /* background: #3700FE; */
    z-index: 10;
}

.ladoA::after {
    right: -10px;
    border-radius: 0 10px 10px 0;
}

.ladoB::before {
    left: -10px;
    border-radius: 10px 0 0 10px;
}

.certo {
    background: var(--feedback-positivo);
    color: white;
    font-weight: 600;
    animation: correctPulse 2s infinite alternate;
}

@keyframes correctPulse {
    0% {
        background: var(--feedback-positivo);
    }
    100% {
        background: var(--feedback-positivo-light);
    }
}

.errado {
    background: var(--feedback-negativo);
    color: white;
    font-weight: 600;
    animation: wrongShake 0.5s;
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.errado::after {
    content: "";
    background-image: url(../img/icon_errado.svg);
    background-size: contain;
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.certo::after {
    content: "";
    background-image: url(../img/icon_certo.svg);
    background-size: contain;
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

/* Feedback - usa sistema global padronizado */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glowSuccess {
    0% {
        box-shadow: 0 4px 10px rgba(93, 213, 97, 0.3);
    }
    100% {
        box-shadow: 0 8px 20px rgba(93, 213, 97, 0.5);
    }
}

@media only screen and (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    #maincombine {
        padding: 10px;
    }
    
    #colA, #colB {
        width: 45%;
        padding: 5px;
    }
    
    #animaA, #animaB {
        width: calc(45% - 10px);
    }
    
    #enunciado {
        width: 100%;
        font-size: 14px;
        display: block;
        position: initial;
        top: 0;
        left: 0;
        text-align: center;
        transform: initial;
        padding: 10px;
        margin-bottom: 20px;
        animation: none;
    }
    
    .juncao {
        display: flex;
        width: calc(100% - 10px);
        margin: 0 5px 10px 0;
        font-size: 14px;
    }
    
    .juncao .ladoA, .juncao .ladoB {
        line-height: 1.2em;
        padding: 8px;
        font-size: 12px;
    }
    
    .peca {
        min-height: 60px;
        margin-bottom: 10px;
        padding: 8px;
    }
    
    .peca .conteudo {
        font-size: 12px;
    }
    
    .peca[tipo='A'] .conteudo {
        padding-right: 15px;
    }
    
    .peca[tipo='B'] .conteudo {
        padding-left: 15px;
    }
    
    #selecionados {
        padding: 15px 5px;
    }
    
    #btn_conferir {
        /* position: initial; */
        display: block;
        margin: 15px auto;
        transform: none;
    }
    
    .ladoA, .ladoB {
        padding: 8px;
    }
    
    .peca[tipo="A"]::after,
    .peca[tipo="B"]::after {
        width: 20px;
        height: 20px;
    }

    .peca[tipo="A"]::after{
        right: -10px;
    }

    .peca[tipo="B"]::after{
        left: -10px;
    }
    
    .certo::after,
    .errado::after {
        width: 15px;
        height: 15px;
    }
}