/* =======================
   IMPORT FONTS
======================= */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Share+Tech+Mono&display=swap');

/* =======================
   VARIABLES
======================= */
:root {
    --cyan:        #00f2ff;
    --cyan-dim:    rgba(0, 242, 255, 0.18);
    --cyan-glow:   rgba(0, 242, 255, 0.45);
    --cyan-border: rgba(0, 242, 255, 0.25);
    --teal:        #00cfb4;
    --orange:      #ff8c00;
    --orange-glow: rgba(255, 140, 0, 0.35);
    --blue-deep:   #020c18;
    --blue-mid:    #041424;
    --blue-panel:  rgba(4, 20, 40, 0.88);
    --green-dl:    #00ff88;
    --text-body:   #a8dde9;
    --text-dim:    #4a7a8a;
    --font-hud:    'Share Tech Mono', monospace;
    --font-title:  'Orbitron', sans-serif;
}

/* =======================
   GLOBAL
======================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 17px;
}

body {
    font-family: var(--font-title);
    background-color: var(--blue-deep);
    background-image: url(/stylesheet/images/body_background.png);
    color: var(--cyan);
    line-height: 1.5;
}

/* =======================
   CONTENEUR PRINCIPAL FICHE
======================= */
#fiche_presentation,
#fiche_description,
#fiche_donnees,
#fiche_archives,
#fiche_image_emulateur {
    max-width: 860px;
    margin: 22px auto;
    padding: 28px 30px;
    background: var(--blue-panel);
    border: 1px solid var(--cyan-border);
    border-radius: 4px 20px 4px 20px;
    box-shadow:
        0 0 0 1px rgba(0, 242, 255, 0.06),
        0 0 40px rgba(0, 242, 255, 0.07),
        inset 0 0 60px rgba(0, 20, 40, 0.6);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(6px);
}

/* Grille holographique */
#fiche_presentation::before,
#fiche_description::before,
#fiche_donnees::before,
#fiche_archives::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 242, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 255, 0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Scan animé */
#fiche_presentation::after,
#fiche_donnees::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0; right: 0;
    height: 120px;
    background: linear-gradient(to bottom,
        transparent,
        rgba(0, 242, 255, 0.025),
        rgba(0, 242, 255, 0.06),
        rgba(0, 242, 255, 0.025),
        transparent);
    animation: holo-scan 9s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes holo-scan {
    0%   { top: -120px; }
    100% { top: 110%; }
}

#fiche_presentation > *,
#fiche_description > *,
#fiche_donnees > *,
#fiche_archives > *,
#fiche_image_emulateur > * {
    position: relative;
    z-index: 1;
}

/* Coins décoratifs */
#fiche_presentation,
#fiche_description,
#fiche_donnees,
#fiche_archives {
    --corner: 10px;
}

/* =======================
   TITRES
======================= */
h1 {
    font-family: var(--font-title);
    font-size: 1.4em;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #e0f8ff;
    text-shadow: 0 0 18px var(--cyan-glow), 0 0 40px rgba(0,242,255,0.2);
    margin-bottom: 8px;
    text-align: center;
}

h2 {
    font-family: var(--font-title);
    font-size: 0.78em;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

h2::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background: linear-gradient(to bottom, var(--cyan), var(--teal));
    border-radius: 2px;
    box-shadow: 0 0 8px var(--cyan-glow);
    flex-shrink: 0;
}

h2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--cyan-border), transparent);
    margin-left: 4px;
}

h3 {
    font-family: var(--font-hud);
    font-size: 0.82em;
    color: var(--teal);
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 2px solid var(--teal);
    text-align: left;
}

/* =======================
   BLOC PRESENTATION
======================= */
#fiche_presentation {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

#fiche_presentation > div:first-child {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

#fiche_presentation h1 {
    font-size: 1.2em;
}

#fiche_presentation h2 {
    font-size: 0.72em;
    justify-content: center;
    color: var(--teal);
}

#fiche_presentation h2::before,
#fiche_presentation h2::after {
    display: none;
}

