/* Mosapop : feuille de style du site.
   Concept : une plaque de construction. Fond crème à tenons discrets, sections posées comme des briques (rangée de
   tenons sur le bord haut), boutons « bonbon » qui s'enfoncent, mosaïques dessinées en vraies briques (site.js).
   Couleurs = palette des briques du jeu (DesignData.swift). Thème clair et thème nuit. */

@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(/fonts/fredoka-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(/fonts/fredoka-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/fonts/nunito-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/fonts/nunito-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/fonts/nunito-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }

:root {
  /* Couleurs */
  --bg: #FFF6EC;
  --bg-2: #F1ECFC;
  --surface: #FFFFFF;
  --surface-2: #FBF6FF;
  --ink: #2E2340;
  --ink-2: #4A3F5C;
  --muted: #6E6480;
  --line: #EADFF0;
  --stud: rgba(46, 35, 64, .055);
  --red: #D9453A;
  --red-deep: #A52E25;
  --yellow: #F5C542;
  --yellow-deep: #C99A1E;
  --blue: #3A86F0;
  --blue-deep: #2563C4;
  --green: #46A85F;
  --red-ink: #B8352B;   /* rouge pour le petit texte : contraste AA sur les fonds clairs */
  --green-ink: #2E8049;
  --orange: #F08A2E;
  --violet: #9B5DE5;
  --pink: #F29BB2;
  --teal: #2BB3B0;
  --link: #B8342A;
  --focus: #3A86F0;
  --shadow: 0 1px 0 rgba(46, 35, 64, .04), 0 10px 30px -12px rgba(46, 35, 64, .22);
  --shadow-lg: 0 30px 60px -24px rgba(46, 35, 64, .35);
  /* Typographie */
  --font-display: "Fredoka", ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
  /* Mesures */
  --radius: 22px;
  --radius-sm: 14px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --maxw: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15111C; --bg-2: #1D1727; --surface: #221B2D; --surface-2: #2A2236; --ink: #F7F1FF; --ink-2: #DDD3EC;
    --muted: #B3A8C4; --line: #3A3048; --stud: rgba(255, 255, 255, .045); --link: #FF8C7F; --red-deep: #C0392B; --red-ink: #FF7A6E; --green-ink: #5CC478;
    --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 14px 34px -14px rgba(0, 0, 0, .6); --shadow-lg: 0 30px 60px -24px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15111C; --bg-2: #1D1727; --surface: #221B2D; --surface-2: #2A2236; --ink: #F7F1FF; --ink-2: #DDD3EC;
  --muted: #B3A8C4; --line: #3A3048; --stud: rgba(255, 255, 255, .045); --link: #FF8C7F; --red-deep: #C0392B; --red-ink: #FF7A6E; --green-ink: #5CC478;
  --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 14px 34px -14px rgba(0, 0, 0, .6); --shadow-lg: 0 30px 60px -24px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
/* Écritures sans police dessinée pour elles : polices du système, un peu plus grandes */
:lang(ar) { --font-display: "SF Arabic Rounded", "SF Arabic", "Noto Kufi Arabic", "Geeza Pro", system-ui, sans-serif; --font-body: "SF Arabic", "Noto Sans Arabic", "Geeza Pro", system-ui, sans-serif; }
:lang(ja) { --font-display: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; --font-body: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif; }
:lang(ko) { --font-display: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; --font-body: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; }
:lang(zh-Hant) { --font-display: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; --font-body: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.6;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(circle at 12px 12px, var(--stud) 5px, transparent 5.5px);
  background-size: 24px 24px;
}
img, canvas, svg, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
:lang(ar) :is(h1, h2, h3), :lang(ja) :is(h1, h2, h3), :lang(ko) :is(h1, h2, h3), :lang(zh-Hant) :is(h1, h2, h3) { letter-spacing: 0; line-height: 1.25; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5.2rem); font-weight: 700; }
/* mots très longs (« Datenschutzerklärung », « Gebruiksvoorwaarden ») : césure plutôt que débordement sur mobile */
h1, h2 { overflow-wrap: break-word; }
@media (max-width: 600px) { h1, h2 { overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 12 5 5; } }
h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 700; }
h3 { font-size: 1.32rem; font-weight: 600; }
p { margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 800; text-decoration: none; }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 10px); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-weight: 900; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--red-ink); }
:lang(ar) .eyebrow, :lang(ja) .eyebrow, :lang(ko) .eyebrow, :lang(zh-Hant) .eyebrow { letter-spacing: .02em; }
.eyebrow::before { content: ""; width: 14px; height: 14px; border-radius: 4px; background: currentColor; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.lead { font-size: clamp(1.08rem, 1.6vw, 1.28rem); color: var(--ink-2); max-width: 60ch; }

/* ---------- En-tête ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); }
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; letter-spacing: -.01em; }
.brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.nav { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink-2); font-weight: 800; text-decoration: none; padding: 9px 12px; border-radius: 12px; font-size: .97rem; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav .btn { margin-inline-start: 6px; }
.nav a.btn, .nav a.btn:hover { color: var(--t); background: var(--c); }
.btn.menu-toggle { display: none; margin-inline-start: auto; }
@media (max-width: 860px) {
  .btn.menu-toggle { display: inline-flex; }
  .nav { position: fixed; inset: calc(env(safe-area-inset-top, 0px) + 68px) 0 auto; flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg); padding: 10px var(--gutter-r) 18px var(--gutter-l); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); }
  .nav[hidden] { display: none !important; }
  .nav a { padding: 14px 12px; font-size: 1.1rem; }
  .nav .btn { margin: 8px 0 0; justify-content: center; }
}

/* ---------- Boutons « brique » ---------- */
.btn { --c: var(--red); --c-deep: var(--red-deep); --t: #fff;
  display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer; text-decoration: none; font-family: var(--font-display);
  font-weight: 600; font-size: 1.08rem; line-height: 1; color: var(--t); background: var(--c); padding: 15px 22px 17px; border-radius: 16px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.28), inset 0 -2px 0 rgba(0,0,0,.08), 0 5px 0 var(--c-deep), 0 12px 22px -10px var(--c-deep);
  transition: transform .12s ease, box-shadow .12s ease; -webkit-tap-highlight-color: transparent; }
