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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ff1493 0%, #ff4500 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    text-align: center;
    max-width: 1200px;
    width: 100%;
}

.game-title {
    font-size: 48px;
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #ff4500, 0 0 40px #ff1493;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(255, 20, 147, 0.5);
    border: 2px solid #ff1493;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    font-size: 14px;
    color: #ff1493;
    font-weight: 600;
    text-shadow: 0 0 5px #ff1493;
}

.info-value {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 10px #ff4500;
}

.game-board {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 2px solid #ff4500;
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.4);
}

.top-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.stock-waste {
    display: flex;
    gap: 20px;
}

.foundations {
    display: flex;
    gap: 20px;
}

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

.card-pile {
    width: 100px;
    min-height: 140px;
    position: relative;
}

#waste {
    width: 160px; /* Wider to show 3 cards */
}

.tableau-pile {
    min-height: 400px;
}

.card-placeholder {
    width: 100px;
    height: 140px;
    border: 3px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: bold;
}

.card {
    width: 100px;
    height: 140px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    position: absolute;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    display: flex;
    flex-direction: column;
    padding: 8px;
}

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

.card.face-down {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    cursor: default;
}

.card.face-down:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card.face-down::before {
    content: '🂠';
    font-size: 80px;
    color: rgba(255, 255, 255, 0.2);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.card.dragging {
    opacity: 0.5;
    z-index: 1000;
}

.card.selected {
    border: 3px solid #fbbf24;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

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

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

.card.red .card-rank,
.card.red .card-suit {
    color: #dc2626;
}

.card.black .card-rank,
.card.black .card-suit {
    color: #000;
}

.card-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.btn {
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid #ff1493;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 20, 147, 0.6), 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 69, 0, 0.8), 0 6px 15px rgba(0, 0, 0, 0.4);
    border-color: #ff4500;
}

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

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

.btn:not(.btn-secondary) {
    background: linear-gradient(135deg, #ff1493 0%, #ff4500 100%);
    color: white;
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-color: white;
}

.message {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    min-height: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    max-width: 400px;
}

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

.modal-content p {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.final-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.stat {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background: #f3f4f6;
    border-radius: 10px;
}

.stat-label {
    font-size: 18px;
    color: #666;
    font-weight: 600;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #0f4c3a;
}

/* Responsive */
@media (max-width: 1024px) {
    .game-title {
        font-size: 36px;
    }
    
    .card-pile {
        width: 80px;
    }
    
    .card {
        width: 80px;
        height: 112px;
    }
    
    .card-placeholder {
        width: 80px;
        height: 112px;
        font-size: 24px;
    }
    
    .top-row {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .tableau {
        gap: 10px;
    }
}

