:root {
    --bg-color: #0f172a;
    --card-back: #1e293b;
    --accent: #38bdf8; /* Cyan for tech feel */
    --text-color: #e2e8f0;
    --success: #22c55e;
    --fail: #ef4444;
}

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

body {
    background-color: var(--bg-color);
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header h1 {
    font-family: 'Orbitron', sans-serif;
    text-align: center;
    font-size: 2rem;
}

.highlight { color: var(--accent); }

/* Stats Panel */
.stats-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-back);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #334155;
}

.stat-box { display: flex; flex-direction: column; align-items: center; }
.value { font-family: 'Orbitron', sans-serif; font-size: 1.2rem; color: var(--accent); }

button {
    background: var(--accent);
    color: var(--bg-color);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

button:hover { transform: scale(1.05); }

/* Responsive Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns on desktop */
    gap: 15px;
    perspective: 1000px; /* Essential for 3D flip */
}

/* Mobile Responsiveness */
@media (max-width: 500px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on mobile */
        gap: 10px;
    }
}

/* Card Styles */
.card {
    background-color: transparent;
    aspect-ratio: 1 / 1; /* Keeps cards square */
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

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

.front-face, .back-face {
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden; /* Hides the back when flipped */
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    padding: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.front-face {
    background: var(--accent);
    color: var(--bg-color);
    transform: rotateY(180deg); /* Text is hidden initially */
    border: 2px solid var(--accent);
}

.back-face {
    background: var(--card-back);
    border: 2px solid #334155;
    color: #64748b;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
}

/* Modal */
.modal {
    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: 10;
}
.hidden { display: none; }
.modal-content {
    background: var(--card-back);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid var(--accent);
}
/* ... existing styles ... */

/* Footer Styles */
footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #334155;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.dev-name {
    color: var(--accent);
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

.sub-text {
    font-size: 0.8rem;
    margin-bottom: 10px;
    opacity: 0.8;
}

.ai-badge {
    display: inline-block;
    background: rgba(56, 189, 248, 0.1); /* Subtle Cyan bg */
    border: 1px solid var(--accent);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 5px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

/* Ensure footer doesn't get squashed on small screens */
@media (max-height: 700px) {
    body {
        height: auto;
        padding-bottom: 20px;
    }
}