:root {
  --bg: #0c1118;
  --surface: #141c27;
  --surface-2: #1a2331;
  --border: #273344;
  --text: #edf1f6;
  --muted: #9aa7b8;
  --accent: #ffa51f;
  --accent-ink: #221503;
  --ok: #58b07f;
  --warn: #d9a13b;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

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

.wrap {
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0c1118;
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 10px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand img { width: 34px; height: 34px; }

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.market-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
}

.search-box { flex: 1 1 220px; }

.search-box input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
}

.lang-select {
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

/* ---- Category nav ---- */
.cat-nav {
  display: flex;
  gap: 8px;
  padding-block: 12px;
  overflow-x: auto;
}

.cat-btn {
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.88rem;
  cursor: pointer;
}

.cat-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

/* ---- Stats strip ---- */
.stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding-block: 14px 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.stat { font-size: 0.9rem; color: var(--muted); }
.stat strong { color: var(--text); font-size: 1.05rem; }

.toolbar {
  display: flex;
  justify-content: flex-end;
  padding-block: 8px;
}

.toolbar select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

/* ---- Game grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 14px;
  padding-block: 8px 32px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  text-align: start;
  padding: 0;
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover, .card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cover {
  position: relative;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  overflow: hidden;
}

.cover > span {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  line-height: 1;
}

.cover.has-art::after { display: none; }

.cover img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover::after { content: ""; position: absolute; inset: 0; }

.pat-0::after { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0 9px, transparent 9px 22px); }
.pat-1::after { background-image: radial-gradient(rgba(255, 255, 255, 0.16) 2px, transparent 2.6px); background-size: 18px 18px; }
.pat-2::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 22px 22px;
}
.pat-3::after {
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.22), transparent 46%),
    radial-gradient(circle at 12% 88%, rgba(0, 0, 0, 0.2), transparent 42%);
}

.cover-sm { height: 84px; font-size: 2.1rem; }
.cover-xl { height: 120px; font-size: 3rem; border-radius: 12px; }

.card-body { padding: 10px 12px 12px; }

.card-title {
  margin: 0 0 2px;
  font-size: 0.95rem;
  font-weight: 700;
}

.card-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 8px;
  margin-top: 6px;
}

.badge-play { background: #173b2a; color: var(--ok); border: 1px solid #245c42; }
.badge-pending { background: #3a2f14; color: var(--warn); border: 1px solid #5c4a20; }

/* Fiches en attente : visuel attenue, les jouables ressortent. */
.card.is-pending .cover { filter: saturate(0.55) brightness(0.82); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

/* ---- Player page ---- */
.back-link {
  display: inline-block;
  margin-block: 14px 10px;
  text-decoration: none;
  font-size: 0.9rem;
}

#player-zone { padding-bottom: 8px; }

/* Stade : remplit la largeur dispo sans jamais depasser la hauteur d'ecran. */
.stage {
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  width: min(100%, 1200px, max(320px, calc((100svh - 190px) * 16 / 9)));
  margin-inline: auto;
}

.stage.portrait {
  aspect-ratio: 3 / 4;
  width: min(100%, 500px, max(280px, calc((100svh - 190px) * 3 / 4)));
}

.stage.square {
  aspect-ratio: 1 / 1;
  width: min(100%, 700px, max(300px, calc(100svh - 190px)));
}

.stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.stage:fullscreen {
  width: 100%;
  max-width: none;
  aspect-ratio: auto;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.stage-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.stage-loader[hidden] { display: none; }

.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--border); }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.stage-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(8, 11, 16, 0.94);
  text-align: center;
  padding: 24px;
  overflow-y: auto;
}

.stage-overlay[hidden] { display: none; }

.overlay-art { width: min(64%, 300px); }
.overlay-title { margin: 0; font-size: 1.3rem; }

.btn {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 1rem;
  padding: 12px 34px;
  cursor: pointer;
}

