body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background-color: #0b0c10;
    color: #c5c6c7;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

#ui-layer {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: #66fcf1;
    text-shadow: 0 0 10px rgba(102, 252, 241, 0.5);
}

#grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    perspective: 1000px;
}

.card {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
}

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

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 3rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.card-back {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-image: linear-gradient(135deg, rgba(102, 252, 241, 0.1) 0%, rgba(31, 40, 51, 0) 100%);
}

.card-front {
    background: #1f2833;
    border: 2px solid #66fcf1;
    transform: rotateY(180deg);
    box-shadow: inset 0 0 15px rgba(102, 252, 241, 0.2);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 12, 16, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.3s;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    padding: 3rem;
    border-radius: 20px;
}

.glass-card {
    background: rgba(31, 40, 51, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(102, 252, 241, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.glass-card h1 {
    color: #45a29e;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    text-shadow: 0 0 15px rgba(69, 162, 158, 0.6);
}

.btn {
    background: #45a29e;
    color: #0b0c10;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    background: #66fcf1;
    box-shadow: 0 0 15px rgba(102, 252, 241, 0.5);
    transform: translateY(-2px);
}

footer {
    text-align: center;
    padding: 1rem;
    background: rgba(31, 40, 51, 0.8);
    color: #c5c6c7;
    margin-top: auto;
}

@media (max-width: 600px) {
    #grid {
        gap: 0.5rem;
    }
    .card-face {
        font-size: 2rem;
    }
    #ui-layer {
        gap: 1rem;
        font-size: 1rem;
    }
}
