/* ==========================================================================
   retrogaming.css — Rétrogaming
   Thème : CRT cosy chez soi, beige et orange chaleureux, cartouches,
           polices pixel + terminal, easter egg Konami.
   ========================================================================== */

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

body {
    font-family: 'VT323', 'Courier New', monospace;
    line-height: 1.55;
    color: #2a1f12;
    background: #f4ebd1;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(215, 122, 58, .12) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(95, 163, 65, .08) 0%, transparent 50%);
    min-height: 100vh;
    font-size: 19px;
}

/* CRT scanlines très subtil — ambiance "vieille télé du salon" */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 3px,
        rgba(139, 111, 58, .055) 3px,
        rgba(139, 111, 58, .055) 4px
    );
    pointer-events: none;
    z-index: 50;
}

.rg-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 22px 60px;
    position: relative;
}

.back-link {
    display: inline-block;
    margin-bottom: 22px;
    color: #8b6f3a;
    text-decoration: none;
    font-size: 1.05em;
    border: 2px solid #8b6f3a;
    padding: 4px 12px;
    background: #f4ebd1;
    letter-spacing: 1px;
    box-shadow: 3px 3px 0 #8b6f3a;
    transition: all 0.1s;
}
.back-link:hover {
    background: #d77a3a;
    color: #fff;
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #8b6f3a;
}

/* HERO ====================================================================== */
.rg-hero {
    background: #fff8e7;
    border: 4px solid #8b6f3a;
    border-radius: 14px;
    padding: 50px 40px;
    margin-bottom: 32px;
    text-align: center;
    position: relative;
    box-shadow: 8px 8px 0 #8b6f3a;
}

.rg-hero::before {
    /* Coins style « cartouche NES » */
    content: '';
    position: absolute;
    inset: 8px;
    border: 2px dashed #d77a3a;
    border-radius: 8px;
    pointer-events: none;
}

.rg-hero h1 {
    font-family: 'Press Start 2P', 'VT323', monospace;
    font-size: 2.4em;
    color: #c24a1f;
    margin-bottom: 14px;
    letter-spacing: 3px;
    text-shadow: 4px 4px 0 #f5d28e;
    line-height: 1.2;
}

.rg-hero .tagline {
    font-size: 1.35em;
    color: #5c4520;
    max-width: 700px;
    margin: 0 auto;
}

.rg-hero .tagline em {
    color: #c24a1f;
    font-style: italic;
}

.rg-hero .rg-blink {
    display: inline-block;
    color: #5fa341;
    font-weight: bold;
    margin-top: 18px;
    font-family: 'Press Start 2P', 'VT323', monospace;
    font-size: 0.9em;
    animation: rgblink 1.4s steps(2) infinite;
}
@keyframes rgblink { 50% { opacity: 0; } }

/* SECTIONS ================================================================== */
.section {
    background: #fff8e7;
    border: 3px solid #8b6f3a;
    border-radius: 10px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: 5px 5px 0 #8b6f3a;
}

.section h2 {
    font-family: 'Press Start 2P', 'VT323', monospace;
    font-size: 1.25em;
    color: #c24a1f;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 3px dotted #8b6f3a;
    letter-spacing: 1.5px;
    line-height: 1.4;
}

.section h3 {
    font-family: 'Press Start 2P', 'VT323', monospace;
    font-size: 0.95em;
    color: #5fa341;
    margin: 18px 0 10px;
    letter-spacing: 1px;
    line-height: 1.4;
}

