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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #1b5e20 100%);
    min-height: 100vh;
    padding: 20px;
    color: #fff;
}

.game-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.game-header {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.game-title {
    text-align: center;
    font-size: 2rem;
    color: #4caf50;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 15px;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #81c784;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

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

.btn-control {
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid #4caf50;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-control:hover {
    background: rgba(76, 175, 80, 0.4);
    transform: translateY(-2px);
}

/* Game Board */
.game-board {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 30px;
    min-height: 600px;
}

.foundation-area {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 30px;
}

.foundation {
    width: 100px;
    height: 140px;
    border: 3px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s;
}

.foundation:hover {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.foundation-label {
    font-size: 3rem;
    opacity: 0.3;
}

.foundation.has-cards .foundation-label {
    display: none;
}

.stock-area {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.stock-pile,
.waste-pile {
    width: 100px;
    height: 140px;
    border-radius: 8px;
    position: relative;
}

.stock-pile {
    border: 3px dashed rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.stock-pile:hover {
    border-color: #4caf50;
    transform: scale(1.05);
}

.stock-pile.empty {
    cursor: pointer;
}

.stock-pile.empty::after {
    content: '↻';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
}

.card-back {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1976d2, #1565c0);
    border-radius: 8px;
    border: 2px solid #0d47a1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-back::before {
    content: '🂠';
    font-size: 4rem;
    opacity: 0.5;
}

.tableau-area {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.tableau-column {
    width: 100px;
    min-height: 140px;
    border: 3px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    position: relative;
    transition: all 0.3s;
}

.tableau-column:hover {
    border-color: rgba(76, 175, 80, 0.5);
}

.tableau-column.empty:hover {
    background: rgba(76, 175, 80, 0.1);
}

/* Cards */
.card {
    width: 100px;
    height: 140px;
    background: white;
    border-radius: 8px;
    border: 2px solid #ddd;
    position: absolute;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    user-select: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

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

.card.face-down {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    cursor: default;
}

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

.card.face-down .card-value,
.card.face-down .card-suit {
    display: none;
}

.card.red {
    color: #d32f2f;
}

.card.black {
    color: #000;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.card-suit {
    font-size: 1.5rem;
}

.card-center {
    font-size: 4rem;
    text-align: center;
    margin: auto 0;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    transform: rotate(180deg);
}

.card.hint {
    border: 3px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

/* Pile positioning */
.waste-pile .card {
    position: absolute;
}

.waste-pile .card:nth-child(1) {
    left: 0;
}

.waste-pile .card:nth-child(2) {
    left: 20px;
}

.waste-pile .card:nth-child(3) {
    left: 40px;
}

.foundation .card {
    position: absolute;
    top: 0;
    left: 0;
}

.tableau-column .card {
    left: 0;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    border: 3px solid #4caf50;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(76, 175, 80, 0.5);
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.modal-title {
    color: #4caf50;
    font-size: 2rem;
    margin-bottom: 15px;
}

.modal-message {
    color: #ccc;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.modal-stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin: 25px 0;
}

.modal-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.modal-stat-label {
    color: #81c784;
    font-size: 0.9rem;
}

.modal-stat-value {
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 2px solid #4caf50;
    color: #4caf50;
}

.btn-secondary:hover {
    border-color: #66bb6a;
    color: #66bb6a;
}

/* Mobile */
@media (max-width: 768px) {
    .game-title {
        font-size: 1.5rem;
    }
    
    .game-stats {
        gap: 20px;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .tableau-area {
        overflow-x: auto;
        padding-bottom: 20px;
    }
    
    .card,
    .foundation,
    .stock-pile,
    .waste-pile,
    .tableau-column {
        width: 80px;
        height: 112px;
    }
    
    .card-value,
    .card-suit {
        font-size: 1.2rem;
    }
    
    .card-center {
        font-size: 3rem;
    }
    
    .modal-stats {
        flex-direction: column;
        gap: 15px;
    }
}
