:root {
    color-scheme: dark;

    --ink-950: #03060d;
    --line: rgba(124, 168, 240, 0.16);
    --line-soft: rgba(124, 168, 240, 0.09);
    --glass: rgba(16, 36, 74, 0.34);
    --glass-hi: rgba(28, 58, 112, 0.5);

    --text: #e9f0ff;
    --muted: #8ea4c6;
    --dim: #5d729a;

    --azure: #2f8bff;
    --azure-deep: #0d73e6;
    --azure-hi: #8fc8ff;
    --amber: #f7ad2b;

    --display: var(--font-satoshi), "Segoe UI", system-ui, sans-serif;
    --body: var(--font-general), "Segoe UI", system-ui, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --gutter: clamp(18px, 3.2vw, 54px);
  }

  /* La page d'accueil occupe l'ecran : aucun defilement, aucune barre. */
  html:has(.app), body:has(.app) { height: 100%; overflow: hidden; }

  .app * { box-sizing: border-box; }
  .app {
    color: var(--text);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
  }

  .app h1, .app h2, .app h3 {
    font-family: var(--display);
    font-weight: 600;
    text-wrap: balance;
    margin: 0;
  }

  .app a { color: inherit; text-decoration: none; }
  .app :focus-visible { outline: 2px solid var(--azure-hi); outline-offset: 3px; border-radius: 8px; }

  /* ── Plateau plein écran ─────────────────────────────────────── */
  .app {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: radial-gradient(120% 80% at 50% 2%, #0a1a38 0%, #05090f 56%, #03060d 100%);
  }
  #fx {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: pan-y;
  }
  #fx.dragging { cursor: grabbing; }

  /* ── Barre haute ─────────────────────────────────────────────── */
  .topbar {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px var(--gutter);
    pointer-events: none;
  }
  .topbar > * { pointer-events: auto; }
  .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--display);
    font-weight: 600;
    font-size: 15px;
  }
  .brand svg { width: 20px; height: 20px; color: var(--azure-hi); }
  .topnav { display: flex; align-items: center; gap: 2px; }
  .topnav a {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: #c2d4f2;
    transition: background 0.2s, color 0.2s;
  }
  .topnav a:hover { background: rgba(47, 139, 255, 0.16); color: #fff; }

  .topright { display: flex; align-items: center; gap: 14px; }
  .who { font-size: 13px; color: #c2d4f2; white-space: nowrap; }
  .who b { color: #fff; font-weight: 600; }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
  }
  .btn-primary {
    background: linear-gradient(180deg, #49a0ff, var(--azure-deep));
    color: #04101f;
    box-shadow: 0 10px 30px -12px rgba(47, 139, 255, 0.9);
  }
  .btn-primary:hover { transform: translateY(-1px); background: linear-gradient(180deg, #6ab3ff, #1a82f0); }
  .btn-ghost {
    border-color: var(--line);
    background: var(--glass);
    color: var(--text);
    backdrop-filter: blur(14px);
  }
  .btn-ghost:hover { border-color: rgba(143, 200, 255, 0.4); background: var(--glass-hi); }
  .btn-sm { padding: 9px 18px; font-size: 13px; }

  /* ── Texte posé sur la scène ─────────────────────────────────── */
  .hud {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-content: start;
    gap: 24px;
    padding: clamp(74px, 9vh, 104px) var(--gutter) 0;
    pointer-events: none;
  }
  .hud a, .hud button { pointer-events: auto; }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 15px 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--glass);
    backdrop-filter: blur(14px);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #b8cdf0;
  }
  .eyebrow b {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--azure-hi);
    box-shadow: 0 0 10px 2px rgba(143, 200, 255, 0.85);
    animation: pulse 2.6s ease-in-out infinite;
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.72); }
  }

  .copy { max-width: min(30rem, 42vw); }
  .copy h1 {
    font-size: clamp(2rem, 3.4vw + 0.6vh, 4rem);
    line-height: 0.95;
    letter-spacing: -0.025em;
    margin-top: 14px;
  }
  .copy h1 em { font-style: normal; color: var(--azure-hi); }
  .copy p {
    margin: 14px 0 20px;
    color: var(--muted);
    font-size: clamp(0.88rem, 0.42vw + 0.7rem, 1rem);
  }
  .cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
  .cta-row .host { font-family: var(--mono); font-size: 12px; color: var(--dim); }

  .facts {
    justify-self: end;
    align-self: start;
    display: grid;
    align-content: start;
    gap: 8px;
    max-width: min(24rem, 36vw);
  }
  .fact {
    padding: 11px 15px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(20, 44, 88, 0.36), rgba(8, 18, 38, 0.22));
    backdrop-filter: blur(10px);
  }
  .fact h3 { font-size: 0.9rem; margin-bottom: 2px; }
  .fact p { margin: 0; font-size: 0.78rem; color: var(--muted); line-height: 1.4; }

  .stats { display: flex; gap: 8px; }
  .stat {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(20, 44, 88, 0.36), rgba(8, 18, 38, 0.22));
    backdrop-filter: blur(10px);
  }
  .stat b {
    display: block;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }
  .stat span { display: block; margin-top: 4px; font-size: 0.7rem; color: var(--muted); line-height: 1.3; }

  .nodes {
    padding: 12px 15px 13px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(20, 44, 88, 0.36), rgba(8, 18, 38, 0.22));
    backdrop-filter: blur(10px);
  }
  .nodes h3 { font-size: 0.82rem; margin-bottom: 8px; }
  .nodes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
  .nodes li {
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr) auto;
    gap: 10px;
    align-items: baseline;
    font-size: 0.78rem;
    color: var(--muted);
  }
  .nodes code { font-family: var(--mono); font-size: 0.7rem; color: var(--azure-hi); }
  .nodes .ms { font-family: var(--mono); font-size: 0.68rem; color: var(--dim); }
  .nodes footer { margin-top: 9px; font-size: 0.72rem; color: var(--dim); }

  .swap { animation: swap 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
  @keyframes swap {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }

  /* ── Carrousel principal ─────────────────────────────────────── */
  .orbit { position: absolute; inset: 0; z-index: 15; pointer-events: none; }
  .chip {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 18px 11px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(9, 22, 48, 0.62);
    backdrop-filter: blur(12px);
    color: #cfdffa;
    font-family: var(--body);
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
    transition: border-color 0.25s, background 0.25s, color 0.25s, box-shadow 0.25s;
  }
  .chip svg { width: 17px; height: 17px; color: var(--azure-hi); flex: none; }
  .chip:hover { border-color: rgba(143, 200, 255, 0.55); background: rgba(22, 50, 104, 0.78); color: #fff; }
  .chip[aria-pressed="true"] {
    border-color: rgba(120, 186, 255, 0.85);
    background: linear-gradient(180deg, rgba(47, 116, 214, 0.88), rgba(14, 44, 96, 0.88));
    color: #fff;
    box-shadow: 0 0 0 1px rgba(47, 139, 255, 0.35), 0 14px 40px -12px rgba(47, 139, 255, 0.95);
    animation: chipGlow 3.2s ease-in-out infinite;
  }
  .chip[aria-pressed="true"] svg { color: #fff; }
  @keyframes chipGlow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(47, 139, 255, 0.3), 0 14px 40px -14px rgba(47, 139, 255, 0.8); }
    50% { box-shadow: 0 0 0 1px rgba(120, 190, 255, 0.55), 0 18px 52px -12px rgba(47, 139, 255, 1); }
  }
  .orbit.dim .chip { opacity: 0.3 !important; }
  .chip .soon {
    margin-left: 2px;
    padding: 3px 7px;
    border: 1px solid rgba(247, 173, 43, 0.4);
    border-radius: 999px;
    background: rgba(247, 173, 43, 0.14);
    color: var(--amber);
    font-family: var(--mono);
    font-size: 9.5px;
    font-style: normal;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .chip[aria-pressed="true"] .soon { color: #ffd58a; border-color: rgba(255, 213, 138, 0.55); }
  .soon-card {
    display: grid;
    gap: 3px;
    padding: 11px 15px;
    border: 1px solid rgba(247, 173, 43, 0.38);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(247, 173, 43, 0.16), rgba(60, 38, 8, 0.2));
    backdrop-filter: blur(10px);
  }
  .soon-card b { font-family: var(--display); font-size: 0.95rem; font-weight: 600; color: #ffd58a; }
  .soon-card span { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }

  /* ── Sous-menu des jeux ──────────────────────────────────────── */
  .subdeck { position: absolute; inset: 0; z-index: 18; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s; }
  .subdeck.open { opacity: 1; visibility: visible; }
  .game {
    position: absolute;
    left: 0;
    top: 0;
    width: 132px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 12px 10px 13px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(8, 20, 44, 0.66);
    backdrop-filter: blur(12px);
    cursor: pointer;
    pointer-events: auto;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
  }
  .game canvas { width: 88px; height: 88px; display: block; image-rendering: pixelated; }
  .game span {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.1em;
    color: #b7cdf0;
    white-space: nowrap;
  }
  .game:hover { border-color: rgba(143, 200, 255, 0.55); background: rgba(18, 44, 92, 0.78); }
  .game[aria-pressed="true"] {
    border-color: rgba(120, 186, 255, 0.9);
    background: linear-gradient(180deg, rgba(38, 96, 184, 0.8), rgba(10, 30, 68, 0.85));
    box-shadow: 0 0 0 1px rgba(47, 139, 255, 0.35), 0 18px 48px -14px rgba(47, 139, 255, 0.95);
  }
  .game[aria-pressed="true"] span { color: #fff; }

  .back {
    position: absolute;
    left: 50%;
    bottom: 92px;
    transform: translateX(-50%);
    z-index: 19;
    pointer-events: auto;
    padding: 9px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(9, 22, 48, 0.7);
    backdrop-filter: blur(12px);
    color: #c2d4f2;
    font-family: var(--body);
    font-size: 13px;
    cursor: pointer;
  }
  .back:hover { border-color: rgba(143, 200, 255, 0.5); color: #fff; }

  /* ── Bandeau bas ─────────────────────────────────────────────── */
  .footbar {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px var(--gutter);
    border-top: 1px solid var(--line-soft);
    background: linear-gradient(to top, rgba(3, 6, 13, 0.92), rgba(3, 6, 13, 0));
    font-size: 12px;
    color: var(--dim);
    pointer-events: none;
  }
  .footbar a { pointer-events: auto; }
  .footbar nav { display: flex; flex-wrap: wrap; gap: 16px; }
  .footbar a:hover { color: var(--azure-hi); }
  .hint {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }
  .tail { display: inline-flex; align-items: center; gap: 12px; }
  .sfx {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    background: rgba(9, 22, 48, 0.6);
    color: #9fbde6;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
  }
  .sfx svg { width: 16px; height: 16px; }
  .sfx:hover { color: #fff; border-color: rgba(143, 200, 255, 0.45); }
  .sfx .slash { display: none; }
  .sfx.off { color: var(--dim); }
  .sfx.off .w { display: none; }
  .sfx.off .slash { display: block; }

  /* ── Écrans étroits ──────────────────────────────────────────── */
  @media (max-width: 899px) {
    .topnav, .facts, .who { display: none; }
    .hud {
      grid-template-columns: minmax(0, 1fr);
      padding-top: 60px;
      background: linear-gradient(to bottom, rgba(3, 6, 13, 0.92) 0%, rgba(3, 6, 13, 0.74) 32%, rgba(3, 6, 13, 0) 62%);
    }
    .copy { max-width: none; }
    .copy h1 { font-size: clamp(1.55rem, 6.4vw, 2.1rem); margin-top: 10px; }
    .copy p { margin: 9px 0 13px; font-size: 0.85rem; }
    .eyebrow { padding: 5px 12px 5px 10px; font-size: 10px; }
    .btn { padding: 10px 18px; font-size: 13px; }
    .orbit, .subdeck {
      inset: auto 0 84px 0;
      display: flex;
      gap: 8px;
      overflow-x: auto;
      scrollbar-width: none;
      padding: 8px var(--gutter);
      scroll-snap-type: x proximity;
      overscroll-behavior-x: contain;
      pointer-events: auto;
    }
    .orbit::-webkit-scrollbar, .subdeck::-webkit-scrollbar { display: none; }
    .subdeck { align-items: flex-end; }
    .chip, .game {
      position: static !important;
      transform: none !important;
      opacity: 1 !important;
      flex: none;
      scroll-snap-align: center;
    }
    .game { width: 104px; }
    .game canvas { width: 68px; height: 68px; }
    .orbit.dim { display: none; }
    .back { bottom: 232px; }
    .footbar {
      flex-wrap: wrap;
      justify-content: flex-start;
      gap: 3px 14px;
      font-size: 11px;
      padding-block: 8px 10px;
    }
    .footbar .hint { display: none; }
    .sfx { width: 26px; height: 26px; }
  }

  @media (prefers-reduced-motion: reduce) {
    .swap, .eyebrow b, .chip[aria-pressed="true"] { animation: none; }
  }
