:root {
  --bg: #ffffff;
  --bg-alt: #f6f6fb;
  --ink: #14131a;
  --muted: #5d5b6b;
  --line: #e9e8f2;
  --brand: #6c4cf1;
  --brand-2: #00c2ff;
  --accent: #ff5d8f;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(20, 19, 26, 0.08);
  --shadow-lg: 0 24px 60px rgba(108, 76, 241, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(1140px, 92%); margin: 0 auto; }

h1, h2 { font-family: "Space Grotesk", "Outfit", sans-serif; line-height: 1.1; letter-spacing: -0.02em; }

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

.eyebrow {
  font-family: "Space Grotesk", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
}

.grad {
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 800; font-size: 1.15rem; }
.brand { margin-right: auto; } /* pousse nav + langue + burger a droite */
.brand-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-family: "Space Grotesk", monospace; font-weight: 700;
}
.brand-logo { height: 36px; width: auto; display: block; }
.brand-fallback { display: inline-flex; align-items: center; gap: 0.55rem; }

.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a { color: var(--muted); font-weight: 500; transition: color 0.15s; }
.nav a:hover { color: var(--ink); }
.nav-cta {
  background: var(--ink); color: #fff !important;
  padding: 0.5rem 1rem; border-radius: 999px; font-weight: 600;
}
.nav-cta:hover { background: var(--brand); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: 0.25s; }

/* ---------- Selecteur de langue ---------- */
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.45rem 0.7rem; border-radius: 999px;
  background: var(--bg-alt); border: 1px solid var(--line);
  color: var(--ink); font-weight: 600; font-size: 0.9rem; cursor: pointer;
  font-family: inherit; transition: border-color 0.15s, color 0.15s;
}
.lang-btn:hover { border-color: var(--brand); color: var(--brand); }
.lang-btn .caret { font-size: 0.7rem; opacity: 0.7; transition: transform 0.2s; }
.lang-switch.open .lang-btn .caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  list-style: none; margin: 0; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); min-width: 168px; z-index: 60;
  max-height: 60vh; overflow: auto;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.lang-switch.open .lang-menu { opacity: 1; visibility: visible; transform: none; }
.lang-menu li {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer;
  font-size: 0.92rem; color: var(--muted); transition: background 0.12s, color 0.12s;
}
.lang-menu li:hover { background: var(--bg-alt); color: var(--ink); }
.lang-menu li.active { color: var(--brand); font-weight: 700; }
.lang-menu .code {
  font-family: "Space Grotesk", monospace; font-size: 0.72rem; font-weight: 700;
  background: var(--bg-alt); color: var(--brand);
  padding: 2px 6px; border-radius: 6px; min-width: 30px; text-align: center;
}

/* ---------- Hero ---------- */
.hero { padding: 84px 0 64px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: 14px 0 18px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }

