/* JEUX - feuille de style commune (theme sombre violet, mobile d'abord) */
:root {
    --bg: #120d24;
    --panel: #1d1538;
    --panel2: #261b47;
    --line: #34285c;
    --text: #f3f0ff;
    --muted: #b3a9d6;
    --accent: #8b5cf6;
    --accent2: #c4b5fd;
    --ok: #22c55e;
    --warn: #f59e0b;
    --bad: #ef4444;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent2); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 28px; padding-bottom: 48px; }

/* En-tete */
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: .02em; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 16px; flex: 1; font-size: .95rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); }
.langs { font-size: .9rem; }
.langs a { text-decoration: none; padding: 2px 6px; border-radius: 6px; }
.langs a[aria-current] { background: var(--accent); color: #fff; }

/* Titres */
h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 6px; }
h2 { font-size: 1.25rem; margin: 32px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--accent2); }
h3 { font-size: 1.05rem; margin: 22px 0 6px; }
p, li { color: var(--muted); }
strong { color: var(--text); }
.sub { color: var(--muted); margin: 0 0 18px; font-size: .95rem; }
code { background: var(--panel2); padding: 1px 6px; border-radius: 6px; font-size: .9em; color: var(--text); }

/* Cartes et grilles */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.card .k { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.card .v { font-size: 1.25rem; font-weight: 700; margin-top: 2px; color: var(--text); }
.card .d { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }

/* Liste des jeux */
.games { display: grid; gap: 12px; }
.game { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 8px; }
.game-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.game-name { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.badge { font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; color: #0b0718; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .88rem; color: var(--muted); }

.chip.tag { background: transparent; border-style: dashed; color: var(--accent2); }

/* Edition des jeux */
details.edit { margin-top: 4px; }
details.edit > summary { cursor: pointer; color: var(--accent2); font-size: .9rem; list-style: none; width: fit-content; padding: 4px 0; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit > summary::before { content: "✎ "; }
details.add { margin-top: 14px; background: var(--panel); border: 1px dashed var(--line); border-radius: 14px; padding: 8px 16px; }
details.add > summary::before { content: ""; }
.gform { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 10px; }
.gform label { display: grid; gap: 4px; color: var(--text); font-size: .88rem; }
.gform .wide { grid-column: 1 / -1; }
.gform input[type=text], .gform input[type=url], .gform select {
    width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--bg); color: var(--text); font: inherit;
}
.gform fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.gform legend { color: var(--text); font-size: .88rem; padding: 0 6px; }
.gform label.check { display: flex; align-items: center; gap: 8px; }
.gform .actions { display: flex; gap: 10px; }
button.danger { color: var(--bad); border-color: var(--bad); }
.notice.good { border-color: var(--ok); }
@media (max-width: 520px) { .gform { grid-template-columns: 1fr; } }

/* Tableaux et listes de liens */
table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .92rem; }
th { background: var(--panel2); color: var(--text); text-align: left; }
th, td { padding: 9px 12px; border: 1px solid var(--line); vertical-align: top; color: var(--muted); }
th { color: var(--text); }
.linkrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.linkrow .t { flex: 1 1 220px; color: var(--text); }
.linkrow .u { flex: 2 1 280px; font-size: .85rem; word-break: break-all; }
button, .btn {
    background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 8px 16px;
    font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { filter: brightness(1.12); }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--accent2); }

/* Formulaire de connexion */
.login { max-width: 380px; margin: 40px auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.login label { display: block; margin-bottom: 6px; color: var(--text); }
.login input[type=password] {
    width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--bg); color: var(--text); font: inherit; margin-bottom: 14px;
}
.notice { background: var(--panel2); border-left: 4px solid var(--warn); padding: 10px 14px; border-radius: 8px; margin: 14px 0; }
.notice.bad { border-color: var(--bad); }

/* Pages juridiques */
.legal { max-width: 780px; }
.legal p, .legal li { line-height: 1.8; }
.legal ul { padding-left: 1.4em; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 18px 0 30px; }

@media (max-width: 520px) {
    h1 { font-size: 1.55rem; }
    .grid { grid-template-columns: 1fr 1fr; }
}

/* SCRIPTORIUM : accueil, cartes d'extensions, pas a pas */
.nav a[aria-current] { color: var(--text); font-weight: 600; }
.hero { padding: 18px 0 8px; }
.hero h1 { font-size: 2.2rem; }
.hero p { font-size: 1.05rem; max-width: 720px; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; }
.cats a { text-decoration: none; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.cats a[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }
.exts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 14px; }
.ext { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ext-top { display: flex; gap: 12px; align-items: center; }
.ext-logo { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; color: #1a1325; }
.ext-name { font-weight: 700; color: var(--text); line-height: 1.2; }
.ext-meta { font-size: .8rem; color: var(--muted); }
.ext p { margin: 0; font-size: .92rem; flex: 1; }
.ext .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 4px 0 14px 46px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
pre { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow: auto; font-size: .85rem; color: var(--text); }
pre code { background: none; padding: 0; }
.soon { margin-top: 28px; }
