:root {
  --bg: #0d0c12;
  --bg-2: #15131d;
  --card: #1a1824;
  --card-hi: #222030;
  --line: rgba(243, 209, 122, 0.14);
  --text: #ece8f4;
  --muted: #a39db3;
  --gold: #e2b85a;
  --gold-hi: #f3d17a;
  --radius: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #2a2033 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 16px/1.6 Inter, system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; }
h1, h2, h3 { font-family: Cinzel, Georgia, serif; letter-spacing: .02em; margin: 0; }

#embers { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
main, .nav, .footer { position: relative; z-index: 1; }

/* ── Nav ── */
.nav {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(13, 12, 18, .7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: Cinzel, serif; font-weight: 700; font-size: 1.2rem; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { text-decoration: none; color: var(--muted); transition: color .25s; }
.nav-links a:hover { color: var(--gold-hi); }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: clamp(72px, 14vh, 140px) 16px 64px;
  max-width: 820px; margin: 0 auto;
}
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .3em; font-size: .78rem; margin: 0 0 12px; }
.hero-title {
  font-size: clamp(3rem, 11vw, 6.5rem);
  line-height: 1;
  background: linear-gradient(180deg, var(--gold-hi), #a8762a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(226, 184, 90, .25));
  animation: rise .9s var(--ease) both;
}
.hero-sub { color: var(--muted); font-size: 1.15rem; margin: 18px auto 28px; max-width: 560px; animation: rise .9s .1s var(--ease) both; }
.hero-stats { display: flex; justify-content: center; gap: clamp(20px, 6vw, 56px); margin-bottom: 32px; animation: rise .9s .2s var(--ease) both; }
.stat b { display: block; font-family: Cinzel, serif; font-size: 1.8rem; color: var(--gold-hi); }
.stat span { color: var(--muted); font-size: .85rem; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: .95rem;
  border: 1px solid var(--line); background: var(--card);
  transition: transform .25s var(--ease), box-shadow .25s, background .25s, border-color .25s;
  cursor: pointer; color: var(--text);
}
.btn:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 6px 24px rgba(226, 184, 90, .18); }
.btn-primary { background: linear-gradient(180deg, var(--gold-hi), #b8873a); color: #1a1408; border: 0; animation: rise .9s .3s var(--ease) both; }
.btn-primary:hover { box-shadow: 0 8px 30px rgba(226, 184, 90, .4); }

/* ── Sections ── */
.projects, .about, .featured { max-width: 1180px; margin: 0 auto; padding: 48px clamp(16px, 4vw, 48px); }
.section-head { display: flex; flex-wrap: wrap; gap: 20px; align-items: end; justify-content: space-between; margin-bottom: 28px; }
.section-head h2, .about h2 { font-size: 2rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; }
.filter {
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font: inherit; font-size: .88rem; cursor: pointer;
  transition: background .25s, color .25s;
}
.filter:hover { color: var(--text); }
.filter.active { background: var(--card-hi); color: var(--gold-hi); box-shadow: inset 0 0 0 1px var(--line); }

.search { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); transition: border-color .25s; }
.search:focus-within { border-color: var(--gold); }
.search input { background: none; border: 0; outline: 0; color: var(--text); font: inherit; width: 160px; }

/* ── Cards ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.card {
  --accent: var(--gold);
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; text-align: left; color: inherit; font: inherit; padding: 0;
  transition: transform .35s var(--ease), box-shadow .35s, border-color .35s;
  opacity: 0; transform: translateY(20px);
}
.card.in { opacity: 1; transform: none; }
.card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 18px 40px rgba(0,0,0,.45), 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 40px color-mix(in srgb, var(--accent) 15%, transparent); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.thumb { aspect-ratio: 16 / 9; position: relative; overflow: hidden; background: var(--bg-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .thumb img, .card:hover .thumb .gen { transform: scale(1.06); }
.gen {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 55%),
    radial-gradient(circle at 80% 90%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 50%),
    var(--bg-2);
  transition: transform .6s var(--ease);
}
.gen span { font-family: Cinzel, serif; font-size: 3.2rem; font-weight: 700; color: color-mix(in srgb, var(--accent) 80%, white); text-shadow: 0 0 24px var(--accent); opacity: .9; }

.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h3 { font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); font-size: .93rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.tag { font-size: .75rem; padding: 3px 10px; border-radius: 999px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); }

.badge { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.released { background: rgba(98, 201, 128, .14); color: #7fdc9a; }
.badge.beta { background: rgba(95, 179, 217, .14); color: #7cc8ec; }
.badge.wip { background: rgba(226, 160, 90, .14); color: #f0b072; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ── Featured ── */
.featured .feat {
  --accent: var(--gold);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 0;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: calc(var(--radius) + 4px); overflow: hidden;
  box-shadow: 0 0 60px color-mix(in srgb, var(--accent) 12%, transparent);
  animation: rise .9s .35s var(--ease) both;
}
.feat .thumb { aspect-ratio: auto; min-height: 260px; }
.feat-body { padding: clamp(24px, 4vw, 40px); display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.feat-body .eyebrow { margin: 0; }
.feat-body h3 { font-size: 1.9rem; }
.feat-body p { margin: 0; color: var(--muted); }
.feat-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── About ── */
.about { text-align: center; max-width: 720px; padding-bottom: 80px; }
.about p { color: var(--muted); font-size: 1.05rem; margin: 16px 0 24px; }
.socials { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px; border-top: 1px solid var(--line); }

/* ── Modal ── */
.modal {
  --accent: var(--gold);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: calc(var(--radius) + 4px);
  background: var(--card); color: var(--text);
  padding: 0; width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 60px color-mix(in srgb, var(--accent) 15%, transparent);
}
.modal[open] { animation: pop .4s var(--ease); }
.modal.closing { animation: pop-out .25s ease-in forwards; }
.modal::backdrop { background: rgba(5, 4, 8, .7); backdrop-filter: blur(4px); }
.modal[open]::backdrop { animation: fade .3s ease; }
.modal-inner { position: relative; }
.modal .thumb { aspect-ratio: 21 / 9; }
.modal-content { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 14px; }
.modal-content h3 { font-size: 1.8rem; }
.modal-content .desc { color: var(--muted); white-space: pre-line; margin: 0; }
.modal-content .meta { color: var(--muted); font-size: .85rem; }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(13, 12, 18, .7); color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer;
  transition: transform .25s var(--ease), border-color .25s;
}
.modal-close:hover { transform: rotate(90deg); border-color: var(--gold); }

@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 760px) {
  .featured .feat { grid-template-columns: 1fr; }
  .feat .thumb { min-height: 180px; aspect-ratio: 16 / 9; }
  .section-head { align-items: stretch; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .nav-links { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card { opacity: 1; transform: none; }
}

/* ── Icônes d'addon ── */
.gen .icon {
  width: 42%; height: auto; aspect-ratio: 1; object-fit: contain;
  border-radius: 18%;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .55)) drop-shadow(0 0 26px color-mix(in srgb, var(--accent) 45%, transparent));
  transition: transform .6s var(--ease), filter .6s;
}
.card:hover .gen .icon { transform: translateY(-4px) rotate(-3deg); filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .6)) drop-shadow(0 0 36px color-mix(in srgb, var(--accent) 70%, transparent)); }
.feat .gen .icon { width: min(46%, 220px); animation: float 5s ease-in-out infinite; }

