/* =======================================
   SIMULADOR DE PARTIDA - ESTILOS MÍSTICOS
   ======================================= */

/* Variables específicas del simulador */
:root {
    --card-width: 120px;
    --card-height: 168px;
    --card-border-radius: 8px;
    --shadow-color: rgba(0, 0, 0, 0.6);
    --glow-purple: rgba(200, 115, 196, 0.4);
    --glow-green: rgba(151, 232, 141, 0.4);
    --table-bg: radial-gradient(ellipse at center, #2a2a2a 0%, #1a1a1a 70%);
}

/* =======================================
   HEADER Y NAVEGACIÓN
   ======================================= */
.main-nav a.active {
    color: var(--secondary-green);
    border-bottom: 2px solid var(--secondary-green);
}

.main-nav a:hover {
    color: var(--secondary-green);
    border-bottom: 2px solid var(--secondary-green);
    transition: all 0.3s ease;
}

.btn-perfil { /* kept empty to inherit from global GaleriaCSS.css */ }

/* =======================================
   TÍTULO PRINCIPAL
   ======================================= */
.simulator-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(200, 115, 196, 0.1), rgba(151, 232, 141, 0.1));
    border-bottom: 2px solid var(--primary-purple);
}

.simulator-header h1 {
    font-family: 'Metal Mania', cursive;
    font-size: 3em;
    margin: 0;
    text-shadow: 0 0 20px var(--glow-green);
}

.simulator-header h2 {
    font-family: 'Metal Mania', cursive;
    font-size: 2em;
    margin: 10px 0;
    text-shadow: 0 0 15px var(--glow-purple);
}

.simulator-description {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1em;
    color: #ccc;
    max-width: 600px;
    margin: 20px auto 0;
    line-height: 1.6;
}

/* =======================================
   CONTROLES DE MAZO
   ======================================= */
.deck-controls {
    padding: 30px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(200, 115, 196, 0.3);
}

.control-group {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.control-group h3 {
    font-family: 'Metal Mania', cursive;
    color: var(--primary-purple);
    font-size: 1.5em;
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--glow-purple);
}

