/* Game specific styles for Solitaire */

:root {
    --primary-color: #FF9800;
    --primary-hover: #F57C00;
    --text-main: #333;
    --bg-card: #FFFFFF;
    --felt-green: #2E7D32;
    --felt-border: #1B5E20;
    --card-width: 60px;
    --card-height: 84px;
    --card-gap: 10px;
}

/* Response to screen width changes */
@media (min-width: 600px) {
    :root {
        --card-width: 80px;
        --card-height: 112px;
        --card-gap: 15px;
    }
}

.game-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    padding: 20px 0;
}

.game-container h1 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.game-description {
    margin-bottom: 3rem;
    color: #555;
    font-size: 1.1rem;
}

.game-area-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    margin-bottom: 2rem;
    user-select: none;
    touch-action: none;
    /* Prevent scroll while dragging */
}

/* Prevent scroll only inside game board when using touch actions */
.game-board {
    background-color: var(--felt-green);
    border: 8px solid var(--felt-border);
    border-radius: 12px;
    padding: 10px;
    width: 100%;
    min-height: 500px;
    position: relative;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

.top-row {
    display: flex;
    justify-content: space-between;
    /* distribute nicely */
    margin-bottom: 20px;
    padding: 0 5px;
}

/* Slots */
.stock-pile,
.waste-pile,
.foundation,
.tableau {
    width: var(--card-width);
    height: var(--card-height);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    position: relative;
}

.stock-pile {
    cursor: pointer;
}

/* For tableau, it just holds the base position. Cards are absolute mostly or stacked. */
/* Actually, for simple HTML stacking, tableau can be a container that stacks visually. */
.tableau {
    height: auto;
    min-height: var(--card-height);
    border: none;
    /* No border for whole column usually, just top slot marker? */
    background: transparent;
}

/* But we need a placeholder if empty. */
.tableau::before {
    content: '';
    display: block;
    width: var(--card-width);
    height: var(--card-height);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    position: absolute;
    top: 0;
    left: 0;
}

.spacer {
    flex-grow: 1;
    /* Push foundations right */
    max-width: 20px;
}

.tableau-row {
    display: flex;
    justify-content: space-between;
    padding: 0 5px;
}

/* Cards */
.card {
    width: var(--card-width);
    height: var(--card-height);
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 0;
    left: 0;
    font-family: Arial, sans-serif;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    box-sizing: border-box;
    cursor: grab;
    z-index: 10;
}

.card:active {
    cursor: grabbing;
}

/* Tableau Cards cascading */
/* We will handle positions via JS or `top` percentages */

.card.back {
    background: repeating-linear-gradient(45deg,
            #1565C0,
            #1565C0 10px,
            #1976D2 10px,
            #1976D2 20px);
    border: 2px solid #fff;
    cursor: default;
    /* Back cards not draggable usually */
}

/* Suits */
.red {
    color: #E53935;
}

.black {
    color: #333;
}

.card-top,
.card-center,
.card-bottom {
    pointer-events: none;
    /* Let clicks pass to card */
}

.card-top {
    font-size: 0.8rem;
    text-align: left;
}

.card-bottom {
    font-size: 0.8rem;
    text-align: right;
    transform: rotate(180deg);
}

.card-center {
    font-size: 1.5rem;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Animations */
.card {
    transition: transform 0.1s;
}

.card.dragging {
    z-index: 1000 !important;
    transition: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

/* Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
}

.hidden {
    display: none;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--primary-shadow);
}

.primary-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* Instructions */
.instructions {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-align: left;
    margin: 3rem auto 5rem;
    color: #444;
    line-height: 1.8;
}

.instructions h3 {
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
}