@keyframes float { 50% { transform: translateY(-10px); } }

.card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.card-foot .tags { padding-top: 0; margin-top: 0; }
.dl { display: inline-flex; align-items: center; gap: 4px; color: color-mix(in srgb, var(--accent) 70%, white); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.feat-dl { display: flex; align-items: center; gap: 6px; }
.feat-dl b { color: color-mix(in srgb, var(--accent) 70%, white); font-size: 1.1rem; }

.modal .thumb { aspect-ratio: auto; height: clamp(160px, 30vw, 230px); }
.modal .gen .icon { width: clamp(110px, 20vw, 160px); height: auto; }
@media (max-width: 760px) { .filters { border-radius: 18px; } }
#jeux, #projets, #apropos { scroll-margin-top: 64px; }
#jeux + #projets { padding-top: 0; }

/* ── Discord ── */
.nav-links { align-items: center; }
.nav-discord {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  color: #c9cdfb !important; background: rgba(88, 101, 242, .14); border: 1px solid rgba(124, 136, 255, .35);
  transition: background .25s, border-color .25s, color .25s !important;
}
.nav-discord:hover { background: rgba(88, 101, 242, .32); border-color: #7c88ff; color: #fff !important; }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-discord:hover { background: #6d79ff; border-color: #6d79ff; box-shadow: 0 8px 28px rgba(88, 101, 242, .45); }
.footer a { color: #aab1ff; text-decoration: none; }
.footer a:hover { color: #fff; }
@media (max-width: 760px) { .nav-discord span { display: none; } }

/* ── Bouton de langue FR / EN ── */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0,0,0,.35); }
.lang-switch button { font: inherit; font-size: .74rem; font-weight: 700; letter-spacing: .08em; line-height: 1; color: var(--muted); background: none; border: 0; padding: 6px 9px; border-radius: 999px; cursor: pointer; transition: color .2s, background .25s, box-shadow .25s; }
.lang-switch button:hover { color: var(--text); }
.lang-switch button.on { color: #1a1205; background: var(--gold); box-shadow: 0 0 12px rgba(226,184,90,.45); cursor: default; }

/* ── Twitch ── */
.nav-twitch {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  color: #d9c6ff !important; background: rgba(145, 70, 255, .14); border: 1px solid rgba(169, 112, 255, .4);
  transition: background .25s, border-color .25s, color .25s !important;
}
.nav-twitch:hover { background: rgba(145, 70, 255, .34); border-color: #a970ff; color: #fff !important; }
.nav-twitch.is-live { border-color: rgba(255, 61, 61, .7); }
.btn-twitch { background: #9146ff; border-color: #9146ff; color: #fff; }
.btn-twitch:hover { background: #a970ff; border-color: #a970ff; box-shadow: 0 8px 28px rgba(145, 70, 255, .45); }
.btn-twitch svg { width: 18px; height: 18px; }
@media (max-width: 760px) { .nav-twitch span:last-child { display: none; } }
.live { max-width: 1100px; margin: 0 auto 60px; padding: 0 20px; scroll-margin-top: 64px; animation: liveIn .8s var(--ease) both; }
@keyframes liveIn { from { opacity: 0; transform: translateY(20px); } }
.live-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.live-head h2 { display: flex; align-items: center; gap: 12px; font-size: 1.6rem; }
.live-head .tw-live-dot { width: 11px; height: 11px; }

/* ── Téléphones : barre du haut compacte ── */
.nav { gap: 12px; }
.nav-links a { white-space: nowrap; }
@media (max-width: 640px) {
  .nav { padding: 10px 12px; }
  .brand { font-size: 1.05rem; gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  .nav-links { gap: 8px; }
  .nav-links > a:not(.nav-discord):not(.nav-twitch) { display: none; }
  .nav-discord, .nav-twitch { padding: 6px 8px; }
  .lang-switch button { padding: 5px 7px; }
}

.footer .legal { margin: 8px auto 0; max-width: 640px; font-size: .8rem; opacity: .8; }

/* ── Addons en avant, jeux plus discrets ── */
.hero-link { display: inline-block; margin-left: 18px; color: var(--muted); text-decoration: none; font-size: .95rem; transition: color .2s; }
.hero-link:hover { color: var(--text); }
.section-sub { margin: 6px 0 0; color: var(--muted); font-size: .98rem; }
.addons .section-head h2 { font-size: clamp(2rem, 5vw, 2.6rem); }
.addons .grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.addons .card:first-child { }
.games { padding-top: 24px; opacity: .96; }
.games .section-head h2 { font-size: 1.5rem; }
.games .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 340px)); gap: 16px; }
.games .thumb { aspect-ratio: 21 / 9; }
.games .card-body { padding: 12px 16px 14px; gap: 6px; }
.games .card h3 { font-size: 1.02rem; }
.games .card p { font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.games .gen .icon { width: min(30%, 90px); }
.featured { padding-bottom: 8px; }
.featured .feat { box-shadow: 0 0 50px color-mix(in srgb, var(--accent) 14%, transparent); }
.feat-dl b { font-size: 1.5rem; }
@media (max-width: 640px) { .hero-link { display: block; margin: 14px 0 0; } }

/* ── Illustrations dans la fiche projet ── */
.shots { display: flex; flex-direction: column; gap: 10px; }
.shots-main { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; }
.shots-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.03); transition: opacity .45s ease, transform .6s var(--ease); }
.shots-main img.on { opacity: 1; transform: none; }
.shots-nav { position: absolute; top: 50%; translate: 0 -50%; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(13, 12, 18, .65); color: var(--text); font-size: 1.5rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .25s, border-color .25s, background .25s; }
.shots-nav.prev { left: 12px; }
.shots-nav.next { right: 12px; }
.shots-main:hover .shots-nav, .shots-nav:focus-visible { opacity: 1; }
.shots-nav:hover { border-color: var(--accent, var(--gold)); background: rgba(13, 12, 18, .85); }
.shots-dots { display: flex; justify-content: center; gap: 8px; }
.shots-dots .dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; transition: background .25s, transform .25s, width .25s; }
.shots-dots .dot.on { width: 26px; border-radius: 6px; background: var(--accent, var(--gold)); }
@media (hover: none) { .shots-nav { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .shots-main img { transition: none; transform: none; } }

/* ── Nouveauté ── */
.badge.new { background: color-mix(in srgb, var(--accent, var(--gold)) 22%, transparent); color: color-mix(in srgb, var(--accent, var(--gold)) 60%, white); border: 1px solid color-mix(in srgb, var(--accent, var(--gold)) 60%, transparent); animation: newGlow 2.4s ease-in-out infinite; }
@keyframes newGlow { 0%, 100% { box-shadow: 0 0 6px color-mix(in srgb, var(--accent, var(--gold)) 30%, transparent); } 50% { box-shadow: 0 0 16px color-mix(in srgb, var(--accent, var(--gold)) 75%, transparent); } }
.featured .feat { animation: featGlow 4s ease-in-out infinite; }
@keyframes featGlow { 0%, 100% { box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 12%, transparent); } 50% { box-shadow: 0 0 70px color-mix(in srgb, var(--accent) 28%, transparent); } }
@media (prefers-reduced-motion: reduce) { .badge.new, .featured .feat { animation: none; } }
