* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e7245 0%, #2a986a 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.game-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.game-header h1 {
    font-size: 28px;
    font-weight: 600;
}

/* Difficulty Selector */
.difficulty-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.difficulty-label {
    font-size: 14px;
    opacity: 0.8;
}

.difficulty-buttons {
    display: flex;
    gap: 5px;
}

.btn-difficulty {
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-difficulty:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.btn-difficulty.active {
    background: #4CAF50;
    border-color: #4CAF50;
}

.btn-difficulty.active:hover {
    background: #45a049;
    border-color: #45a049;
}

.game-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #4CAF50;
}

.btn-primary:hover:not(:disabled) {
    background: #45a049;
}

.btn-secondary {
    background: #2196F3;
}

.btn-secondary:hover:not(:disabled) {
    background: #1976D2;
}

.game-stats {
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
}

/* Main game board */
.game-board {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Foundations */
.foundations {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.foundation-placeholder {
    font-size: 16px;
    opacity: 0.8;
}

/* Tableau */
.tableau {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
    min-height: 600px;
}

.column {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    min-height: 120px;
    position: relative;
    padding: 5px;
    transition: all 0.3s ease;
}

.column.drag-over {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
    border-style: solid;
}

.column.drag-invalid {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
    animation: shake 0.3s;
}

.column.empty {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Cards */
.card {
    width: 100%;
    aspect-ratio: 5/7;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    position: absolute;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.card.hint-source {
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 15px #FFD700;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.card.face-down {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    cursor: default;
}

.card.face-down:hover {
    transform: none;
}

.card-content {
    width: 100%;
    height: 100%;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.card-rank {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

.card-suit {
    font-size: 24px;
    line-height: 1;
}

.card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    opacity: 0.15;
}

.card-bottom {
    align-self: flex-end;
    transform: rotate(180deg);
}

.card.red {
    color: #c62828;
}

.card.black {
    color: #000;
}

/* Card back pattern */
.card.face-down::before {
    content: '';
    position: absolute;
    inset: 10px;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.1) 10px,
            rgba(255, 255, 255, 0.1) 20px
        );
    border-radius: 4px;
}

/* Stock area */
.stock-area {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.stock {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.stock:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.stock.empty {
    opacity: 0.5;
    cursor: not-allowed;
}

.stock.empty:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
}

.stock-info {
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 18px;
    margin-bottom: 20px;
}

.win-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.win-stats p {
    font-size: 16px;
    margin: 10px 0;
}

/* Responsive design */
@media (max-width: 1200px) {
    .tableau {
        gap: 8px;
    }

    .card-rank {
        font-size: 16px;
    }

    .card-suit {
        font-size: 20px;
    }

    .card-center {
        font-size: 36px;
    }
}

@media (max-width: 900px) {
    .game-header {
        flex-direction: column;
        align-items: stretch;
    }

    .game-header h1 {
        text-align: center;
    }

    .game-controls {
        justify-content: center;
    }

    .game-stats {
        justify-content: center;
    }

    .tableau {
        gap: 5px;
    }

    .card-rank {
        font-size: 14px;
    }

    .card-suit {
        font-size: 18px;
    }

    .card-center {
        font-size: 28px;
    }
}
