:root {
  --bg: #0d0b14;
  --fg: #f3f0fa;
  --muted: #a9a3bd;
  --surface: #17141f;
  --surface-2: #211c2d;
  --border: #2e2840;
  --accent: #9146ff;
  --accent-2: #00e0c6;
  --on-accent: #ffffff;
  --twitch: #9146ff;
  --youtube: #ff3b3b;
  --discord: #5865f2;
  --tiktok: #ff0050;
  --radius: 14px;
  --game-amber: #f0b45a;
  --game-night: #0c0e19;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f5fc;
  --fg: #17131f;
  --muted: #5d5770;
  --surface: #ffffff;
  --surface-2: #efebf8;
  --border: #ddd6ee;
  --accent: #7228e0;
  --accent-2: #00897a;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--fg);
}

a { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: .5rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 8px;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

.site-header,
.site-footer,
main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1rem;
}

/* En-tête */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--fg);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #2b1752, #0c0814);
  border: 1px solid #3a2466;
  color: #fff;
  font-size: .85rem;
  letter-spacing: .02em;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
}
.icon-button:hover { background: var(--surface-2); }

.header-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
}

/* Onglet « Mon jeu » : couleurs du jeu Ambrelune (ambre sur nuit), mêmes dans les deux thèmes */
.game-tab {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  height: 2.5rem;
  padding: 0 1rem 0 .4rem;
  border: 1px solid var(--game-amber);
  border-radius: 999px;
  background: #23201f;
  color: var(--game-amber);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease;
}
.game-tab:hover { background: #3c3229; }
.game-tab img { width: 1.75rem; height: 1.75rem; border-radius: 50%; }

@media (max-width: 600px) {
  .game-tab-name { display: none; }
}

/* Accueil */
.hero {
  position: relative;
  padding: 5rem 1rem 4rem;
  text-align: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: 0 5%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 35%, transparent), transparent);
  filter: blur(40px);
  z-index: -1;
}

.avatar {
  display: block;
  width: 160px;
  height: 160px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: 0 0 0 3px var(--accent), 0 12px 40px color-mix(in srgb, var(--accent) 40%, transparent);
}

.eyebrow {
  margin: 0 0 .5rem;
  color: var(--accent-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .85rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.75rem, 10vw, 5.5rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -.02em;
  background: linear-gradient(90deg, var(--accent) 15%, color-mix(in srgb, var(--accent) 45%, var(--fg)) 50%, var(--fg) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 34rem;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 1.15rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}

/* Boutons */
.button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.button:hover { transform: translateY(-2px); }

.button-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button-ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--fg);
}

/* Sections */
section { padding: 3rem 0; }

h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

/* Cartes */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  --card-accent: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}

a.card:hover {
  transform: translateY(-3px);
  border-color: var(--card-accent);
}

.card-twitch { --card-accent: var(--twitch); }
.card-youtube { --card-accent: var(--youtube); }
.card-tiktok { --card-accent: var(--tiktok); }
.card-discord { --card-accent: var(--discord); }

.card-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: .5rem;
  border-radius: 12px;
  background: var(--card-accent);
  color: #fff;
}

.card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.card-text {
  margin: 0 0 .75rem;
  color: var(--muted);
}

