/*
 * style.css - Pacto das Estações
 * Estilos organizados e simplificados - Versão Corrigida
 */

/* =======================================
   VARIÁVEIS E RESET
   ======================================= */
:root {
    --color-bg-dark: #1e1f26;
    --color-bg-panel: #2a2c34;
    --color-table-green: #0d4f30;
    --color-gold-light: #ffc87a;
    --color-gold-dark: #cc9c4c;
    --color-red-deep: #8b0000;
    --color-text-light: #e0e0e0;
    --color-border-accent: #4a4a4a;
    --card-bg-back: #4f0a0a;
    --color-blue-light: #a0a0ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Georgia', serif;
}

/* =======================================
   LAYOUT GERAL
   ======================================= */
body {
    background: var(--color-bg-dark);
    color: var(--color-text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: radial-gradient(circle at center, #3a3d4a 0%, var(--color-bg-dark) 100%);
    padding: 10px;
}

.game-container {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    height: 99%;
    max-height: 900px;
    width: 99%;
    max-width: 1440px;
    background-color: var(--color-table-green);
    border: 5px solid var(--color-gold-dark);
    border-radius: 5px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* =======================================
   PAINÉIS LATERAIS
   ======================================= */
.side-panel {
    background-color: var(--color-bg-panel);
    border: 3px solid var(--color-gold-dark);
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.7);
    height: 98%;
    max-height: 860px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    color: var(--color-gold-light);
    border-bottom: 2px solid var(--color-border-accent);
    padding: 10px 5px 5px 5px;
    flex-shrink: 0;
}

.panel-header h3 {
    font-family: 'Times New Roman', serif;
    font-size: 1.2em;
    font-weight: bold;
    text-shadow: 0 0 5px var(--color-gold-light);
    margin: 0;
}

.events-log, .revelation-log {
    font-size: 0.85em;
    line-height: 1.4;
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    padding-right: 5px;
}

.events-log strong {
    color: var(--color-gold-light);
}

/* =======================================
   ÁREA CENTRAL E TABULEIROS
   ======================================= */
.central-game-area {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 10px;
    height: 100%;
}

.board-container {
    width: 100%;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.board-label {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--color-gold-light);
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(2, 1fr);
    flex: 1;
    min-height: 200px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 3px solid var(--color-gold-dark);
    border-radius: 8px;
    padding: 15px;
    gap: 5px;
    justify-content: center;
    align-items: center;
}

#board-container-p1 .board {
    border-color: var(--color-red-deep);
}

#board-container-p2 .board {
    border-color: var(--color-blue-light);
}

/* =======================================
   CARTA DO PACTO
   ======================================= */
.pact-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

#pact-card-element.pact-card-style {
    background: linear-gradient(135deg, #2a2c34 0%, #4a4c54 100%);
    border: 3px solid var(--color-gold-light);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 120px;
    box-shadow: 0 0 20px var(--color-gold-light);
    border-radius: 5px;
}

#pact-card-element.pact-card-style .card-rank-text {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--color-text-light);
}

#pact-card-element.pact-card-style .suit-icon {
    font-size: 1.5em;
    margin-bottom: 8px;
    color: var(--color-text-light);
}

#pact-card-element.pact-card-style .pact-label {
    font-size: 0.9em;
    color: var(--color-gold-light);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    text-align: center;
    margin-top: 5px;
}

/* =======================================
   BARRA CENTRAL DE ELEMENTOS
   ======================================= */
#info-bar {
    width: 100%;
    padding: 10px 0;
    border-top: 1px solid var(--color-border-accent);
    border-bottom: 1px solid var(--color-border-accent);
    flex-shrink: 0;
}

#game-elements {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
}

.game-element {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 80px;
    text-align: center;
}

.label {
    font-size: 0.75em;
    text-transform: uppercase;
    color: var(--color-text-light);
    font-weight: 600;
}

/* =======================================
   ESTILOS DAS CARTAS - REORGANIZADO E CORRIGIDO
   ======================================= */

