/* ==========================================================================
   3DSTYLIZEDGAMES — feuille de style
   Direction : carnet d'atelier technique. Fond graphite, encre claire,
   accent bronze/métal (écho aux props Viking : épée, hache, heaume),
   fiches "spécification" à coins d'équerre façon plan / viseur technique.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #131315;
    --bg-panel: #1B1B1E;
    --bg-panel-alt: #212124;
    --text: #ECE9E3;
    --text-muted: #98958E;
    --accent: #C08552;
    --accent-bright: #D9A06B;
    --accent-soft: rgba(192, 133, 82, 0.14);
    --line: #2B2B2E;
    --line-bright: #3A3A3D;
    --ok: #7FA37F;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius: 3px;
    --max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 28px;
}

/* ---------- Typographie ---------- */

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

/* ---------- Header ---------- */

.site-header {
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: rgba(19, 19, 21, 0.92);
    backdrop-filter: blur(6px);
    z-index: 50;
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }

.main-nav { display: flex; gap: 28px; }
.main-nav a {
    font-size: 14px;
    color: var(--text-muted);
    transition: color .15s ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); }

/* ---------- Hero ---------- */

.hero {
    padding: 96px 0 72px;
    border-bottom: 1px solid var(--line);
}

.hero h1 {
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.08;
    max-width: 780px;
    margin-top: 16px;
}

.hero p {
    max-width: 560px;
    color: var(--text-muted);
    margin-top: 20px;
    font-size: 17px;
}

.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.hero-stat .num {
    font-family: var(--font-mono);
    font-size: 26px;
    color: var(--accent-bright);
}
.hero-stat .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

/* ---------- Sections ---------- */

.section {
    padding: 72px 0;
    border-bottom: 1px solid var(--line);
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 36px;
    gap: 20px;
    flex-wrap: wrap;
}

.section-head h2 { font-size: 28px; }

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.filter-btn {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 7px 12px;
    border: 1px solid var(--line-bright);
    border-radius: var(--radius);
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
}
.filter-btn.active, .filter-btn:hover {
    color: var(--bg);
    background: var(--accent);
    border-color: var(--accent);
}

/* ---------- Grille de fiches (signature : coins d'équerre type viseur) ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 22px;
}

.card {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--line-bright); transform: translateY(-2px); }

.card::before, .card::after,
.card .thumb::before, .card .thumb::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--accent);
    opacity: 0;
    transition: opacity .18s ease;
    z-index: 2;
}
.card:hover::before, .card:hover::after,
.card:hover .thumb::before, .card:hover .thumb::after { opacity: 1; }

.card::before        { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.card::after          { top: 8px; right: 8px; border-left: none; border-bottom: none; }
.card .thumb::before { bottom: 8px; left: 8px; border-right: none; border-top: none; }
.card .thumb::after   { bottom: 8px; right: 8px; border-left: none; border-top: none; }

.card .thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--bg-panel-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .placeholder {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.card .body { padding: 16px 18px 18px; }

.card .cat {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.card h3 { font-size: 18px; margin-top: 6px; }

.card .meta {
    display: flex;
    gap: 14px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.featured-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 7px;
    border-radius: var(--radius);
    z-index: 3;
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--line-bright);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 13px;
}

/* ---------- Page détail ---------- */

.detail-head {
    padding: 56px 0 32px;
    border-bottom: 1px solid var(--line);
}
.back-link {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}
.back-link:hover { color: var(--accent); }

.detail-head h1 { font-size: clamp(28px, 4vw, 42px); margin-top: 14px; }

.detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 48px;
    padding: 48px 0 72px;
}
@media (max-width: 860px) {
    .detail-grid { grid-template-columns: 1fr; }
}

.detail-gallery .main-image {
    aspect-ratio: 4/3;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.detail-gallery .main-image img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs img {
    width: 64px; height: 64px; object-fit: cover;
    border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}

.spec-table {
    font-family: var(--font-mono);
    font-size: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.spec-table .row {
    display: flex;
    justify-content: space-between;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
}
.spec-table .row:last-child { border-bottom: none; }
.spec-table .row span:first-child { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.tag-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.tag {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    border: 1px solid var(--line-bright);
    border-radius: var(--radius);
    padding: 4px 8px;
}

.detail-desc { margin-top: 22px; color: var(--text-muted); }

.btn {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 20px;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--bg);
    margin-top: 24px;
    border: 1px solid var(--accent);
    cursor: pointer;
}
.btn:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-bright); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger { background: #7A3B3B; border-color: #7A3B3B; }
.btn.danger:hover { background: #944848; border-color: #944848; }
.btn.small { padding: 8px 12px; font-size: 11px; margin-top: 0; }

.video-embed {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.video-embed iframe { width: 100%; height: 100%; border: 0; }

/* ---------- Footer ---------- */

.site-footer {
    padding: 40px 0;
}
.site-footer .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.social-links { display: flex; gap: 18px; }
.social-links a {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.social-links a:hover { color: var(--accent); }
.copyright { font-size: 12px; color: var(--text-muted); }

/* ---------- Accessibilité ---------- */

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Formulaires (admin) ---------- */

.admin-body { background: var(--bg-panel-alt); min-height: 100vh; }

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 220px;
    background: var(--bg-panel);
    border-right: 1px solid var(--line);
    padding: 24px 0;
    flex-shrink: 0;
}
.admin-sidebar .logo { padding: 0 20px 24px; display: block; }
.admin-sidebar nav a {
    display: block;
    padding: 11px 20px;
    font-size: 14px;
    color: var(--text-muted);
    border-left: 2px solid transparent;
}
.admin-sidebar nav a:hover { color: var(--text); }
.admin-sidebar nav a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); }

.admin-main { flex: 1; padding: 36px 40px; max-width: 920px; }

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}
.login-box {
    width: 100%;
    max-width: 360px;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 36px 32px;
}
.login-box h1 { font-size: 20px; margin-bottom: 24px; }

.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.field input[type=text],
.field input[type=password],
.field input[type=url],
.field input[type=date],
.field select,
.field textarea {
    width: 100%;
    background: var(--bg-panel-alt);
    border: 1px solid var(--line-bright);
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input[type=file] { color: var(--text-muted); font-size: 13px; }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field input { width: auto; }

.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 20px;
    border: 1px solid;
}
.alert.error { color: #E4A0A0; border-color: #7A3B3B; background: rgba(122,59,59,0.15); }
.alert.success { color: var(--ok); border-color: #3F5B3F; background: rgba(127,163,127,0.12); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--line-bright);
}
.admin-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:hover td { background: var(--bg-panel); }
.row-actions { display: flex; gap: 8px; }
.thumb-sm { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius); background: var(--bg-panel-alt); }

.badge {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: var(--radius);
    border: 1px solid var(--line-bright);
    color: var(--text-muted);
}
.badge.featured { color: var(--accent); border-color: var(--accent); }