.btn:hover { transform: translateY(-1px); box-shadow: inset 0 2px 0 rgba(255,255,255,.28), inset 0 -2px 0 rgba(0,0,0,.08), 0 6px 0 var(--c-deep), 0 16px 26px -10px var(--c-deep); }
.btn:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255,255,255,.2), 0 1px 0 var(--c-deep), 0 4px 10px -6px var(--c-deep); }
.btn.small { font-size: .95rem; padding: 10px 14px 12px; border-radius: 12px; box-shadow: inset 0 2px 0 rgba(255,255,255,.28), 0 3px 0 var(--c-deep); }
.btn.small:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--c-deep); }
.btn.yellow { --c: var(--yellow); --c-deep: var(--yellow-deep); --t: #3B2A05; }
.btn.blue { --c: #2D6CCF; --c-deep: #1F52A8; }
.btn.ghost { --c: var(--surface); --c-deep: var(--line); --t: var(--ink); }
.btn svg { width: 22px; height: 22px; flex: none; }
.store { display: inline-flex; align-items: center; gap: 12px; background: #000; color: #fff; text-decoration: none; padding: 10px 20px 11px 16px; border-radius: 14px; box-shadow: 0 5px 0 #3a3a3a, 0 14px 24px -12px rgba(0,0,0,.6); transition: transform .12s ease, box-shadow .12s ease; }
:root[data-theme="dark"] .store, :root:not([data-theme="light"]) .store { }
.store:hover { transform: translateY(-1px); }
.store:active { transform: translateY(4px); box-shadow: 0 1px 0 #3a3a3a; }
.store svg { width: 28px; height: 28px; flex: none; }
.store span { display: grid; line-height: 1.1; }
.store small { font-size: .72rem; font-weight: 700; opacity: .85; letter-spacing: .02em; }
.store b { font-family: -apple-system, "SF Pro Display", var(--font-body); font-size: 1.22rem; font-weight: 600; letter-spacing: -.01em; }
.cta-note { font-size: .9rem; color: var(--muted); font-weight: 700; }

/* ---------- Sections et briques ---------- */
section { padding-block: clamp(64px, 9vw, 120px); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); max-width: 760px; }
.section-head.center { margin-inline: auto; text-align: center; justify-items: center; }
.brick-card { position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.brick-card.studs::before { content: ""; position: absolute; top: -10px; inset-inline-start: 22px; width: 92px; height: 12px;
  background: radial-gradient(circle at 11px 11px, var(--sc, var(--surface)) 9px, transparent 9.5px) 0 0 / 34px 22px repeat-x;
  filter: drop-shadow(0 -1px 0 rgba(0,0,0,.05)); }
.band { background: var(--bg-2); }
.band-dark { background: #221A33; color: #F7F1FF; --red-ink: #FF7A6E; --ink: #F7F1FF; --ink-2: #DDD3EC; --muted: #B9AECB; --surface: #2D2340; --line: #3E3352; --link: #FF9D91; }
.stud-rule { height: 22px; background: radial-gradient(circle at 12px 9px, var(--sr, var(--yellow)) 8px, transparent 8.5px) 0 0 / 24px 22px repeat-x; opacity: .9; }

/* ---------- Accueil : héros ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(36px, 6vw, 80px) clamp(56px, 8vw, 110px);
  background: radial-gradient(1200px 520px at 85% 10%, color-mix(in srgb, var(--violet) 18%, transparent), transparent 70%),
              radial-gradient(900px 500px at 0% 100%, color-mix(in srgb, var(--yellow) 22%, transparent), transparent 70%); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 70px); align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.6rem); }
.hero h1 em { font-style: normal; color: var(--red); position: relative; }
.hero-copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; min-width: 0; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.stat { background: var(--surface); border-radius: 14px; padding: 8px 14px 9px; box-shadow: var(--shadow); display: grid; line-height: 1.15; }
.stat b { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { font-size: .82rem; color: var(--muted); font-weight: 800; }
.stat:nth-child(1) b { color: var(--red); } .stat:nth-child(2) b { color: var(--blue); } .stat:nth-child(3) b { color: var(--green-ink); } .stat:nth-child(4) b { color: var(--violet); }
.hero-stage { position: relative; min-width: 0; }
.plate-3d { position: relative; perspective: 1400px; width: 100%; max-width: 520px; margin-inline: auto; }
.plate-flip { position: relative; aspect-ratio: 1; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.65,.05,.25,1); transform: rotateX(8deg) rotateZ(-3deg); }
.plate-flip.flipped { transform: rotateX(8deg) rotateZ(-3deg) rotateY(180deg); }
.plate-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 26px; overflow: hidden;
  box-shadow: 0 2px 0 rgba(255,255,255,.5) inset, 0 -8px 0 rgba(0,0,0,.12) inset, 0 40px 70px -28px rgba(46,35,64,.55), 0 10px 0 #C9C0D3; background: #EDE7F3; }
.plate-face canvas { width: 100%; height: 100%; }
.plate-face.back { transform: rotateY(180deg); background: #fff; }
.plate-face.back img { width: 100%; height: 100%; object-fit: cover; }
.plate-caption { margin-top: 26px; text-align: center; color: var(--muted); font-size: .92rem; font-weight: 700; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.plate-caption b { color: var(--ink); }
.demo-toggle { border: 0; background: var(--surface); color: var(--ink); width: 34px; height: 34px; border-radius: 50%; box-shadow: var(--shadow); cursor: pointer; display: inline-grid; place-items: center; }
.demo-toggle svg { width: 14px; height: 14px; }
.hero-mascot { position: absolute; width: clamp(110px, 16vw, 190px); inset-inline-end: -4%; bottom: -8%; z-index: 3; filter: drop-shadow(0 18px 18px rgba(46,35,64,.28)); animation: bob 4.5s ease-in-out infinite; }
.hero-mascot.left { inset-inline-end: auto; inset-inline-start: -6%; bottom: auto; top: -6%; width: clamp(80px, 11vw, 130px); animation-delay: -2s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } .hero-stage { order: -1; max-width: 460px; margin-inline: auto; width: 100%; } .hero-mascot { inset-inline-end: -2%; } }

/* ---------- Plaque miroir ---------- */
.flip-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.flip-grid .plate-3d { max-width: 460px; }
.flip-grid .plate-flip { transform: none; cursor: pointer; }
.flip-grid .plate-flip.flipped { transform: rotateY(180deg); }
.chooser { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: 800 .95rem var(--font-body); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
@media (max-width: 860px) { .flip-grid { grid-template-columns: 1fr; } }

/* ---------- Comment on joue ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.step { display: grid; gap: 12px; align-content: start; }
.step .num { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font: 700 1.3rem var(--font-display); color: #fff; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18), inset 0 2px 0 rgba(255,255,255,.3); }
.step:nth-child(1) .num { background: var(--blue); } .step:nth-child(2) .num { background: var(--orange); } .step:nth-child(3) .num { background: var(--green); }
.step:nth-child(1) { --sc: var(--blue); } .step:nth-child(2) { --sc: var(--orange); } .step:nth-child(3) { --sc: var(--green); }
.step p { color: var(--ink-2); }
.mini { height: 120px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.mini canvas { width: 100%; height: 100%; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Mondes ---------- */
.world-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 230px); gap: 16px; overflow-x: auto; padding: 18px 4px 26px; scroll-snap-type: x mandatory; scrollbar-width: thin; overscroll-behavior-x: contain; }
.world-card { --tint: var(--red); scroll-snap-align: start; position: relative; display: grid; gap: 4px; text-decoration: none; color: var(--ink); border-radius: var(--radius);
  padding: 18px 18px 20px; background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 22%, var(--surface)), var(--surface) 62%); box-shadow: var(--shadow); transition: transform .2s ease; }
.world-card:hover { transform: translateY(-4px) rotate(-.6deg); }
.world-card .art { position: relative; display: grid; place-items: end center; height: 168px; margin: -6px -6px 8px; border-radius: 16px; overflow: hidden;
  background: color-mix(in srgb, var(--tint) 30%, var(--surface)); }
.world-card .art::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 -40px 40px -30px rgba(0,0,0,.18); pointer-events: none; }
.world-card img { position: relative; width: 120px; height: 120px; object-fit: contain; margin-bottom: 6px; filter: drop-shadow(0 10px 10px rgba(0,0,0,.28)); }
.world-card .art img.bg { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; object-fit: cover; filter: none; }
.world-card .n { font-weight: 900; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--tint); filter: brightness(.8); }
:root:not([data-theme="light"]) .world-card .n { filter: none; }
.world-card b { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; line-height: 1.15; }
.world-card small { color: var(--muted); font-weight: 700; }
.worlds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.rules-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.rule-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-weight: 800; font-size: .92rem; }
.rule-chip i { width: 12px; height: 12px; border-radius: 3px; background: var(--c, var(--blue)); }

