/* Game specific styles for FreeCell */

:root {
    --primary-color: #FF9800;
    --primary-hover: #F57C00;
    --text-main: #333;
    --bg-card: #FFFFFF;
    --felt-green: #2E7D32;
    --felt-border: #1B5E20;

    /* Responsive card sizing */
    --card-width: 40px;
    --card-height: 57px;
    --card-gap: 4px;
}

@media (min-width: 500px) {
    :root {
        --card-width: 50px;
        --card-height: 70px;
    }
}

@media (min-width: 700px) {
    :root {
        --card-width: 70px;
        --card-height: 100px;
        --card-gap: 10px;
    }
}

.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-controls {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.game-area-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    margin-bottom: 2rem;
    user-select: none;
    -webkit-user-select: none;
}

.game-board {
    background-color: var(--felt-green);
    border: 8px solid var(--felt-border);
    border-radius: 12px;
    padding: 10px;
    width: 100%;
    min-height: 600px;
    position: relative;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

.header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px 10px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    background: #333;
    /* Dark strip for stats */
    border-radius: 8px 8px 0 0;
    margin-bottom: -5px;
    /* Merge visually */
    position: relative;
    z-index: 10;
}

/* Top Row */
.top-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-top: 10px;
}

.cells-group {
    display: flex;
    gap: 5px;
}

.freecell,
.foundation {
    width: var(--card-width);
    height: var(--card-height);
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    position: relative;
}

.spacer {
    flex-grow: 1;
}

/* Tableau */
.tableau-row {
    display: flex;
    justify-content: space-between;
    height: 100%;
    padding: 0 5px;
}

.tableau {
    width: var(--card-width);
    position: relative;
}

/* 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;
    left: 0;
    font-family: Arial, sans-serif;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2px;
    box-sizing: border-box;
    cursor: grab;
    z-index: 10;
    font-size: 12px;
}

@media (min-width: 700px) {
    .card {
        padding: 5px;
        font-size: 16px;
    }
}

.red {
    color: #E53935;
}

.black {
    color: #333;
}

.card-top,
.card-center,
.card-bottom {
    pointer-events: none;
}

.card-top {
    text-align: left;
    line-height: 1;
}

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

/* 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;
}

/* Buttons */
.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;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
}

/* 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;
}

.instructions h3:first-child {
    margin-top: 0.5rem;
}