/* Basic body and game board styling */
body {
    background-color: #0a632a; /* Dark green felt color */
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column; /* Changed to column for footer */
    justify-content: space-between; /* Pushes footer down */
    align-items: center;
    padding: 20px;
    min-height: 100vh;
    box-sizing: border-box;
    margin: 0;
}

.game-board {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 20px;
    width: 100%;
    max-width: 1000px;
}

/* Top area layout for stock, waste, and foundation */
.top-area {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.stock-waste-container, .foundation-piles {
    display: flex;
    gap: 10px;
}

/* Styling for all card piles */
.pile {
    width: 100px;
    height: 140px;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    position: relative;
}

/* Specific styling for stock pile to indicate it can be clicked */
.stock::before {
    content: '⟳';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 50px;
    color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.4);
}

/* Tableau layout */
.tableau-piles {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    width: 100%;
}

.tableau {
    height: auto; /* Allow tableau to grow downwards */
    min-height: 140px;
}

/* Card styling */
.card {
    width: 100px;
    height: 140px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: absolute;
    top: 0;
    left: 0;
    user-select: none; /* Prevents text selection on drag */
    background-size: cover;
}

.card img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    pointer-events: none; /* Clicks go through the image to the parent div */
}

/* Overlapping cards in the tableau */
.tableau .card {
    position: relative;
    margin-top: -115px; /* Overlap face-down cards */
}

.tableau .card:first-child {
    margin-top: 0; /* No negative margin for the first card */
}

.tableau .card.face-up {
    margin-top: -95px; /* Less overlap for face-up cards */
}

.tableau .card.face-up:first-child {
    margin-top: 0;
}

/* Dragging styles */
.dragging {
    opacity: 0.5;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    transform: rotate(3deg);
}

/* Win Message Overlay */
.hidden {
    display: none !important;
}

#win-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.win-message-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#restart-button {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    background-color: #0a632a;
    color: white;
    border-radius: 5px;
}

/* Footer Styling */
footer {
    width: 100%;
    text-align: center;
    padding: 20px 0 10px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

footer p {
    margin: 5px 0;
}

footer a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    text-decoration: underline;
}