.card {
    width: 80px;
    height: 120px;
    border-radius: 5px;
    border: 3px solid var(--color-gold-light);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    background-color: #fff;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 200, 122, 0.4);
}

/* === VERSO DA CARTA (NÃO REVELADA) === */
.card.back {
    background: var(--card-bg-back) !important;
    border: 2px solid var(--color-gold-light);
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card.back::before {
    content: '★';
    position: absolute;
    font-size: 40px;
    color: var(--color-gold-light);
    opacity: 0.6;
    text-shadow: 0 0 10px rgba(255, 200, 122, 0.5);
}

/* === CARTA REVELADA (FRENTE) === */
.card:not(.back) {
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background-color: #fff;
    box-shadow: 
        3px 3px 5px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(255, 200, 122, 0.3); /* Brilho base para todas */
}

.card:not(.back).revealed {
    opacity: 0.9; /* Transparência menor para cartas reveladas */
    border-width: 2px;
}

/* Efeito de brilho para cartas importantes */
.card:not(.back).has-glow {
    box-shadow: 
        3px 3px 5px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(255, 200, 122, 0.6),
        inset 0 0 10px rgba(255, 200, 122, 0.2);
}

/* === CONTEÚDO DA CARTA === */
.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    z-index: 2;
}

.card-rank-text {
    font-size: 1.3em;
    font-weight: bold;
    display: block;
}

.suit-icon {
    font-size: 1.5em;
    display: block;
}

