* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 1rem;
}

.container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
    transition: all 0.3s ease;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    background: linear-gradient(45deg, #fff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 0.5rem;
}

.stats > div {
    text-align: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    transition: transform 0.2s ease;
}

.stats > div:hover {
    transform: translateY(-2px);
}

.game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.game-controls button {
    padding: 0.5rem 1.5rem;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    background: linear-gradient(45deg, #ff9800, #f57c00);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 1;
    transform: scale(1);
}

.game-controls button[style*="display: none"] {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.game-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.game-controls button:active {
    transform: translateY(0);
}

#endButton {
    background: linear-gradient(45deg, #f44336, #d32f2f);
}

.game-board {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 2rem;
    perspective: 1000px;
}

.card {
    aspect-ratio: 1;
    background-color: #fff;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(1.5rem, 4vw, 2rem);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: scale(1.02);
}

.card.flipped {
    transform: rotateY(180deg);
    background-color: #e0e0e0;
}

.card.matched {
    background-color: #4CAF50;
    cursor: default;
    animation: matched 0.5s ease;
}

@keyframes matched {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.card-front {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
    font-weight: bold;
}

.card-back {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    transform: rotateY(180deg);
    color: white;
}

#startButton {
    display: block;
    margin: 0 auto;
    padding: 1rem 2rem;
    font-size: clamp(1rem, 3vw, 1.2rem);
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#startButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#startButton:active {
    transform: translateY(0);
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    .game-board {
        gap: 0.25rem;
    }
    
    .card {
        font-size: 1.5rem;
    }
}

@media (max-width: 400px) {
    .stats {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0.5rem;
    }
}

.game-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1.2rem;
    z-index: 1000;
    animation: slideDown 0.3s ease, fadeOut 0.3s ease 1.7s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
    }
    to {
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
} 