:root {
    --bg-dark: #0f172a;
    --card-back: #1e293b;
    --accent: #3b82f6;
}

body {
    /* Stylish Gradient Background */
    background-color: #0f172a;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0, transparent 50%), 
        radial-gradient(at 50% 0%, rgba(16, 185, 129, 0.1) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.15) 0, transparent 50%);
    background-attachment: fixed;
    
    color: white;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    margin: 0;
}

footer .version{
    position: absolute;
    bottom: 0;
    left: 0;
    font-size: 13rem;
    color: #88888811;
    font-family: sans-serif;
    font-weight: 700;
    z-index: -1;
}

/* 3D Card Flip CSS */
.memory-game {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    perspective: 1000px;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.memory-card {
    position: relative;
    aspect-ratio: 3/4;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    cursor: pointer;
}

.memory-card:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

.memory-card.flip {
    transform: rotateY(180deg);
}

.front-face,
.back-face {
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 10px;
    border-radius: 12px;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    user-select: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.front-face {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    transform: rotateY(180deg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-face {
    background: var(--card-back);
    border: 2px solid #334155;
    position: relative;
    overflow: hidden;
}

/* Back Face Shine Animation */
.back-face::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(45deg, transparent 45%, rgba(59, 130, 246, 0.1) 50%, transparent 55%);
    background-size: 200% 200%;
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { background-position: -100% -100%; }
    100% { background-position: 100% 100%; }
}

.back-face::after {
    content: '?';
    color: #475569;
    font-weight: bold;
    font-size: 1.5rem;
    z-index: 1;
}

/* Difficulty Selector */
.difficulty-btn.active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* Match Glow */
.match-glow {
    animation: glow 0.5s ease-in-out forwards;
}

@keyframes glow {
    0% { box-shadow: 0 0 0px var(--accent); transform: rotateY(180deg) scale(1); }
    50% { box-shadow: 0 0 30px var(--accent); transform: rotateY(180deg) scale(1.05); }
    100% { box-shadow: 0 0 10px var(--accent); transform: rotateY(180deg) scale(1); }
}

/* Star Rating System */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
}
.star-rating input { display: none; }
.star-rating label {
    font-size: 2rem;
    color: #334155;
    cursor: pointer;
    transition: color 0.2s;
}
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #fbbf24;
}

/* Responsive Overrides */
@media (max-width: 480px) {
    .memory-game {
        gap: 8px;
        padding: 10px;
        margin: 0 10px;
    }

    .front-face, .back-face {
        font-size: 1.5rem;
        padding: 5px;
    }

    footer .version{
        font-size: 6rem;
        color: #81818136;
    }
}