/* === CORES DO TEXTO === */
.red-text {
    color: var(--color-red-deep);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.black-text {
    color: #000;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

/* === ESTILOS POR JOGADOR === */

/* Jogador 1 (Vermelho) - Cartas de Poder */
.p1-power {
    box-shadow: 
        3px 3px 5px rgba(0, 0, 0, 0.5),
        0 0 12px rgba(139, 0, 0, 0.4);
}

/* Jogador 1 - Cartas de Batalha */
.p1-battle {
    box-shadow: 
        3px 3px 5px rgba(0, 0, 0, 0.5),
        0 0 8px rgba(30, 31, 38, 0.3);
}

/* Jogador 2 (Preto/Azul) - Cartas de Poder */
.p2-power {
    box-shadow: 
        3px 3px 5px rgba(0, 0, 0, 0.5),
        0 0 12px rgba(139, 0, 0, 0.4);
}

/* Jogador 2 - Cartas de Batalha */
.p2-battle {
    box-shadow: 
        3px 3px 5px rgba(0, 0, 0, 0.5),
        0 0 8px rgba(139, 0, 0, 0.3);
}

@keyframes perfect-match-pulse {
    0%, 100% {
        box-shadow: 
            0 0 20px var(--color-gold-light),
            inset 0 0 15px var(--color-gold-light),
            0 0 30px rgba(255, 200, 122, 0.8);
    }
    50% {
        box-shadow: 
            0 0 30px var(--color-gold-light),
            inset 0 0 20px var(--color-gold-light),
            0 0 40px rgba(255, 200, 122, 1);
    }
}

.perfect-match .card-rank-text,
.perfect-match .suit-icon {
    text-shadow: 
        0 0 10px rgba(255, 200, 122, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* === CARTAS COM IMAGENS TEMÁTICAS === */

/* Cartas Pretas (P2 - PC/Destino) */
.p2-power[data-card-rank="K"] {
    background-image: url('rei.png');
    background-size: cover;
    background-position: center;
    background-color: #cc9c4c;
}

.p2-power[data-card-rank="Q"] {
    background-image: url('dama.png');
    background-size: cover;
    background-position: center;
    background-color: #cc9c4c;
}

.p2-power[data-card-rank="A"] {
    background-image: url('bispo.png');
    background-size: cover;
    background-position: center;
    background-color: #cc9c4c;
}

.p2-power[data-card-rank="J"] {
    background-image: url('cavalo.png');
    background-size: cover;
    background-position: center;
    background-color: #cc9c4c;
}

.p2-power[data-card-rank="10"] {
    background-image: url('torre.png');
    background-size: cover;
    background-position: center;
    background-color: #cc9c4c;
}

/* Cartas 2-9 Pretas (Peões) */
.p2-power[data-card-rank="2"],
.p2-power[data-card-rank="3"],
.p2-power[data-card-rank="4"],
.p2-power[data-card-rank="5"],
.p2-power[data-card-rank="6"],
.p2-power[data-card-rank="7"],
.p2-power[data-card-rank="8"],
.p2-power[data-card-rank="9"] {
    background-image: url('peao.png');
    background-size: cover;
    background-position: center;
    background-color: #cc9c4c;
}

/* Cartas Vermelhas (P1 - Jogador) */
.p1-power[data-card-rank="K"] {
    background-image: url('rei.png');
    background-size: cover;
    background-position: center;
    background-color: #ffc87a;
}

.p1-power[data-card-rank="Q"] {
    background-image: url('dama.png');
    background-size: cover;
    background-position: center;
    background-color: #ffc87a;
}

.p1-power[data-card-rank="A"] {
    background-image: url('bispo.png');
    background-size: cover;
    background-position: center;
    background-color: #ffc87a;
}

.p1-power[data-card-rank="J"] {
    background-image: url('cavalo.png');
    background-size: cover;
    background-position: center;
    background-color: #ffc87a;
}

.p1-power[data-card-rank="10"] {
    background-image: url('torre.png');
    background-size: cover;
    background-position: center;
    background-color: #ffc87a;
}

/* Cartas 2-9 Vermelhas (Peões) */
.p1-power[data-card-rank="2"],
.p1-power[data-card-rank="3"],
.p1-power[data-card-rank="4"],
.p1-power[data-card-rank="5"],
.p1-power[data-card-rank="6"],
.p1-power[data-card-rank="7"],
.p1-power[data-card-rank="8"],
.p1-power[data-card-rank="9"] {
    background-image: url('peao.png');
    background-size: cover;
    background-position: center;
    background-color: #ffc87a;
}

/* Melhorar legibilidade do texto sobre as imagens */
.p1-power .card-rank-text,
.p1-power .suit-icon,
.p2-power .card-rank-text,
.p2-power .suit-icon {
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 8px rgba(255, 255, 255, 0.7);
    font-weight: 900;
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
}

/* === CARTAS NA ZONA TROPICAL (MENORES) === */
.battle-arena .card {
    width: 66px;
    height: 99px;
    border-width: 2px;
    font-size: 1em;
}

.battle-arena .card-rank-text {
    font-size: 1.1em;
}

.battle-arena .suit-icon {
    font-size: 1.3em;
}

/* === SLOTS VAZIOS === */
.empty-slot {
    border: 2px dashed var(--color-gold-dark);
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--color-gold-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
    opacity: 0.6;
}

.empty-slot::before {
    content: "vazio";
    font-size: 0.7em;
}

/* === CARTA DO PACTO === */
#pact-card-element.pact-card-style {
    background: linear-gradient(135deg, #2a2c34 0%, #4a4c54 100%);
    border: 3px solid var(--color-gold-light);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 120px;
    box-shadow: 
        0 0 20px var(--color-gold-light),
        0 0 30px rgba(255, 200, 122, 0.5);
    border-radius: 5px;
}

#pact-card-element.pact-card-style .card-rank-text {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 0px;
    color: var(--color-text-light);
}

#pact-card-element.pact-card-style .suit-icon {
    font-size: 1.5em;
    margin-bottom: 0px;
    color: var(--color-text-light);
}

#pact-card-element.pact-card-style .pact-label {
    font-size: 0.9em;
    color: var(--color-gold-light);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    text-align: center;
    margin-top: 0px;
}

/* === ESTADOS ESPECIAIS DAS CARTAS === */
.card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.7);
}

