/* =======================
   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;
    --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);
    background-size: cover;
    background-attachment: fixed;
    color: var(--cyan);
    line-height: 1.5;
}

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);
}
a:focus, button:focus, input:focus, textarea:focus {
    outline: 2px dashed var(--cyan);
    outline-offset: 3px;
}

/* =======================
   MACHINE FRAME
======================= */
.machine-frame {
    max-width: 900px;
    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 */
.machine-frame::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é */
.machine-frame::after {
    content: '';
    position: absolute;
    top: -120px; 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%; }
}

.machine-frame > * { position: relative; z-index: 1; }

/* =======================
   TITRES
======================= */
h1 {
    font-family: var(--font-title);
    font-size: 1.35em;
    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);
    text-align: center;
    margin-bottom: 8px;
}

h2 {
    font-family: var(--font-hud);
    font-size: 0.82em;
    font-weight: 400;
    color: var(--text-dim);
    text-align: center;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
}

h2 span { color: var(--teal); }

/* =======================
   TABLE DESKTOP
======================= */
.emulator-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(2, 12, 24, 0.8);
    border: 1px solid var(--cyan-border);
    border-radius: 4px 14px 4px 14px;
    overflow: hidden;
    display: table;
    margin-top: 6px;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.06);
}

.emulator-table thead {
    background: rgba(0, 242, 255, 0.05);
}

.emulator-table thead th {
    padding: 13px 16px;
    text-align: center;
    color: var(--cyan);
    font-family: var(--font-title);
    font-size: 0.66em;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--cyan-border);
    white-space: nowrap;
    vertical-align: middle;
}

.emulator-table thead th:first-child {
    border-left: 3px solid var(--cyan);
    text-align: left;
    width: 220px; /* largeur fixe colonne Fiche émulateur */
}

.emulator-table tbody td {
    padding: 12px 16px;
    color: var(--text-body);
    border-bottom: 1px solid rgba(0, 242, 255, 0.07);
    font-family: var(--font-hud);
    font-size: 0.86em;
    text-align: center;
    vertical-align: middle;
}

.emulator-table tbody td:first-child {
    text-align: left;
    border-left: 3px solid transparent;
    transition: border-color 0.2s;
    width: 220px; /* même largeur fixe */
}

.emulator-table tbody tr:last-child td {
    border-bottom: none;
}

.emulator-table tbody tr:hover td {
    background: rgba(0, 242, 255, 0.04);
}

.emulator-table tbody tr:hover td:first-child {
    border-left-color: var(--teal);
}

/* Lien émulateur dans la table — taille harmonisée */
.emulator-table td a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 242, 255, 0.05);
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 2px 8px 2px 8px;
    color: var(--cyan);
    font-family: var(--font-hud);
    font-size: 0.88em;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emulator-table td a:hover {
    background: rgba(0, 242, 255, 0.1);
    border-color: var(--cyan);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.18);
    color: #fff;
    text-shadow: none;
}

/* =======================
   MESSAGE VIDE
======================= */
.machine-frame > p {
    font-family: var(--font-hud);
    font-size: 0.86em;
    color: var(--text-dim);
    text-align: center;
    padding: 30px 0;
    letter-spacing: 0.06em;
}

.machine-frame > p strong { color: var(--cyan); }

/* Debug details */
details {
    margin-top: 1rem;
    font-family: var(--font-hud);
    font-size: 0.78em;
    color: var(--text-dim);
    border: 1px solid rgba(0, 242, 255, 0.1);
    border-radius: 6px;
    padding: 10px 14px;
}
details summary { cursor: pointer; color: var(--text-dim); }
details code {
    color: var(--teal);
    background: rgba(0, 242, 255, 0.05);
    padding: 1px 5px;
    border-radius: 3px;
}

/* =======================
   MINI-CARDS MOBILE
======================= */
.emulator-cards { display: none; }

@media (max-width: 768px) {

    html { font-size: 15px; }

    .machine-frame {
        margin: 10px;
        padding: 18px 16px;
        border-radius: 4px 14px 4px 14px;
    }

    h1 { font-size: 1.05em; letter-spacing: 0.1em; }

    /* Cacher table, afficher cards */
    .emulator-table { display: none; }

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

    .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;
        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,
    .emulator-card:focus-within {
        border-left-color: var(--teal);
        border-color: rgba(0, 242, 255, 0.3);
        background: rgba(0, 20, 40, 0.9);
        box-shadow: 0 0 16px rgba(0, 242, 255, 0.08);
        transform: translateX(3px);
    }

    .emulator-card a {
        display: block;
        font-family: var(--font-hud);
        font-weight: 700;
        font-size: 0.95em;
        color: var(--cyan);
        letter-spacing: 0.06em;
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(0, 242, 255, 0.1);
        text-decoration: none;
    }

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

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

    .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);
        color: var(--text-body);
    }

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

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

    .emulator-cards .emulator-card { text-align: left; }
}

/* =======================
   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;
}