.btn:disabled { opacity: 0.55; cursor: wait; }
.btn-play { font-size: 1.1rem; padding: 14px 52px; }
.btn-small { font-size: 0.85rem; padding: 9px 16px; }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-size: 0.9rem;
  padding: 9px 20px;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 16px;
  cursor: pointer;
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.ad-note { font-size: 0.8rem; color: var(--muted); max-width: 420px; }

.player-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-block: 14px 6px;
  max-width: 1152px;
  margin-inline: auto;
}

.player-id h1 { margin: 0 0 2px; font-size: 1.35rem; }
.player-id p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.player-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.game-about { max-width: 1152px; margin-inline: auto; padding-block: 10px; }
.game-about h2, .similar h2 { font-size: 1.05rem; margin: 0 0 8px; }
.game-about p { margin: 0 0 10px; color: var(--muted); font-size: 0.92rem; max-width: 70ch; }

.tags { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
}

.similar { max-width: 1152px; margin-inline: auto; padding-block: 10px 28px; }

/* ---- Annonce maison (repli sans pub) ---- */
.house-ad-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 11, 16, 0.96);
}

.house-ad-card {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 28px 32px;
  max-width: 430px;
  width: 100%;
  text-align: center;
}

.house-ad-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 12px;
}

.house-ad-title { margin: 14px 0 6px; font-size: 1.35rem; }
.house-ad-body { margin: 0 0 18px; color: var(--muted); font-size: 0.95rem; }

.house-ad-cta {
  display: inline-block;
  text-decoration: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 1rem;
  padding: 12px 30px;
}

.house-ad-note { margin: 14px 0 0; font-size: 0.82rem; color: var(--warn); }

.house-ad-close {
  display: block;
  margin: 18px auto 0;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  padding: 8px 20px;
  cursor: pointer;
}

.house-ad-close:disabled { opacity: 0.65; cursor: wait; }
.house-ad-close:not(:disabled) { color: var(--accent); border-color: var(--accent); }

.demo-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--warn);
  border: 1px solid #5c4a20;
  border-radius: 999px;
  padding: 2px 10px;
}

.license-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}

.license-card h2 { margin-top: 0; }

.related { padding-block: 20px 40px; }
.related h2 { font-size: 1.1rem; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 20px 32px;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.site-footer a { color: var(--muted); }

/* ---- Rangees catalogue (style portails) ---- */
.row { margin-bottom: 4px; }

.row-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 20px 0 10px;
}

.row-head h2 { margin: 0; font-size: 1.1rem; }
.row-head .count { color: var(--muted); font-size: 0.85rem; }

.see-all {
  margin-inline-start: auto;
  background: none;
  border: 0;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
}

.rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.rail .card { flex: 0 0 186px; scroll-snap-align: start; }
.rail-featured .card { flex-basis: 290px; }
.rail-featured .cover { height: 132px; font-size: 3.2rem; }

.results-title { font-size: 1.05rem; margin: 14px 0 0; }

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .cover { height: 80px; font-size: 2.1rem; }
  .cover-sm { height: 72px; font-size: 1.8rem; }
  .cover-xl { height: 96px; font-size: 2.4rem; }
  .stats { gap: 16px; }
  .rail .card { flex-basis: 160px; }
  .rail-featured .card { flex-basis: 250px; }
  /* Stade bord a bord sur mobile. */
  #player-zone .stage {
    width: auto;
    margin-inline: -16px;
    border-radius: 0;
    border-inline: 0;
  }
  #player-zone .stage.portrait { width: min(100%, 460px); margin-inline: auto; }
  .player-bar { padding-inline: 2px; }
  .overlay-art { width: min(72%, 260px); }
  /* Chrome compact : le jeu domine l'ecran. */
  .site-header .header-row { padding-block: 8px; }
  .back-link { margin-block: 8px 6px; }
  .player-bar { padding-block: 10px 4px; }
  .player-id h1 { font-size: 1.15rem; }
}

