/* --- ESTRUCTURA GENERAL --- */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #063852;
    color: white;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* --- PANTALLA DE INICIO --- */
#splash-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, #063852, #011a27);
}

#splash-left, #splash-right {
    width: 45%;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#splash-left {
    text-align: center;
}

#splash-logo {
    max-width: 120px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(0, 169, 183, 0.5));
}

#splash-left h1 { 
    font-size: 3em; 
    color: #00a9b7; 
    margin: 0; 
    text-shadow: 0 0 8px rgba(0,0,0,0.6);
}
#splash-left .subtitle { 
    font-size: 1.2em; 
    margin: 5px 0 30px 0; 
    color: #e0e0e0; 
    text-shadow: 0 0 4px rgba(0,0,0,0.6);
}
#splash-left input {
    font-size: 1.1em; 
    padding: 10px; 
    border-radius: 6px; 
    border: 2px solid #00a9b7;
    background-color: rgba(0,0,0,0.4); 
    color: white; 
    text-align: center; 
    width: 70%;
}
#start-game-button {
    font-size: 1.2em; 
    padding: 15px 35px; 
    border-radius: 10px; 
    border: none;
    background-color: #00a9b7; 
    color: #011a27; 
    cursor: pointer; 
    margin-top: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

#start-game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.6);
    background-color: #00c4d4;
}

#splash-right .instructions {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #00a9b7;
    height: 100%;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.instructions h3 { font-size: 1.6em; color: #00a9b7; margin-top: 0; }
.instructions h4 { font-size: 1.2em; color: #00a9b7; margin-top: 20px; }
.instructions p, .instructions li { font-size: 1em; line-height: 1.6; color: #e0e0e0; }
.instructions ol { padding-left: 20px; }

.rules-link-splash {
    display: inline-block;
    margin-top: 20px;
    color: #00a9b7;
    font-weight: bold;
    text-decoration: none;
    border: 1px solid #00a9b7;
    padding: 10px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
}
.rules-link-splash:hover {
    background-color: #00a9b7;
    color: #011a27;
    transform: scale(1.05);
}

/* --- MODAL DE EJEMPLOS --- */
#example-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
}

#example-modal {
    background-color: #011a27;
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #00a9b7;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    text-align: center;
    max-width: 600px;
    position: relative;
}

#example-modal .close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2.5em;
    color: #00a9b7;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#example-modal-title {
    font-size: 1.5em;
    color: #00a9b7;
    margin-bottom: 20px;
}

#example-modal-cards {
    justify-content: center;
    min-height: 150px;
}

.example-modal-score {
    width: 100%;
    text-align: center;
    font-size: 1.2em;
    color: #00a9b7;
    font-weight: bold;
    margin-top: 20px;
}

.zaldor-message {
    color: cyan;
    font-style: italic;
}

.system-message {
    color: #a7ff89;
}

#game-container { display: none; width: 100%; height: 100%; justify-content: center; align-items: center; }
#game-board { display: flex; flex-direction: row; justify-content: space-between; width: 98%; height: 95%; padding: 15px; border: 2px solid #c9a40a; border-radius: 10px; background-color: #0e203a; background-image: url(img/formula2.png); box-sizing: border-box; }
.game-column { height: 100%; display: flex; flex-direction: column; align-items: center; padding: 0 10px; box-sizing: border-box; }
.score-container { display: flex; justify-content: space-around; width: 100%; margin-bottom: 10px; }
.score-area { width: 45%; text-align: center; }
#player-column { width: 45%; }
#table-column { width: 20%; justify-content: space-around; }
#info-column { width: 35%; }
h2 { margin: 10px 0; }
.hand { width: 100%; flex-grow: 1; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; background-color: rgba(0, 0, 0, 0.4); border-radius: 5px; border: 1px dashed #00a9b7; overflow-y: auto; padding: 10px; box-sizing: border-box; }
#quinta-area { border-color: #87ceeb; }
#deck, #discard-pile { width: 100%; }
#discard-pile { min-height: 170px; }
#discard-pile .card { pointer-events: none; }
#message-area { width: 100%; height: 250px; background-color: rgba(0, 0, 0, 0.4); border-radius: 5px; padding: 10px; box-sizing: border-box; overflow-y: auto; }
#game-controls { margin-top: 20px; width: 100%; }
.table-controls { margin-top: 20px; width: 100%; text-align: center; }
#check-quinta-button, #continue-game-button { width: 100%; padding: 15px; margin-bottom: 10px; font-size: 1.1em; cursor: pointer; border: none; border-radius: 5px; background-color: #00a9b7; color: #011a27; font-weight: bold; }
#continue-game-button { display: none; }
.opponent-quinta-title { color: #ff4d4d; text-align: center; }
button:disabled { background-color: #888; cursor: not-allowed; }
#player-score-area, #opponent-score-area { font-size: 1.2em; font-weight: bold; margin-bottom: 10px; padding: 10px; background-color: rgba(0,0,0,0.637); border-radius: 5px; text-align: center; color: #c9a40a; }
#opponent-score-area { margin-bottom: 20px; }
.title-wrapper { display: flex; justify-content: center; align-items: center; gap: 10px; }
#rules-link { display: inline-block; color: #c9a40a; border: 1px solid #c9a40a; border-radius: 50%; width: 20px; height: 20px; line-height: 20px; text-align: center; text-decoration: none; font-weight: bold; }
#rules-link:hover { background-color: #c9a40a; color: #112c19; }
.card { height: 96px; width: auto; margin: 5px; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.637); cursor: pointer; }
#scoring-rules { margin-top: auto; padding: 10px; background-color: rgba(0,0,0,0.637); border-radius: 5px; border-top: 1px solid #c9a40a; width: 100%; box-sizing: border-box; }
#scoring-rules h4 { margin: 0 0 10px 0; text-align: center; }
#scoring-rules ul { list-style: none; padding: 0; margin: 0 0 10px 0; }
#scoring-rules li { margin-bottom: 5px; }
#scoring-rules p { font-size: 0.8em; text-align: center; margin: 0; }

@media (max-width: 768px) {
    /* --- PANTALLA DE INICIO RESPONSIVE --- */
    #splash-screen {
        flex-direction: column;
        height: auto;
        padding: 20px 0;
    }

    #splash-left, #splash-right {
        width: 90%;
        padding: 20px;
        text-align: center;
    }

    #splash-right {
        margin-top: 20px;
    }

    /* --- ESTRUCTURA GENERAL RESPONSIVE --- */
    #game-board {
        flex-direction: column;
        height: auto;
        min-height: 100vh; /* Ocupar al menos toda la altura de la pantalla */
        padding: 10px;
    }

    .game-column {
        width: 100%;
        margin-bottom: 15px;
    }

    #player-column { order: 3; }
    #table-column { order: 2; }
    #info-column { order: 1; }

    /* --- AJUSTES DE TAMAÑO PARA MÓVIL --- */
    .hand {
        min-height: 120px; /* Menos altura para las manos */
    }

    #message-area {
        height: 150px; /* Menos altura para el área de mensajes */
    }

    .card {
        height: 80px; /* Cartas más pequeñas */
    }

    #player-score-area, #opponent-score-area {
        font-size: 1em; /* Letra de puntaje más pequeña */
        padding: 5px;
    }

    h2 {
        font-size: 1.2em;
    }
}
