/* Pages publiques rendues côté serveur (landing, explorer, niveau, profil). Aucune police externe. */
:root {
  --bg: #12131c;
  --bg-2: #0b0c12;
  --panel: #1b1e2c;
  --panel-2: #252a3c;
  --line: #333c57;
  --text: #e6e9f2;
  --muted: #a9bdcc;
  --accent: #73eff7;
  --accent-2: #41a6f6;
  --gold: #ffcd75;
  --orange: #ef7d57;
  --green: #38b764;
  --ink: #0d1020;
  --shadow: #000;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: .01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem); margin: .2em 0 .4em; }
h2 { font-size: 1.4rem; margin: 1.6em 0 .7em; }
h3 { font-size: 1.15rem; margin: .5em 0 .3em; }
code { font: .95em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--panel-2); padding: .1em .4em; word-break: break-all; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.page { padding-top: 24px; padding-bottom: 48px; }
.small { font-size: .9rem; color: var(--muted); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: 8px; top: -60px; background: var(--gold); color: var(--ink); padding: 8px 12px; z-index: 10; font-weight: 700; }
.skip:focus { top: 8px; }

/* ---------- en-tête / pied */
.site-header { background: var(--panel); border-bottom: 4px solid var(--line); }
.header-row, .footer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.header-row { min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: .04em; }
.brand:hover { color: var(--gold); }
.nav { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; }
.nav a { display: inline-block; padding: 8px 2px; font-weight: 600; }
.site-footer { margin-top: 32px; background: var(--panel); border-top: 4px solid var(--line); padding: 20px 0; color: var(--muted); font-size: .92rem; }
.site-footer p { margin: 0; }

/* ---------- boutons (ombre dure, coins carrés : esprit pixel) */
.btn {
  display: inline-block; padding: 12px 22px; font-weight: 800; font-size: 1.05rem; text-decoration: none;
  color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--shadow);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { color: var(--ink); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--shadow); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }
.btn-play { background: var(--green); }
.btn-play:hover { background: #4fd17c; }
.btn-create { background: var(--accent-2); }
.btn-create:hover { background: #6bbcf8; }
.btn-big { font-size: 1.35rem; padding: 14px 40px; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 20px 0; }

/* ---------- landing */
.hero { background: linear-gradient(#141627, #1f2440 70%, var(--bg)); padding: 32px 0 8px; }
.hero-grid { display: grid; gap: 20px; }
.hero-text { max-width: 720px; }
.lead { font-size: 1.15rem; color: var(--text); margin: 0 0 4px; }
.hero-img { display: block; width: 100%; border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--shadow); background: #1f2440; }
.arg-list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.arg { background: var(--panel); border: 3px solid var(--line); padding: 18px; box-shadow: 4px 4px 0 var(--shadow); }
.arg p { margin: 0; color: var(--muted); }
.icon {
  display: block; width: 48px; height: 48px; image-rendering: pixelated;
  background-repeat: no-repeat; background-size: 384px auto;
}
.icon-play { background-image: url(/assets/player.png); background-position: 0 0; }
.icon-create { background-image: url(/assets/tiles.png); background-position: -336px 0; }
.icon-race { background-image: url(/assets/entities.png); background-position: 0 0; }
.more { margin-top: 18px; font-weight: 700; }

/* ---------- cartes de niveaux */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { background: var(--panel); border: 3px solid var(--line); padding: 14px; box-shadow: 4px 4px 0 var(--shadow); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card:hover, .card:focus-within { border-color: var(--accent-2); }
.card-link { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.08rem; }
.card-link:hover .card-title { text-decoration: underline; color: var(--gold); }
.card-title { overflow-wrap: anywhere; }
.card-gem {
  flex: none; width: 24px; height: 24px; image-rendering: pixelated;
  background: url(/assets/entities.png) 0 0 / 192px auto no-repeat;
}
.card-meta { margin: 0; color: var(--muted); font-size: .92rem; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.empty { background: var(--panel); border: 3px dashed var(--line); padding: 18px; color: var(--muted); }

/* ---------- explorer */
.tabs { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 20px; }
.tabs a { display: inline-block; padding: 8px 14px; border: 3px solid var(--line); background: var(--panel-2); color: var(--text); text-decoration: none; font-weight: 700; }
.tabs a[aria-current="page"] { background: var(--gold); border-color: var(--ink); color: var(--ink); }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 20px; margin-top: 28px; font-weight: 700; }
.pager a { padding: 8px 12px; border: 3px solid var(--line); background: var(--panel-2); text-decoration: none; }

/* ---------- fiche niveau, profil */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 8px; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: '›'; margin-right: 4px; }
.crumbs span { overflow-wrap: anywhere; }
.level h1, .page > h1 { overflow-wrap: anywhere; }
.byline { color: var(--muted); margin: 0 0 12px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.stats div { background: var(--panel); border: 3px solid var(--line); padding: 8px 16px; min-width: 110px; }
.stats dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stats dd { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--gold); }
.board { width: 100%; max-width: 560px; border-collapse: collapse; background: var(--panel); border: 3px solid var(--line); }
.board caption { text-align: left; padding: 0 0 8px; color: var(--muted); font-size: .9rem; }
.board th, .board td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.board th { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.board td:first-child { width: 4.5em; font-weight: 800; }
.board td:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.board tbody tr:nth-child(1) td:first-child { color: var(--gold); }
.versions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.versions a[aria-current="page"] { color: var(--gold); font-weight: 800; }
.note { background: #2c2440; border-left: 4px solid var(--gold); padding: 10px 14px; }
.share { margin-top: 8px; }

/* ---------- erreurs */
.page-error .error-code { font-size: 4rem; font-weight: 900; color: var(--orange); margin: 16px 0 0; line-height: 1; text-shadow: 4px 4px 0 var(--shadow); }

@media (min-width: 860px) {
  .hero { padding-top: 48px; }
  .page-landing h1 { font-size: 2.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* /admin */
.admin-reports{list-style:none;margin:1rem 0;padding:0;display:grid;gap:.75rem}
.admin-report{border:1px solid #3a3d52;border-radius:8px;padding:.75rem 1rem;background:#1a1c2a}
.admin-head{margin:0 0 .25rem;font-weight:700}
.admin-reason{margin:.25rem 0;white-space:pre-wrap;overflow-wrap:anywhere}
.admin-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.5rem}
.admin-actions button{cursor:pointer;font:inherit}