/* ---- Animations du portail ---- */
body::before { content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none; opacity: .9;
  background: radial-gradient(40% 35% at 15% 10%, rgba(46, 125, 110, .28), transparent 70%),
    radial-gradient(35% 30% at 90% 20%, rgba(130, 90, 220, .22), transparent 70%),
    radial-gradient(40% 35% at 70% 95%, rgba(242, 163, 60, .14), transparent 70%);
  animation: aurora 24s ease-in-out infinite alternate; }
@keyframes aurora { from { transform: translate3d(-3%, -2%, 0) scale(1); } to { transform: translate3d(4%, 3%, 0) scale(1.12); } }

.hero { position: relative; margin: 4px 0 22px; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: #0f1722;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 60px rgba(46, 125, 110, .18); animation: heroIn .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.hero-stage { display: grid; }
.hero-slide { grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); opacity: 0; visibility: hidden;
  transition: opacity .8s ease, visibility .8s; }
.hero-slide.on { opacity: 1; visibility: visible; }
.hero .cover { height: 100%; min-height: 240px; border-radius: 0; }
.hero .cover img { transform: scale(1.04); }
.hero-slide.on .cover img { animation: kenburns 9s ease-out both; }
@keyframes kenburns { from { transform: scale(1.04) translate3d(0, 0, 0); } to { transform: scale(1.16) translate3d(-2%, -1.5%, 0); } }
.hero-body { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 24px 24px 34px; }
.hero-slide .hero-body > * { opacity: 0; transform: translateY(12px); }
.hero-slide.on .hero-body > * { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.hero-slide.on .hero-body > :nth-child(2) { animation-delay: .1s; }
.hero-slide.on .hero-body > :nth-child(3) { animation-delay: .2s; }
.hero-slide.on .hero-body > :nth-child(4) { animation-delay: .3s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.hero-tag { align-self: flex-start; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800;
  color: var(--accent-ink); background: var(--accent); padding: 4px 10px; border-radius: 999px; }
.hero h2 { margin: 0; font-size: 1.8rem; line-height: 1.1; }
.hero p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.45; }
.hero-cta { position: relative; overflow: hidden; align-self: flex-start; margin-top: 4px; padding: 12px 26px; border-radius: 12px; font-weight: 800;
  text-decoration: none; color: var(--accent-ink); background: linear-gradient(180deg, #ffbd5c, #f08a1c);
  box-shadow: 0 6px 22px rgba(242, 140, 28, .35); transition: transform .15s, box-shadow .15s; }
.hero-cta::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%); animation: shimmer 3.2s ease-in-out 1.2s infinite; }
@keyframes shimmer { 60%, 100% { transform: translateX(120%); } }
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(242, 140, 28, .55); }
.hero-dots { position: absolute; inset-inline-end: 16px; bottom: 12px; display: flex; gap: 7px; z-index: 2; }
.hero-dot { width: 9px; height: 9px; padding: 0; border-radius: 99px; border: 0; background: rgba(255, 255, 255, .35); cursor: pointer; transition: width .3s, background .3s; }
.hero-dot.on { width: 26px; background: var(--accent); }
.hero-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; background: linear-gradient(90deg, var(--accent), #7de3a8);
  animation: heroBar 6.5s linear forwards; z-index: 2; }
@keyframes heroBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Cartes : apparition en cascade, survol vivant */
.reveal { opacity: 0; transform: translateY(18px) scale(.97); }
.reveal.in { opacity: 1; transform: none; transition: opacity .55s ease calc(var(--i, 0) * 60ms), transform .6s cubic-bezier(.2, .8, .2, 1) calc(var(--i, 0) * 60ms); }
.card { position: relative; transition: border-color .2s, box-shadow .25s, transform .25s cubic-bezier(.2, .8, .2, 1); }
.card.reveal.in:hover, .card:hover { transform: translateY(-5px) scale(1.015); transition-delay: 0s; }
.card .cover img { transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.card:hover .cover img { transform: scale(1.1); }
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .13) 50%, transparent 65%); transform: translateX(-120%); }
.card:hover::after { transform: translateX(120%); transition: transform .8s ease; }
.card:hover { box-shadow: 0 14px 30px rgba(0, 0, 0, .5), 0 0 22px rgba(255, 165, 31, .18); }
.badge-play { position: relative; }
.badge-play::before { content: ""; position: absolute; inset-inline-start: 6px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%;
  background: var(--ok); animation: pulse 2s ease-in-out infinite; }
