/* === Solitaire Styles === */

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    min-height: calc(100vh - var(--nav-height));
    padding-top: calc(var(--nav-height) + var(--space-4));
    padding-bottom: var(--space-4);
    position: relative;
}

/* ── Top Bar ── */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 900px;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.game-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
}

.top-bar__right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
}

.stat-pill__value {
    font-family: var(--font-mono);
    font-weight: var(--weight-semibold);
    color: var(--accent-cyan);
}

.stat-pill__label {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.btn--sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

/* ── Board ── */
.solitaire-board {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.top-row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
}

.stock-waste {
    display: flex;
    gap: var(--space-3);
}

.foundations {
    display: flex;
    gap: var(--space-3);
}

/* ── Card Slot ── */
.card-slot {
    width: 100px;
    min-height: 140px;
    border-radius: var(--radius-lg);
    border: 2px dashed rgba(255, 255, 255, 0.08);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-label {
    color: var(--text-muted);
    font-size: var(--text-2xl);
    opacity: 0.3;
    pointer-events: none;
    user-select: none;
}

.foundation {
    border-color: rgba(99, 102, 241, 0.15);
}

/* ── Tableau ── */
.tableau {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

.tableau-col {
    min-height: 300px;
    flex-direction: column;
    align-items: stretch;
    border: 2px dashed rgba(255, 255, 255, 0.05);
}

/* ── Cards ── */
.card {
    width: 100px;
    height: 140px;
    border-radius: var(--radius-md);
    position: absolute;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-3px);
    z-index: 100 !important;
}

.card--selected {
    box-shadow: 0 0 0 3px var(--accent-primary-bright), var(--shadow-glow-primary) !important;
    transform: translateY(-5px);
    z-index: 200 !important;
}

.card--face-up {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: var(--shadow-sm);
}

.card--face-down {
    background: linear-gradient(135deg, #1a1a5e 0%, #2d1b69 50%, #1a1a5e 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-sm);
    cursor: default;
}

.card--face-down::after {
    content: '♠♥♦♣';
    position: absolute;
    inset: 8px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    color: rgba(99, 102, 241, 0.3);
    letter-spacing: 3px;
}

/* Card content */
.card__rank {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 15px;
    font-weight: var(--weight-bold);
    line-height: 1;
}

.card__rank-br {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 15px;
    font-weight: var(--weight-bold);
    line-height: 1;
    transform: rotate(180deg);
}

.card__suit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    line-height: 1;
}

.card--red {
    color: #dc2626;
}

.card--black {
    color: #1a1a2e;
}

/* Stock pile */
.stock {
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.stock:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.stock--empty {
    border-style: dashed;
}

.stock--has-cards {
    border-style: solid;
    border-color: rgba(99, 102, 241, 0.2);
}

/* ── Win Overlay ── */
.win-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.win-overlay--visible {
    display: flex;
}

.win-card {
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-12) var(--space-10);
    text-align: center;
    max-width: 400px;
}

.win-card h2 {
    margin-bottom: var(--space-3);
}

.win-card p {
    margin-bottom: var(--space-6);
}

/* ── Responsive ── */
@media (max-width: 900px) {

    .card-slot,
    .card {
        width: calc((100vw - 80px) / 7 - 8px);
        height: calc(((100vw - 80px) / 7 - 8px) * 1.4);
        min-height: unset;
    }

    .card__rank,
    .card__rank-br {
        font-size: 11px;
    }

    .card__suit-center {
        font-size: 24px;
    }

    .slot-label {
        font-size: var(--text-lg);
    }
}

@media (max-width: 600px) {
    .top-bar {
        justify-content: center;
        text-align: center;
    }

    .top-bar__right {
        justify-content: center;
    }

    .solitaire-board {
        gap: var(--space-2);
    }

    .top-row,
    .foundations,
    .stock-waste,
    .tableau {
        gap: var(--space-1);
    }

    .card-slot,
    .card {
        width: calc((100vw - 40px) / 7 - 4px);
        height: calc(((100vw - 40px) / 7 - 4px) * 1.4);
        border-radius: var(--radius-sm);
    }

    .card--face-down::after {
        font-size: 8px;
        inset: 3px;
    }
}