/* Images (machine, fabricant) */
#fiche_presentation img {
    max-width: 150px;
    border: 1px solid var(--cyan-border);
    border-radius: 4px 12px 4px 12px;
    box-shadow: 0 0 16px rgba(0,242,255,0.12);
    background: rgba(0,10,22,0.6);
    padding: 6px;
    transition: box-shadow 0.3s;
}

#fiche_presentation img:hover {
    box-shadow: 0 0 28px rgba(0,242,255,0.3);
}

/* Image émulateur */
#fiche_image_emulateur {
    flex: 0 0 auto;
    text-align: center;
}

#fiche_image_emulateur img {
    max-width: 300px;
    border: 1px solid rgba(0,242,255,0.2);
    border-radius: 4px 14px 4px 14px;
    box-shadow: 0 0 24px rgba(0,242,255,0.15);
    background: rgba(0,10,22,0.6);
    padding: 8px;
    transition: box-shadow 0.3s;
}

#fiche_image_emulateur img:hover {
    box-shadow: 0 0 36px rgba(0,242,255,0.3);
}

/* =======================
   DESCRIPTION
======================= */
#fiche_description div {
    font-family: var(--font-hud);
    font-size: 0.96em;
    color: var(--text-body);
    line-height: 1.8;
}

#fiche_description p {
    color: var(--text-body);
    line-height: 1.8;
    font-family: var(--font-hud);
    font-size: 0.96em;
    margin-bottom: 8px;
}

#fiche_description strong, #fiche_description b { color: var(--cyan); }

/* =======================
   TABLE DONNÉES
======================= */
#fiche_donnees table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 6px;
    background: rgba(2, 12, 24, 0.7);
    border: 1px solid var(--cyan-border);
    border-radius: 8px;
    overflow: hidden;
    display: table;
}

#fiche_donnees td {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(0, 242, 255, 0.07);
    font-family: var(--font-hud);
    font-size: 0.94em;
    vertical-align: middle;
}

#fiche_donnees td:first-child {
    width: 200px;
    color: var(--cyan);
    font-weight: 700;
    letter-spacing: 0.05em;
    background: rgba(0, 242, 255, 0.03);
    border-right: 1px solid rgba(0, 242, 255, 0.08);
    white-space: nowrap;
}

#fiche_donnees td:last-child {
    color: var(--text-body);
}

#fiche_donnees tr:last-child td {
    border-bottom: none;
}

#fiche_donnees tr:hover td {
    background: rgba(0, 242, 255, 0.04);
}

#fiche_donnees strong { color: var(--cyan); }

/* =======================
   LIENS
======================= */
a {
    color: var(--cyan);
    text-decoration: none;
    transition: color 0.2s, text-shadow 0.2s;
}

a:hover, a:focus {
    color: #fff;
    text-shadow: 0 0 8px var(--cyan);
}

/* Lien téléchargement traduction */
#fiche_donnees td a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.28);
    border-radius: 3px 8px 3px 8px;
    color: var(--green-dl);
    font-family: var(--font-hud);
    font-size: 0.92em;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

#fiche_donnees td a:hover {
    background: rgba(0, 255, 136, 0.12);
    border-color: var(--green-dl);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.2);
    color: #fff;
    text-shadow: none;
}

/* Lien site officiel */
#fiche_donnees td a[rel~="noopener"] {
    background: rgba(0, 242, 255, 0.05);
    border-color: rgba(0, 242, 255, 0.25);
    color: var(--cyan);
    padding: 4px 10px;
    font-weight: 400;
}

#fiche_donnees td a[rel~="noopener"]:hover {
    background: rgba(0, 242, 255, 0.1);
    border-color: var(--cyan);
    box-shadow: 0 0 10px rgba(0,242,255,0.2);
    color: #fff;
}

/* Compteur téléchargements */
.dl-count {
    font-family: var(--font-hud);
    font-size: 0.88em;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}

/* =======================
   SECTION ARCHIVES
======================= */
#fiche_archives p {
    font-family: var(--font-hud);
    font-size: 0.94em;
    color: var(--text-body);
    margin-bottom: 16px;
    line-height: 1.7;
}

