/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    user-select: none;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.game-header {
    text-align: center;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.game-header h1 {
    font-size: 2.5rem;
    color: #4a5568;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

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

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d3748;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Game area */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.card-pile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    width: 100%;
    justify-content: center;
}

.card-pile {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 7/10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.card-pile:active {
    transform: scale(0.98);
}

.placeholder-card {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    border: 3px dashed #cbd5e0;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.placeholder-card:hover {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.02);
}

.placeholder-text {
    text-align: center;
    color: #666;
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.placeholder-text p {
    font-size: 1.3rem;
    font-weight: 500;
}

.card {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center center;
    cursor: pointer;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.card.entering {
    transform: scale(0.5) translateY(-20px) rotate(var(--start-rotation, 0deg));
    opacity: 0;
}

.card.entered {
    transform: scale(1) translateY(0px) rotate(var(--final-rotation, 0deg));
    opacity: 1;
}



/* Stack effect for multiple cards */
.card:nth-child(2) {
    transform: translate(-2px, -2px) scale(0.98);
    z-index: -1;
}

.card:nth-child(3) {
    transform: translate(-4px, -4px) scale(0.96);
    z-index: -2;
}

.bottom-controls {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.reset-button {
    padding: 15px 30px;
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
}

.reset-button:active {
    transform: translateY(0);
}

.button-icon {
    font-size: 1.3rem;
}

/* Game complete modal */
.game-complete {
    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;
    backdrop-filter: blur(5px);
}

.game-complete.hidden {
    display: none;
}

.complete-content {
    background: white;
    padding: 40px;
    border-radius: 25px;
    text-align: center;
    max-width: 350px;
    margin: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.5s ease-out;
}

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

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.preload-indicator {
    font-size: 0.8em;
    color: #667eea;
}

.complete-content h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.complete-content p {
    margin-bottom: 15px;
    color: #4a5568;
    font-size: 1.1rem;
    line-height: 1.6;
}

.play-again-button {
    padding: 15px 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.play-again-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .card-pile {
        max-width: 450px;
    }
    
    .stats {
        gap: 15px;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .reset-button {
        min-width: 120px;
        padding: 12px 25px;
        font-size: 1.1rem;
    }
    
    .complete-content {
        padding: 30px 25px;
        margin: 15px;
    }
    
    .complete-content h2 {
        font-size: 1.6rem;
    }
    
    .placeholder-text p {
        font-size: 1.2rem;
    }
    
    .card-icon {
        font-size: 3.5rem;
    }
}

@media (max-width: 480px) {
    .card-pile {
        max-width: 350px;
    }
    
    .reset-button {
        width: 100%;
        max-width: 200px;
    }
    
    .placeholder-text p {
        font-size: 1.1rem;
    }
    
    .card-icon {
        font-size: 3rem;
        margin-bottom: 10px;
    }
}

@media (max-width: 320px) {
    .card-pile {
        max-width: 280px;
    }
} 