.card.selected {
    border-color: #4CAF50;
    box-shadow: 
        0 0 15px #4CAF50,
        3px 3px 5px rgba(0, 0, 0, 0.5);
}

.card.highlighted {
    border-color: #2196F3;
    box-shadow: 
        0 0 15px #2196F3,
        3px 3px 5px rgba(0, 0, 0, 0.5);
}

/* === ANIMAÇÕES DE REVELAÇÃO === */
@keyframes card-reveal {
    0% {
        transform: rotateY(0deg);
        opacity: 0;
    }
    50% {
        transform: rotateY(90deg);
        opacity: 0.5;
    }
    100% {
        transform: rotateY(0deg);
        opacity: 0.9;
    }
}

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

/* =======================================
   ESTILOS DOS CORINGAS COM IMAGENS
   ======================================= */

/* Container dos controles coringa */
#joker-controls-container {
    /* Estilos existentes mantidos */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(42, 44, 52, 0.95);
    border: 3px solid var(--color-gold-light);
    border-radius: 15px;
    padding: 20px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 15px;
    min-width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    text-align: center;
}

/* Botões dos coringas com imagens */
.coringa-button {
    width: 120px;
    height: 180px;
    border-radius: 8px;
    border: 3px solid var(--color-gold-light);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Coringa Preto - Sabotagem */
#coringa-preto-button {
    background-image: url('joker.png');
    background-size: cover;
    background-position: center;
    background-color: #2a2a2a; /* Cor de fallback */
    border-color: #000000;
}

#coringa-preto-button:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: #ffc87a;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 200, 122, 0.6);
}

#coringa-preto-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(50, 50, 50, 0.3));
    border-radius: 5px;
}

/* Coringa Vermelho - Revelação */
#coringa-vermelho-button {
    background-image: url('joker.png');
    background-size: cover;
    background-position: center;
    background-color: #5a0a0a; /* Cor de fallback */
    border-color: #8b0000;
}

#coringa-vermelho-button:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: #ff6b6b;
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.8), 0 0 30px rgba(255, 107, 107, 0.6);
}

#coringa-vermelho-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.4), rgba(90, 10, 10, 0.3));
    border-radius: 5px;
}

/* Texto sobre as imagens */
.coringa-button .coringa-text {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    margin: 5px;
}

.coringa-button .coringa-title {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.coringa-button .coringa-desc {
    font-size: 0.8em;
    opacity: 0.9;
}

/* Layout dos botões */
.joker-buttons-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Título dos controles coringa */
.joker-title {
    color: var(--color-gold-light);
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 200, 122, 0.5);
}

/* Efeitos ativos */
.coringa-button.active {
    border-width: 4px;
    box-shadow: 0 0 25px currentColor;
}

#coringa-preto-button.active {
    border-color: #000000;
    box-shadow: 0 0 25px #000000, 0 0 35px rgba(0, 0, 0, 0.8);
}

#coringa-vermelho-button.active {
    border-color: #ff0000;
    box-shadow: 0 0 25px #ff0000, 0 0 35px rgba(255, 0, 0, 0.8);
}

/* Estados desabilitados */
.coringa-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.7);
}

.coringa-button:disabled:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
/* =======================================
   PLACARES E MULTIPLICADORES
   ======================================= */
.score-container {
    position: relative;
    padding: 5px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    border: 1px solid var(--color-border-accent);
    flex-shrink: 0;
}

.score-card {
    width: 110px;
    height: 110px;
    background-color: var(--color-bg-dark);
    border: 3px solid var(--color-gold-light);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.8em;
    font-weight: bold;
    position: relative;
    box-shadow: 0 0 10px var(--color-gold-light);
    overflow: visible;
}

.dynamic-score {
    position: relative;
    z-index: 2;
}

#current-score-p1, #current-score-p2 {
    color: var(--color-gold-light);
}