.card-stat {
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}
.card-stat[hidden] { display: none; }
.card-stat-value {
  color: var(--card-accent);
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stats-updated {
  margin: .75rem 0 0;
  color: var(--muted);
  font-size: .8rem;
  text-align: right;
}

.card-wide { --card-accent: var(--accent-2); }

/* Mobile : cartes réseaux en 2 × 2, plus compactes */
@media (max-width: 600px) {
  #reseaux .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  #reseaux .card { padding: 1rem; }
  #reseaux .card-icon { width: 2.5rem; height: 2.5rem; }
  #reseaux .card-title { font-size: 1rem; }
  #reseaux .card-text { font-size: .85rem; line-height: 1.4; }
  #reseaux .card-stat { font-size: .8rem; }
  #reseaux .card-stat-value { display: block; font-size: 1.3rem; }
  .stats-updated { text-align: center; }
}

/* Encart « Collaboration » en tête de l'accueil (Liferun by Cristaline) :
   couleurs reprises de l'image des lots Liferun (nuit violette, vert Cristaline, bleu bulle).
   Thème sombre : panneau nuit comme le haut de l'image. Thème clair : panneau blanc bleuté comme le bas. */
.collab {
  --collab-fond-1: #2a2545;
  --collab-fond-2: #171427;
  --collab-bord: #0cab58;
  --collab-halo: rgba(12, 171, 88, .25);
  --collab-bulle: rgba(143, 199, 235, .35);
  --collab-texte: #ffffff;
  --collab-doux: #d6d3e6;
  --collab-bleu: #8fc7eb;
  --collab-vert: #0cab58;
  --collab-vert-fonce: #008443;
  --collab-sur-vert: #171427;
  --collab-code-fond: rgba(0, 0, 0, .3);
  --collab-image-bord: rgba(143, 199, 235, .35);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem 2.25rem;
  margin-bottom: 1rem;
  padding: 1.25rem;
  border: 2px solid var(--collab-bord);
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(circle at 96% 12%, transparent 10px, var(--collab-bulle) 11px 13px, transparent 14px),
    radial-gradient(circle at 92% 22%, transparent 5px, var(--collab-bulle) 6px 7px, transparent 8px),
    radial-gradient(circle at 5% 90%, transparent 7px, var(--collab-bulle) 8px 9px, transparent 10px),
    radial-gradient(90% 120% at 100% 0%, var(--collab-halo), transparent 60%),
    linear-gradient(160deg, var(--collab-fond-1), var(--collab-fond-2));
  color: var(--collab-texte);
  box-shadow: 0 18px 50px rgba(12, 171, 88, .15);
}

:root[data-theme="light"] .collab {
  --collab-fond-1: #ffffff;
  --collab-fond-2: #e6f4fd;
  --collab-bord: #8fc7eb;
  --collab-halo: rgba(12, 171, 88, .12);
  --collab-bulle: rgba(24, 100, 179, .25);
  --collab-texte: #211d35;
  --collab-doux: #4a4560;
  --collab-bleu: #1864b3;
  --collab-vert: #008443;
  --collab-vert-fonce: #00602f;
  --collab-sur-vert: #ffffff;
  --collab-code-fond: #d9eefc;
  --collab-image-bord: #211d35;
  box-shadow: 0 14px 40px rgba(24, 100, 179, .15);
}

.collab-visuel {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--collab-image-bord);
  transition: transform .15s ease, border-color .15s ease;
}
.collab-visuel:hover { transform: translateY(-3px); border-color: var(--collab-vert); }
.collab-visuel img { display: block; width: 100%; height: auto; background: #211d35; }

.collab-corps { padding: .5rem .75rem .5rem 0; }

.collab-mention {
  display: inline-block;
  margin: 0 0 .75rem;
  padding: .2rem .65rem;
  border: 1px solid var(--collab-bleu);
  border-radius: 6px;
  color: var(--collab-texte);
  font-size: .78rem;
  font-weight: 700;
}

.collab-titre {
  margin: 0;
  color: var(--collab-texte);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.01em;
  text-transform: uppercase;
  font-style: italic;
}
.collab-titre span {
  display: block;
  margin-top: .35rem;
  color: var(--collab-bleu);
  font-size: .4em;
  font-style: normal;
  letter-spacing: .14em;
}

.collab-texte { margin: 1rem 0 .9rem; color: var(--collab-doux); }

.collab-code {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  margin: 0 0 1.25rem;
  padding: .45rem .8rem;
  border-radius: 10px;
  background: var(--collab-code-fond);
  color: var(--collab-doux);
  font-size: .9rem;
}
.collab-code strong {
  color: var(--collab-vert);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  user-select: all;
}

.collab-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
}