/* ---------- Grille de fonctionnalités ---------- */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.bento > * { grid-column: span 6; min-width: 0; }
.bento .wide { grid-column: span 12; }
.bento .third { grid-column: span 4; }
.feature { display: grid; gap: 12px; align-content: start; }
.feature .icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; box-shadow: inset 0 -4px 0 rgba(0,0,0,.15), inset 0 2px 0 rgba(255,255,255,.3); }
.feature .icon svg { width: 28px; height: 28px; color: #fff; }
.feature p { color: var(--ink-2); }
.feature-art { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.feature-art img { width: clamp(110px, 18vw, 170px); flex: none; filter: drop-shadow(0 12px 12px rgba(0,0,0,.18)); }
@media (max-width: 860px) { .bento > *, .bento .third { grid-column: span 12; } .feature-art { flex-direction: column; align-items: flex-start; } }

/* ---------- Photo en mosaïque (curseur) ---------- */
.compare { position: relative; aspect-ratio: 1; max-width: 460px; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); user-select: none; touch-action: pan-y; background: #fff; }
.compare img, .compare canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .after { clip-path: inset(0 0 0 var(--cut, 50%)); }
[dir="rtl"] .compare .after { clip-path: inset(0 var(--cut, 50%) 0 0); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 4px; margin-left: -2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.08); pointer-events: none; }
[dir="rtl"] .compare .handle { left: auto; right: var(--cut, 50%); margin-right: -2px; }
.compare .handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; box-shadow: var(--shadow); background-image: linear-gradient(90deg, transparent 18px, var(--ink) 18px 20px, transparent 20px 24px, var(--ink) 24px 26px, transparent 26px); }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.create-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 860px) { .create-grid { grid-template-columns: 1fr; } }
.note { font-size: .88rem; color: var(--muted); font-weight: 700; }