/* Multiplicador estático */
.multiplier-indicator.static {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6em;
    background: var(--color-gold-dark);
    color: var(--color-bg-dark);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 900;
    display: none;
    z-index: 5;
    white-space: nowrap;
}

.multiplier-indicator.active {
    display: block;
    animation: pulse-static 1.5s infinite;
}

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

/* Multiplicador flutuante */
.multiplier-float {
    position: absolute;
    font-size: 0.7em;
    background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold-dark));
    color: var(--color-bg-dark);
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 900;
    z-index: 10;
    white-space: nowrap;
    animation: float-multiplier 2s ease-out forwards;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-gold-light);
}

@keyframes float-multiplier {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0.8);
        bottom: 10px;
    }
    20% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1.1);
        bottom: 20px;
    }
    60% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
        bottom: 30px;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0.9);
        bottom: 50px;
    }
}

/* =======================================
   ZONA TROPICAL - CORRIGIDA
   ======================================= */
.battle-arena {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 8px;
    padding: 10px;
    height: auto;
    max-height: 95%;
    overflow-y: auto;
}

.battle-slot {
    width: 60px;
    height: 90px;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px dashed var(--color-border-accent);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.3);
    position: relative;
}

.battle-arena .card {
    width: 60px;
    height: 90px;
    border-width: 2px;
    font-size: 1em;
}

/* =======================================
   BARRA DE MEMORIZAÇÃO - CORRIGIDA
   ======================================= */
#memory-action-container {
    position: fixed;
    top: 50%;
    left: 12%;
    transform: translate(-50%, -50%);
    background: rgba(42, 44, 52, 0.98);
    border: 3px solid var(--color-gold-light);
    border-radius: 15px;
    padding: 20px;
    z-index: 1000;
    min-width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    text-align: center;
}

.memory-header {
    color: var(--color-gold-light);
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 200, 122, 0.5);
}

.memory-bar-container {
    width: 100%;
    height: 25px;
    background-color: #1a1a1a;
    border-radius: 12px;
    margin: 15px 0;
    overflow: hidden;
    border: 2px solid var(--color-border-accent);
}

.memory-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.memory-timer-container {
    text-align: center;
    margin: 10px 0;
    font-weight: bold;
    color: var(--color-gold-light);
    font-size: 1.1em;
    min-height: 30px;
}

.memory-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.memory-controls button {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    background-color: var(--color-red-deep);
    color: white;
    cursor: pointer;
    font-size: 0.9em;
    flex: 1;
    transition: all 0.3s;
    font-weight: bold;
}

.memory-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#memory-pause-button {
    background-color: var(--color-gold-dark) !important;
    color: var(--color-bg-dark) !important;
}

#memory-pause-button:hover {
    background-color: var(--color-gold-light) !important;
}

#memory-end-button {
    background-color: #2E7D32 !important;
}

#memory-end-button:hover {
    background-color: #4CAF50 !important;
}

/* Estados da barra de memória */
.memory-bar.bonus-state {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
}

.memory-bar.warning-state {
    background: linear-gradient(90deg, #FF9800, #FFC107);
}

.memory-bar.penalty-state {
    background: linear-gradient(90deg, #F44336, #FF5722);
    animation: penalty-flash 1s infinite;
}

@keyframes penalty-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Efeitos de texto para bônus/penalidade */
.bonus-text {
    color: #4CAF50 !important;
    font-weight: bold;
}

.penalty-text {
    color: #F44336 !important;
    font-weight: bold;
}

/* =======================================
   BOTÕES E INDICADORES
   ======================================= */
#start-button {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 30px;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    background: var(--color-red-deep);
    color: var(--color-gold-light);
    border: 3px solid var(--color-gold-light);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
    transition: all 0.2s ease;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    z-index: 1001;
}

#start-button:hover {
    background: #a00000;
    transform: translate(-50%, -50%) scale(1.05);
}

#start-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.state-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 15px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    font-size: 0.9em;
    z-index: 100;
}

