* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;
    --accent2: #f5576c;
    --dark: #0a0a15;
    --dark2: #1a1a2e;
    --dark3: #16213e;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Étoiles animées */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.main-header {
    text-align: center;
    margin-bottom: 60px;
}

.glitch {
    font-size: 4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    position: relative;
    animation: glitchAnim 5s infinite;
}

@keyframes glitchAnim {
    0%, 96%, 100% { opacity: 1; }
    97% { opacity: 0.8; }
    98% { opacity: 1; }
    99% { opacity: 0.9; }
}

.subtitle {
    font-size: 1.2rem;
    color: #aaa;
    letter-spacing: 2px;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* Cards */
.card {
    background: linear-gradient(135deg, var(--dark2) 0%, var(--dark3) 100%);
    border-radius: 20px;
    padding: 40px 30px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    text-align: center;
}

.card h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-align: center;
}

.card p {
    color: #aaa;
    text-align: center;
    margin-bottom: 20px;
}

.card-tag {
    display: inline-block;
    padding: 6px 15px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 30px;
    color: #666;
    font-size: 0.9rem;
}

/* Navigation commune */
.nav-bar {
    padding: 20px;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.back-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Game container */
.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Unified Game Buttons */
.game-btn {
    padding: 15px 35px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin: 5px;
    position: relative;
    overflow: hidden;
}

.game-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.game-btn:hover::before {
    width: 300px;
    height: 300px;
}

.game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.game-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.game-btn.start-btn {
    background: linear-gradient(135deg, #00f260, #0575e6);
}

.game-btn.restart-btn {
    background: linear-gradient(135deg, var(--accent2), #fa709a);
}

.game-btn.stop-btn {
    background: linear-gradient(135deg, #f5576c, #c0392b);
}

.game-btn.pause-btn {
    background: linear-gradient(135deg, var(--accent), #f093fb);
}

.game-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.game-btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Action buttons (legacy support) */
.action-btn {
    padding: 15px 35px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin: 5px;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

/* Fullscreen Button */
.fullscreen-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
    z-index: 9999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.7);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
    .glitch {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .nav-bar {
        flex-direction: column;
        gap: 10px;
    }
}
