* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: white;
}

.container {
    max-width: 1200px;
    width: 100%;
    text-align: center;
}

h1 {
    margin: 20px 0;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Modal */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: white;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.player {
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex: 1;
    margin: 0 10px;
}

.player.active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.player h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.player-score {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.player-history {
    font-size: 0.9rem;
    opacity: 0.8;
    max-height: 100px;
    overflow-y: auto;
}

.player-history div {
    margin: 2px 0;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.card {
    height: 120px;
    perspective: 1000px;
    cursor: pointer;
}

.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;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Cartas de pergunta (vermelho claro) - PARTE DA FRENTE */
.card.question .card-front {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
}

/* Cartas de resposta (verde) - PARTE DA FRENTE */
.card.answer .card-front {
    background: linear-gradient(135deg, #51cf66 0%, #69db7c 100%);
    color: white;
}

.card-back {
    background: white;
    color: #333;
    transform: rotateY(180deg);
    padding: 10px;
}

.controls {
    margin-top: 20px;
}

button {
    background: #ffcc00;
    color: #333;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    margin: 0 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:hover {
    background: #ffd633;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.message {
    margin-top: 20px;
    font-size: 1.2rem;
    min-height: 30px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.match {
    animation: pulse 1s;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-question {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
}

.legend-answer {
    background: linear-gradient(135deg, #51cf66 0%, #69db7c 100%);
}

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

@media (max-width: 1100px) {
    .game-board {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    .game-board {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .card {
        height: 100px;
    }
    
    .controls {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    button {
        margin: 5px 0;
    }
}

@media (max-width: 576px) {
    .game-board {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .card {
        height: 90px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .legend {
        flex-direction: column;
        gap: 10px;
    }
    
    .player {
        margin: 5px 0;
    }
}