.turn-indicator {
    font-weight: bold;
    color: var(--color-gold-light);
}

.board.active-turn {
    box-shadow: 0 0 20px var(--color-gold-light);
    border-color: var(--color-gold-light);
}

/* =======================================
   BOTÃO SOBRE
   ======================================= */
.sobre-btn {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold-dark));
    border: 2px solid var(--color-gold-light);
    border-radius: 5px;
    color: var(--color-bg-dark);
    font-weight: bold;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.7em;
}

.sobre-btn:hover {
    background: linear-gradient(135deg, var(--color-gold-dark), var(--color-gold-light));
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--color-gold-light);
}

.sobre-icon {
    font-size: 1.5em;
}

.sobre-text {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =======================================
   PAINEL DIREITO - ESTRUTURA CORRIGIDA
   ======================================= */
.side-panel.right-panel {
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    height: 98%;
}

.side-panel.left-panel {
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    height: 98%;
}

.panel-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 10px;
}

.panel-section:first-child {
    flex: 1.2;
    border-bottom: 1px solid var(--color-border-accent);
}

.panel-section:last-child {
    flex: 0.8;
    padding-bottom: 10px;
}

/* Header dos painéis */
.panel-header {
    flex-shrink: 0;
    padding: 10px 0 5px 0;
}

/* Conteúdo da Zona Tropical */
.revelation-log {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.battle-arena-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Conteúdo do Sobre */
.about-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.about-panels {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    margin-top: 5px;
}

/* =======================================
   SCROLLBAR PERSONALIZADA
   ======================================= */
.battle-arena::-webkit-scrollbar,
.about-panels::-webkit-scrollbar,
.events-log::-webkit-scrollbar,
.revelation-log::-webkit-scrollbar {
    width: 6px;
}

.battle-arena::-webkit-scrollbar-track,
.about-panels::-webkit-scrollbar-track,
.events-log::-webkit-scrollbar-track,
.revelation-log::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.battle-arena::-webkit-scrollbar-thumb,
.about-panels::-webkit-scrollbar-thumb,
.events-log::-webkit-scrollbar-thumb,
.revelation-log::-webkit-scrollbar-thumb {
    background: var(--color-gold-dark);
    border-radius: 3px;
}

.battle-arena::-webkit-scrollbar-thumb:hover,
.about-panels::-webkit-scrollbar-thumb:hover,
.events-log::-webkit-scrollbar-thumb:hover,
.revelation-log::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold-light);
}


/* Manter o efeito de perfect-match visível */
.p1-power.perfect-match,
.p2-power.perfect-match {
    box-shadow: 
        0 0 20px var(--color-gold-light),
        inset 0 0 10px var(--color-gold-light),
        0 0 30px rgba(255, 200, 122, 0.8) !important;
    border: 3px solid var(--color-gold-light) !important;
}

/* =======================================
   TELA DE FIM DE JOGO
   ======================================= */
#game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-over-content {
    background: linear-gradient(135deg, var(--color-bg-panel), var(--color-bg-dark));
    border: 4px solid var(--color-gold-light);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 0 50px rgba(255, 200, 122, 0.3);
    animation: slideUp 0.6s ease;
}

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

.game-result {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 0 0 20px currentColor;
}

.victory-p1 {
    color: var(--color-red-deep);
    animation: pulse-glow 2s infinite;
}

.victory-p2 {
    color: var(--color-blue-light);
    animation: pulse-glow 2s infinite;
}

.draw {
    color: var(--color-gold-light);
    animation: pulse-glow 2s infinite;
}

.final-scores {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    font-size: 1.5em;
}

.score-box {
    padding: 20px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.score-box.winner {
    border: 2px solid var(--color-gold-light);
    box-shadow: 0 0 20px var(--color-gold-light);
}

.score-label {
    font-size: 0.8em;
    opacity: 0.8;
    margin-bottom: 5px;
}

.score-value {
    font-size: 2em;
    font-weight: bold;
}

.game-stats {
    margin: 20px 0;
    font-size: 1.1em;
    opacity: 0.9;
}

.restart-button {
    background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold-dark));
    color: var(--color-bg-dark);
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.restart-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--color-gold-light);
}

