* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    text-align: center;
    background: #0a0a0f;
    min-height: 100vh;
    color: #00ff41;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(0deg, transparent 24%, rgba(0, 255, 65, 0.05) 25%, rgba(0, 255, 65, 0.05) 26%, transparent 27%, transparent 74%, rgba(0, 255, 65, 0.05) 75%, rgba(0, 255, 65, 0.05) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(0, 255, 65, 0.05) 25%, rgba(0, 255, 65, 0.05) 26%, transparent 27%, transparent 74%, rgba(0, 255, 65, 0.05) 75%, rgba(0, 255, 65, 0.05) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
    animation: scanlines 4s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: 30px;
    font-weight: 900;
    color: #00ff41;
    text-shadow: 
        0 0 5px #00ff41,
        0 0 10px #00ff41,
        0 0 20px #00ff41,
        0 0 40px #00ff41;
    animation: neonFlicker 2s ease-in-out infinite alternate;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    position: relative;
}

h1::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #ff0080;
    text-shadow: 
        0 0 5px #ff0080,
        0 0 10px #ff0080;
    animation: glitch 3s infinite;
    z-index: -1;
}

@keyframes neonFlicker {
    0%, 100% { 
        text-shadow: 
            0 0 5px #00ff41,
            0 0 10px #00ff41,
            0 0 20px #00ff41,
            0 0 40px #00ff41;
    }
    50% { 
        text-shadow: 
            0 0 2px #00ff41,
            0 0 5px #00ff41,
            0 0 8px #00ff41,
            0 0 12px #00ff41;
    }
}

@keyframes glitch {
    0%, 90%, 100% { transform: translate(0, 0); opacity: 0; }
    5% { transform: translate(-2px, 0); opacity: 0.8; }
    10% { transform: translate(2px, 0); opacity: 0.8; }
    15% { transform: translate(-1px, 0); opacity: 0; }
}

#chrono {
    font-size: clamp(1.5rem, 3vw, 2.8rem);
    font-weight: 700;
    background: linear-gradient(45deg, rgba(0, 255, 65, 0.1), rgba(255, 0, 128, 0.1));
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 20px 40px;
    margin: 30px auto;
    display: inline-block;
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.5),
        inset 0 0 20px rgba(0, 255, 65, 0.1);
    position: relative;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px #00ff41;
    animation: chronoPulse 1.5s ease-in-out infinite;
}

@keyframes chronoPulse {
    0%, 100% { 
        border-color: #00ff41; 
        box-shadow: 
            0 0 20px rgba(0, 255, 65, 0.5),
            inset 0 0 20px rgba(0, 255, 65, 0.1);
    }
    50% { 
        border-color: #ff0080; 
        box-shadow: 
            0 0 30px rgba(255, 0, 128, 0.7),
            inset 0 0 30px rgba(255, 0, 128, 0.2);
    }
}

#btn, #supprimer {
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.1), rgba(0, 0, 0, 0.3));
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 16px 32px;
    font-size: 1rem;
    border-radius: 0;
    cursor: pointer;
    margin: 15px 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.1em;
    font-family: 'Courier New', monospace;
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 5px #00ff41;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

#btn::before, #supprimer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.4), transparent);
    transition: left 0.5s ease;
}

#btn:hover, #supprimer:hover {
    background: rgba(0, 255, 65, 0.2);
    border-color: #ff0080;
    color: #ff0080;
    text-shadow: 0 0 10px #ff0080;
    box-shadow: 
        0 0 25px rgba(255, 0, 128, 0.6),
        inset 0 0 10px rgba(255, 0, 128, 0.2);
    transform: translateY(-2px);
}

#btn:hover::before, #supprimer:hover::before {
    left: 100%;
}

#result {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 20px 0;
    color: #00ffff;
    text-shadow: 
        0 0 5px #00ffff,
        0 0 10px #00ffff,
        0 0 20px #00ffff;
    animation: resultGlow 2s ease-in-out infinite alternate;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@keyframes resultGlow {
    from { 
        text-shadow: 
            0 0 5px #00ffff,
            0 0 10px #00ffff,
            0 0 20px #00ffff;
    }
    to { 
        text-shadow: 
            0 0 10px #00ffff,
            0 0 20px #00ffff,
            0 0 30px #00ffff,
            0 0 40px #00ffff;
    }
}

.container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    text-align: center;
    gap: 50px;
    margin-top: 60px;
    flex-wrap: wrap;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(4, 110px);
    grid-template-rows: repeat(4, 110px);
    grid-gap: 15px;
    justify-content: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff41;
    box-shadow: 
        0 0 30px rgba(0, 255, 65, 0.3),
        inset 0 0 30px rgba(0, 255, 65, 0.1);
    position: relative;
}

#game-board::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00ff41, #ff0080, #00ffff, #ff0080, #00ff41);
    background-size: 400% 400%;
    animation: borderRotate 3s linear infinite;
    z-index: -1;
}

@keyframes borderRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#formulaire {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff0080;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
    min-width: 320px;
    box-shadow: 
        0 0 30px rgba(255, 0, 128, 0.4),
        inset 0 0 30px rgba(255, 0, 128, 0.1);
}

form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 20px;
    width: 100%;
}