.badge-play { padding-inline-start: 18px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(88, 176, 127, .6); } 50% { box-shadow: 0 0 0 6px rgba(88, 176, 127, 0); } }
.cat-btn { transition: transform .15s, background .2s, border-color .2s; }
.cat-btn:hover { transform: translateY(-2px); }
.row-head.reveal.in h2 { animation: slideTitle .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes slideTitle { from { letter-spacing: .08em; opacity: .3; } to { letter-spacing: 0; opacity: 1; } }

@media (max-width: 640px) { .hero-slide { grid-template-columns: 1fr; } .hero .cover { min-height: 170px; } .hero h2 { font-size: 1.4rem; } .hero-body { padding-bottom: 38px; } .hero-dots { inset-inline-end: 50%; transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) {
  body::before, .hero, .hero-slide.on .cover img, .hero-cta::after, .badge-play::before, .hero-bar { animation: none !important; }
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
  .hero-slide { transition: none; } .hero-slide .hero-body > * { opacity: 1; transform: none; animation: none !important; }
  .card, .card:hover, .card:hover .cover img { transform: none; transition: none; }
}

/* Aperçus vidéo dans les jaquettes */
.cover video { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; background: #070b14; }
.cover video.on { opacity: 1; }
.cover.has-preview::before { content: "▶"; position: absolute; z-index: 3; inset-inline-end: 8px; top: 8px; width: 24px; height: 24px; display: grid; place-items: center;
  font-size: .62rem; color: #fff; background: rgba(8, 12, 20, .62); border: 1px solid rgba(255, 255, 255, .25); border-radius: 50%; backdrop-filter: blur(4px);
  transition: opacity .3s; }
.cover.has-preview:has(video.on)::before { opacity: 0; }

/* ---- Plein écran immersif : le jeu couvre l'écran, sortie en un geste ---- */
.exit-btn { display: none; }
body.immersive { overflow: hidden; overscroll-behavior: none; }
body.immersive .site-header, body.immersive .back-link, body.immersive .player-bar, body.immersive .game-about,
body.immersive .similar, body.immersive .site-footer { display: none; }
body.immersive #player-zone .stage, body.immersive #player-zone .stage.portrait, body.immersive #player-zone .stage.square {
  position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  aspect-ratio: auto; margin: 0; border: 0; border-radius: 0; background: #05070c; }
body.immersive .exit-btn { display: inline-flex; align-items: center; gap: 6px; position: absolute; z-index: 30;
  top: max(10px, env(safe-area-inset-top)); inset-inline-start: max(10px, env(safe-area-inset-left)); min-height: 40px; padding: 0 14px 0 12px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(8, 12, 20, .68); color: #fff; font: inherit; font-weight: 700; font-size: .85rem;
  cursor: pointer; backdrop-filter: blur(6px); opacity: .72; transition: opacity .2s, transform .15s; }
body.immersive .exit-btn:hover, body.immersive .exit-btn:focus-visible { opacity: 1; }
body.immersive .exit-btn:active { transform: scale(.94); }
body.immersive .stage-overlay { display: none; }
@media (max-width: 420px) { body.immersive .exit-btn .exit-label { display: none; } body.immersive .exit-btn { padding: 0; width: 40px; justify-content: center; } }

/* ---- Compte, classements, toasts (auth.js / lb.js) ---- */
.nav-link { color: var(--text); text-decoration: none; font-weight: 700; font-size: .9rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); transition: border-color .2s, color .2s; }
.nav-link:hover, .nav-link.is-current { border-color: var(--accent); color: var(--accent); }
.header-gap { flex: 1; }
.ax-acct { position: relative; display: flex; }
.ax-acct[hidden] { display: none; }
.ax-acct-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 170px; padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; transition: border-color .2s; }
.ax-acct-btn:hover, .ax-acct-btn[aria-expanded="true"] { border-color: var(--accent); }
.ax-acct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax-skel { min-width: 90px; height: 36px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 200% 100%; animation: axsk 1.2s linear infinite; }
@keyframes axsk { to { background-position: -200% 0; } }
.ax-av { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; overflow: hidden; font-weight: 800; font-size: .85rem; color: #fff; background: hsl(var(--h, 210) 45% 38%); }
.ax-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ax-av-lg { width: 42px; height: 42px; font-size: 1.05rem; }
.ax-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 40; width: min(280px, calc(100vw - 24px)); padding: 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); animation: rise .18s ease both; }
.ax-menu[hidden] { display: none; }
.ax-menu-head { display: flex; gap: 10px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.ax-menu-head > div { min-width: 0; }
.ax-menu-head strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax-menu-head small { display: block; color: var(--muted); font-size: .74rem; line-height: 1.3; }
.ax-item { display: block; width: 100%; text-align: start; padding: 10px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: .9rem; text-decoration: none; cursor: pointer; }
.ax-item:hover, .ax-item:focus-visible { background: var(--surface-2); }
.ax-item-danger { color: #ff8a7a; }
@media (max-width: 640px) { .ax-acct-name { display: none; } .ax-acct-btn { padding: 3px; } .header-row { gap: 8px; } .nav-link { padding: 5px 10px; } }

.ax-dlg { width: min(400px, calc(100vw - 24px)); padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.ax-dlg::backdrop { background: rgba(5, 8, 12, .72); }
.ax-dlg h2 { margin: 0 0 8px; font-size: 1.2rem; }
.ax-dlg h3 { margin: 0 0 8px; font-size: .8rem; color: var(--muted); font-weight: 700; }
.ax-dlg-note { color: var(--muted); font-size: .85rem; margin: 6px 0 14px; }
.ax-dlg input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.ax-dlg input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ax-wide { display: block; width: 100%; margin-top: 10px; }
.ax-row { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.ax-row input { flex: 1; }
.ax-test { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); }
.ax-err { color: #ff8a7a; font-size: .85rem; margin: 0 0 10px; }
.ax-err[hidden] { display: none; }
.ax-danger { background: #d9503f; color: #fff; }

.ax-toast { position: fixed; z-index: 2147483000; inset-inline: 0; bottom: max(14px, env(safe-area-inset-bottom)); margin-inline: auto; width: max-content; max-width: min(92vw, 460px); display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 999px; background: rgba(20, 28, 39, .96); border: 1px solid var(--border); color: var(--text); font: 600 .86rem/1.3 var(--font); box-shadow: 0 8px 28px rgba(0, 0, 0, .55); animation: toastIn .3s cubic-bezier(.2, .8, .2, 1) both; pointer-events: none; }
.ax-toast-act { pointer-events: auto; border: 0; border-radius: 999px; padding: 5px 12px; background: var(--accent); color: var(--accent-ink); font: 800 .8rem var(--font); cursor: pointer; white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Page classement */
.lb-page { padding-block: 18px 40px; max-width: 760px; }
.lb-h1 { margin: 0 0 14px; font-size: 1.7rem; animation: slideTitle .6s cubic-bezier(.2, .8, .2, 1) both; }
.lb-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); width: fit-content; max-width: 100%; overflow-x: auto; }
.lb-tab { border: 0; border-radius: 999px; padding: 8px 18px; background: transparent; color: var(--muted); font: 700 .9rem var(--font); cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.lb-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.lb-filters { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.lb-select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 .95rem var(--font); }
.lb-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 5px 14px; font: 600 .84rem var(--font); cursor: pointer; }
.lb-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#lb-panel { margin-top: 16px; min-height: 240px; }
.lb-in { animation: rise .35s ease both; }
.lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 9px 14px 9px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); opacity: 0; transform: translateY(8px); animation: rise .4s cubic-bezier(.2, .8, .2, 1) calc(var(--i, 0) * 35ms) both; }
.lb-row.is-me { border-color: var(--accent); background: linear-gradient(90deg, rgba(255, 165, 31, .16), var(--surface) 70%); box-shadow: 0 0 22px rgba(255, 165, 31, .15); }
.lb-rk { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--muted); }
.lb-rk.m1, .lb-rk.m2, .lb-rk.m3 { color: #2b1a02; box-shadow: inset 0 -3px 5px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .4); }
.lb-rk.m1 { background: radial-gradient(circle at 35% 30%, #fff1b8, #f2a33c 60%, #b86a0b); }
.lb-rk.m2 { background: radial-gradient(circle at 35% 30%, #fff, #b6c2d4 60%, #6f7f98); }
.lb-rk.m3 { background: radial-gradient(circle at 35% 30%, #ffd9b8, #d9884a 60%, #8a4a1c); }
.lb-who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.lb-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.lb-who em { font-style: normal; font-size: .68rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.lb-who small { flex-basis: 100%; color: var(--muted); font-size: .76rem; }
.lb-val { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-gap { text-align: center; color: var(--muted); line-height: .8; }
.lb-link { cursor: pointer; }
.lb-link:hover { border-color: var(--accent); }
.lb-game { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); color: var(--accent); }
.lb-me { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; border-radius: 14px; border: 1px solid var(--accent); background: linear-gradient(100deg, rgba(255, 165, 31, .2), rgba(130, 90, 220, .12)); }
.lb-me-rk { font-size: 1.7rem; font-weight: 900; color: var(--accent); }
.lb-me strong { display: block; font-size: 1.05rem; }
.lb-me small { color: var(--muted); }
.lb-me-login { justify-content: space-between; flex-wrap: wrap; border-color: var(--border); background: var(--surface); }
.lb-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: .85rem; }
.lb-note { color: var(--muted); font-size: .78rem; text-align: center; margin: 14px 0 0; }
.lb-state { text-align: center; padding: 44px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lb-state p { margin: 0; color: var(--text); font-weight: 700; }
.lb-state .btn { margin-top: 10px; text-decoration: none; display: inline-block; }
.lb-trophy { font-size: 2.6rem; filter: grayscale(.3); animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.lb-skel { opacity: 1; transform: none; animation: none; pointer-events: none; }
.lb-skel .lb-rk, .lb-skel .ax-av, .lb-skel b, .lb-skel .lb-val { background: linear-gradient(100deg, var(--surface-2) 30%, #26334a 50%, var(--surface-2) 70%) 0 0 / 200% 100%; animation: axsk 1.2s linear infinite; border-radius: 8px; }
.lb-skel b { display: block; width: 55%; height: 14px; }
.lb-skel .lb-val { width: 56px; height: 14px; }
@media (prefers-reduced-motion: reduce) { .lb-row, .lb-in, .lb-trophy, .ax-skel, .lb-skel * { animation: none !important; opacity: 1; transform: none; } }

/* Bloc classement de la page de jeu */
.lb-zone { max-width: 1152px; margin-inline: auto; padding-block: 12px 4px; }
.lb-zone[hidden] { display: none; }
.lb-zone-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lb-zone-head h2 { margin: 0; font-size: 1.05rem; }
.lb-zone-head .lb-select { width: auto; padding: 6px 10px; font-size: .85rem; }
.lb-zone-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.lb-zone .lb-state { padding: 18px 8px; }
.lb-zone .lb-trophy { font-size: 1.8rem; }
body.immersive .lb-zone { display: none; }
.lb-filters[hidden] { display: none; }
.lb-page a.btn, .lb-zone a.btn { text-decoration: none; display: inline-block; }
@media (max-width: 520px) { .site-header .market-badge { display: none; } }
.lb-val, .lb-who small, .lb-who strong, .lb-me small, .lb-me strong, .ax-toast span { unicode-bidi: plaintext; }
@media (max-width: 480px) { .site-header .brand-name { display: none; } }