@keyframes pulse-glow {
    0%, 100% {
        text-shadow: 0 0 20px currentColor;
    }
    50% {
        text-shadow: 0 0 30px currentColor, 0 0 40px currentColor;
    }
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--color-gold-light);
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* =======================================
   RESPONSIVIDADE BÁSICA
   ======================================= */
@media (max-width: 1200px) {
    .game-container {
        grid-template-columns: 200px 1fr 200px;
    }
    
    .card {
        width: 70px;
        height: 105px;
        font-size: 1em;
    }
    
    #pact-card-element.pact-card-style {
        width: 70px;
        height: 105px;
    }
}

@media (max-width: 900px) {
    .game-container {
        grid-template-columns: 180px 1fr 180px;
    }
    
    .card {
        width: 60px;
        height: 90px;
        font-size: 0.9em;
    }
    
    .board {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }
}

/* =============================================
   ESTILOS PARA AS NOVAS FUNCIONALIDADES
   ============================================= */

/* Contador do Monte */
#duel-deck {
    transition: all 0.3s ease;
}

#duel-deck.monte-vazio {
    background: linear-gradient(135deg, #444444, #666666);
    border-color: #888888;
    color: #cccccc;
}

/* Mensagem de Vitória Épica */
.victory-message {
    text-align: center;
    padding: 20px;
    margin: 10px 0;
    background: rgba(10, 10, 30, 0.95);
    border-radius: 15px;
    border: 3px solid;
    font-weight: bold;
    font-size: 1.3rem;
    text-shadow: 0 0 10px currentColor;
}

.victory-p1 {
    border-color: var(--color-red-light);
    color: var(--color-red-light);
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.victory-p2 {
    border-color: var(--color-blue-light);
    color: var(--color-blue-light);
    box-shadow: 0 0 20px rgba(68, 68, 255, 0.5);
}

.victory-draw {
    border-color: var(--color-gold-light);
    color: var(--color-gold-light);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* =============================================
   ANIMAÇÕES PARA PONTOS INSTANTÂNEOS - CORRIGIDAS
   ============================================= */

@keyframes floatInstant {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(0, -40px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(0, -80px) scale(1.5);
    }
}

.instant-score-effect {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.4rem;
    font-weight: bold;
    z-index: 1000;
    text-shadow: 0 0 8px currentColor;
    animation: floatInstant 1.5s ease-out forwards;
    pointer-events: none;
}

.instant-score-effect.positive {
    color: #4CAF50 !important;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
}

.instant-score-effect.negative {
    color: #F44336 !important;
    text-shadow: 0 0 10px rgba(244, 67, 54, 0.8);
}

.instant-score-effect.memory-bonus::before {
    content: '🎁 ';
}

.instant-score-effect.memory-penalty::before {
    content: '⚠️ ';
}

/* =======================================
   CORREÇÕES ADICIONAIS
   ======================================= */

/* Garantir que os placares tenham position relative para os efeitos */
.score-card {
    position: relative;
    overflow: visible;
}

/* Garantir que o botão start não interfira */
#start-button {
    z-index: 1001;
}

/* Estados visuais da memorização */
.memory-phase-active .card:not(.back) {
    box-shadow: 
        3px 3px 5px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(255, 200, 122, 0.6) !important;
    border-color: var(--color-gold-light) !important;
}

.memory-phase-active #memory-action-container {
    display: block !important;
}

/* Responsividade para memorização */
@media (max-width: 768px) {
    #memory-action-container {
        min-width: 280px;
        padding: 15px;
        top: 40%;
    }
    
    .memory-header {
        font-size: 1.1em;
    }
    
    .memory-controls {
        flex-direction: column;
    }
    
    .memory-controls button {
        width: 100%;
    }
}