.deck-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-control {
    font-family: 'Metal Mania', cursive;
    background: linear-gradient(to bottom, var(--primary-purple), #8b4a8b);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.btn-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--shadow-color);
    filter: brightness(1.2);
}

.btn-reset {
    background: linear-gradient(to bottom, #dc3545, #a02834);
}

.deck-status {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--primary-purple);
}

.deck-status span {
    font-family: 'Montserrat', sans-serif;
    color: var(--secondary-green);
    font-weight: bold;
    font-size: 1.1em;
}

/* =======================================
   MESA DE JUEGO
   ======================================= */
.game-table {
    background: var(--table-bg);
    min-height: 600px;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
}

.game-table h3 {
    font-family: 'Metal Mania', cursive;
    color: var(--secondary-green);
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.3em;
    text-shadow: 0 0 8px var(--glow-green);
}

/* Panteón (superior izquierda) */
.pantheon-area {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pantheon-slot {
    width: var(--card-width);
    height: var(--card-height);
    border: 2px dashed var(--primary-purple);
    border-radius: var(--card-border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(200, 115, 196, 0.1);
    transition: all 0.3s ease;
    overflow: visible;
    transform: rotate(90deg);
}

/* Girar la carta de Panteón 90 grados a la derecha visualmente */
.pantheon-slot .card {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pantheon-slot .card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--card-border-radius);
}

.card-placeholder {
    color: var(--primary-purple);
    font-family: 'Metal Mania', cursive;
    text-align: center;
    opacity: 0.7;
}

/* Oráculos (centro) */
.oracles-area {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.oracles-grid {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
}

.oracle-slot {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Mazo de Designios (derecha) */
.destiny-deck-area {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.deck-pile {
    position: relative;
    margin-bottom: 15px;
}

.deck-counter {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--secondary-green);
    color: #000;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    box-shadow: 0 2px 6px var(--shadow-color);
}

.deck-instruction {
    color: #ccc;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    margin: 10px 0;
    font-size: 0.9em;
}

.draw-counter {
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--secondary-green);
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
}

/* Mano del jugador */
.player-hand {
    grid-column: 1 / 4;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hand-area {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 200px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(151, 232, 141, 0.3);
    width: 100%;
    max-width: 800px;
}

/* =======================================
   CARTAS
   ======================================= */
.card {
    width: var(--card-width);
    height: var(--card-height);
    border-radius: var(--card-border-radius);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px var(--shadow-color);
}

.card img {
    width: 100%;
    height: 100%;
    border-radius: var(--card-border-radius);
    object-fit: cover;
}

.card-back {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    border: 2px solid var(--primary-purple);
}

.gods-back {
    border-color: var(--primary-purple);
    box-shadow: 0 0 15px var(--glow-purple);
}

.destiny-back {
    border-color: var(--secondary-green);
    box-shadow: 0 0 15px var(--glow-green);
}

/* Carta revelada */
.card-revealed {
    border: 2px solid var(--secondary-green);
    box-shadow: 0 0 20px var(--glow-green);
}

/* =======================================
   ANIMACIONES
   ======================================= */
@keyframes cardFlip {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(90deg);
    }
    100% {
        transform: rotateY(0deg);
    }
}

@keyframes cardDraw {
    0% {
        transform: translateX(0) translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(-200px) translateY(-100px) scale(0.8);
        opacity: 0.7;
    }
    100% {
        transform: translateX(-400px) translateY(-200px) scale(1);
        opacity: 1;
    }
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.card-flipping {
    animation: cardFlip 0.6s ease-in-out;
}

.card-drawing {
    animation: cardDraw 0.8s ease-out;
}

.card-appearing {
    animation: cardAppear 0.5s ease-out;
}

/* =======================================
   CONTROLES DE JUEGO
   ======================================= */
.game-controls {
    padding: 30px 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(200, 115, 196, 0.3);
}

.game-controls .btn-control {
    margin: 0 10px;
}

/* =======================================
   MODAL
   ======================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    margin: 5% auto;
    padding: 0;
    border: 2px solid var(--primary-purple);
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.modal-header {
    background: linear-gradient(to right, var(--primary-purple), #8b4a8b);
    padding: 20px;
    border-radius: 13px 13px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: 'Metal Mania', cursive;
    color: white;
    margin: 0;
    font-size: 1.5em;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--secondary-green);
}

.modal-body {
    padding: 30px;
}

.deck-list {
    display: grid;
    gap: 15px;
}

.deck-item {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--primary-purple);
    cursor: pointer;
    transition: all 0.3s ease;
}

.deck-item:hover {
    background: rgba(200, 115, 196, 0.1);
    border-color: var(--secondary-green);
}

.deck-item h4 {
    font-family: 'Metal Mania', cursive;
    color: var(--secondary-green);
    margin: 0 0 10px 0;
}

.deck-item p {
    font-family: 'Montserrat', sans-serif;
    color: #ccc;
    margin: 5px 0;
    font-size: 0.9em;
}

/* Preview de cartas en el modal */
.deck-preview {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.deck-preview-card {
    width: 60px;
    height: 84px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(151, 232, 141, 0.3);
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}

.deck-preview-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =======================================
   RESPONSIVE
   ======================================= */
@media (max-width: 1200px) {
    .game-table {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 20px;
    }
    
    .pantheon-area {
        grid-column: 1;
        grid-row: 1;
    }
    
    .oracles-area {
        grid-column: 1;
        grid-row: 2;
    }
    
    .destiny-deck-area {
        grid-column: 1;
        grid-row: 3;
    }
    
    .player-hand {
        grid-column: 1;
        grid-row: 4;
    }
}

@media (max-width: 768px) {
    :root {
        --card-width: 100px;
        --card-height: 140px;
    }
    
    .simulator-header h1 {
        font-size: 2em;
    }
    
    .simulator-header h2 {
        font-size: 1.5em;
    }
    
    .deck-options {
        flex-direction: column;
        align-items: center;
    }
    
    .oracles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .hand-area {
        gap: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}