.collab-bouton {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.5rem;
  border-radius: 999px;
  background: var(--collab-vert);
  color: var(--collab-sur-vert);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--collab-vert-fonce);
  transition: transform .15s ease, filter .15s ease;
}
.collab-bouton:hover { transform: translateY(-2px); filter: brightness(1.1); }

.collab-plateformes { color: var(--collab-doux); font-size: .8rem; opacity: .85; }


@media (max-width: 760px) {
  .collab {
    grid-template-columns: 1fr;
    padding: .9rem;
    text-align: center;
    background:
      radial-gradient(90% 60% at 100% 0%, var(--collab-halo), transparent 60%),
      linear-gradient(160deg, var(--collab-fond-1), var(--collab-fond-2));
  }
  .collab-corps { padding: 0 .25rem .5rem; }
  .collab-actions { justify-content: center; }
  .collab-bouton { width: 100%; justify-content: center; }
}

/* Bloc « Mon jeu » : tout le panneau mène à la page du jeu (pas de téléchargement ici) */
@font-face {
  font-family: "Cinzel";
  font-weight: 700;
  font-display: swap;
  src: url("/ambrelune/fonts/cinzel-latin-700-normal.woff2") format("woff2");
}

.game-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1.5rem 2.25rem;
  padding: 2rem 2.25rem;
  border: 1px solid #6b4a1e;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(240, 180, 90, .16), transparent 55%),
    linear-gradient(135deg, #141626, var(--game-night));
  color: #f3eee4;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.game-card:hover { transform: translateY(-3px); border-color: var(--game-amber); }

.game-logo {
  width: 140px;
  height: 140px;
  filter: drop-shadow(0 0 24px rgba(240, 180, 90, .35));
}

.game-body { display: flex; flex-direction: column; align-items: flex-start; }

.game-kicker {
  color: var(--game-amber);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.game-title {
  margin: .15rem 0 .25rem;
  font: 700 clamp(1.8rem, 4vw, 2.6rem)/1.1 "Cinzel", Georgia, serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--game-amber);
}

.game-sub {
  color: #cfc6b8;
  font-size: .8rem;
  letter-spacing: .25em;
  text-transform: uppercase;
}

.game-text { margin: .6rem 0 1.1rem; color: #cfc6b8; }

.game-button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.4rem;
  border-radius: 999px;
  background: var(--game-amber);
  color: var(--game-night);
  font-weight: 800;
  transition: background-color .15s ease;
}
.game-card:hover .game-button { background: #f6c77a; }

@media (max-width: 600px) {
  .game-card {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 1.5rem 1.25rem;
    text-align: center;
  }
  .game-logo { width: 110px; height: 110px; }
  .game-body { align-items: center; }
  .game-button { width: 100%; justify-content: center; }
}

/* Pied de page */
.site-footer {
  padding-top: 2rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}
.site-footer p { margin: .25rem 0; }

/* Page 404 */
.not-found { padding-top: 6rem; }

/* Mentions légales */
.legal { max-width: 46rem; padding-top: 2rem; padding-bottom: 3rem; }
.legal section { padding: 0; }
.legal h1 { margin: 0 0 .25rem; font-size: clamp(1.8rem, 5vw, 2.5rem); }
.legal h2 { margin: 2rem 0 .5rem; font-size: 1.2rem; color: var(--accent); }
.legal p, .legal li { color: var(--fg); }
.legal ul { padding-left: 1.25rem; }
.legal li { margin: .35rem 0; }
.legal-updated { color: var(--muted) !important; font-size: .9rem; }
.legal mark.todo { background: #ffd60a; color: #17131f; padding: 0 .25rem; border-radius: 4px; }
.footer-note a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button,
  .card,
  .collab-visuel,
  .collab-bouton { transition: none; }
  .button:hover,
  a.card:hover,
  .collab-visuel:hover,
  .collab-bouton:hover { transform: none; }
}
