/*
 * Estilos para o jogo de Buraco (Canastra) simplificado. A temática usa
 * cores verdes para lembrar mesas de baralho. Elementos como monte,
 * descarte e mão são representados por cartas retangulares. Há layouts
 * responsivos para diferentes tamanhos de tela e reutilização de
 * componentes de modal para rankings e seleção de modo.
 */

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #0d4c32;
    color: #ecf0f1;
    height: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #07361f;
    color: #ecf0f1;
}

nav button, nav .home-link {
    margin-right: 8px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: #27ae60;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
}
nav button:hover, nav .home-link:hover {
    background: #1e8449;
}

#game-container {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.area {
    margin-bottom: 10px;
}

.status {
    font-size: 1rem;
    margin-bottom: 10px;
}

.stock, .discard {
    width: 70px;
    height: 100px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 0 10px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.hand {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
}

.card {
    width: 60px;
    height: 90px;
    border-radius: 6px;
    background: #fff;
    color: #000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    cursor: grab;
    user-select: none;
    font-size: 0.9rem;
}

.card.red {
    color: #e74c3c;
}
.card.selected {
    outline: 3px solid #f1c40f;
}

/* Instruções do jogador */
.instructions {
    font-size: 0.8rem;
    margin-top: 6px;
    color: #ecf0f1;
    max-width: 360px;
}

.melds {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

/* Barra de ações para o jogador */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.actions button {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: #e67e22;
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
}
.actions button:hover {
    background: #d35400;
}
.actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modais reaproveitados de outros jogos */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.modal.hidden {
    display: none;
}

.modal-content {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    text-align: center;
}
.modal-content h2 {
    margin-top: 0;
}
.modal-content button {
    margin: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: #3498db;
    color: #fff;
    cursor: pointer;
}
.modal-content button:hover {
    background: #2980b9;
}
.modal-content .close-btn {
    background: #c0392b;
}
.modal-content .close-btn:hover {
    background: #922b21;
}

#ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
}
#ranking-list li {
    padding: 4px 0;
    border-bottom: 1px solid #ccc;
}

@media (max-width: 600px) {
    .card {
        width: 50px;
        height: 75px;
        font-size: 0.8rem;
    }
    nav button, nav .home-link {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}