.btn-archives {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.08), rgba(0, 207, 180, 0.06));
    border: 1px solid var(--cyan-border);
    border-radius: 3px 14px 3px 14px;
    color: var(--cyan);
    font-family: var(--font-hud);
    font-size: 0.82em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.btn-archives::before {
    content: '▶';
    font-size: 0.7em;
    color: var(--teal);
}

.btn-archives::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(0, 242, 255, 0.06));
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-archives:hover {
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.15), rgba(0, 207, 180, 0.1));
    border-color: var(--cyan);
    box-shadow: 0 0 22px rgba(0, 242, 255, 0.25), inset 0 0 12px rgba(0,242,255,0.06);
    color: #fff;
    text-shadow: 0 0 8px var(--cyan);
    transform: translateX(3px);
}

.btn-archives:hover::after { opacity: 1; }

.archives-dl-count {
    font-size: 0.85em;
    color: var(--text-dim);
    font-weight: 400;
}

/* =======================
   YES/NO BADGES
======================= */
#fiche_donnees td:last-child {
    /* Pour les Oui/Non, couleurs via contenu */
}

/* Mini-cards cachées par défaut (desktop uniquement table visible) */
.emulator-cards {
    display: none;
}

/* =======================
   RESPONSIVE / MOBILE
======================= */
@media (max-width: 768px) {

    #fiche_presentation,
    #fiche_description,
    #fiche_donnees,
    #fiche_archives,
    #fiche_image_emulateur {
        margin: 12px 10px;
        padding: 16px;
    }

    #fiche_presentation {
        flex-direction: column;
        align-items: center;
        gap: 18px;
    }

    #fiche_presentation > div:first-child {
        width: 100%;
    }

    /* Table → cards sur mobile */
    #fiche_donnees table {
        display: none;
    }

    .emulator-cards {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 8px;
    }

    .emulator-card {
        background: rgba(2, 14, 28, 0.85);
        border: 1px solid rgba(0, 242, 255, 0.15);
        border-left: 3px solid var(--cyan);
        border-radius: 0 10px 10px 0;
        padding: 14px 16px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        transition: all 0.22s ease;
        animation: item-appear 0.3s ease both;
    }

    @keyframes item-appear {
        from { opacity: 0; transform: translateX(-10px); }
        to   { opacity: 1; transform: translateX(0); }
    }

    .emulator-card:hover {
        border-color: rgba(0, 242, 255, 0.35);
        background: rgba(0, 20, 40, 0.9);
        box-shadow: 0 0 16px rgba(0,242,255,0.08);
        transform: translateX(3px);
    }

    .emulator-info {
        display: flex;
        flex-direction: column;
        gap: 5px;
        font-family: var(--font-hud);
        font-size: 0.84em;
    }

    .emulator-info span {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 4px;
        padding: 3px 0;
        border-bottom: 1px solid rgba(0,242,255,0.05);
    }

    .emulator-info span:last-child { border-bottom: none; }

    .emulator-info span strong {
        color: var(--cyan);
        flex-shrink: 0;
        margin-right: 8px;
    }

    .emulator-card a {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 5px 10px;
        background: rgba(0, 255, 136, 0.05);
        border: 1px solid rgba(0, 255, 136, 0.28);
        border-radius: 3px 8px 3px 8px;
        color: var(--green-dl);
        font-weight: 700;
        font-family: var(--font-hud);
        font-size: 0.82em;
        text-decoration: none;
        transition: all 0.2s ease;
    }

    .emulator-card a:hover, .emulator-card a:focus {
        background: rgba(0, 255, 136, 0.12);
        border-color: var(--green-dl);
        color: #fff;
        text-shadow: none;
        box-shadow: 0 0 10px rgba(0,255,136,0.2);
    }

    h1 { font-size: 1em; }

    .btn-archives { width: 100%; justify-content: center; }
}

/* =======================
   ACCESSIBILITÉ
======================= */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

a:focus, button:focus, select:focus, input:focus {
    outline: 2px dashed var(--cyan);
    outline-offset: 3px;
}

/* =======================
   UTILITAIRES
======================= */
.retrait { padding-left: 15px; }

strong { color: var(--cyan); }

small { color: var(--text-dim); font-family: var(--font-hud); }