/* ---------- Famille ---------- */
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.checks li { display: flex; gap: 12px; align-items: center; background: var(--surface); padding: 14px 16px; border-radius: 16px; font-weight: 800; box-shadow: var(--shadow); }
.checks li::before { content: ""; flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E") center / 18px no-repeat; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.family-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.family-grid img { width: min(320px, 70%); margin-inline: auto; filter: drop-shadow(0 18px 20px rgba(0,0,0,.2)); }
@media (max-width: 860px) { .family-grid { grid-template-columns: 1fr; } }

/* ---------- Skins ---------- */
.skin-row { display: flex; gap: 14px; overflow-x: auto; padding: 12px 4px 20px; scrollbar-width: thin; }
.skin-row img { width: 108px; height: 108px; object-fit: contain; flex: none; background: var(--surface); border-radius: 22px; padding: 10px; box-shadow: var(--shadow); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq details { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 56px 18px 22px; font-family: var(--font-display); font-weight: 600; font-size: 1.14rem; position: relative; }
[dir="rtl"] .faq summary { padding: 18px 22px 18px 56px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; inset-inline-end: 20px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 7px; background: var(--yellow); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15);
  background-image: linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink)); background-size: 10px 2.5px, 2.5px 10px; background-position: center; background-repeat: no-repeat; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 22px 20px; color: var(--ink-2); }

