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

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background: linear-gradient(135deg, #1a472a 0%, #0d2818 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.home-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(196, 30, 58, 0.9);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 1000;
    transition: all 0.3s;
}

.home-button:hover {
    background: rgba(160, 23, 41, 0.9);
    transform: scale(1.05);
}

.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.snowflake {
    position: absolute;
    top: -10%;
    color: #fff;
    font-size: 1.5em;
    opacity: 0.8;
    animation: fall linear infinite;
}

.snowflake:nth-child(1) { left: 15%; animation-duration: 10s; animation-delay: 0s; }
.snowflake:nth-child(2) { left: 30%; animation-duration: 12s; animation-delay: 2s; }
.snowflake:nth-child(3) { left: 45%; animation-duration: 9s; animation-delay: 4s; }
.snowflake:nth-child(4) { left: 60%; animation-duration: 11s; animation-delay: 1s; }
.snowflake:nth-child(5) { left: 75%; animation-duration: 13s; animation-delay: 3s; }
.snowflake:nth-child(6) { left: 90%; animation-duration: 10s; animation-delay: 5s; }

@keyframes fall {
    0% { top: -10%; opacity: 0.8; }
    100% { top: 110%; opacity: 0.3; }
}

.container {
    max-width: 700px;
    width: 100%;
    position: relative;
    z-index: 10;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

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

.stat-box {
    background: rgba(187, 173, 160, 0.5);
    padding: 10px 20px;
    border-radius: 8px;
    min-width: 80px;
}

.stat-label {
    font-size: 0.8em;
    text-transform: uppercase;
    color: #eee4da;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
}

.button {
    background: #c41e3a;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.button:hover {
    background: #a01729;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    perspective: 1000px;
}

.card {
    aspect-ratio: 1;
    background: rgba(196, 30, 58, 0.8);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.card:hover {
    transform: scale(1.05);
}

.card.flipped {
    transform: rotateY(180deg);
}

.card.matched {
    opacity: 0.6;
    cursor: default;
}

.card .front,
.card .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    border-radius: 12px;
}

.card .front {
    background: rgba(196, 30, 58, 0.8);
    color: white;
}

.card .back {
    background: rgba(255, 255, 255, 0.95);
    transform: rotateY(180deg);
}

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

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

.win-content {
    background: linear-gradient(135deg, #c41e3a 0%, #8b1528 100%);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s;
}

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

.win-content h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.win-content p {
    font-size: 1.3em;
    margin-bottom: 15px;
}

.hidden {
    display: none !important;
}

@media (max-width: 600px) {
    h1 { font-size: 2em; }
    .game-board { gap: 10px; }
    .card .front, .card .back { font-size: 2em; }
}
