@font-face { font-family: 'Fraunces'; src: url(/fonts/fraunces.woff2) format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url(/fonts/fraunces-ext.woff2) format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Fraunces'; src: url(/fonts/fraunces-italic.woff2) format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Reem Kufi'; src: url(/fonts/reemkufi-ar.woff2) format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Reem Kufi'; src: url(/fonts/reemkufi-lat.woff2) format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF; }
@font-face { font-family: 'Noto Kufi Arabic'; src: url(/fonts/notokufi.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Tifinagh'; src: url(/fonts/tifinagh.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url(/fonts/instrument.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url(/fonts/instrument-ext.woff2) format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }

:root {
  --red: #c1272d; --red2: #e0343b; --green: #006233; --green2: #0b7a4b; --gold: #f2b134; --gold2: #ffd27a;
  --majorelle: #4a46e0; --ink: #0b1020; --ink2: #1b2340; --cream: #fbf6ec; --sand: #f1e4c8; --muted: #6b6457;
  --ui: 'Instrument Sans', 'Noto Kufi Arabic', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --disp: 'Fraunces', 'Reem Kufi', 'Songti SC', serif;
  --ar: 'Reem Kufi', 'Noto Kufi Arabic', serif;
  --spring: cubic-bezier(.2, 1.45, .32, 1); --out: cubic-bezier(.16, 1, .3, 1);
  --zel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23c1272d' stroke-opacity='.13' stroke-width='1.4'%3E%3Cpath d='M28 6l6 8h10v10l8 6-8 6v10H34l-6 8-6-8H12V36l-8-6 8-6V14h10z'/%3E%3Ccircle cx='28' cy='28' r='7'/%3E%3C/g%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1020; color: var(--ink); font-family: var(--ui); -webkit-font-smoothing: antialiased; }
html[dir=rtl] body { font-family: 'Noto Kufi Arabic', var(--ui); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 3; }

/* ——— étiquettes de villes ——— */
.clabel { position: absolute; left: 0; top: 0; border: 0; background: rgba(251, 246, 236, .92); color: var(--ink); border-radius: 999px 999px 14px 14px; padding: .55rem .9rem .5rem; display: flex; flex-direction: column; align-items: center; line-height: 1.05; box-shadow: 0 8px 30px rgba(0, 0, 0, .25), inset 0 -3px 0 var(--red); transition: opacity .35s, background .3s; will-change: transform, opacity; white-space: nowrap; }
.clabel .cn { font: 700 italic 1.05rem/1 var(--disp); }
.clabel .cs { font: 500 .72rem/1.2 'Tifinagh', var(--ar); color: var(--green2); margin-top: .2rem; letter-spacing: .02em; }
.clabel.wc::after { content: '2030'; position: absolute; top: -.55rem; inset-inline-end: -.5rem; background: var(--green); color: #fff; font: 700 .6rem/1 var(--ui); padding: .22rem .38rem; border-radius: 99px; transform: rotate(8deg); }
.clabel.near { background: var(--red); color: #fff; box-shadow: 0 0 0 4px rgba(242, 177, 52, .7), 0 10px 40px rgba(193, 39, 45, .5); }
.clabel.near .cs { color: var(--gold2); }
.clabel::before { content: ''; position: absolute; bottom: -9px; left: 50%; width: 2px; height: 9px; background: currentColor; opacity: .5; }
.wlabel { position: absolute; left: 0; top: 0; font: 600 italic clamp(1rem, 2vw, 1.6rem) var(--disp); color: var(--gold2); text-shadow: 0 2px 18px rgba(0, 0, 0, .6); transition: opacity .4s; white-space: nowrap; }
.wlabel::before { content: '→ '; }
html[dir=rtl] .wlabel::before { content: '← '; }

/* ——— vantaux ——— */
#doors { position: fixed; inset: 0; z-index: 50; perspective: 1600px; pointer-events: none; }
#doors .door { position: absolute; top: 0; bottom: 0; width: 50.2%; background: #6a1418; overflow: hidden; transition: transform 1.6s cubic-bezier(.7, 0, .2, 1); pointer-events: auto; box-shadow: inset 0 0 120px rgba(0, 0, 0, .55); }
#doors .left { left: 0; transform-origin: left center; }
#doors .right { right: 0; transform-origin: right center; }
#doors .dz { position: absolute; inset: -40px; background-color: #8f1b20; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23f2b134' stroke-opacity='.55' stroke-width='2'%3E%3Cpath d='M60 10l13 17h21v21l17 12-17 12v21H73l-13 17-13-17H26V72L9 60l17-12V27h21z'/%3E%3Cpath d='M60 34l8 10h12v12l10 4-10 4v12H68l-8 10-8-10H40V64l-10-4 10-4V44h12z' stroke='%230b7a4b' stroke-opacity='.9'/%3E%3Ccircle cx='60' cy='60' r='6' fill='%23f2b134' fill-opacity='.5'/%3E%3C/g%3E%3C/svg%3E"); background-size: 120px; animation: drift 30s linear infinite; }
#doors .left .dz { border-right: 10px solid #f2b134; }
#doors .right .dz { border-left: 10px solid #f2b134; }
@keyframes drift { to { background-position: 120px 240px; } }
#doors .seal { position: absolute; left: 50%; top: 50%; width: 132px; height: 132px; margin: -66px 0 0 -66px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff5a5f, #c1272d 55%, #7d1317); box-shadow: 0 0 0 6px #f2b134, 0 0 0 12px rgba(242, 177, 52, .25), 0 20px 60px rgba(0, 0, 0, .5); display: grid; place-items: center; transition: transform 1s var(--out), opacity .6s; animation: pulse 2.2s ease-in-out infinite; }
#doors .seal svg { width: 82px; }
@keyframes pulse { 50% { transform: scale(1.06); } }
#doors .loading { position: absolute; left: 0; right: 0; bottom: 12vh; text-align: center; color: var(--gold2); font: italic 500 clamp(1rem, 2.2vw, 1.4rem) var(--disp); letter-spacing: .02em; transition: opacity .4s; }
#doors.open .left { transform: rotateY(-105deg); }
#doors.open .right { transform: rotateY(105deg); }
#doors.open .seal { transform: scale(2.6); opacity: 0; }
#doors.open .loading { opacity: 0; }
#doors.gone { display: none; }

/* ——— ouverture ——— */
#hero { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: center; padding: 72px max(4vw, 18px) 24px; pointer-events: none; color: #fff; background: radial-gradient(120% 90% at 20% 60%, rgba(11, 16, 32, .62), rgba(11, 16, 32, 0) 70%); }
#hero > * { pointer-events: auto; }
#hero .kicker { display: flex; gap: .7rem; align-items: center; font: 600 clamp(.72rem, 1.1vw, .9rem)/1.3 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--gold2); margin: 0 0 1.2rem; opacity: 0; transform: translateY(14px); }
html[dir=rtl] #hero .kicker, html[lang=zh] #hero .kicker { letter-spacing: 0; }
#hero h1 { margin: 0; line-height: .82; display: flex; flex-direction: column; }
#hero .h-fr, #hero .h-fr2 { font: 800 italic clamp(3.2rem, min(13.5vw, 19vh), 13rem)/.86 var(--disp); letter-spacing: -.045em; display: block; }
#hero .h-fr2 { color: var(--gold); margin-inline-start: .6em; text-shadow: 0 0 60px rgba(242, 177, 52, .35); }
#hero .h-ar { font: 700 clamp(2.2rem, min(7.4vw, 10vh), 7rem)/1.25 var(--ar); color: #fff; margin-top: .25em; align-self: flex-start; position: relative; padding: 0 .25em; }
#hero .h-ar::before { content: ''; position: absolute; inset: 52% -.1em 8% -.1em; background: var(--red); z-index: -1; transform: skewX(-12deg); border-radius: 4px; }
#hero .slogan { max-width: 62ch; font: 500 clamp(1rem, 1.55vw, 1.32rem)/1.5 var(--ui); margin: 1.6rem 0 2rem; color: #fff; text-shadow: 0 2px 22px rgba(0, 0, 0, .55); }
html[dir=rtl] #hero .slogan { font-size: clamp(1.05rem, 1.7vw, 1.42rem); line-height: 1.8; }
#hero .cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-drive { position: relative; display: inline-flex; align-items: center; gap: .9rem; border: 0; border-radius: 999px; padding: 1.15rem 2rem 1.15rem 1.2rem; background: var(--red); color: #fff; font: 800 clamp(1.05rem, 1.6vw, 1.35rem) var(--ui); box-shadow: 0 0 0 4px var(--gold), 0 18px 60px rgba(193, 39, 45, .55); transition: transform .5s var(--spring), box-shadow .3s; overflow: hidden; }
html[dir=rtl] .btn-drive { padding: 1.15rem 1.2rem 1.15rem 2rem; }
.btn-drive .key { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--gold); color: var(--ink); font-size: 1.3rem; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-drive::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%); transform: translateX(-120%); animation: sheen 3.2s 2s ease-in-out infinite; }
@keyframes sheen { 40%, 100% { transform: translateX(120%); } }
.btn-drive:hover { transform: translateY(-3px) scale(1.04) rotate(-1deg); box-shadow: 0 0 0 6px var(--gold), 0 24px 80px rgba(193, 39, 45, .7); }
.btn-drive:active { transform: scale(.96); }
.btn-ghost { border: 2px solid rgba(255, 255, 255, .7); background: rgba(11, 16, 32, .35); backdrop-filter: blur(8px); color: #fff; border-radius: 999px; padding: 1.05rem 1.6rem; font-weight: 700; transition: transform .5s var(--spring), background .3s; }
.btn-ghost:hover { background: #fff; color: var(--ink); transform: translateY(-2px); }
#hero .hint { margin: 1.4rem 0 0; font-size: .85rem; color: rgba(255, 255, 255, .78); }
#hero .h-fr, #hero .h-fr2, #hero .h-ar, #hero .slogan, #hero .cta, #hero .hint { opacity: 0; transform: translateY(40px); }
body.ready #hero .kicker, body.ready #hero .h-fr, body.ready #hero .h-fr2, body.ready #hero .h-ar, body.ready #hero .slogan, body.ready #hero .cta, body.ready #hero .hint { opacity: 1; transform: none; transition: opacity 1s var(--out), transform 1.2s var(--out); }
body.ready #hero .h-fr { transition-delay: .15s; } body.ready #hero .h-fr2 { transition-delay: .28s; } body.ready #hero .h-ar { transition-delay: .45s; }
body.ready #hero .slogan { transition-delay: .65s; } body.ready #hero .cta { transition-delay: .8s; } body.ready #hero .hint { transition-delay: 1s; }
body.driving #hero { pointer-events: none; }
body.driving #hero > * { pointer-events: none; opacity: 0 !important; transform: translateY(-60px) scale(1.05) !important; filter: blur(8px); transition: opacity .8s, transform 1s var(--out), filter .8s !important; }
body.driving #hero .h-fr2 { transform: translateY(-120px) rotate(-4deg) !important; }

.flag-mini { display: inline-block; width: 26px; height: 18px; border-radius: 3px; background: #c1272d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-30 -20 60 40'%3E%3Cpolygon points='0,-9 5.3,7.3 -8.6,-2.8 8.6,-2.8 -5.3,7.3' fill='none' stroke='%23006233' stroke-width='1.6'/%3E%3C/svg%3E") center/cover; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }

/* ——— barre haute ——— */
#top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: max(14px, env(safe-area-inset-top)) max(18px, 2vw) 0; pointer-events: none; }
#top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: #fff; background: rgba(11, 16, 32, .55); backdrop-filter: blur(12px); border-radius: 999px; padding: .4rem 1rem .4rem .45rem; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
html[dir=rtl] .brand { padding: .4rem .45rem .4rem 1rem; }
.flag-wave { width: 44px; height: 30px; border-radius: 6px; overflow: hidden; position: relative; background: #c1272d; box-shadow: 0 0 0 2px var(--gold); }
.flag-wave i { position: absolute; inset: -20%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-30 -20 60 40'%3E%3Cpolygon points='0,-9 5.3,7.3 -8.6,-2.8 8.6,-2.8 -5.3,7.3' fill='none' stroke='%23006233' stroke-width='1.6'/%3E%3C/svg%3E") center/70% no-repeat, linear-gradient(100deg, rgba(0, 0, 0, .18), rgba(255, 255, 255, .22) 25%, rgba(0, 0, 0, .15) 50%, rgba(255, 255, 255, .2) 75%, rgba(0, 0, 0, .18)) 0 0/200% 100%; animation: wave 2.4s linear infinite; }
@keyframes wave { to { background-position: center, -200% 0; } }
.bt { display: flex; flex-direction: column; line-height: 1.05; }
.bt b { font: 800 italic 1.02rem var(--disp); letter-spacing: -.01em; }
.bt em { font: 600 .82rem var(--ar); font-style: normal; color: var(--gold2); }
.stats { margin: 0; font-size: .8rem; color: #fff; background: rgba(11, 16, 32, .45); backdrop-filter: blur(10px); padding: .45rem .8rem; border-radius: 99px; display: none; }
body.driving .stats { display: block; }
.tools { margin-inline-start: auto; display: flex; gap: .5rem; align-items: center; }
.chip, .sel select { border: 0; background: rgba(251, 246, 236, .94); color: var(--ink); border-radius: 999px; padding: .55rem .9rem; font-weight: 700; font-size: .85rem; display: inline-flex; align-items: center; gap: .45rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); transition: transform .4s var(--spring); }
.chip:hover { transform: translateY(-2px); }
.chip.ico { width: 2.4rem; justify-content: center; padding: .55rem 0; }
.chip[aria-pressed=true] { background: var(--gold); }
.chip.acct { background: var(--red); color: #fff; }
.chip .dot { width: .7rem; height: .7rem; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4c2, #f2b134); box-shadow: 0 0 10px #f2b134; }
.sel select { appearance: none; padding-inline-end: 1.1rem; max-width: 11rem; }

/* ——— dock ——— */
#dock { position: fixed; z-index: 20; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translate(-50%, 140%); display: flex; gap: .35rem; padding: .45rem; background: rgba(251, 246, 236, .96); border-radius: 999px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(193, 39, 45, .15); transition: transform 1s var(--spring) .3s; max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none; }
body.driving #dock { transform: translate(-50%, 0); }
#dock button { position: relative; border: 0; background: transparent; border-radius: 999px; padding: .62rem .8rem; display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .84rem; white-space: nowrap; transition: background .25s, transform .45s var(--spring); }
#dock button .i { font-size: 1.05rem; color: var(--red); }
#dock button:hover { background: var(--sand); transform: translateY(-3px); }
#dock button.primary { background: var(--red); color: #fff; box-shadow: 0 0 0 3px var(--gold); }
#dock button.primary .i { color: var(--gold2); animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(1.35) rotate(20deg); } }
#dock button.on { background: var(--ink); color: #fff; }
.badge { position: absolute; top: .2rem; inset-inline-end: .3rem; min-width: 1.1rem; height: 1.1rem; border-radius: 99px; background: var(--green); color: #fff; font-size: .68rem; display: grid; place-items: center; padding: 0 .25rem; }

/* ——— mini-carte ——— */
#minimap { position: fixed; z-index: 19; inset-inline-start: max(18px, 2vw); bottom: 96px; width: 170px; background: rgba(11, 16, 32, .6); backdrop-filter: blur(12px); border-radius: 22px 22px 22px 22px; padding: .6rem; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); opacity: 0; transform: translateY(20px); transition: opacity .6s .6s, transform .8s var(--spring) .6s; }
body.driving #minimap { opacity: 1; transform: none; pointer-events: auto; }
#minimap, #keys { pointer-events: none; }
#minimap svg { width: 100%; height: auto; display: block; }
#minimap p { margin: .3rem 0 0; color: rgba(255, 255, 255, .75); font-size: .68rem; text-align: center; }
#mm .land { fill: #e8c48c; stroke: #f2b134; stroke-width: .4; }
#mm .city { fill: #c1272d; stroke: #fff; stroke-width: .35; cursor: pointer; transition: r .2s; }
#mm .city:hover { r: 2.4; }
#mm .car { fill: #fff; stroke: #c1272d; stroke-width: .8; }
#keys { position: fixed; z-index: 19; inset-inline-end: max(18px, 2vw); bottom: 100px; margin: 0; color: #fff; font-size: .78rem; background: rgba(11, 16, 32, .5); padding: .5rem .8rem; border-radius: 12px; opacity: 0; transition: opacity .6s 1s; max-width: 260px; }
body.driving #keys { opacity: .9; }

#joy, #boost, #horn { display: none; }
@media (pointer: coarse) {
  body.driving #joy { display: block; position: fixed; z-index: 21; left: 22px; bottom: 96px; width: 128px; height: 128px; border-radius: 50%; background: rgba(251, 246, 236, .18); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); touch-action: none; }
  #joy .knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--gold); }
  body.driving #boost, body.driving #horn { display: grid; place-items: center; position: fixed; z-index: 21; right: 22px; bottom: 110px; width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--gold); font-size: 1.6rem; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); touch-action: none; }
  body.driving #horn { bottom: 186px; width: 52px; height: 52px; right: 28px; background: var(--cream); font-size: 1.3rem; }
  #minimap { top: 70px; bottom: auto; width: 112px; inset-inline-start: auto; inset-inline-end: 12px; padding: .35rem; }
  #minimap p, #keys { display: none; }
  #dock button span:not(.i) { display: none; }
  #dock button { padding: .75rem .85rem; }
  #dock button .i { font-size: 1.25rem; }
  .bt em { display: none; }
  .stats { display: none !important; }
  #top .chip#time span#time-l { display: none; }
}

/* ——— carte de ville (porte franchie) ——— */
#city { position: fixed; z-index: 22; top: 84px; inset-inline-end: max(18px, 2vw); width: min(400px, calc(100vw - 36px)); max-height: calc(100vh - 200px); overflow: auto; background: var(--cream); background-image: var(--zel); border-radius: 50% 50% 26px 26px / 150px 150px 26px 26px; box-shadow: 0 30px 90px rgba(0, 0, 0, .45), 0 0 0 5px var(--gold), 0 0 0 9px var(--red); padding: 0 0 1.2rem; transform: translateY(30px) scaleY(.6); transform-origin: bottom; opacity: 0; pointer-events: none; transition: transform .7s var(--spring), opacity .35s; scrollbar-width: thin; }
#city.on { transform: none; opacity: 1; pointer-events: auto; }
#city .media { display: none; position: relative; height: 210px; border-radius: 50% 50% 0 0 / 150px 150px 0 0; overflow: hidden; background: var(--ink); }
#city video, #city .media img { width: 100%; height: 100%; object-fit: cover; display: block; }
#city .media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(251, 246, 236, 1)); }
#city .gatew { position: absolute; z-index: 2; left: 0; right: 0; bottom: .3rem; text-align: center; font: 600 .8rem var(--ui); color: var(--red); letter-spacing: .12em; text-transform: uppercase; }
#city .body { padding: 0 1.4rem; text-align: center; }
#city h2 { margin: .1rem 0 0; font: 800 italic clamp(2.2rem, 5vw, 3.1rem)/1 var(--disp); letter-spacing: -.03em; color: var(--ink); }
#city .tri { display: flex; justify-content: center; gap: .8rem; margin: .4rem 0 .2rem; font: 700 1.15rem var(--ar); color: var(--green2); }
#city .tri .tf { font-family: 'Tifinagh'; color: var(--red); }
#city .reg { font-size: .8rem; color: var(--muted); margin: 0 0 .8rem; }
#city .tag { font: 500 1.02rem/1.45 var(--ui); margin: 0 0 .9rem; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; margin: 0 0 .9rem; }
.pill { font-size: .74rem; font-weight: 700; padding: .3rem .65rem; border-radius: 99px; background: var(--ink); color: #fff; }
.pill.wc { background: var(--green); }
.pill.cap { background: var(--red); }
#city h3, #panel h3 { font: 700 .78rem var(--ui); text-transform: uppercase; letter-spacing: .12em; color: var(--red); margin: 1rem 0 .5rem; }
html[dir=rtl] #city h3, html[dir=rtl] #panel h3 { letter-spacing: 0; }
.ll { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; text-align: start; }
.ll li button { width: 100%; text-align: start; border: 0; background: #fff; border-radius: 14px; padding: .65rem .8rem; display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; box-shadow: 0 3px 12px rgba(0, 0, 0, .07); transition: transform .35s var(--spring); }
.ll li button:hover { transform: translateX(4px); }
html[dir=rtl] .ll li button:hover { transform: translateX(-4px); }
.ll .lc { width: 14px; height: 18px; border-radius: 50% 50% 40% 40%; margin-top: .2rem; box-shadow: 0 0 12px currentColor; background: currentColor; }
.ll .lt { font-size: .88rem; line-height: 1.35; }
.ll .lm { display: block; font-size: .72rem; color: var(--muted); margin-top: .15rem; }
.demo { font-size: .62rem; font-weight: 800; background: var(--sand); color: var(--muted); border-radius: 4px; padding: .05rem .3rem; margin-inline-start: .3rem; text-transform: uppercase; letter-spacing: .05em; }
.btn { border: 0; border-radius: 999px; padding: .85rem 1.3rem; font-weight: 800; background: var(--red); color: #fff; box-shadow: 0 0 0 3px var(--gold); transition: transform .45s var(--spring); display: inline-flex; gap: .5rem; align-items: center; justify-content: center; }
.btn:hover { transform: translateY(-2px) scale(1.03); }
.btn.alt { background: var(--ink); box-shadow: none; }
.btn.soft { background: var(--sand); color: var(--ink); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: wait; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-top: 1rem; }

/* ——— lanterne proche ——— */
#near { position: fixed; z-index: 18; left: 50%; top: auto; bottom: 92px; transform: translate(-50%, -20px); opacity: 0; max-width: min(520px, 86vw); background: rgba(11, 16, 32, .82); color: #fff; backdrop-filter: blur(10px); border-radius: 18px; padding: .7rem 1rem; font-size: .92rem; transition: opacity .4s, transform .6s var(--spring); pointer-events: none; box-shadow: 0 0 0 2px var(--gold); }
#near.on { opacity: 1; transform: translate(-50%, -14px); pointer-events: auto; cursor: pointer; }
#near b { color: var(--gold2); }

/* ——— panneau (porte en arc outrepassé) ——— */
#panel { position: fixed; z-index: 30; top: 76px; bottom: 96px; inset-inline-start: max(18px, 2vw); width: min(440px, calc(100vw - 36px)); background: var(--cream); background-image: var(--zel); border-radius: 50% 50% 28px 28px / 170px 170px 28px 28px; box-shadow: 0 40px 120px rgba(0, 0, 0, .5), 0 0 0 5px var(--gold), 0 0 0 10px var(--green); display: flex; flex-direction: column; transform: translateY(40px) scaleY(.55); transform-origin: bottom; opacity: 0; pointer-events: none; transition: transform .75s var(--spring), opacity .3s; }
#panel.on { transform: none; opacity: 1; pointer-events: auto; }
#panel .phead { padding: 3.4rem 1.6rem .4rem; text-align: center; position: relative; }
#panel .phead .orn { font: 700 1.1rem var(--ar); color: var(--gold); letter-spacing: .4em; }
#panel h2 { margin: .2rem 0 0; font: 800 italic clamp(1.7rem, 3.4vw, 2.3rem)/1.02 var(--disp); letter-spacing: -.02em; }
html[dir=rtl] #panel h2, html[dir=rtl] #city h2 { font-family: var(--ar); font-style: normal; letter-spacing: 0; }
#panel .x { position: absolute; top: 1rem; inset-inline-end: 50%; transform: translateX(50%); border: 0; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--ink); color: #fff; font-size: 1.1rem; }
html[dir=rtl] #panel .x { transform: translateX(-50%); }
#panel .pbody { padding: .4rem 1.5rem 1.4rem; overflow: auto; flex: 1; scrollbar-width: thin; }
#panel p { line-height: 1.5; }
.f { display: grid; gap: .35rem; margin: 0 0 .85rem; text-align: start; }
.f > span { font-size: .78rem; font-weight: 700; color: var(--muted); }
.f input, .f select, .f textarea { width: 100%; border: 2px solid #e6dcc6; background: #fff; border-radius: 14px; padding: .75rem .9rem; outline: none; transition: border-color .2s, box-shadow .2s; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(193, 39, 45, .12); }
.f textarea { min-height: 96px; resize: vertical; }
.seg { display: flex; gap: .35rem; flex-wrap: wrap; }
.seg button, .tagb { border: 2px solid #e6dcc6; background: #fff; border-radius: 99px; padding: .45rem .8rem; font-size: .82rem; font-weight: 700; transition: transform .35s var(--spring), background .2s, border-color .2s, color .2s; }
.seg button:hover, .tagb:hover { transform: translateY(-2px); }
.seg button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tagb { display: inline-flex; gap: .4rem; align-items: center; }
.tagb i { width: .7rem; height: .7rem; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.tagb.on { background: var(--c); border-color: var(--c); color: var(--ink); }
.aud { text-align: center; margin: .6rem 0 .8rem; }
.aud b { display: block; font: 800 italic 3.6rem/1 var(--disp); color: var(--red); transition: transform .4s var(--spring); }
.aud b.bump { transform: scale(1.25); }
.small { font-size: .78rem; color: var(--muted); }
.link { border: 0; background: none; color: var(--red); font-weight: 700; text-decoration: underline; padding: .3rem; }
.err { color: var(--red); font-weight: 700; font-size: .85rem; min-height: 1.2em; margin: .2rem 0; }
.msgs { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.msgs li { background: #fff; border-radius: 16px; padding: .8rem .9rem; box-shadow: 0 3px 12px rgba(0, 0, 0, .06); text-align: start; }
.msgs li.unread { box-shadow: inset 4px 0 0 var(--green), 0 3px 12px rgba(0, 0, 0, .06); }
.msgs .mh { font-size: .74rem; color: var(--muted); display: flex; justify-content: space-between; gap: .5rem; }
.msgs .mt { margin: .35rem 0 0; white-space: pre-wrap; line-height: 1.45; }
.chat { display: flex; flex-direction: column; gap: .6rem; }
.bub { max-width: 88%; padding: .7rem .9rem; border-radius: 18px; line-height: 1.5; white-space: pre-wrap; font-size: .93rem; }
.bub.ai { background: #fff; align-self: flex-start; border-start-start-radius: 4px; box-shadow: 0 3px 12px rgba(0, 0, 0, .06); }
.bub.me { background: var(--ink); color: #fff; align-self: flex-end; border-end-end-radius: 4px; }
.bub.ai.typing::after { content: '▍'; animation: blink 1s steps(2) infinite; color: var(--red); }
@keyframes blink { 50% { opacity: 0; } }
.sugs { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0; }
.sugs button { border: 0; background: var(--sand); border-radius: 99px; padding: .45rem .75rem; font-size: .8rem; font-weight: 600; }
.chatin { display: flex; gap: .4rem; padding: .7rem 1.2rem 1.2rem; }
.chatin input { flex: 1; border: 2px solid #e6dcc6; border-radius: 99px; padding: .75rem 1rem; background: #fff; outline: none; }
.manif .big { font: 800 italic clamp(1.6rem, 3vw, 2.2rem)/1.08 var(--disp); text-align: center; margin: .3rem 0 1rem; }
html[dir=rtl] .manif .big { font-family: var(--ar); font-style: normal; }
.manif video { width: 100%; border-radius: 120px 120px 18px 18px; display: block; margin: 0 0 1rem; box-shadow: 0 0 0 4px var(--gold); }
.pillgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; margin: 1rem 0; }
.pillgrid div { background: var(--ink); color: #fff; border-radius: 40px 40px 10px 10px; padding: .9rem .2rem .6rem; text-align: center; font-size: .7rem; font-weight: 700; }
.pillgrid div:nth-child(2n) { background: var(--red); }
.pillgrid div:nth-child(3) { background: var(--green); }
.pillgrid div span { display: block; font-size: 1.3rem; margin-bottom: .2rem; }

#toast { position: fixed; z-index: 60; left: 50%; bottom: 110px; transform: translate(-50%, 30px); background: var(--ink); color: #fff; border-radius: 99px; padding: .8rem 1.3rem; font-weight: 700; box-shadow: 0 0 0 3px var(--gold), 0 20px 60px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .3s, transform .6s var(--spring); max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#foot { position: fixed; z-index: 15; bottom: 4px; inset-inline-end: 12px; font-size: .68rem; color: rgba(255, 255, 255, .6); display: flex; gap: .3rem; }
#foot a { color: inherit; }
body.driving #foot { display: none; }

@media (max-width: 720px) {
  #panel, #city { inset-inline-start: 8px; inset-inline-end: 8px; width: auto; top: auto; bottom: 86px; max-height: 76vh; border-radius: 50% 50% 22px 22px / 110px 110px 22px 22px; }
  #panel { top: 64px; }
  #city .media { height: 150px; border-radius: 50% 50% 0 0 / 110px 110px 0 0; }
  #hero .h-fr2 { margin-inline-start: .25em; }
  .brand { padding: .3rem .7rem .3rem .3rem; } .bt b { font-size: .9rem; }
  .tools { gap: .3rem; } .chip { padding: .5rem .65rem; font-size: .78rem; } .sel select { max-width: 6.6rem; }
  .pillgrid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .2s !important; }
}

@media (max-width: 1240px) and (pointer: fine) { #dock button[data-p=manifest] span:not(.i), #dock button[data-p=tour] span:not(.i) { display: none; } }

/* ——— typographie géante permanente : LE MAROC AUGMENTÉ respire ——— */
#mega { position: fixed; z-index: 4; left: 0; right: 0; top: 64px; text-align: center; pointer-events: none; white-space: nowrap; overflow: hidden; opacity: 0; transform: translateY(-30px) scale(.96); transition: opacity 1.2s var(--out) .6s, transform 1.4s var(--out) .6s; font: italic 900 clamp(2.4rem, 8.2vw, 9rem)/1 var(--disp); letter-spacing: -.03em; }
body.driving #mega { opacity: 1; transform: none; }
#mega .ch { display: inline-block; color: transparent; -webkit-text-stroke: 1.6px rgba(255, 255, 255, .78); background: linear-gradient(100deg, #c1272d 0%, #ff5a5f 22%, #f2b134 44%, #19d27a 66%, #006233 88%, #c1272d 100%) 0 0 / 400% 100%; -webkit-background-clip: text; background-clip: text; animation: breathe 4.2s ease-in-out infinite, flow 9s linear infinite; text-shadow: 0 10px 40px rgba(11, 16, 32, .25); }
#mega .ch.sp { width: .28em; }
@keyframes breathe { 0%, 100% { font-variation-settings: 'wght' 260; transform: translateY(0) scale(1); opacity: .55; } 50% { font-variation-settings: 'wght' 900; transform: translateY(-6px) scale(1.04); opacity: .95; } }
@keyframes flow { to { background-position: 400% 0; } }
html[dir=rtl] #mega { font: 700 clamp(2.6rem, 9.6vw, 10rem)/1.2 var(--ar); letter-spacing: 0; }
html[lang=zh] #mega { font-style: normal; font-weight: 900; letter-spacing: .1em; }
#mega.morph .ch { animation: none; filter: blur(10px); opacity: 0 !important; transform: translateY(30px) scale(1.4) rotate(-6deg) !important; transition: all .45s var(--out); }
#mega .ch.in { animation: glyphIn .9s var(--spring) both, breathe 4.2s ease-in-out infinite .9s, flow 9s linear infinite; }
@keyframes glyphIn { from { opacity: 0; transform: translateY(-50px) scale(.4) rotate(12deg); filter: blur(12px); } to { opacity: .8; transform: none; filter: none; } }

/* ——— sélecteur de véhicule ——— */
#modes { position: fixed; z-index: 20; inset-inline-end: max(18px, 2vw); bottom: 152px; display: flex; flex-direction: column; gap: .35rem; opacity: 0; transform: translateX(30px); pointer-events: none; transition: opacity .6s .8s, transform .9s var(--spring) .8s; }
html[dir=rtl] #modes { transform: translateX(-30px); }
body.driving #modes { opacity: 1; transform: none; pointer-events: auto; }
#modes button { border: 0; border-radius: 99px; padding: .5rem .9rem .5rem .55rem; display: flex; gap: .5rem; align-items: center; background: rgba(251, 246, 236, .92); font-weight: 800; font-size: .8rem; box-shadow: 0 6px 22px rgba(0, 0, 0, .22); transition: transform .45s var(--spring), background .25s; }
#modes button .vi { width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 50%; background: var(--sand); font-size: 1.05rem; }
#modes button:hover { transform: translateX(-5px); }
#modes button.on { background: var(--red); color: #fff; box-shadow: 0 0 0 3px var(--gold), 0 8px 30px rgba(193, 39, 45, .5); }
#modes button.on .vi { background: var(--gold); animation: hop .9s var(--spring); }
@keyframes hop { 30% { transform: translateY(-8px) rotate(-12deg) scale(1.2); } }
@media (pointer: coarse) { #modes { bottom: auto; top: 200px; } #modes button span:not(.vi) { display: none; } #modes button { padding: .35rem; } #mega { top: 58px; font-size: 12vw; } }
@media (max-width: 1240px) and (pointer: fine) { #modes button span:not(.vi) { display: none; } #modes button { padding: .4rem; } }
#keys { bottom: 100px; }
#city .head { padding: 2.6rem 1.4rem .2rem; text-align: center; position: relative; }
#city .head .tfbig { font: 400 2.2rem/1 'Tifinagh'; color: var(--red); opacity: .85; }
#city .head .portal-note { font: 700 .72rem var(--ui); color: var(--green2); letter-spacing: .12em; text-transform: uppercase; margin-top: .4rem; }
.agent-badge { display: inline-flex; gap: .4rem; align-items: center; font-weight: 800; font-size: .78rem; background: var(--ink); color: var(--gold2); border-radius: 99px; padding: .35rem .8rem; margin: 0 auto .6rem; }
.agent-badge i { width: .7rem; height: .7rem; border-radius: 50%; background: radial-gradient(circle, #ffd27a, #f2b134); box-shadow: 0 0 0 2px #c1272d, 0 0 0 4px #006233; animation: pulse 1.6s infinite; }

.profs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.prof { border: 0; background: #fff; border-radius: 60px 60px 14px 14px; padding: .35rem .3rem .5rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; font-size: .68rem; font-weight: 700; line-height: 1.15; box-shadow: 0 3px 12px rgba(0,0,0,.07); transition: transform .45s var(--spring), box-shadow .3s; }
.prof img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; filter: saturate(.75); transition: filter .3s, transform .5s var(--spring); }
.prof:hover { transform: translateY(-4px); }
.prof.on { box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px var(--red), 0 10px 30px rgba(193,39,45,.35); }
.prof.on img { filter: none; transform: scale(1.06); }
#city { width: min(340px, calc(100vw - 36px)); max-height: min(58vh, 560px); }
#city h2 { font-size: clamp(1.8rem, 3.6vw, 2.4rem); }
#city .tag { font-size: .92rem; }
#city .head { padding-top: 2rem; }