/* ---------- Appel final ---------- */
.final { text-align: center; display: grid; justify-items: center; gap: 20px; }
.final img { width: clamp(150px, 22vw, 230px); filter: drop-shadow(0 22px 20px rgba(0,0,0,.25)); animation: bob 4.5s ease-in-out infinite; }

/* ---------- Pages de texte ---------- */
.page-hero { padding-block: clamp(36px, 6vw, 72px) 24px; }
@media (max-width: 600px) { .page-hero h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); } }
.page-hero .wrap { display: grid; gap: 16px; }
.crumbs { font-size: .9rem; font-weight: 700; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.prose-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 48px; align-items: start; padding-bottom: 96px; }
.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 92px); font-size: .92rem; display: grid; gap: 6px; }
.toc b { font-family: var(--font-display); font-size: 1rem; margin-bottom: 4px; }
.toc a { color: var(--ink-2); text-decoration: none; font-weight: 700; padding: 4px 0; }
.toc a:hover { color: var(--link); }
@media (max-width: 960px) { .prose-layout { grid-template-columns: 1fr; } .toc { display: none; } }
.prose { max-width: 72ch; display: grid; gap: 30px; }
.prose section { padding: 0; display: grid; gap: 12px; scroll-margin-top: 100px; }
.prose h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { margin: 0; padding-inline-start: 22px; display: grid; gap: 8px; }
.prose code { font-size: .88em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.summary-box { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); border-inline-start: 8px solid var(--green); }
.updated { color: var(--muted); font-weight: 700; font-size: .92rem; }
.contact-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.contact-card img { width: 90px; }
.email { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; user-select: all; overflow-wrap: anywhere; }

