/* Estilos customizados para animações e cards */

.card {
    perspective: 1000px;
    cursor: pointer;
    user-select: none;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-front {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Logo arredondada nas costas dos cards */
.house-logo-back {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.card-back {
    background: white;
    transform: rotateY(180deg);
    padding: 8px;
}

.card-back img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.card-back.special-card {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

/* Logo retangular para o card especial da HouseJs */
.house-logo-rectangular {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-back.java-special {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
}

.card-back.java-special .card-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.card-back.java-special .java-logo {
    width: 50px;
    height: 50px;
}

.card-back.java-special .rosana-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.card.matched {
    opacity: 0.7;
    transform: scale(0.95);
    pointer-events: none;
}

.card:hover:not(.flipped):not(.matched) {
    transform: scale(1.05);
    transition: transform 0.2s;
}

/* Animações de entrada */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: scale(0.8) rotateY(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.card {
    animation: cardEntrance 0.6s ease-out;
}

/* Animação de match */
@keyframes matchAnimation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(255, 255, 0, 0.6);
    }
    100% {
        transform: scale(0.95);
    }
}

.card.match-animation {
    animation: matchAnimation 0.6s ease-in-out;
}

/* Estilo para texto dos tópicos */
.topic-text {
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    color: #4a5568;
    padding: 8px;
    line-height: 1.2;
}

/* Estilos para cards da comunidade */
.community-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

.community-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 4px;
}

.community-text {
    font-size: 0.8rem;
    font-weight: bold;
    color: #4a5568;
    text-align: center;
    margin-bottom: 2px;
}

/* Estilos específicos para o card do café */
.cafe-card {
    padding: 6px;
    gap: 2px;
}

.cafe-text {
    font-size: 0.7rem;
    margin-bottom: 1px;
    padding: 0 4px;
    line-height: 1.1;
}

.cafe-image {
    max-width: 75%;
    max-height: 65%;
    object-fit: contain;
}

/* Responsividade */
@media (max-width: 1024px) and (min-width: 769px) {
    #game-board {
        grid-template-columns: repeat(6, 1fr);
        gap: 3px;
        max-width: 5xl;
    }
}

@media (max-width: 768px) {
    #game-board {
        grid-template-columns: repeat(5, 1fr);
        gap: 2px;
        padding: 8px;
    }
    
    .card {
        height: 80px;
    }
    
    .card-back img {
        max-width: 90%;
        max-height: 90%;
    }
    
    .topic-text {
        font-size: 0.7rem;
        padding: 4px;
    }
    
    .community-text {
        font-size: 0.6rem;
    }
    
    .community-image {
        max-width: 85%;
        max-height: 85%;
    }
    
    /* Ajustes específicos para o café em tablet */
    .cafe-text {
        font-size: 0.55rem;
        padding: 0 2px;
    }
    
    .cafe-image {
        max-width: 70%;
        max-height: 60%;
    }
    
    /* Responsividade para logos */
    .house-logo-back {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .card {
        height: 70px;
    }
    
    .topic-text {
        font-size: 0.6rem;
    }
    
    .community-text {
        font-size: 0.5rem;
    }
    
    .community-image {
        max-width: 80%;
        max-height: 80%;
    }
    
    /* Ajustes específicos para o café em mobile */
    .cafe-text {
        font-size: 0.45rem;
        padding: 0 1px;
        margin-bottom: 0;
    }
    
    .cafe-image {
        max-width: 65%;
        max-height: 55%;
    }
    
    /* Logos ainda menores em telas muito pequenas */
    .house-logo-back {
        width: 30px;
        height: 30px;
    }
}

/* Animação de pulso para o timer quando restam poucos segundos */
.timer-warning {
    animation: pulse 1s infinite;
    color: #ef4444 !important;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Estilo para inputs */
.player-name-input:focus {
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(147, 51, 234, 0.3);
}

/* Animação para o modal de nome */
#player-name-modal {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Estilos para o placar */
#scoreboard-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 158, 11, 0.6) rgba(245, 158, 11, 0.1);
}

#scoreboard-container::-webkit-scrollbar {
    width: 8px;
}

#scoreboard-container::-webkit-scrollbar-track {
    background: rgba(245, 158, 11, 0.1);
    border-radius: 4px;
}

#scoreboard-container::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.6);
    border-radius: 4px;
}

#scoreboard-container::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 158, 11, 0.8);
}
