/* Reset e estilos gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a472a 0%, #2a5c3d 100%);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

/* Container principal */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid #d4af37;
}

/* Cabeçalho */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #d4af37;
}

h1 {
    font-size: 3rem;
    color: #d4af37;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #ccc;
    font-style: italic;
}

/* Área de pontos dos times */
.teams-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    padding: 20px;
    background: rgba(42, 92, 61, 0.8);
    border-radius: 15px;
    border: 2px solid #d4af37;
}

.team {
    text-align: center;
    padding: 15px;
    min-width: 200px;
}

.team-name {
    font-size: 1.8rem;
    color: #d4af37;
    margin-bottom: 10px;
}

.team-points {
    font-size: 2.5rem;
    font-weight: bold;
    color: #fff;
}

.trump-section {
    text-align: center;
    padding: 20px;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    min-width: 200px;
}

.trump-label {
    font-size: 1.2rem;
    color: #d4af37;
    margin-bottom: 10px;
}

.trump-card {
    font-size: 3rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.hearts { color: #ff6b6b; }
.diamonds { color: #ff6b6b; }
.clubs { color: #fff; }
.spades { color: #fff; }

/* Layout dos jogadores */
.players-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.player-card {
    background: rgba(42, 92, 61, 0.9);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #3c8d62;
    transition: all 0.3s ease;
    text-align: center;
}

.player-card.current {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.player-name {
    font-size: 1.5rem;
    color: #d4af37;
}

.player-team {
    font-size: 0.9rem;
    background: #3c8d62;
    padding: 5px 10px;
    border-radius: 15px;
    color: white;
}

.player-points {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 15px;
}

/* Cartas na mão */
.player-hand {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 110px;
}

/* Mesa de jogo */
.table-container {
    position: relative;
    margin: 40px auto;
    width: 400px;
    height: 300px;
}

.game-table {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    border-radius: 50%;
    border: 10px solid #8B4513;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.game-table::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px dashed rgba(212, 175, 55, 0.5);
    border-radius: 50%;
}

/* Posições das cartas na mesa */
.card-position {
    position: absolute;
    width: 80px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-position.top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.card-position.right {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.card-position.bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.card-position.left {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* Cartas */
.card {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.card.playable {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.card-rank {
    font-size: 2rem;
    line-height: 1;
}

.card-suit {
    font-size: 1.5rem;
    margin-top: 5px;
}

.card-back {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border: 3px solid #8B4513;
    color: #8B4513;
    font-size: 1.5rem;
}

/* Controles do jogo */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #3c8d62;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #000;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #3c8d62 0%, #2a5c3d 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(60, 141, 98, 0.4);
}

/* Mensagens do jogo */
.message-area {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 10px;
    border: 1px solid #d4af37;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#message {
    font-size: 1.3rem;
    color: #d4af37;
    font-weight: bold;
}

/* Responsividade */
@media (max-width: 768px) {
    .teams-info {
        flex-direction: column;
        gap: 20px;
    }
    
    .players-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        width: 300px;
        height: 250px;
    }
    
    .card-position {
        width: 60px;
        height: 85px;
    }
    
    .card {
        font-size: 1.5rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 80%;
    }
}

/* Animações */
@keyframes dealCard {
    0% { transform: scale(0) rotate(-180deg); }
    100% { transform: scale(1) rotate(0); }
}

.dealing {
    animation: dealCard 0.5s ease-out;
}

@keyframes winAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.winning-card {
    animation: winAnimation 1s ease-in-out;
}

/* Indicador de turno */
.turn-indicator {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #d4af37;
    color: #000;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    z-index: 10;
}

/* Adicione ao final do seu CSS existente */

.my-hand-container {
    margin-top: 40px;
    padding: 20px;
    background: rgba(42, 92, 61, 0.9);
    border-radius: 15px;
    border: 2px solid #d4af37;
    text-align: center;
}

.my-hand-container h3 {
    color: #d4af37;
    margin-bottom: 15px;
}

#my-hand {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 130px;
}

.hand-instructions {
    margin-top: 10px;
    color: #ccc;
    font-style: italic;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #2a5c3d;
    padding: 30px;
    border-radius: 15px;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    border: 3px solid #d4af37;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.rules-text {
    text-align: left;
    color: white;
    line-height: 1.6;
    margin: 20px 0;
}

.rules-text ul, .rules-text ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.rules-text li {
    margin-bottom: 8px;
}

.player-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Ajustes para as cartas na mesa */
.card-position {
    position: absolute;
    width: 80px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-position .card {
    position: relative;
    z-index: 2;
}

/* Ajuste das posições específicas */
.card-position.top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.card-position.right {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.card-position.bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.card-position.left {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}