/* BOARD PRINCIPAL */
.solitaire-board {
    display: grid;
    grid-template-areas:
        "foundations stock"
        "tableau tableau";
    grid-template-columns: auto 120px;
    gap: 20px;
    margin: 20px auto;
    max-width: 800px;      /* largeur max */
    width: 100%;
}

/* Fondations */
.foundations {
    grid-area: foundations;
    display: flex;
    gap: 10px;
}

.foundation {
    width: 60px;
    height: 120px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 5px;
    position: relative;
}

/* Stock / Waste */
.stock-waste {
    grid-area: stock;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stock, .waste {
    width: 60px;
    height: 90px;
    border-radius: 5px;
    position: relative;
}

/* Stock - face cachée */
.stock .card {
    background-color: #333;
    color: #fff;
    font-size: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    cursor: pointer;
}

/* Waste - carte visible */
.waste .card {
    background-color: #fff;
    color: #000;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 90px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* Tableau 7 colonnes */
.tableau {
    grid-area: tableau;
    display: flex;
    gap: 20px;
    max-height: 500px;   /* hauteur max */
    overflow-y: auto;
    align-items: flex-start;
    padding-bottom: 10px;
	width: 95%;
}

.pile {
    position: relative;
    width: 60px;
    min-height: 200px;
}

/* Carte dans pile */
.pile .card {
    position: absolute;
    width: 60px;
    height: 90px;
    border-radius: 8px;
    background-color: #FFF;
    color: #000;
    font-weight: bold;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: transform 0.1s ease;
}

.pile .card:active {
    cursor: grabbing;
    transform: scale(1.05);
}

/* Fondation - cartes empilées */
.foundation .card {
    width: 60px;
    height: 90px;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 24px;
    background-color: #fff;
    color: #000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    z-index: 1;
}

.foundation .card.red {
    color: red;
}

/* Hover */
.foundation .card:hover,
.pile .card:hover {
    transform: none;
}

/* Messages */
.poker-result-ok,
.poker-result-no {
    display: none;
    padding: 10px;
    margin-top: 10px;
    border-radius: 5px;
    color: #fff;
}

.poker-result-ok { background-color: #2ecc71; }
.poker-result-no { background-color: #e74c3c; }

/* Boutons */
.btn-game {
    background-color: #1E90FF;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 15px;
    font-size: 16px;
}

.btn-game:hover { background-color: #1C86EE; }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 600px) {
    .solitaire-board {
        grid-template-areas:
            "foundations stock"
            "tableau tableau";
        grid-template-columns: 1fr 80px; /* réduit la colonne stock */
        gap: 10px;
        margin: 10px;
    }

    .tableau {
        gap: 10px;
        overflow-x: auto;   /* permet de faire défiler horizontalement */
        padding-bottom: 10px;
    }

    .pile, .foundation, .stock, .waste {
        width: 40px;        /* réduit la largeur des cartes */
        height: 60px;       /* réduit la hauteur */
    }

    .pile .card, .foundation .card, .waste .card, .stock .card {
        width: 40px;
        height: 60px;
        font-size: 14px;    /* adapte le texte à la taille de la carte */
    }

    .pile .card {
        top: calc(var(--card-index, 0) * 15px); /* décalage vertical plus petit */
    }

    .stock .card {
        font-size: 24px;
    }

    .foundation .card {
        font-size: 16px;
    }
}