form h2 {
    color: #ff0080;
    margin-bottom: 25px;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 
        0 0 5px #ff0080,
        0 0 10px #ff0080,
        0 0 20px #ff0080;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

form label {
    color: #00ffff;
    font-weight: 600;
    align-self: flex-start;
    font-size: 0.95rem;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    text-shadow: 0 0 5px #00ffff;
}

form input {
    padding: 16px 24px;
    border: 1px solid #00ffff;
    background: rgba(0, 0, 0, 0.7);
    color: #00ffff;
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.3),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
}

form input::placeholder {
    color: rgba(0, 255, 255, 0.6);
    text-transform: uppercase;
}

form input:focus {
    outline: none;
    border-color: #ff0080;
    box-shadow: 
        0 0 20px rgba(255, 0, 128, 0.5),
        inset 0 0 10px rgba(255, 0, 128, 0.2);
    color: #ff0080;
    text-shadow: 0 0 5px #ff0080;
}

form button {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(0, 0, 0, 0.3));
    border: 2px solid #00ffff;
    color: #00ffff;
    padding: 16px 32px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-top: 15px;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

form button:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ff41;
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41;
    box-shadow: 
        0 0 25px rgba(0, 255, 65, 0.6),
        inset 0 0 10px rgba(0, 255, 65, 0.2);
    transform: translateY(-2px);
}

.card {
    background: radial-gradient(circle, rgba(0, 0, 0, 0.9), rgba(0, 50, 0, 0.3));
    border: 1px solid #00ff41;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 15px rgba(0, 255, 65, 0.2),
        inset 0 0 15px rgba(0, 255, 65, 0.1);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(0, 255, 65, 0.2), transparent);
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.6s ease;
}

.card:hover {
    border-color: #ff0080;
    box-shadow: 
        0 0 25px rgba(255, 0, 128, 0.4),
        inset 0 0 25px rgba(255, 0, 128, 0.2);
    transform: scale(1.05);
}

.card:hover::before {
    transform: translateX(100%) rotate(45deg);
}

.card .card-content {
    opacity: 0;
    transition: all 0.4s ease;
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #00ffff;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff;
}

.card.flip .card-content {
    opacity: 1;
    max-width: 100%;
}

.card.matched {
    border: 2px solid #00ffff;
    box-sizing: border-box;
    cursor: default;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.3), rgba(0, 0, 0, 0.7));
    box-shadow: 
        0 0 40px rgba(0, 255, 255, 0.8),
        inset 0 0 40px rgba(0, 255, 255, 0.3);
    animation: matchedCyberPulse 1.5s ease-in-out;
}

@keyframes matchedCyberPulse {
    0% { 
        transform: scale(1); 
        box-shadow: 
            0 0 40px rgba(0, 255, 255, 0.8),
            inset 0 0 40px rgba(0, 255, 255, 0.3);
    }
    50% { 
        transform: scale(1.15); 
        box-shadow: 
            0 0 60px rgba(0, 255, 255, 1),
            inset 0 0 60px rgba(0, 255, 255, 0.5);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 
            0 0 40px rgba(0, 255, 255, 0.8),
            inset 0 0 40px rgba(0, 255, 255, 0.3);
    }
}

.card.flip {
    transform: rotateY(180deg);
    background: radial-gradient(circle, rgba(255, 0, 128, 0.3), rgba(0, 0, 0, 0.7));
    border-color: #ff0080;
    box-shadow: 
        0 0 25px rgba(255, 0, 128, 0.4),
        inset 0 0 25px rgba(255, 0, 128, 0.2);
}

.score {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ffff;
    padding: 40px;
    color: #00ffff;
    font-size: 1.3rem;
    font-weight: 600;
    min-width: 250px;
    font-family: 'Courier New', monospace;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.4),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
}

.score h2 {
    margin-bottom: 25px;
    font-weight: 700;
    color: #00ffff;
    text-shadow: 
        0 0 5px #00ffff,
        0 0 10px #00ffff,
        0 0 20px #00ffff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#tableau {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
    font-family: 'Courier New', monospace;
}

#tableau th,
#tableau td {
    border: 1px solid #00ff41;
    padding: 16px 24px;
    font-size: 1rem;
    text-align: center;
    color: #00ff41;
    background: rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#tableau thead th {
    background: rgba(0, 255, 65, 0.2);
    text-shadow: 0 0 5px #00ff41;
    border-color: #00ff41;
}

#tableau tbody tr:nth-child(even) td {
    background: rgba(0, 20, 0, 0.8);
}

#tableau tbody tr:hover td {
    background: rgba(0, 255, 65, 0.2);
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
    border-color: #00ffff;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 30px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    #game-board {
        grid-template-columns: repeat(4, 85px);
        grid-template-rows: repeat(4, 85px);
        grid-gap: 12px;
        padding: 20px;
    }
    
    #chrono {
        font-size: 1.8rem;
        padding: 15px 30px;
    }
    
    .score {
        min-width: auto;
        width: 100%;
        max-width: 400px;
    }
    
    .card .card-content {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    #game-board {
        grid-template-columns: repeat(4, 70px);
        grid-template-rows: repeat(4, 70px);
        grid-gap: 10px;
        padding: 15px;
    }
    
    .card .card-content {
        font-size: 1.5rem;
    }
    
    #btn, #supprimer {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    #tableau th,
    #tableau td {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}