.hero-actions { display: flex; gap: 14px; margin: 28px 0 36px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0.85rem 1.5rem; border-radius: 999px;
  font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: var(--shadow-lg); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: var(--bg-alt); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.hero-stats { display: flex; gap: 36px; }
.hero-stats strong { font-family: "Space Grotesk"; font-size: 1.8rem; display: block; }
.hero-stats span { color: var(--muted); font-size: 0.85rem; }

/* Hero gamepad art */
.hero-art { display: grid; place-items: center; }
.pad {
  width: 280px; padding: 26px; border-radius: 28px;
  background: linear-gradient(160deg, #1b1830, #2a2350);
  box-shadow: var(--shadow-lg);
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
.pad-screen {
  position: relative; height: 130px; border-radius: 14px; overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #00c2ff33, transparent 60%), #0c0a1a;
  border: 2px solid #ffffff22;
}
.scanlines { position: absolute; inset: 0; background: repeating-linear-gradient(transparent 0 3px, #ffffff0a 3px 4px); }
.sprite {
  position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; transform: translate(-50%, -50%);
  background: var(--accent); border-radius: 4px;
  box-shadow: 0 0 0 6px #ffffff14, 0 0 24px var(--accent);
  animation: hop 1.2s steps(2) infinite;
}
@keyframes hop { 0%,100% { transform: translate(-50%, -40%); } 50% { transform: translate(-50%, -65%); } }
.pad-buttons { display: flex; justify-content: space-between; margin-top: 22px; }
.dpad { width: 46px; height: 46px; border-radius: 8px; background:
  linear-gradient(#ffffff22, #ffffff10),
  conic-gradient(from 45deg, #ffffff18 0 25%, transparent 0 50%, #ffffff18 0 75%, transparent 0); }
.abxy { width: 46px; height: 46px; border-radius: 50%; background:
  radial-gradient(circle at 50% 20%, var(--accent) 18%, transparent 19%),
  radial-gradient(circle at 80% 50%, var(--brand-2) 18%, transparent 19%),
  radial-gradient(circle at 20% 50%, #ffd24a 18%, transparent 19%),
  radial-gradient(circle at 50% 80%, #4ade80 18%, transparent 19%); }

/* ---------- Sections ---------- */
.section { padding: 76px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 600px; margin: 0 auto 42px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 10px 0; }
.section-head p { color: var(--muted); }

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

/* Game cards */
.game-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
}
.game-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.game-thumb { height: 150px; position: relative; display: grid; place-items: center;
  background-size: cover !important; background-position: center !important; }
.game-thumb .emoji { font-size: 3rem; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25)); }
/* Quand une vraie image est presente : on masque l'emoji */
.game-thumb.has-img .emoji { display: none; }
.game-thumb.has-img .tag { background: rgba(0,0,0,0.55); color: #fff; }
.game-thumb .tag {
  position: absolute; top: 12px; left: 12px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em;
  background: #ffffffea; color: var(--ink); padding: 4px 10px; border-radius: 999px;
}
.game-body { padding: 18px; }
.game-body h3 { font-family: "Space Grotesk"; font-size: 1.2rem; }
.game-body .genre { color: var(--brand); font-size: 0.82rem; font-weight: 600; }
.game-body p { color: var(--muted); font-size: 0.92rem; margin-top: 8px; }
.game-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 0.85rem; }
.stars { color: #ffb020; letter-spacing: 2px; }
.play { color: var(--brand); font-weight: 700; }

/* ---------- Studio ---------- */
.studio-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.features { list-style: none; margin-top: 18px; display: grid; gap: 10px; }
.features li { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.features .ic { color: var(--brand); }
.studio-card {
  background: #0c0a1a; border-radius: var(--radius); padding: 26px; color: #d8d6ea;
  font-family: "Space Grotesk", monospace; box-shadow: var(--shadow-lg);
}
.studio-card code { display: block; line-height: 2; font-size: 0.95rem; }
.c-key { color: #00c2ff; } .c-str { color: #ff5d8f; } .c-num { color: #ffd24a; }
.loadbar { height: 8px; background: #ffffff14; border-radius: 999px; overflow: hidden; margin-bottom: 20px; }
.loadbar span { display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); animation: load 2.4s ease-in-out infinite; }
@keyframes load { 0% { width: 8%; } 60% { width: 92%; } 100% { width: 8%; } }

/* ---------- CTA ---------- */
.cta { padding: 80px 0; text-align: center; }
.cta-inner {
  background: linear-gradient(135deg, var(--brand), #3a2bb0);
  border-radius: 28px; padding: 56px 24px; color: #fff; box-shadow: var(--shadow-lg);
}
.cta h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.cta p { opacity: 0.9; margin: 10px 0 26px; }
.cta .btn-primary { background: #fff; color: var(--brand); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 30px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.footer-inner p { color: var(--muted); font-size: 0.9rem; }

/* ====================================================================
   Page dédiée d'un jeu (jeu.html)
   ==================================================================== */
.game-detail { padding: 40px 0 72px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-weight: 600; margin-bottom: 24px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--brand); }

.game-hero {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: center;
  margin-bottom: 56px;
}
.game-hero-art {
  min-height: 240px; border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--bg-alt), #eef0fb);
  border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden;
}
.game-hero-art .game-logo { max-width: 80%; max-height: 200px; object-fit: contain; }
.game-hero-art .game-emoji { font-size: 5.5rem; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2)); }

.game-tags { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.game-tags .tag {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em;
  background: var(--ink); color: #fff; padding: 4px 10px; border-radius: 999px;
}
.game-hero-info .genre { color: var(--brand); font-weight: 700; font-size: 0.9rem; }
.game-hero-info h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 4px 0 12px; }
.game-hero-info .stars { color: #ffb020; letter-spacing: 3px; font-size: 1.1rem; margin-bottom: 14px; }
.game-hero-info .lead { color: var(--muted); max-width: 50ch; }

.game-section { margin: 0 auto 52px; max-width: 920px; }
.game-section > h2 {
  font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 20px;
  display: inline-flex; align-items: center; gap: 10px;
}
.game-section > h2::before {
  content: ""; width: 22px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.game-long { color: var(--muted); font-size: 1.08rem; line-height: 1.8; }
.muted-note {
  color: var(--muted); background: var(--bg-alt); border: 1px dashed var(--line);
  border-radius: 14px; padding: 22px; text-align: center;
}

/* Carrousel */
.carousel { position: relative; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.carousel-track { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0c0a1a; }
.carousel-track .slide {
  position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 0.4s ease;
  display: grid; place-items: center;
}
.carousel-track .slide.active { opacity: 1; }
.carousel-track .slide img { width: 100%; height: 100%; object-fit: cover; }
.car-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,0.9); color: var(--ink); font-size: 1.5rem; line-height: 1;
  box-shadow: var(--shadow); transition: background 0.15s, transform 0.15s;
}
.car-btn:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.car-btn.prev { left: 14px; } .car-btn.next { right: 14px; }
.car-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.car-dots .dot {
  width: 9px; height: 9px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.5); transition: background 0.15s, transform 0.15s;
}
.car-dots .dot.active { background: #fff; transform: scale(1.25); }

/* Lecteur vidéo */
.video-wrap { border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); background: #0c0a1a; }
.video-wrap video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0c0a1a; }

/* Jeu introuvable */
.notfound { text-align: center; padding: 60px 0; }
.notfound h1 { font-size: 2rem; margin-bottom: 20px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner, .studio-inner, .game-hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .nav { position: fixed; inset: 68px 0 auto 0; background: #fff; flex-direction: column;
    align-items: flex-start; padding: 18px 6%; gap: 6px; border-bottom: 1px solid var(--line);
    transform: translateY(-130%); transition: transform 0.3s; box-shadow: var(--shadow); }
  .nav.open { transform: none; }
  .nav a { width: 100%; padding: 8px 0; }
  .nav-toggle { display: flex; }
  .hero-stats { gap: 22px; }
}
