@import url('https://fonts.googleapis.com/css2?family=Anton&family=Courier+Prime:wght@400;700&display=swap');

:root {
    --bg-dark: #000000;
    --accent-red: #ff003c;
    --accent-blue: #00f2fe;
    --accent-purple: #9c27b0;
    --text-main: #ffffff;
    --text-muted: #888888;
    --card-bg: rgba(10, 10, 10, 0.85);
    --font-terminal: 'Courier Prime', monospace;
    --font-display: 'Anton', sans-serif;
    --glitch-speed: 2s;
}

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

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-terminal);
    overflow-x: hidden;
    scroll-behavior: smooth;
    background-image: 
        linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)),
        url('contenu/game_scene.gif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* CRT EFFECTS */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 50%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
    z-index: 9999;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.05), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.05));
    z-index: 9998;
    background-size: 100% 2.5px, 2.5px 100%;
    pointer-events: none;
    opacity: 0.3;
}

header {
    padding: 20px 20px 60px;
    text-align: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);
}

.logo-container {
    margin-bottom: 20px;
    animation: fadeIn 2s ease-in;
}

.main-logo {
    max-width: 150px;
    filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.4));
    transition: transform 0.3s ease;
}

.main-logo:hover {
    transform: scale(1.05);
}

.glitch-text {
    font-family: var(--font-display);
    font-size: 5rem;
    line-height: 1;
    letter-spacing: 5px;
    position: relative;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    margin-bottom: 5px;
}

.glitch-text::before, .glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-blue);
    clip: rect(44px, 1000px, 56px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -3px 0 var(--accent-red);
    clip: rect(85px, 1000px, 140px, 0);
    animation: glitch-anim2 2s infinite linear alternate-reverse;
}

.subtitle {
    font-size: 1rem;
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 8px;
    font-weight: bold;
    opacity: 0;
    animation: fadeInUp 1s forwards 0.5s;
}

/* COUNTDOWN SECTION */
.countdown-section {
    margin-top: 40px;
    padding: 20px;
    background: rgba(255, 0, 0, 0.05);
    border-top: 1px solid rgba(255, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: fadeIn 2s ease-in;
}

.countdown-label {
    font-size: 0.8rem;
    color: var(--accent-red);
    letter-spacing: 4px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 0, 60, 0.5);
}

.countdown-timer {
    display: flex;
    gap: 20px;
    align-items: center;
    font-family: var(--font-display);
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.time-block span {
    font-size: 3.5rem;
    color: var(--text-main);
    line-height: 1;
    text-shadow: 0 0 15px var(--accent-red);
    animation: flicker 4s infinite;
}

.time-block label {
    font-family: var(--font-terminal);
    font-size: 0.6rem;
    color: var(--accent-red);
    margin-top: 5px;
    letter-spacing: 2px;
}

.time-separator {
    font-size: 3rem;
    color: var(--accent-red);
    margin-top: -20px;
    animation: pulse 1s infinite;
}

.download-notice {
    font-size: 0.7rem;
    color: #666;
    letter-spacing: 1px;
    max-width: 600px;
}

.released-msg {
    font-size: 2.5rem;
    color: #00ff41;
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
    letter-spacing: 5px;
}

/* GAMES CONTAINER */
.games-container {
    max-width: 1200px;
    margin: 40px auto 100px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 40px;
    padding: 0 40px;
}

.game-card {
    position: relative;
    height: 600px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    transition: border 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
}

.game-card.fnols:hover::before { border-color: var(--accent-blue); }
.game-card.fnaf29m:hover::before { border-color: var(--accent-red); }

.card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.6) grayscale(0.5);
    transition: filter 0.5s ease;
}

.fnols .card-background { background-image: url('contenu/fnaf.png'); }
.fnaf29m .card-background { background-image: url('contenu/anniv.jpg'); }

.game-card:hover .card-background {
    filter: brightness(1) grayscale(0);
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    z-index: 20;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-blue);
    color: black;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 20px;
    width: fit-content;
}

.badge.troll { background: var(--accent-red); }

.game-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    text-transform: uppercase;
    margin-bottom: 15px;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.game-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1;
}

.game-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    font-size: 0.8rem;
    color: #555;
    text-transform: uppercase;
}

.dl-button {
    background: transparent;
    border: 2px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 15px 30px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.dl-button::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-blue);
    transition: all 0.3s;
    z-index: -1;
}

.dl-button:hover { color: black; box-shadow: 0 0 20px var(--accent-blue); }
.dl-button:hover::after { top: 0; }

.dl-button.red { border-color: var(--accent-red); color: var(--accent-red); }
.dl-button.red:hover { box-shadow: 0 0 20px var(--accent-red); }
.dl-button.red::after { background: var(--accent-red); }

/* FOOTER */
footer {
    padding: 60px 40px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.9);
}

.footer-info p { margin-bottom: 10px; font-size: 0.8rem; color: #444; }
.warning { color: var(--accent-red) !important; font-weight: bold; letter-spacing: 2px; }

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.modal.active { display: flex; animation: fadeIn 0.3s forwards; }

.modal-box {
    background: #050505;
    border: 1px solid var(--accent-blue);
    padding: 60px;
    width: 600px;
    text-align: center;
    box-shadow: 0 0 100px rgba(0, 242, 254, 0.2);
}

.status-label { font-size: 0.8rem; color: var(--accent-blue); margin-bottom: 30px; letter-spacing: 3px; }
.progress-wrap { background: #000; height: 6px; border: 1px solid #222; margin-bottom: 20px; overflow: hidden; position: relative; }
.progress-bar { width: 0%; height: 100%; background: var(--accent-blue); box-shadow: 0 0 15px var(--accent-blue); transition: width 0.1s linear; }
.percentage { font-family: var(--font-display); font-size: 4rem; margin-bottom: 10px; }
.file-name { color: #555; font-size: 0.8rem; }

/* ANIMATIONS */
@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 94px, 0); }
    20% { clip: rect(62px, 9999px, 42px, 0); }
    40% { clip: rect(16px, 9999px, 78px, 0); }
    60% { clip: rect(81px, 9999px, 19px, 0); }
    80% { clip: rect(55px, 9999px, 66px, 0); }
    100% { clip: rect(97px, 9999px, 33px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    100% { clip: rect(10px, 9999px, 45px, 0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
    20%, 24%, 55% { opacity: 0.4; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .glitch-text { font-size: 3rem; }
    .games-container { grid-template-columns: 1fr; padding: 0 20px; }
    .game-card { height: auto; }
    .card-background { height: 250px; position: relative; }
    .card-content { height: auto; position: relative; padding: 20px; }
    .modal-box { width: 90%; padding: 40px 20px; }
}