/* ---------- Page d'un monde ---------- */
.world-hero { --tint: var(--red); background: radial-gradient(900px 420px at 80% 0%, color-mix(in srgb, var(--tint) 30%, transparent), transparent 70%); padding-block: clamp(32px, 5vw, 64px) clamp(40px, 6vw, 72px); }
.world-hero.painted { position: relative; background: var(--fond) right 30% / cover no-repeat; }
.world-hero.painted::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 42%, color-mix(in srgb, var(--bg) 30%, transparent) 75%, transparent 100%), linear-gradient(0deg, var(--bg) 0%, transparent 22%); }
[dir="rtl"] .world-hero.painted::before { background: linear-gradient(270deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 42%, color-mix(in srgb, var(--bg) 30%, transparent) 75%, transparent 100%), linear-gradient(0deg, var(--bg) 0%, transparent 22%); }
.world-hero.painted .wrap { position: relative; min-height: clamp(420px, 52vw, 560px); }
@media (max-width: 760px) { .world-hero.painted { background-position: center top; background-size: 100% auto; } .world-hero.painted::before { background: linear-gradient(0deg, var(--bg) 0%, var(--bg) 48%, color-mix(in srgb, var(--bg) 40%, transparent) 70%, transparent 100%); } .world-hero.painted .wrap { min-height: 0; padding-top: 38vw; } }
.world-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.world-hero img.mascot { width: clamp(150px, 22vw, 240px); filter: drop-shadow(0 18px 18px rgba(0,0,0,.2)); }
.speech { position: relative; background: var(--surface); border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow); display: grid; gap: 8px; max-width: 62ch; }
.speech b { font-family: var(--font-display); color: var(--tint); filter: brightness(.85); }
@media (max-width: 760px) { .world-hero .wrap { grid-template-columns: 1fr; } .world-hero img.mascot { order: -1; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.gallery figure { margin: 0; display: grid; gap: 8px; }
.gallery canvas { width: 100%; aspect-ratio: 1; border-radius: 14px; background: #EDE7F3; box-shadow: var(--shadow); }
.gallery figcaption { font-weight: 800; font-size: .92rem; line-height: 1.25; }
.gallery figcaption small { display: block; color: var(--muted); font-weight: 700; }
.level-list { columns: 3 220px; column-gap: 28px; padding-inline-start: 0; margin: 0; list-style: none; counter-reset: lv; }
.level-list li { break-inside: avoid; padding: 5px 0; color: var(--ink-2); counter-increment: lv; display: flex; gap: 10px; }
.level-list li::before { content: counter(lv); font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 800; min-width: 2.2ch; text-align: end; }
.world-nav { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ---------- Cadeau ---------- */
.gift-box { max-width: 620px; margin-inline: auto; text-align: center; display: grid; gap: 18px; justify-items: center; }
.gift-box img { width: 180px; }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; font-size: clamp(1.05rem, 3.6vw, 1.5rem); background: var(--surface); padding: 14px 18px; border-radius: 16px; box-shadow: var(--shadow); border: 2px dashed var(--line); overflow-wrap: anywhere; direction: ltr; }
.steps-list { text-align: start; display: grid; gap: 10px; padding-inline-start: 22px; margin: 0; }

/* ---------- Bandeau de langue ---------- */
.lang-banner { position: fixed; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40; margin-inline: auto; max-width: 560px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--ink); color: var(--bg); padding: 12px 14px 12px 18px; border-radius: 18px; box-shadow: var(--shadow-lg); font-weight: 800; }
.lang-banner p { flex: 1 1 200px; }
.lang-banner a { color: var(--yellow); }
.lang-banner button { background: transparent; border: 0; color: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 4px 8px; }

/* ---------- Pied de page ---------- */
.site-footer { background: #1B1527; color: #E9E1F5; padding-block: 0 calc(36px + env(safe-area-inset-bottom, 0px)); margin-top: 0; --link: #FFD27A; }
.site-footer .stud-rule { --sr: #2B2240; height: 22px; background-color: var(--bg); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 32px; padding-block: 48px 32px; }
.footer-grid h2 { font-size: 1rem; font-family: var(--font-body); font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: #B9AECB; margin-bottom: 12px; }
:lang(ar) .footer-grid h2, :lang(ja) .footer-grid h2, :lang(ko) .footer-grid h2, :lang(zh-Hant) .footer-grid h2 { letter-spacing: .02em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid a { color: #E9E1F5; text-decoration: none; font-weight: 700; }
.footer-grid a:hover { color: #FFD27A; text-decoration: underline; }
.footer-brand { display: grid; gap: 12px; align-content: start; }
.footer-brand .brand { color: #fff; }
.footer-brand p { color: #CFC5DE; max-width: 36ch; }
.footer-brand .store b { font-size: 1rem; }
.langs { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-block: 20px; border-top: 1px solid #33294A; }
.langs a { color: #CFC5DE; text-decoration: none; font-weight: 700; font-size: .92rem; }
.langs a[aria-current="true"] { color: #FFD27A; }
.legal-line { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; color: #9F94B3; font-size: .86rem; padding-top: 18px; border-top: 1px solid #33294A; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Apparition douce (sans jamais cacher le contenu : seulement un léger glissement) ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    @keyframes rise { from { transform: translateY(26px) scale(.985); } to { transform: none; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-mascot, .final img { animation: none; }
  .plate-flip { transition: none; }
}
:is(h2, section, details)[id] { scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 96px); }