.section p { margin-bottom: 12px; color: #2a1f12; line-height: 1.7; }
.section ul, .section ol { margin: 10px 0 14px 28px; }
.section li { margin-bottom: 6px; color: #2a1f12; line-height: 1.7; }
.section strong { color: #c24a1f; }
.section em { color: #5fa341; font-style: italic; }

/* CARTRIDGE CARDS =========================================================== */
.cart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.cart {
    background: #2a1f12;
    border: 3px solid #1a1108;
    border-radius: 8px 8px 12px 12px;
    overflow: hidden;
    color: #f4ebd1;
    box-shadow: 4px 4px 0 #8b6f3a;
    position: relative;
    transition: transform 0.15s;
}

.cart:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #8b6f3a;
}

.cart::before {
    /* Bandeau étiquette NES */
    content: '';
    display: block;
    height: 8px;
    background: repeating-linear-gradient(90deg, #4a3a20 0 4px, #2a1f12 4px 8px);
}

.cart-label {
    background: linear-gradient(180deg, #f4ebd1, #e6d8a8);
    color: #2a1f12;
    margin: 14px 12px;
    padding: 14px 12px;
    border-radius: 4px;
    border: 2px solid #1a1108;
    text-align: center;
}

.cart-label .cl-machine {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7em;
    color: #c24a1f;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.cart-label .cl-name {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    color: #2a1f12;
    margin-bottom: 4px;
}

.cart-label .cl-year {
    font-size: 0.95em;
    color: #5c4520;
    margin-top: 4px;
    font-family: 'VT323', monospace;
}

/* TABLES ==================================================================== */
.section table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 0.96em;
    background: #fdf6e0;
    border: 2px solid #8b6f3a;
}
.section th {
    background: #c24a1f;
    color: #fff8e7;
    padding: 10px 14px;
    text-align: left;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.75em;
    letter-spacing: 1px;
}
.section td {
    padding: 8px 14px;
    border-bottom: 1px dashed #8b6f3a;
}
.section tr:last-child td { border-bottom: none; }

/* CALLOUT =================================================================== */
.callout {
    background: #fff3d4;
    border: 2px dashed #d77a3a;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 16px 0;
    color: #5c4520;
}
.callout strong { color: #c24a1f; }

/* KONAMI ZONE =============================================================== */
.konami-zone {
    background: #2a1f12;
    color: #5fa341;
    padding: 22px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
    border: 3px solid #1a1108;
    box-shadow: 4px 4px 0 #8b6f3a;
    font-family: 'VT323', monospace;
}

.konami-zone .kz-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 1em;
    color: #f5d28e;
    margin-bottom: 12px;
    letter-spacing: 1.5px;
}

.konami-zone .kz-code {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.4em;
    color: #5fa341;
    letter-spacing: 5px;
    margin: 10px 0;
}

.konami-zone p { color: #f4ebd1; margin: 0 0 6px; }

/* EASTER EGG OVERLAY ======================================================== */
#konami-easter-egg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    animation: kBoot 0.6s ease;
}

#konami-easter-egg.active { display: flex; }

#konami-easter-egg .ke-content {
    text-align: center;
    color: #5fa341;
    font-family: 'Press Start 2P', monospace;
    padding: 40px;
    border: 4px solid #5fa341;
    background: #2a1f12;
    box-shadow: 0 0 40px rgba(95, 163, 65, .8),
                inset 0 0 30px rgba(95, 163, 65, .15);
    max-width: 90vw;
}

#konami-easter-egg h3 {
    color: #f5d28e;
    font-size: 1.4em;
    margin-bottom: 18px;
    letter-spacing: 3px;
    line-height: 1.6;
}

#konami-easter-egg .ke-lives {
    font-size: 2.4em;
    color: #5fa341;
    text-shadow: 0 0 18px #5fa341;
    margin: 20px 0;
    letter-spacing: 3px;
    animation: kPulse 1s infinite alternate;
}

@keyframes kPulse {
    from { transform: scale(1); }
    to   { transform: scale(1.08); }
}

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

#konami-easter-egg .ke-close {
    background: transparent;
    color: #f5d28e;
    border: 2px solid #f5d28e;
    padding: 8px 18px;
    font-family: inherit;
    cursor: pointer;
    font-size: 0.85em;
    letter-spacing: 1.5px;
    margin-top: 18px;
}
#konami-easter-egg .ke-close:hover {
    background: #f5d28e;
    color: #2a1f12;
}

/* CRT TOGGLE BUTTON ========================================================= */
#crt-toggle {
    position: fixed;
    bottom: 18px; right: 18px;
    background: #2a1f12;
    color: #5fa341;
    border: 2px solid #5fa341;
    border-radius: 4px;
    padding: 7px 14px;
    cursor: pointer;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65em;
    letter-spacing: 1.5px;
    z-index: 60;
    box-shadow: 0 0 12px rgba(95, 163, 65, .35);
}
#crt-toggle:hover { background: #5fa341; color: #2a1f12; }

/* CRT INTENSE MODE ========================================================== */
body.crt-intense::before {
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 2px,
        rgba(0, 0, 0, .22) 2px,
        rgba(0, 0, 0, .22) 3px
    );
}
body.crt-intense::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.45) 100%);
    pointer-events: none;
    z-index: 49;
}

/* RESPONSIVE =============================================================== */
@media (max-width: 700px) {
    .rg-hero h1 { font-size: 1.5em; letter-spacing: 1px; }
    .rg-hero { padding: 32px 22px; }
    .section { padding: 22px 20px; }
    .section h2 { font-size: 1em; }
    .section h3 { font-size: 0.85em; }
}
