:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --accent: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(56, 189, 248, 0.3);
}

.lead {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
    border-color: rgba(56, 189, 248, 0.3);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255,255,255,0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.card:hover::before {
    opacity: 1;
}

.icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}

.title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1;
}

.tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.play-btn {
    margin-top: 1.5rem;
    background: linear-gradient(to right, #3b82f6, #2563eb);
    color: white;
    text-align: center;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    width: 100%;
    box-sizing: border-box;
    text-decoration: none; /* Just to be safe */
    display: block; /* ensure block for width */
}

.play-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 20px var(--primary-glow);
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Game canvas generic styles */
canvas {
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    background: #111;
    display: block;
    margin: 20px auto;
}

/* Back button */
.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-main);
}
