/* Grand Chantier : interface sobre, en CSS, dans les couleurs du Voxel Pack de Kenney. Boutons de partie : blancs, sans mots. */
@font-face { font-family: 'Blocks'; src: url('polices/blocks.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Future'; src: url('polices/future-narrow.ttf') format('truetype'); font-display: swap; }
:root { --encre: #16222c; --herbe: #2fbf71; --bois: #b8743a; --ciel: #6fc3ea; --creme: #fff4dc; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ciel); color: #fff; font-family: 'Future', system-ui, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none; }
button { font-family: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* Écran titre */
#titre { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh; background: linear-gradient(rgba(16, 30, 40, .28), rgba(16, 30, 40, .55)), url('img/fond.webp') center / cover, var(--ciel); padding: 16px; }
#titre h1 { margin: 0; font: 400 clamp(36px, 11vmin, 92px)/1 'Blocks', sans-serif; letter-spacing: .01em; text-align: center; color: var(--creme); text-shadow: 0 .06em 0 var(--bois), 0 .12em 0 #5c3a1c; }
#titre .ligne { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bouton { min-height: 56px; min-width: 240px; padding: 0 28px; font-size: 21px; background: var(--herbe); color: #082417; border-radius: 3px; box-shadow: inset 0 -5px 0 #1d8a4f, 0 4px 0 #0b4a2a; }
.bouton:active { transform: translateY(3px); box-shadow: inset 0 -3px 0 #1d8a4f, 0 1px 0 #0b4a2a; }
.bouton.calme { background: #2a3b48; color: #fff; box-shadow: inset 0 -4px 0 #1a2832, 0 3px 0 #0d161c; min-height: 48px; font-size: 16px; }
.bouton.danger { background: #d9553f; color: #fff; box-shadow: inset 0 -4px 0 #a33c2a, 0 3px 0 #5a1f14; }
#erreur { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; background: #000c; padding: 12px; font: 14px system-ui, sans-serif; }

/* Partie */
#jeu { position: fixed; inset: 0; pointer-events: none; }
#jeu > * { pointer-events: auto; }
#viseur { position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px; pointer-events: none !important; opacity: .85; mix-blend-mode: difference; }
#viseur::before, #viseur::after { content: ''; position: absolute; background: #fff; }
#viseur::before { left: 9px; top: 0; width: 2px; height: 20px; }
#viseur::after { top: 9px; left: 0; height: 2px; width: 20px; }
#main { position: absolute; right: 12%; bottom: -6vh; height: 56vh; pointer-events: none !important; transform-origin: 80% 100%; transform: rotate(8deg); will-change: transform; }
#main.coup { animation: coup .3s cubic-bezier(.3,.6,.3,1); }
body.en-voiture #main, body.en-voiture #viseur, body.en-voiture #saut, body.en-voiture #b-coup, body.en-voiture #b-poser, body.en-voiture #barre, body.en-voiture #coups { display: none !important; }
#main.pose { animation: pose .18s ease-out; }
/* Le coup part vers le viseur : on lève, on frappe vers le centre de l'écran, on revient. */
@keyframes coup { 0%, 100% { transform: rotate(8deg); } 22% { transform: rotate(22deg) translate(2vh, 2vh); } 42% { transform: rotate(-52deg) translate(-16vh, -9vh); } 58% { transform: rotate(-44deg) translate(-14vh, -7vh); } }
@keyframes pose { 0%, 100% { transform: rotate(8deg); } 50% { transform: rotate(-4deg) translateY(2vh); } }
#barre { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; gap: 2px; padding: 3px; background: rgba(14, 22, 30, .55); border-radius: 3px;
  max-width: min(calc(100vw - 340px), 620px); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; touch-action: pan-x; overscroll-behavior: contain; }
#barre::-webkit-scrollbar { display: none; }
.place { position: relative; flex: 0 0 auto; width: 48px; height: 48px; -webkit-touch-callout: none; user-select: none; background: rgba(255, 255, 255, .06); display: grid; place-items: center; }
.place.on { outline: 3px solid #fff; outline-offset: -3px; background: rgba(255, 255, 255, .18); }
.place.eclaire { border-radius: 0; }
.place .ic { width: 36px; height: 36px; display: block; }
.place.vide .ic { opacity: .25; }
.place b { position: absolute; right: 3px; bottom: 1px; font: 400 13px/1 'Future', sans-serif; font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
.place.pris { animation: pris .2s ease-out; }
@keyframes pris { 50% { transform: scale(1.14); } }
#nom-bloc { position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); padding: 4px 10px; background: rgba(14, 22, 30, .6); font-size: 13px; border-radius: 2px; opacity: 0; transition: opacity .2s; pointer-events: none !important; white-space: nowrap; }
#nom-bloc.vu { opacity: 1; }
#consigne { display: flex; align-items: center; gap: 8px; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); max-width: 60vw; padding: 7px 12px; background: rgba(14, 22, 30, .68); font-size: 14px; line-height: 1.25; text-align: center; border-radius: 2px; opacity: 0; transition: opacity .25s; pointer-events: none !important; }
#consigne.vu { opacity: 1; }
#consigne canvas { width: 30px; height: 30px; flex: none; }
#fps { position: absolute; left: 12px; top: 44px; font: 11px/1 ui-monospace, monospace; color: rgba(255, 255, 255, .75); text-shadow: 0 1px 0 #0009; pointer-events: none !important; }
#b-pause { position: absolute; right: 8px; top: 8px; width: 48px; height: 48px; display: grid; place-items: center; }
#b-pause img { width: 30px; height: 30px; filter: drop-shadow(0 1px 1px #0009); }

/* Commandes au doigt : fixes dans les coins, blanches et discrètes */
#joy, #saut, #b-coup, #b-poser { display: none; }
.tactile #joy { display: block; position: absolute; left: max(16px, env(safe-area-inset-left)); bottom: 14px; width: 132px; height: 132px; border-radius: 50%; background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .34); touch-action: none; }
#poignee { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: rgba(255, 255, 255, .42); will-change: transform; pointer-events: none; }
.tactile #saut, .tactile #b-coup, .tactile #b-poser { display: grid; place-items: center; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .34); touch-action: none; }
.tactile #b-coup { right: max(14px, env(safe-area-inset-right)); bottom: 14px; width: 88px; height: 88px; }
.tactile #b-poser { right: calc(max(14px, env(safe-area-inset-right)) + 94px); bottom: 12px; width: 66px; height: 66px; }
.tactile #saut { right: max(20px, env(safe-area-inset-right)); bottom: 110px; width: 66px; height: 66px; }
#saut img, #b-poser img { width: 36px; height: 36px; pointer-events: none; }
#b-coup img { width: 50px; height: 50px; pointer-events: none; }
#saut.app, #b-coup.app, #b-poser.app { background: rgba(255, 255, 255, .32); }
#b-carnet { position: absolute; right: 60px; top: 8px; width: 48px; height: 48px; display: grid; place-items: center; }
#b-carnet img { width: 28px; height: 28px; filter: drop-shadow(0 1px 1px #0009); }
.eclaire { border-radius: 50%; }
#toast { position: fixed; z-index: 41; left: 50%; top: 58px; transform: translateX(-50%); padding: 6px 12px; background: rgba(14, 22, 30, .78); font-size: 14px; border-radius: 2px; opacity: 0; transition: opacity .2s; pointer-events: none !important; white-space: nowrap; max-width: 80vw; }
#toast.vu { opacity: 1; }
#repere { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none !important; display: none; will-change: transform; }
/* La flèche de quête, bien voyante (porteur, 13 nov. 2026 : « pas assez voyante, surtout quand c'est derrière nous ») :
   grosse, cernée de noir sur un disque sombre, elle respire doucement ; plus grande au bord de l'écran quand la cible est hors de vue. */
#repere i { position: absolute; left: -27px; top: -27px; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(#10141bcc 55%, #10141b00 72%); }
#repere span { position: absolute; left: -19px; top: -19px; width: 38px; height: 38px; background: #ffd94a; clip-path: polygon(50% 100%, 0 30%, 32% 30%, 32% 0, 68% 0, 68% 30%, 100% 30%); filter: drop-shadow(0 0 2px #000) drop-shadow(0 0 6px #ffcf3a); animation: repere-souffle 1.1s ease-in-out infinite; }
@keyframes repere-souffle { 50% { transform: translateY(5px) scale(1.08); } }
#repere.bord span { width: 46px; height: 46px; left: -23px; top: -23px; }
#repere.bord i { width: 64px; height: 64px; left: -32px; top: -32px; }

#viseur.sur-automate { opacity: 1; mix-blend-mode: normal; }
#viseur.sur-automate::before, #viseur.sur-automate::after { background: #ff5a3c; }
#horloge { position: absolute; left: 12px; top: 10px; display: flex; align-items: center; gap: 7px; padding: 5px 9px; background: rgba(14, 22, 30, .6); border-radius: 2px; font-size: 13px; pointer-events: none !important; font-variant-numeric: tabular-nums; }
#horloge i { width: 15px; height: 15px; background: #ffdf73; display: block; }
#horloge.nuit i { background: #f6ecd0; clip-path: polygon(40% 0, 100% 0, 75% 50%, 100% 100%, 40% 100%, 0 50%); }
#coups { position: absolute; left: 50%; top: calc(50% + 18px); transform: translateX(-50%); display: flex; gap: 3px; pointer-events: none !important; }
#coups b { width: 9px; height: 5px; background: rgba(255, 255, 255, .35); box-shadow: 0 0 0 1px #0007; }
#coups b.ok { background: #fff; }
#pris { position: fixed; z-index: 41; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); display: flex; align-items: center; gap: 5px; font-size: 18px; opacity: 0; pointer-events: none !important; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000; }
#pris canvas { width: 30px; height: 30px; }
#pris.vu { animation: pris-vu .9s ease-out; }
@keyframes pris-vu { 0% { opacity: 0; transform: translate(-50%, 8px); } 15%, 70% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8px); } }

#bourse { position: absolute; left: 12px; top: 42px; display: flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; background: rgba(14, 22, 30, .6); border-radius: 2px; font-size: 14px; pointer-events: none !important; font-variant-numeric: tabular-nums; }
#bourse img { width: 22px; height: 22px; }
#b-appeler { position: absolute; right: 112px; top: 8px; width: 48px; height: 48px; display: grid; place-items: center; }
#b-appeler svg { filter: drop-shadow(0 1px 1px #0009); }
#b-descendre { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: 18px; min-height: 58px; padding: 0 20px; font-size: 16px; background: rgba(14, 22, 30, .78); border: 2px solid rgba(255, 255, 255, .4); border-radius: 3px; }
#invite { position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 6px 7px 6px 14px; background: rgba(14, 22, 30, .88); border-radius: 3px; white-space: nowrap; }
.inv-txt { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.inv-txt b { font-weight: 400; font-size: 15px; color: #ffdf73; }
.inv-txt span { font-size: 12px; line-height: 1.2; }
#invite-ok { flex: none; min-height: 46px; padding: 0 20px; font-size: 15px; background: #ffdf73; color: #2a1f05; border-radius: 2px; }
body.en-voiture #invite { bottom: 18px; }
#repere b { position: absolute; left: -36px; top: 26px; width: 72px; text-align: center; font-weight: 400; font-size: 15px; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
#bulle { position: absolute; left: 0; top: 0; max-width: 240px; padding: 6px 10px; background: rgba(255, 250, 235, .95); color: #2a2418; font-size: 14px; line-height: 1.2; border-radius: 3px; pointer-events: none !important; display: none; will-change: transform; }
#dialogue { position: fixed; z-index: 45; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(620px, 86vw); padding: 12px 16px 12px; background: rgba(14, 22, 30, .94); border-radius: 3px; }
#dlg-nom { display: block; font-weight: 400; font-size: 15px; color: #ffdf73; margin-bottom: 5px; }
#dlg-texte { margin: 0 0 10px; font-size: 17px; line-height: 1.28; }
.dlg-choix { display: flex; justify-content: flex-end; gap: 10px; }
.dlg-choix button { min-height: 46px; padding: 0 20px; font-size: 15px; border-radius: 2px; }
#dlg-ok { background: #ffdf73; color: #2a1f05; }
#dlg-non { background: rgba(255, 255, 255, .14); }

/* Le carnet */
.panneau { width: min(760px, 100%); height: 100%; max-height: 100%; background: #1c2a34; border-radius: 3px; display: flex; flex-direction: column; overflow: hidden; }
.onglets { display: flex; align-items: stretch; background: #14202a; flex: none; }
.onglet { min-height: 46px; padding: 0 18px; font-size: 16px; color: #b9c8d2; }
.onglet.on { background: #1c2a34; color: #fff; box-shadow: inset 0 3px 0 var(--herbe); }
#fermer-carnet { margin-left: auto; min-height: 46px; padding: 0 18px; font-size: 16px; background: #2a3b48; }
#mes-objets { flex: none; display: flex; align-items: center; gap: 4px; padding: 4px 8px; background: #16222c; overflow-x: auto; touch-action: pan-x; min-height: 44px; }
.objet { display: flex; align-items: center; gap: 3px; flex: none; padding: 2px 6px 2px 2px; font-size: 14px; font-variant-numeric: tabular-nums; background: #263743; border-radius: 2px; }
.objet canvas, .objet img { width: 30px; height: 30px; object-fit: contain; }
.objet.en-main { background: #3b4f2f; font-size: 12px; }
.mission { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #263743; border-radius: 3px; }
.mission.en-cours { box-shadow: inset 0 0 0 3px #ffdf73; }
.mission.finie { opacity: .6; }
.mission.fermee { opacity: .42; }
.mission .infos .nom { font-size: 14px; }
.mission .prix, .article .prix { display: flex; align-items: center; gap: 4px; font-size: 14px; flex: none; }
.mission .prix img, .article .prix img { width: 22px; height: 22px; }
.article { flex: 1 1 200px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #263743; border-radius: 3px; }
.article canvas, .article > img { width: 42px; height: 42px; object-fit: contain; flex: none; }
#guide-carnet { flex: none; padding: 8px 12px; font-size: 14px; line-height: 1.2; background: #ffdf73; color: #2a2008; }
#guide-carnet:empty { display: none; }
#contenu-carnet { flex: 1; overflow-y: auto; touch-action: pan-y; padding: 8px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; }
.ligne { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; background: #263743; border-radius: 3px; min-height: 64px; position: relative; }
.ligne.conseil { box-shadow: inset 0 0 0 3px #ffdf73; }
.ligne.fait { animation: fait-ligne .5s ease-out; }
@keyframes fait-ligne { 0% { background: #3fbf7a; } 100% { background: #263743; } }
.ingrs { display: flex; align-items: center; gap: 6px; flex: none; }
.ingr { display: flex; flex-direction: column; align-items: center; width: 50px; font-size: 13px; line-height: 1; color: #fff; }
.ingr canvas, .ingr img { width: 36px; height: 36px; object-fit: contain; }
.ingr.manque { color: #ffb09f; }
.ingr.manque canvas { opacity: .45; }
.fleche { font-size: 20px; color: #ffdf73; flex: none; }
.infos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.infos .nom { font-size: 14px; line-height: 1.1; }
.infos .note { font-size: 12px; line-height: 1.15; color: #cfe0ea; }
.infos .note.manque { color: #ffb09f; }
.qte { display: flex; align-items: center; gap: 2px; flex: none; }
.qte button { width: 38px; height: 44px; background: #1a2832; font-size: 20px; border-radius: 2px; }
.qte span { min-width: 26px; text-align: center; font-size: 15px; font-variant-numeric: tabular-nums; }
.bouton-p { min-height: 44px; padding: 0 12px; font-size: 14px; background: var(--herbe); color: #082417; border-radius: 2px; flex: none; }
.bouton-p:disabled { background: #3a4a55; color: #93a4af; }
.bouton-p.eclaire, #fermer-carnet.eclaire { border-radius: 2px; }
.bouton-p.eclaire { background: var(--herbe) !important; }
#fermer-carnet.eclaire { background: #ffdf73 !important; color: #2a2008; }
.carte { display: flex; flex-direction: column; gap: 5px; padding: 8px 6px; background: #263743; border-radius: 3px; align-items: center; text-align: center; flex: 1 1 150px; position: relative; }
.carte canvas, .carte img { flex: none; object-fit: contain; }
.carte .nom { font-size: 13px; line-height: 1.1; }
.carte.grise { opacity: .5; }
.carte.conseil { box-shadow: inset 0 0 0 3px #ffdf73; }
.txt { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.cout { font-size: 12px; line-height: 1.15; color: #cfe0ea; }
.carte.grand { flex-direction: column; align-items: stretch; flex: 1 1 200px; max-width: 49%; }
.carte.grand canvas { width: 100%; height: 86px; }
.carte.sac { flex: 0 0 92px; gap: 2px; padding: 6px; }
.carte.sac canvas { width: 46px; height: 46px; }
.carte.sac .nom { font-size: 12px; text-align: center; }

.vide-note { grid-column: 1 / -1; font-size: 14px; color: #b9c8d2; padding: 8px; }
.reglage .large { width: auto; min-width: 96px; padding: 0 12px; font-size: 15px; }

/* Fenêtres */
.voile { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(10, 18, 24, .62); padding: 16px; }
.boite { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 26px; background: #1c2a34; border-radius: 3px; max-width: 460px; text-align: center; }
.boite h2 { margin: 0 0 4px; font: 400 26px/1 'Blocks', sans-serif; color: var(--creme); }
.boite p { margin: 0; font-size: 15px; line-height: 1.3; }
.reglage { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.reglage button { width: 48px; height: 48px; background: #2a3b48; font-size: 24px; border-radius: 3px; }
.reglage span { min-width: 92px; font-variant-numeric: tabular-nums; }
.deux { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.deux .bouton { min-width: 150px; }

/* Écran commun « plein écran » */
#tourner { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; background: linear-gradient(rgba(16, 30, 40, .55), rgba(16, 30, 40, .55)), url('img/fond.webp') center / cover, #24404f; text-align: center; padding: 20px; }
#tourner.on, #tourner.visible { display: flex; }
#tourner .centre { max-width: 420px; }
#tourner p { font-size: 18px; margin: 12px 0; }
#tourner .aide { font-size: 13px; color: #d6e3ea; }
#tourner-plein { min-height: 54px; min-width: 200px; padding: 0 24px; font-size: 19px; background: var(--herbe); color: #082417; border-radius: 3px; box-shadow: inset 0 -5px 0 #1d8a4f, 0 4px 0 #0b4a2a; }
@media (max-height: 340px) { .place { width: 42px; height: 42px; } .place .ic { width: 32px; height: 32px; } }

/* Le mode création : la palette, les outils, la zone */
body.creation #horloge, body.creation #bourse, body.creation .aventure-seul, body:not(.creation) .creation-seul { display: none !important; }
body.creation .place b { display: none; }
.place.plus { background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .22); }
.place.plus span { font: 400 30px/1 'Blocks', sans-serif; color: rgba(255, 255, 255, .7); }
.place.depot { outline: 3px dashed #ffdf73; outline-offset: -3px; background: rgba(255, 223, 115, .25); }
body.en-palette #barre { z-index: 31; }
body.en-palette #palette { padding-bottom: 72px; }
#pal-blocs button { touch-action: none; -webkit-touch-callout: none; user-select: none; }
.icone-glisse { position: fixed; z-index: 40; width: 56px; height: 56px; margin: -28px 0 0 -28px; pointer-events: none; filter: drop-shadow(0 4px 6px #0008); }
#b-annuler, #b-zone { position: absolute; top: 8px; width: 48px; height: 48px; display: grid; place-items: center; }
#b-annuler { right: 164px; } #b-zone { right: 216px; }
/* La pioche est dessinée en 3D (js/main.js) : l'ancienne image reste cachée. */
#main { display: none !important; }
#b-vue { position: absolute; top: 8px; right: 268px; width: 48px; height: 48px; display: grid; place-items: center; opacity: .9; }
#b-vue svg { filter: drop-shadow(0 1px 1px #0009); }
#b-vue.on svg path { fill: #ffdf73; }
body.en-voiture #b-vue { display: none; }
#b-annuler svg, #b-zone svg, #b-carnet svg { filter: drop-shadow(0 1px 1px #0009); }
#b-zone.on { background: rgba(255, 255, 255, .28); border-radius: 50%; }
#zone-choix { position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: rgba(14, 22, 30, .9); border-radius: 3px; white-space: nowrap; }
#zone-choix button { min-height: 44px; min-width: 44px; padding: 0 12px; font-size: 15px; background: rgba(255, 255, 255, .14); border-radius: 2px; }
#zone-choix button.fort { background: #ffdf73; color: #2a1f05; }
#zone-choix span { font-size: 13px; padding: 0 4px; }
/* Sans horloge, la consigne passe à gauche : elle ne glisse plus sous les outils du haut. */
body.creation #consigne { left: 12px; transform: none; max-width: calc(100vw - 300px); text-align: left; }
/* Le menu des modes : trois cartes, deux mots chacune. */
#titre .modes { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
#titre .mode { width: 176px; min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: #1c2a34e6; border-radius: 3px; box-shadow: inset 0 -5px 0 #101a21, 0 4px 0 #0b1217; }
#titre .mode b { font: 400 26px/1 'Blocks', sans-serif; color: var(--creme); }
#titre .mode span { font-size: 14px; color: #cfe0ea; }
#titre .mode.charge { background: var(--herbe); box-shadow: inset 0 -5px 0 #1d8a4f, 0 4px 0 #0b4a2a; }
#titre .mode.charge b { color: #082417; } #titre .mode.charge span { color: #0b3a22; }
#titre .mode:active { transform: translateY(3px); }
#titre .lien { font-size: 14px; color: #e7f1f6; text-decoration: underline; text-underline-offset: 3px; opacity: .85; min-height: 40px; padding: 0 10px; }
/* Ce qu'il faut toucher clignote, c'est tout : ni cadre ni anneau autour (porteur, 10 nov. 2026). */
@keyframes clignote { 0%, 100% { filter: brightness(1); background-color: rgba(255, 223, 115, .1); } 50% { filter: brightness(1.9) drop-shadow(0 0 8px rgba(255, 223, 115, .95)); background-color: rgba(255, 223, 115, .55); } }
.eclaire { animation: clignote 0.8s ease-in-out infinite; outline: none !important; }
/* La bulle du tutoriel (porteur, 11 nov. 2026) : à côté de ce qu'il faut toucher, on lit, « OK », puis on fait. Rien d'autre ne se touche. */
#tb-voile { position: fixed; inset: 0; z-index: 58; background: rgba(8, 14, 20, .16); }
#tb { position: fixed; z-index: 59; left: 0; top: 0; width: min(310px, calc(100vw - 24px)); padding: 12px 14px 10px; background: #fff8e6; color: #2a2418; border-radius: 4px; box-shadow: 0 6px 22px rgba(0, 0, 0, .35); font-size: 15px; line-height: 1.32; text-align: left; animation: tb-vient .22s ease-out; }
#tb[hidden], #tb-voile[hidden], #tb-queue[hidden], #tb-autre[hidden] { display: none; }
#tb p { margin: 0 0 10px; }
.tb-boutons { display: flex; justify-content: flex-end; gap: 8px; }
.tb-boutons button { min-height: 44px; min-width: 78px; padding: 0 16px; font-size: 16px; font-weight: 700; border-radius: 3px; background: #ffdf73; color: #2a1f05; }
.tb-boutons #tb-autre { background: rgba(42, 36, 24, .1); color: #2a2418; font-weight: 600; }
#tb-queue { position: absolute; width: 16px; height: 16px; background: #fff8e6; transform: translateX(-50%) rotate(45deg); }
#tb-queue.bas { bottom: -7px; } #tb-queue.haut { top: -7px; }
@keyframes tb-vient { from { opacity: 0; translate: 0 6px; } }
#zone-choix button.eclaire { border-radius: 2px; background: #ffdf73 !important; color: #2a1f05; }
#b-bas { position: absolute; display: grid; place-items: center; right: calc(max(20px, env(safe-area-inset-right)) + 76px); bottom: 110px; width: 66px; height: 66px; border-radius: 50%; background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .34); touch-action: none; }
#b-bas.app { background: rgba(255, 255, 255, .32); }
body:not(.tactile) #b-bas { display: none; }

/* ---------- Le menu (porteur, 10 nov. 2026 : « un menu digne d'un vrai jeu vidéo »). Le monde vit derrière, filmé lentement. */
#titre { background: linear-gradient(90deg, rgba(10, 20, 28, .62) 0%, rgba(10, 20, 28, .28) 46%, rgba(10, 20, 28, .08) 70%, rgba(10, 20, 28, .4) 100%) !important;
  flex-direction: row !important; align-items: center !important; justify-content: space-between !important; gap: 4vw !important; padding: 5vh 6vw !important; box-sizing: border-box; }
#titre.chargement { background: linear-gradient(rgba(16, 30, 40, .28), rgba(16, 30, 40, .55)), url('img/fond.webp') center / cover !important; }
.titre-logo { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; }
#logo { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .04em; font: 400 clamp(46px, 22vmin, 160px)/.9 'Blocks', sans-serif; letter-spacing: .015em; }
#logo span { color: transparent; background: var(--tex-logo, #d9c08f) center / .5em repeat; -webkit-background-clip: text; background-clip: text; image-rendering: pixelated;
  text-shadow: 0 .045em 0 rgba(92, 58, 28, .95), 0 .09em 0 rgba(70, 42, 18, .95), 0 .135em 0 rgba(40, 24, 10, .8), 0 .2em .18em rgba(0, 0, 0, .45);
}
#logo span:last-child { font-size: .84em; margin-left: .06em; background-image: var(--tex-logo2, var(--tex-logo)); }
#splash { position: absolute; right: -2vw; bottom: -1.2em; transform: rotate(-12deg); font: 400 clamp(13px, 3.4vmin, 24px)/1.1 'Blocks', sans-serif; color: #ffe94d; text-shadow: 0 .1em 0 #4d3f00, 0 0 .4em rgba(0, 0, 0, .35);
  white-space: nowrap; animation: splash .5s ease-in-out infinite alternate; transform-origin: 50% 50%; pointer-events: none; }
@keyframes splash { from { scale: 1; } to { scale: 1.08; } }
.titre-menu { flex: 0 0 auto; width: min(320px, 42vw); display: flex; flex-direction: column; align-items: stretch; gap: 1.4vh; }
#titre .modes { display: none; }
#titre .mode[hidden], #titre .mode-bis[hidden], #titre .lien[hidden] { display: none !important; }
#titre .mode, #titre .mode-bis { width: auto !important; min-height: 0 !important; height: clamp(46px, 12vh, 66px); display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: space-between !important;
  padding: 0 18px; gap: 10px; border-radius: 2px !important; color: var(--creme);
  background: var(--tex-bouton, #8a5a2e) center / 48px repeat !important; image-rendering: pixelated;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .28), inset 0 -5px 0 rgba(0, 0, 0, .42), inset 0 0 0 2px rgba(0, 0, 0, .55), 0 4px 0 rgba(0, 0, 0, .35) !important; transition: filter .12s, transform .08s; }
#titre .mode b, #titre .mode-bis b { font: 400 clamp(20px, 5vmin, 30px)/1 'Blocks', sans-serif !important; color: var(--creme) !important; text-shadow: 0 3px 0 rgba(0, 0, 0, .55); }
#titre .mode span { font-size: clamp(11px, 2.8vmin, 14px) !important; color: #fff4dccc !important; text-shadow: 0 1px 0 #0009; }
#titre .mode.gros { height: clamp(58px, 16vh, 84px); background-image: var(--tex-bouton-vert, var(--tex-bouton)) !important; }
#titre .mode.gros b { font-size: clamp(26px, 7vmin, 40px) !important; }
#titre .mode:hover, #titre .mode-bis:hover { filter: brightness(1.14); }
#titre .mode:active, #titre .mode-bis:active { transform: translateY(3px); filter: brightness(.92); }
#titre .mode.charge { background-color: transparent !important; }
#titre .mode.conseille { outline: 3px solid #ffdf73; outline-offset: 2px; animation: conseil 1.2s ease-in-out infinite alternate; }
@keyframes conseil { from { outline-color: #ffdf73; } to { outline-color: #ffdf7344; } }
#titre .lien { align-self: center; }
#version { position: absolute; left: 12px; bottom: 8px; font-size: 12px; color: #fff9; text-shadow: 0 1px 0 #000a; }
#fondu { position: fixed; inset: 0; z-index: 25; background: #0d161d; opacity: 0; pointer-events: none; transition: opacity .35s; }
#fondu.noir { opacity: 1; }
@media (orientation: portrait) { #titre { flex-direction: column !important; justify-content: center !important; gap: 6vh !important; } .titre-logo { flex: 0 0 auto; align-items: center; } #logo { align-items: center; } .titre-menu { width: min(340px, 86vw); } }

/* Les réglages et la pause dans les matières du jeu. */
#pause .boite { background: linear-gradient(rgba(22, 32, 40, .9), rgba(22, 32, 40, .9)), var(--tex-pierre, #26343f) center / 40px repeat; image-rendering: pixelated;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .55), inset 0 4px 0 rgba(255, 255, 255, .08), 0 6px 0 rgba(0, 0, 0, .35); border-radius: 2px; }
#pause .reglage button { background: var(--tex-bouton, #2a3b48) center / 32px repeat; image-rendering: pixelated; color: var(--creme); text-shadow: 0 2px 0 rgba(0, 0, 0, .55);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -3px 0 rgba(0, 0, 0, .4), inset 0 0 0 2px rgba(0, 0, 0, .5); border-radius: 2px; }
#pause .reglage button:active { filter: brightness(.9); transform: translateY(2px); }

/* ---------- La ville : pièces, boutique, défis, modèles. */
body.ville #bourse { display: flex !important; }
#defi { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); padding: 6px 14px; background: rgba(14, 22, 30, .62); border-radius: 2px; font: 400 20px/1 'Blocks', sans-serif; color: #ffe36b; text-shadow: 0 2px 0 #4d3600; font-variant-numeric: tabular-nums; }
#boutique-ville { z-index: 32; }
.bv { width: min(620px, 100%); max-height: 100%; overflow: auto; background: linear-gradient(rgba(22, 32, 40, .92), rgba(22, 32, 40, .92)), var(--tex-pierre, #26343f) center / 40px repeat; image-rendering: pixelated;
  border-radius: 2px; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .55), 0 6px 0 rgba(0, 0, 0, .35); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; box-sizing: border-box; }
.bv-haut { display: flex; align-items: center; gap: 10px; }
.bv-haut b { flex: 1; font: 400 20px/1.1 'Blocks', sans-serif; color: var(--creme); }
#bv-bourse { color: #ffe36b; font-size: 15px; }
#bv-fermer { min-height: 44px; padding: 0 14px; background: rgba(255, 255, 255, .14); border-radius: 2px; }
#bv-objets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.bv-objet { display: flex; align-items: center; gap: 10px; padding: 6px; background: rgba(255, 255, 255, .06); border-radius: 2px; }
.bv-objet.acquis { opacity: .65; }
.bv-ic { width: 48px; height: 48px; flex: none; }
.bv-texte { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.bv-texte b { font-size: 15px; color: #fff; }
.bv-texte span { font-size: 13px; color: #ffe36b; }
.bv-objet button { min-height: 44px; padding: 0 12px; background: var(--herbe); color: #082417; border-radius: 2px; font-size: 14px; }
.bv-objet button:disabled { background: rgba(255, 255, 255, .12); color: #fff8; }

/* ---------- Les engins : « Remettre en blocs » au-dessus de « Descendre ». */
#b-defaire { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: 86px; width: 58px; height: 58px; display: grid; place-items: center; background: rgba(14, 22, 30, .78); border: 2px solid rgba(255, 255, 255, .4); border-radius: 3px; }
#b-defaire[hidden] { display: none; }
#b-defaire img { width: 34px; height: 34px; }

/* ---------- Les succès : bouton du menu, bandeau, écran. Un losange doré (ni coupe, ni médaille). */
#titre .menu-ligne { display: flex; gap: 1.4vh; }
#titre .menu-ligne .mode-bis { flex: 1 1 0; min-width: 0; padding: 0 8px; flex-direction: column !important; justify-content: center !important; gap: 2px; }
#titre .menu-ligne .mode-bis b { font-size: clamp(16px, 4vmin, 24px) !important; }
#succes-pts { font-size: clamp(11px, 2.6vmin, 14px); color: #ffe36b; }
.sb-etoile { flex: none; width: 22px; height: 22px; background: linear-gradient(135deg, #fff2a8, #e8b72e 55%, #a87412); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
#succes-bandeau { position: fixed; z-index: 60; left: 50%; top: 10px; transform: translate(-50%, -140%); display: flex; align-items: center; gap: 10px; padding: 8px 14px; min-width: min(360px, 86vw);
  background: linear-gradient(rgba(22, 32, 40, .95), rgba(22, 32, 40, .95)); border-radius: 2px; box-shadow: inset 0 0 0 2px rgba(255, 227, 107, .55), 0 5px 0 rgba(0, 0, 0, .35); transition: transform .35s cubic-bezier(.2, .9, .3, 1.2); pointer-events: none; }
#succes-bandeau.vu { transform: translate(-50%, 0); }
.sb-texte { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sb-texte b { font: 400 17px/1.1 'Blocks', sans-serif; color: #ffe36b; }
.sb-texte i { font-style: normal; font-size: 13px; color: var(--creme); }
.sb-points, .es-pts { font: 400 18px/1 'Blocks', sans-serif; color: #ffe36b; }
#ecran-succes { z-index: 70; }
#es-points { color: #ffe36b; font-size: 15px; }
#es-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.es-ligne { display: flex; align-items: center; gap: 10px; padding: 8px; background: rgba(255, 255, 255, .05); border-radius: 2px; opacity: .55; }
.es-ligne .sb-etoile { filter: grayscale(1) brightness(.6); }
.es-ligne.oui { opacity: 1; background: rgba(255, 227, 107, .1); }
.es-ligne.oui .sb-etoile { filter: none; }
.es-texte { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.es-texte b { font-size: 15px; color: #fff; }
.es-texte i { font-style: normal; font-size: 12px; color: var(--creme); }

/* ---------- La ville de tous : combien en ligne, signaler une parcelle. */
#en-ligne { position: absolute; left: max(12px, env(safe-area-inset-left)); top: 96px; padding: 3px 8px; background: rgba(14, 22, 30, .55); border-radius: 2px; font-size: 12px; color: #b9f0c4; }
#en-ligne::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #5fe08a; vertical-align: 1px; }
#en-ligne[hidden], #b-signaler[hidden] { display: none; }
#b-signaler { position: absolute; left: max(12px, env(safe-area-inset-left)); top: 104px; min-height: 36px; padding: 0 12px; font-size: 13px; background: rgba(14, 22, 30, .7); border: 1px solid rgba(255, 255, 255, .3); border-radius: 2px; }
#signaler { z-index: 72; }
.bv.sg { width: min(380px, 100%); align-items: center; text-align: center; gap: 10px; }
.bv.sg b { font: 400 22px/1.1 'Blocks', sans-serif; color: var(--creme); }
.bv.sg span { font-size: 14px; color: var(--creme); opacity: .8; }
.sg-boutons { display: flex; gap: 8px; width: 100%; }
.sg-boutons button { flex: 1; min-height: 48px; border-radius: 2px; background: rgba(255, 255, 255, .14); font-size: 15px; }
#signaler-ok { background: #c8463d; }

/* Pause et réglages (porteur, 11 nov. 2026 : « la fenêtre des options est beaucoup trop grande, on ne peut même pas cliquer » ;
   « des réglages classiques et compréhensibles ») : une pause courte, des réglages en deux onglets, tout tient dans l'écran. */
#pause .boite { max-height: calc(100vh - 20px); overflow: hidden; }
.pause-boite { min-width: min(340px, 92vw); }
.pause-boite .bouton { min-width: 0; width: 100%; }
.pause-boite .deux { width: 100%; flex-wrap: nowrap; }
.pause-boite .deux .bouton { flex: 1; min-width: 0; }
.roue-texte { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.regl-boite { width: min(540px, 94vw); gap: 10px; padding: 14px 18px; }
.onglets-r { display: flex; gap: 6px; align-self: stretch; }
.onglets-r button { flex: 1; min-height: 44px; font-size: 16px; background: rgba(255, 255, 255, .08); border-radius: 2px; color: var(--creme); }
.onglets-r button.on { background: var(--herbe); color: #082417; }
.regl-page { align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 104px; }
.regl-page[hidden] { display: none; }
.ligne-r { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ligne-r > span { font-size: 15px; text-align: left; }
.choix { display: flex; gap: 4px; flex: none; }
.choix button { min-height: 44px; min-width: 62px; padding: 0 10px; font-size: 15px; background: rgba(255, 255, 255, .1); border-radius: 2px; color: var(--creme); }
.choix button.on { background: #ffdf73; color: #2a1f05; }
.regl-boite .bouton { min-height: 48px; min-width: 180px; font-size: 18px; }
#b-reglages.roue { display: grid; place-items: center; flex: 0 0 64px !important; }
@media (max-height: 420px) { .regl-boite { padding: 10px 14px; gap: 7px; } .regl-boite h2 { font-size: 22px; } .regl-page { min-height: 96px; gap: 7px; } }
.roue-texte svg, #b-reglages.roue svg { flex: none; width: 26px; height: 26px; }

/* Le tutoriel contraint (porteur, 11 nov. 2026). */
/* « Passer le tutoriel » : à gauche, sous la mini-carte (au milieu, la barre du haut l'atteint sur téléphone : il couvrait le relieur). */
#b-passer { position: absolute; left: 12px; top: 210px; min-height: 34px; padding: 0 12px; font-size: 13px; background: rgba(14, 22, 30, .62); color: #fff; border-radius: 2px; }
#b-passer[hidden] { display: none; }
#geste { position: fixed; left: 52%; top: 40%; width: 34%; height: 60px; pointer-events: none; z-index: 20; }
#geste[hidden] { display: none; }
#geste i { position: absolute; left: 0; top: 8px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .8); box-shadow: 0 0 0 6px rgba(255, 255, 255, .25), -26px 0 18px rgba(255, 255, 255, .35); animation: glisse 1.5s ease-in-out infinite; }
@keyframes glisse { 0% { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateX(calc(34vw - 44px)); opacity: 0; } }
#zone-choix button.bloque { opacity: .32; pointer-events: none; }
.tactile #b-poser canvas { width: 40px; height: 40px; image-rendering: pixelated; filter: drop-shadow(0 2px 2px #0007); }

/* La palette, du genre au bloc puis à sa forme et sa couleur (porteur, 11 nov. 2026 : « on ne fait pas la différence de
   hiérarchie entre ce qui est en haut et ce qui est en bas »). Au-dessus de la barre, jamais dessous. */
#palette { align-items: center; justify-content: center; }
.pal { width: min(840px, 100%); height: 100%; max-height: 430px; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; background: #1c2a34; border-radius: 3px; box-sizing: border-box; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .4); }
.pal-tete { display: flex; align-items: center; gap: 10px; min-height: 40px; }
#pal-titre { font: 400 19px/1.1 'Blocks', sans-serif; color: var(--creme); flex: none; }
#pal-guide { flex: 1; font-size: 13px; color: #ffdf73; }
#pal-fermer { min-height: 40px; padding: 0 16px; font-size: 15px; background: rgba(255, 255, 255, .14); border-radius: 2px; margin-left: auto; }
.pal-corps { flex: 1; min-height: 0; display: flex; gap: 10px; }
.pal-cats { display: flex; flex-direction: column; gap: 4px; flex: 0 0 112px; overflow-y: auto; }
.pal-cats button { flex: 0 0 auto; min-height: 46px; display: flex; align-items: center; gap: 6px; padding: 0 6px; font-size: 11px; white-space: nowrap; text-align: left; background: rgba(255, 255, 255, .05); border-radius: 2px; color: #b9c6ce; }
.pal-cats button canvas { width: 26px; height: 26px; flex: none; }
.pal-cats button.on { background: rgba(255, 255, 255, .18); color: #fff; box-shadow: inset 3px 0 0 #ffdf73; }
.pal-choix { flex: 1; min-width: 0; overflow-y: auto; padding-right: 2px; }
#pal-blocs { display: grid; grid-template-columns: repeat(auto-fill, 52px); gap: 4px; align-content: start; }
#pal-blocs[hidden], #pal-modeles[hidden], .pal-reglage[hidden], #pal-teinte[hidden] { display: none; }
#pal-blocs button { width: 52px; height: 52px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); border-radius: 2px; touch-action: none; -webkit-touch-callout: none; user-select: none; }
#pal-blocs canvas { width: 40px; height: 40px; }
#pal-modeles { display: flex; flex-wrap: wrap; gap: 4px; align-content: start; }
#pal-modeles button { height: 52px; padding: 0 12px 0 4px; display: flex; align-items: center; gap: 6px; background: rgba(255, 223, 115, .1); border-radius: 2px; font-size: 13px; }
#pal-modeles canvas { width: 40px; height: 40px; }
.pal-reglage { flex: 0 0 236px; display: flex; flex-direction: column; gap: 6px; padding-left: 10px; border-left: 2px solid rgba(255, 255, 255, .08); }
.pal-sous { font-size: 11px; color: #9fb0bb; text-transform: uppercase; letter-spacing: .08em; }
#pal-formes { display: flex; gap: 4px; }
#pal-formes button { width: 42px; height: 42px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); border-radius: 2px; }
#pal-formes button.on { background: rgba(255, 255, 255, .22); box-shadow: inset 0 -3px 0 #ffdf73; }
#pal-formes canvas { width: 32px; height: 32px; }
#pal-teinte { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
#pal-couleurs { display: grid; grid-template-columns: repeat(8, 25px); gap: 4px; }
#pal-couleurs button { width: 25px; height: 25px; border-radius: 2px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25); }
#pal-couleurs button.on { outline: 3px solid #fff; outline-offset: 1px; }
@media (max-height: 420px) { .pal { padding: 8px 10px; gap: 6px; } .pal-tete { min-height: 36px; } }

/* Conduire (porteur, 11 nov. 2026) : à gauche on tourne, à droite on avance et on freine ; Descendre partout, en haut à droite ;
   « En blocs » seulement à l'arrêt, dans sa parcelle. */
#joy2 { display: none; }
.tactile.en-voiture #joy2 { display: block; position: absolute; right: max(26px, env(safe-area-inset-right)); bottom: 14px; width: 96px; height: 150px; border-radius: 48px; background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .34); touch-action: none; }
#poignee2 { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
#joy2 .fl-h, #joy2 .fl-b { position: absolute; left: 50%; width: 0; height: 0; margin-left: -9px; border: 9px solid transparent; }
#joy2 .fl-h { top: 8px; border-bottom-color: rgba(255, 255, 255, .7); border-top: 0; }
#joy2 .fl-b { bottom: 8px; border-top-color: rgba(255, 255, 255, .7); border-bottom: 0; }
body.en-voiture #b-descendre { top: 62px; bottom: auto; min-height: 48px; }
body.en-voiture #b-defaire { top: 62px; bottom: auto; right: calc(max(14px, env(safe-area-inset-right)) + 150px); width: auto; height: 48px; padding: 0 12px; display: flex; gap: 6px; align-items: center; font-size: 14px; }
body.en-voiture #b-defaire img { width: 26px; height: 26px; }
body.en-voiture #b-defaire[hidden] { display: none; }
.tactile.en-voiture.vole #saut { display: grid !important; right: max(140px, calc(env(safe-area-inset-right) + 140px)); bottom: 90px; }
.tactile.en-voiture.vole #b-bas { display: grid !important; right: max(140px, calc(env(safe-area-inset-right) + 140px)); bottom: 14px; }

/* La carte (porteur, 11 nov. 2026 : « une mini-carte pour voir les repères, revoir sa parcelle ; on l'agrandit en cliquant ;
   le côté GTA, en mode Minecraft »). */
/* La petite carte ronde ne s'affiche plus : un bouton dans la barre du haut ouvre la grande carte (porteur, 15 nov. 2026). */
#carte { display: none !important; position: absolute; left: 12px; top: 74px; width: 104px; height: 104px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(14, 22, 30, .7), 0 3px 8px rgba(0, 0, 0, .35); cursor: pointer; }
#carte[hidden] { display: none; }
body.en-palette #carte { display: none; }
#grande-carte { padding: 10px; }
.gc-boite { display: flex; gap: 14px; align-items: stretch; height: 100%; max-height: 520px; background: #1c2a34; border-radius: 3px; padding: 10px; box-sizing: border-box; }
#carte-g { height: 100%; aspect-ratio: 1; max-width: 62vw; border-radius: 2px; touch-action: none; cursor: crosshair; }
.gc-cote { display: flex; flex-direction: column; gap: 7px; width: 190px; }
.gc-cote h2 { margin: 0; font: 400 22px/1 'Blocks', sans-serif; color: var(--creme); }
.gc-aide { margin: 0; font-size: 12px; color: #9fb0bb; }
.gc-cote .bouton { min-width: 0; width: 100%; min-height: 40px; font-size: 15px; }
.gc-cote #gc-fermer { margin-top: auto; }
.gc-leg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; font-size: 11px; color: #cfd8de; }
.gc-leg span { display: flex; align-items: center; gap: 5px; }
.gc-leg i { width: 11px; height: 11px; flex: none; }
.l-moi { background: #fff; clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%); }
.l-maison { background: #ffdf73; }
.l-autres { background: #4aa3ff; transform: rotate(45deg) scale(.8); }
.l-balise { background: #ff7a45; border-radius: 50%; box-shadow: 0 0 0 2px #fff inset; }
@media (max-height: 420px) { .gc-cote { gap: 5px; } .gc-cote .bouton { min-height: 36px; font-size: 14px; } .gc-cote h2 { font-size: 18px; } }

/* Le menu (porteur, 11 nov. 2026 : « un menu sur le côté gauche, et sur le côté droit du paysage, une illustration ») :
   un panneau sombre à gauche (logo, puis les boutons, chacun son icône), la ville vivante à droite, sans voile. */
#titre { flex-direction: row !important; align-items: stretch !important; justify-content: flex-start !important; padding: 0 !important; gap: 0 !important;
  background: linear-gradient(90deg, rgba(12, 22, 30, .94) 0%, rgba(12, 22, 30, .88) 32%, rgba(12, 22, 30, .4) 46%, rgba(12, 22, 30, 0) 60%) !important; }
.menu-gauche { position: relative; width: min(420px, 46vw); display: flex; flex-direction: column; justify-content: center; gap: 3.5vh; padding: 5vh 30px 5vh max(30px, env(safe-area-inset-left)); box-sizing: border-box; }
.menu-gauche .titre-logo { flex: 0 0 auto; align-items: flex-start; }
.menu-gauche #logo { font-size: clamp(32px, 10.5vmin, 80px); }
#logo-img { display: block; width: 100%; max-height: 32vh; object-fit: contain; object-position: left center; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); }
#logo-img[hidden] { display: none; }
.menu-gauche .titre-menu { width: 100%; gap: 1.3vh; }
#titre .menu-gauche .mode, #titre .menu-gauche .mode-bis { height: clamp(44px, 11vh, 58px); justify-content: flex-start !important; gap: 14px !important; padding: 0 18px 0 14px !important;
  background: rgba(255, 255, 255, .07) !important; background-image: none !important; box-shadow: inset 3px 0 0 rgba(255, 255, 255, .16) !important; border-radius: 3px; }
#titre .menu-gauche .mode-bis:hover, #titre .menu-gauche .mode:hover { background: rgba(255, 255, 255, .13) !important; filter: none; }
#titre .menu-gauche .mode.gros { height: clamp(54px, 14vh, 74px); background: linear-gradient(180deg, #45d382, #27a960) !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -4px 0 #1b7d45, 0 6px 16px rgba(39, 169, 96, .3) !important; }
#titre .menu-gauche .mode.gros b { color: #fff !important; text-shadow: 0 2px 0 #13603a !important; }
#titre .menu-gauche .mode.gros span { color: #eafff2 !important; }
#titre .menu-gauche .mode b, #titre .menu-gauche .mode-bis b { font-size: clamp(18px, 5vmin, 26px) !important; }
#titre .menu-gauche .mode.gros b { font-size: clamp(24px, 7vmin, 36px) !important; }
#titre .menu-gauche .mode span, #titre .menu-gauche .mode-bis span { margin-left: auto; font-size: clamp(11px, 2.6vmin, 13px) !important; color: #cfdde6 !important; }
#titre .menu-gauche .mode-bis { flex-direction: row !important; align-items: center !important; }
.ic-menu { width: 30px; height: 30px; flex: none; display: grid; place-items: center; color: #e9eef1; }
.ic-menu canvas { width: 30px; height: 30px; image-rendering: pixelated; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); }
.ic-svg svg { width: 26px; height: 26px; }
#titre .menu-gauche .lien { align-self: flex-start; padding: 0 2px; min-height: 36px; margin-top: .4vh; font-size: 13px; opacity: .75; }
.menu-gauche #version { left: max(30px, env(safe-area-inset-left)); bottom: 10px; }
@media (orientation: portrait) { .menu-gauche { width: 100%; } #titre { background: rgba(12, 22, 30, .8) !important; } }

#logo[hidden] { display: none !important; }

#serveur { display: flex; align-items: center; gap: 8px; margin: -0.4vh 0 0.4vh 2px; font-size: 12px; color: #cfdde6; }
#serveur[hidden] { display: none; }
#serveur i { width: 9px; height: 9px; border-radius: 50%; background: #45d382; box-shadow: 0 0 6px #45d382; flex: none; }
#serveur.coupe i { background: #9aa6ad; box-shadow: none; }

/* Tutoriel : dans la palette, seul ce qui clignote répond. */
#palette button.bloque { opacity: .3; pointer-events: none; }

/* Le bloc en main, à part de la barre (porteur, 11 nov. 2026) : sur PC, en bas à gauche ; au doigt, sur le bouton Poser. */
#en-main { display: none; }
body.creation:not(.tactile):not(.en-voiture) #en-main { display: grid; place-items: center; position: absolute; left: 14px; bottom: 10px; width: 62px; height: 62px; background: rgba(14, 22, 30, .6); border-radius: 3px; box-shadow: inset 0 0 0 3px #ffdf73; }
#en-main canvas { width: 44px; height: 44px; image-rendering: pixelated; }

/* Choisir sa parcelle sur la carte (porteur, 11 nov. 2026). */
#gc-prendre { display: none; }
#grande-carte.choix #gc-prendre { display: block; }
#grande-carte.choix #gc-maison, #grande-carte.choix #gc-place, #grande-carte.choix #gc-effacer, #grande-carte.choix #gc-fermer, #grande-carte.choix .gc-leg { display: none; }
#gc-prendre:disabled { opacity: .45; }

/* Après le choix de sa parcelle, on entre sans repasser par le menu (porteur, 11 nov. 2026 : « renvoyé au menu, j'ai pas compris »). */
#pret { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(12, 22, 30, .78); }
#pret[hidden] { display: none; }
#pret b { font: 400 clamp(24px, 6vmin, 40px)/1.1 'Blocks', sans-serif; color: var(--creme); text-align: center; }
#pret .bouton { min-width: 220px; }
#tb-autre.danger { background: #d9553f !important; color: #fff !important; }
#invite-ok.danger { background: #d9553f !important; color: #fff !important; }

/* Tutoriel : le geste « glisser » du bloc jusqu'à la barre (porteur, 11 nov. 2026 : « il faut bien montrer le geste »). */
#geste-glisser { position: fixed; z-index: 45; left: 0; top: 0; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 0 0 7px rgba(255, 255, 255, .3), 0 4px 10px rgba(0, 0, 0, .35); pointer-events: none; animation: glisser-bloc 1.9s ease-in-out infinite; }
#geste-glisser[hidden] { display: none; }
@keyframes glisser-bloc { 0% { transform: translate(var(--x0), var(--y0)) scale(1.15); opacity: 0; } 15% { transform: translate(var(--x0), var(--y0)) scale(.9); opacity: 1; } 75% { transform: translate(var(--x1), var(--y1)) scale(.9); opacity: 1; } 100% { transform: translate(var(--x1), var(--y1)) scale(1); opacity: 0; } }
#barre.eclaire { border-radius: 3px; }
/* La barre de l'outil zone : des icônes seules, juste au-dessus de la barre rapide, pas plus large qu'elle (porteur, 11 nov. 2026 :
   « trop large », « ça se superpose avec un autre texte »). */
#zone-choix { bottom: 66px; gap: 3px; padding: 4px; border-radius: 3px; background: rgba(14, 22, 30, .82); }
#zone-choix button { min-width: 40px; min-height: 40px; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; color: #fff; }
#zone-choix button.fort { color: #2a1f05; }
#zone-choix #zone-taille { min-width: 26px; text-align: center; font: 700 17px Future, system-ui, sans-serif; padding: 0; }
#zone-choix .sep { width: 1px; align-self: stretch; margin: 4px 3px; background: rgba(255, 255, 255, .25); }
@media (max-height: 340px) { #zone-choix { bottom: 58px; } #zone-choix button { width: 36px; height: 36px; min-width: 36px; min-height: 36px; } }

/* Conduire (porteur, 11 nov. 2026) : à gauche, le pouce n'importe où tourne ; à droite, avancer et freiner. */
.tactile.en-voiture #joy2 { display: none !important; }
#b-gaz, #b-frein { display: none; }
.tactile.en-voiture #b-gaz, .tactile.en-voiture #b-frein { display: grid; place-items: center; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); border: 2px solid rgba(255, 255, 255, .4); touch-action: none; }
.tactile.en-voiture #b-gaz { right: max(18px, env(safe-area-inset-right)); bottom: 18px; width: 104px; height: 104px; }
.tactile.en-voiture #b-frein { right: calc(max(18px, env(safe-area-inset-right)) + 116px); bottom: 14px; width: 74px; height: 74px; }
#b-gaz.app, #b-frein.app { background: rgba(255, 255, 255, .32); }
.tactile.en-voiture.vole #saut { right: calc(max(18px, env(safe-area-inset-right)) + 202px) !important; bottom: 96px !important; }
.tactile.en-voiture.vole #b-bas { right: calc(max(18px, env(safe-area-inset-right)) + 202px) !important; bottom: 14px !important; }
#joy.volant { opacity: .85; }
/* Ranger le modèle tenu en main : un vrai bouton (porteur : « pas intuitif »). */
#b-ranger { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: 108px; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; font-size: 14px; background: rgba(14, 22, 30, .78); border: 2px solid rgba(255, 255, 255, .4); border-radius: 3px; }
.tactile #b-ranger { right: calc(max(14px, env(safe-area-inset-right)) + 100px); bottom: 92px; }
#b-ranger[hidden] { display: none; }

#invite-2[hidden] { display: none; }
#invite-2 { flex: none; min-height: 46px; padding: 0 18px; font-size: 15px; border-radius: 2px; margin-right: -6px; background: #2fbf71 !important; color: #fff !important; }

/* Réécouter la consigne : petit haut-parleur dans le coin de la bulle (porteur, 11 nov. 2026 : « au cas où un enfant a mal entendu »). */
#tb-redire { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; background: transparent; color: #8a7a5c; border-radius: 50%; }
#tb-redire:active { background: rgba(0, 0, 0, .08); }
#tb-redire[hidden] { display: none; }
#tb:has(#tb-redire:not([hidden])) #tb-texte { padding-right: 28px; }
/* Quête accomplie : un grand bandeau doré au centre, qui arrive et repart. */
#quete-finie { position: fixed; z-index: 57; left: 50%; top: 22%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 34px 14px; background: linear-gradient(#2a2418f2, #1a150ef2); border: 2px solid #ffdf73; border-radius: 4px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); pointer-events: none !important; text-align: center; }
#quete-finie[hidden] { display: none; }
/* La fiche d'un objet : en 3D qui tourne, une phrase, sa taille, son prix. */
#fiche { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(8, 12, 16, .6); }
#fiche[hidden] { display: none; }
.fiche { width: min(620px, 94vw); display: flex; gap: 16px; align-items: center; padding: 14px 18px; background: #1c2a34; border-radius: 4px; box-shadow: 0 12px 34px rgba(0, 0, 0, .5); }
#fiche-vue { width: min(220px, 36vw); height: min(220px, 36vw); flex: none; background: radial-gradient(#2f4452, #1c2a34 70%); border-radius: 3px; }
.fiche-droite { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
#fiche-nom { font-family: Future, system-ui, sans-serif; font-size: 22px; color: #fff4dc; text-transform: uppercase; }
#fiche-texte { margin: 0; font-size: 15px; line-height: 1.35; color: #e6edf2; }
#fiche-taille { font-size: 12px; color: #9fb3c0; }
#fiche-taille[hidden] { display: none; }
.fiche-boutons { display: flex; gap: 8px; margin-top: 4px; }
.fiche-boutons button { min-height: 42px; padding: 0 16px; border-radius: 3px; font-size: 15px; }
#fiche-acheter { background: #2ec27e; color: #fff; }
#fiche-acheter:disabled { background: #44525c; color: #aab6be; }
#fiche-acheter[hidden] { display: none; }
#fiche-fermer { background: rgba(255, 255, 255, .12); color: #fff; }
.bv-objet .bv-ic, .bv-objet .bv-texte { cursor: pointer; }
/* Ce qu'un trésor rapporte, en clair (porteur, 15 nov. 2026 : « faut qu'on voie ce qu'on a gagné »). */
#gain { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(8, 12, 16, .55); }
#gain[hidden] { display: none; }
.gain { min-width: min(420px, 92vw); max-width: 92vw; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 22px 16px; background: linear-gradient(#2a2418f8, #1a150ef8); border: 2px solid #ffdf73; border-radius: 4px; box-shadow: 0 12px 34px rgba(0, 0, 0, .5); animation: gain-vient .35s ease-out; }
.gain small { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #ffdf73; }
.gain b { font-family: Future, system-ui, sans-serif; font-size: 26px; text-transform: uppercase; color: #fff4dc; }
#gain-liste { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-height: 46vh; overflow: auto; }
.gain-objet { width: 116px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; background: rgba(255, 255, 255, .06); border-radius: 3px; text-align: center; font-size: 12px; color: #e8dcc0; }
.gain-objet canvas, .gain-objet img { width: 56px; height: 56px; }
.gain-objet strong { font-size: 13px; color: #fff; font-weight: 400; }
.gain-objet em { font-style: normal; font-size: 11px; color: #ffdf73; }
#gain-ok { min-height: 44px; padding: 0 26px; background: #ffdf73; color: #2a1f05; border-radius: 3px; font-size: 16px; }
/* Ce qu'on vient d'acquérir : encadré « Nouveau » dans la palette, jusqu'à ce qu'on le prenne (porteur, 15 nov. 2026). */
#palette button.neuf { box-shadow: inset 0 0 0 2px #ffdf73; position: relative; }
#palette button.neuf::after { content: 'Nouveau'; position: absolute; right: 2px; top: 2px; padding: 1px 4px; font-size: 9px; background: #ffdf73; color: #2a1f05; border-radius: 2px; }
#pal-cats button.neuf::after { content: ''; width: 8px; height: 8px; padding: 0; border-radius: 50%; right: 4px; top: 4px; }
/* Une étape de quête franchie se voit (porteur, 14 nov. 2026 : « on n'a pas l'impression ; il faut que ce soit plus marqué »). */
#quete-pas { position: fixed; z-index: 56; left: 50%; top: 24%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 24px 10px; background: #1c2a34f0; border: 2px solid #ffdf73; border-radius: 4px; pointer-events: none !important; text-align: center; box-shadow: 0 8px 22px rgba(0, 0, 0, .4); }
#quete-pas[hidden] { display: none; }
#quete-pas b { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #ffdf73; }
#quete-pas span { font-family: Future, system-ui, sans-serif; font-size: 22px; color: #fff4dc; }
#quete-pas.vient { animation: quete-vient 2.4s ease-out forwards; }
/* L'heure du jeu, en petit sous la petite carte (porteur, 14 nov. 2026 : « que le soir ait un sens »). */
#heure { position: absolute; left: 12px; top: 74px; z-index: 2; display: flex; justify-content: flex-start; align-items: center; gap: 5px; font-size: 13px; color: #fff; pointer-events: none !important; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000c; }
#heure[hidden] { display: none; }
#heure i { width: 11px; height: 11px; border-radius: 50%; background: #ffdf73; display: block; }
#heure.nuit i { background: #f6ecd0; clip-path: polygon(40% 0, 100% 0, 75% 50%, 100% 100%, 40% 100%, 0 50%); border-radius: 0; }
body.en-palette #heure { display: none; }
/* La vigueur, sur les îles dangereuses : une barre sous l'heure. */
#vigueur { position: absolute; left: 14px; top: 124px; width: 100px; height: 8px; border-radius: 2px; background: rgba(14, 22, 30, .6); box-shadow: 0 0 0 2px rgba(14, 22, 30, .6); pointer-events: none !important; overflow: hidden; }
#vigueur[hidden] { display: none; }
#vigueur i { display: block; height: 100%; width: var(--v, 100%); background: #8fe07a; transition: width .25s; }
#vigueur.bas i { background: #ffb347; }
body.en-palette #vigueur, body.en-voiture #vigueur { display: none; }
/* Bousculé : un voile clair au bord de l'écran, très bref (rien qui fasse peur). */
#coup-recu { position: fixed; inset: 0; pointer-events: none !important; box-shadow: inset 0 0 60px 18px rgba(255, 214, 140, .55); opacity: 0; z-index: 40; }
#coup-recu.vient { animation: coup-recu .38s ease-out; }
@keyframes coup-recu { from { opacity: 1; } to { opacity: 0; } }
#quete-finie small { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #ffdf73; }
#quete-finie b { font-family: Future, system-ui, sans-serif; font-size: 30px; line-height: 1.05; text-transform: uppercase; color: #fff4dc; }
#quete-finie span { font-size: 17px; color: #ffdf73; }
#quete-finie.vient { animation: quete-vient 3.4s ease-out forwards; }
@keyframes quete-vient { 0% { opacity: 0; transform: translateX(-50%) scale(.7); } 8% { opacity: 1; transform: translateX(-50%) scale(1.06); } 14% { transform: translateX(-50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-14px); } }

/* Les réglages, soignés (porteur, 11 nov. 2026 : « il fait trop bâclé ») : une tête, des onglets, une ligne par réglage avec
   son icône et un mot d'aide, des choix en pastilles. */
#reglages.regl-boite { width: min(560px, 94vw); gap: 12px; padding: 16px 18px 18px; background: linear-gradient(#1f2f3a, #17232c); border: 1px solid rgba(255, 223, 115, .35); border-top: 3px solid #ffdf73; border-radius: 4px; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); }
#reglages .r-tete { display: flex; align-items: center; justify-content: center; gap: 10px; color: #ffdf73; }
#reglages .r-tete h2 { margin: 0; font: 700 28px/1 Future, system-ui, sans-serif; letter-spacing: .04em; color: #fff4dc; }
#reglages .onglets-r { gap: 4px; padding: 4px; background: rgba(0, 0, 0, .25); border-radius: 4px; }
#reglages .onglets-r button { min-height: 40px; font: 700 16px Future, system-ui, sans-serif; letter-spacing: .03em; text-transform: uppercase; background: transparent; color: #b7c4cd; border-radius: 3px; }
#reglages .onglets-r button.on { background: #ffdf73; color: #2a1f05; }
#reglages .regl-page { gap: 8px; min-height: 0; }
#reglages .ligne-r { gap: 12px; padding: 8px 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06); border-radius: 4px; }
#reglages .r-ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; color: #ffdf73; background: rgba(255, 223, 115, .1); border-radius: 4px; }
#reglages .r-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 1px; }
#reglages .r-txt b { font-size: 16px; color: #fff4dc; }
#reglages .r-txt small { font-size: 12.5px; color: #93a5b2; line-height: 1.25; }
#reglages .choix { gap: 0; padding: 3px; background: rgba(0, 0, 0, .3); border-radius: 4px; }
#reglages .choix button { min-height: 38px; min-width: 56px; padding: 0 10px; font-size: 14px; font-weight: 600; background: transparent; color: #c7d2d9; border-radius: 3px; transition: background .15s, color .15s; }
#reglages .choix button.on { background: #ffdf73; color: #2a1f05; box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
#reglages #r-ok { min-width: 200px; margin-top: 2px; }
@media (max-height: 420px) { #reglages.regl-boite { padding: 10px 14px 12px; gap: 8px; } #reglages .r-tete h2 { font-size: 22px; } #reglages .ligne-r { padding: 5px 8px; } #reglages .r-ic { width: 34px; height: 34px; } #reglages .r-txt small { display: none; } }

/* La grande carte : zoom en coin (porteur, 11 nov. 2026). */
.gc-carte { position: relative; height: 100%; aspect-ratio: 1; max-width: 62vw; flex: none; }
.gc-carte #carte-g { width: 100%; height: 100%; max-width: none; touch-action: none; }
.gc-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.gc-zoom button { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; background: rgba(14, 22, 30, .78); border: 1px solid rgba(255, 255, 255, .3); border-radius: 3px; }
.gc-zoom button:active { background: rgba(255, 223, 115, .5); }

/* Conduire au doigt (porteur, 11 nov. 2026 : « pas de joystick pour la conduite ») : deux flèches à gauche, ou rien quand on
   penche le téléphone ; à droite, avancer et freiner. */
.tactile.en-voiture #joy { display: none !important; }
#b-gauche, #b-droite { display: none; }
.tactile.en-voiture:not(.volant-pencher) #b-gauche, .tactile.en-voiture:not(.volant-pencher) #b-droite { display: grid; place-items: center; position: absolute; bottom: 16px; width: 92px; height: 92px; border-radius: 50%; background: rgba(255, 255, 255, .12); border: 2px solid rgba(255, 255, 255, .4); touch-action: none; }
.tactile.en-voiture #b-gauche { left: max(16px, env(safe-area-inset-left)); }
.tactile.en-voiture #b-droite { left: calc(max(16px, env(safe-area-inset-left)) + 104px); }
#b-gauche.app, #b-droite.app { background: rgba(255, 255, 255, .32); }
body:not(.tactile) .tactile-seul { display: none !important; }

/* L'atelier : le relieur, à gauche de l'outil zone ; les socles dans la palette. */
#b-carte { position: absolute; top: 8px; right: 372px; width: 48px; height: 48px; display: grid; place-items: center; }
#b-carte[hidden] { display: none; }
#b-carte svg { filter: drop-shadow(0 1px 1px #0009); }
#b-relieur { position: absolute; top: 8px; right: 320px; width: 48px; height: 48px; display: grid; place-items: center; }
#b-relieur[hidden] { display: none; }
#b-relieur svg { filter: drop-shadow(0 1px 1px #0009); }
#b-relieur.on { background: rgba(255, 223, 115, .35); border-radius: 50%; }
#pal-blocs .socle-choix { position: relative; }
#pal-blocs .socle-choix span { position: absolute; left: 2px; right: 2px; bottom: 2px; font-size: 10px; line-height: 14px; text-align: center; background: rgba(14, 22, 30, .72); border-radius: 2px; pointer-events: none; }
#pal-blocs .socle-choix canvas, #pal-blocs .socle-choix img { width: 100%; height: 100%; object-fit: contain; }

/* Le livre des quêtes (porteur, 13 nov. 2026) : en haut à droite, un badge quand une quête attend. */
#b-livre { position: absolute; right: 112px; top: 8px; width: 48px; height: 48px; display: grid; place-items: center; }
#b-livre[hidden] { display: none; }
#b-livre svg { filter: drop-shadow(0 1px 1px #0009); }
#b-livre i { position: absolute; right: 7px; top: 7px; width: 13px; height: 13px; border-radius: 50%; background: #e8483b; border: 2px solid #fff; display: none; }
#b-livre.neuf i { display: block; }
#b-livre.neuf svg { animation: livre-neuf 1.2s ease-in-out infinite; }
@keyframes livre-neuf { 50% { transform: scale(1.14) rotate(-6deg); } }
#livre .livre { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: hidden;
  background: #f4ead2; color: #3b2a17; border-radius: 7px; padding: 18px 20px 16px; box-shadow: 0 8px 30px #0008; border: 3px solid #8a6a3a; display: flex; flex-direction: column; gap: 8px; }
#livre h2 { margin: 0; font-size: 22px; letter-spacing: 2px; text-align: center; color: #6b4b22; }
#livre h3 { margin: 6px 0 0; font-size: 14px; color: #8a6a3a; }
.livre-quete { background: #fffaf0; border: 2px solid #d9c49a; border-radius: 5px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.livre-quete b { font-size: 17px; grid-column: 1; }
.livre-quete p { margin: 0; font-size: 14px; grid-column: 1; }
.livre-prix { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 4px; font-weight: 700; color: #8a5a10; }
.livre-prix img { width: 26px; height: 26px; }
.livre-prix i { font-style: normal; font-size: 16px; }
.livre-vide { margin: 4px 0; text-align: center; }
#livre-faites { margin: 0; padding: 0 0 0 4px; list-style: none; font-size: 13px; color: #7a6a52; max-height: 110px; overflow: hidden; columns: 2; }
#livre-faites li::before { content: '✓ '; color: #4f8f3a; font-weight: 700; }
#livre-fermer { align-self: center; margin-top: 4px; padding: 9px 26px; border-radius: 5px; background: #6b4b22; color: #fff; font-size: 15px; }

/* Le parking de la palette : une place par engin, la place libre en pointillés. */
.parking-place { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.parking-place.libre { border: 2px dashed #ffffff55 !important; background: transparent !important; min-height: 120px; justify-content: center; opacity: .8; }
.parking-place span { font-size: 12px; }

/* Les grandes boutiques (beaucoup de choix) : des cartes serrées, 6 colonnes et plus, le prix est le bouton ; jamais d'écran
   qui défile, même sur un téléphone de 360 de haut. */
.bv.serre { width: min(920px, 100%); overflow: hidden; padding: 8px 10px; gap: 6px; }
.bv.serre #bv-objets { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 3px; }
.bv.serre .bv-objet { flex-direction: column; gap: 1px; padding: 2px 3px; text-align: center; }
.bv.serre .bv-ic { width: 30px; height: 30px; }
.bv.serre .bv-texte { gap: 0; }
.bv.serre .bv-texte b { font-size: 10px; line-height: 1.1; }
.bv.serre .bv-texte span { display: none; }
.bv.serre .bv-objet button { min-height: 22px; padding: 0 6px; font-size: 11px; width: 100%; }
@media (min-height: 520px) { .bv.serre .bv-ic { width: 40px; height: 40px; } .bv.serre .bv-texte b { font-size: 12px; } .bv.serre .bv-objet button { min-height: 30px; } }

/* Les équipements en engin : le nitro (et sa recharge), creuser (pelle ou foreuse). */
#b-nitro, #b-creuser { position: absolute; right: 172px; width: 58px; height: 58px; border-radius: 50%; background: rgba(14, 22, 30, .55); display: grid; place-items: center; }
#b-nitro { bottom: 150px; } #b-creuser { bottom: 82px; }
#b-nitro[hidden], #b-creuser[hidden] { display: none; }
#b-nitro i { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(255,255,255,.45) var(--recharge, 0%), transparent 0); pointer-events: none; }
#b-nitro.pret { background: rgba(58, 103, 184, .75); }

#relais-liste { display: flex; flex-direction: column; gap: 6px; }
#relais-liste button { padding: 10px 14px; border-radius: 5px; background: #fffaf0; border: 2px solid #d9c49a; color: #3b2a17; font-size: 15px; text-align: left; }
#relais-liste button:disabled { opacity: .5; }
#relais-fermer { align-self: center; padding: 9px 26px; border-radius: 5px; background: #6b4b22; color: #fff; font-size: 15px; }
/* Tutoriel : ce qui n'est pas demandé est grisé et ne répond pas (porteur, 14 nov. 2026 : « tout est interdit sauf l'action »). */
.tuto-bloque { opacity: .28 !important; pointer-events: none !important; }
/* Les onglets de la palette tiennent sur l'écran d'un téléphone couché (porteur, 14 nov. 2026 : « il faut scroller »). */
@media (max-height: 460px) { .pal-cats { gap: 3px; } .pal-cats button { min-height: 36px; padding: 0 5px; } .pal-cats button canvas { width: 22px; height: 22px; } }
/* En engin : plus de flèche « annuler » (le frein fait la marche arrière) ; monter et descendre à gauche, au-dessus des flèches
   (porteur, 14 nov. 2026 : « pour accélérer et monter en même temps »). */
body.en-voiture #b-annuler, body.en-voiture #b-zone { display: none !important; }
.tactile.en-voiture.vole #saut, .tactile.en-voiture.vole #b-bas { width: 76px !important; height: 76px !important; bottom: 122px !important; right: auto !important; }
.tactile.en-voiture.vole #b-bas { left: calc(max(16px, env(safe-area-inset-left)) + 8px) !important; }
.tactile.en-voiture.vole #saut { left: calc(max(16px, env(safe-area-inset-left)) + 112px) !important; }
body.en-voiture #b-passer { left: auto; right: max(14px, env(safe-area-inset-right)); top: 120px; }

/* Le repère qu'on se pose soi-même : une épingle bleue (la flèche jaune reste celle des quêtes). */
#repere.balise span { background: #6fb6ff; clip-path: polygon(50% 100%, 22% 52%, 18% 30%, 30% 10%, 50% 2%, 70% 10%, 82% 30%, 78% 52%); }
#repere b { width: 150px; left: -75px; font-size: 13px; }

/* Les matières comptées : combien dans le sac, et la fabrication (porteur, 15 nov. 2026). */
#palette button .compte { position: absolute; right: 3px; bottom: 2px; font-style: normal; font-size: 11px; color: #fff; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; pointer-events: none; }
#pal-blocs button { position: relative; }
#palette button.vide canvas { opacity: .35; }
.recette { display: grid; grid-template-columns: minmax(130px, 1.1fr) auto minmax(150px, 1.4fr) auto; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 6px; background: rgba(255, 255, 255, .05); border-radius: 3px; width: 100%; box-sizing: border-box; }
.recette.rang-1 { box-shadow: inset 3px 0 0 #9fd3ff; } .recette.rang-2 { box-shadow: inset 3px 0 0 #ffdf73; } .recette.rang-3 { box-shadow: inset 3px 0 0 #ff9a5c; }
.rc-sortie { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rc-sortie canvas { width: 40px; height: 40px; flex: none; }
.rc-sortie em { font-style: normal; display: flex; flex-direction: column; min-width: 0; }
.rc-sortie b { font-weight: 400; font-size: 13px; color: #fff; }
.rc-sortie small { font-size: 10px; color: #ffdf73; }
.rc-choix { display: flex; align-items: center; gap: 4px; }
#palette .rc-choix button { min-width: 34px; min-height: 34px; padding: 0 6px; background: rgba(255, 255, 255, .14); color: #fff; border-radius: 3px; font-size: 15px; }
.rc-choix i { font-style: normal; min-width: 30px; text-align: center; font-size: 15px; color: #fff; }
.rc-besoin { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rc-m { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.rc-m canvas { width: 26px; height: 26px; flex: none; }
.rc-m i { font-style: normal; }
.rc-m.ok i { color: #8fe07a; } .rc-m.non i { color: #ff9b8a; }
#palette .rc-fab { min-height: 38px; padding: 0 12px; font-size: 13px; background: #2ec27e; color: #fff; border-radius: 3px; }
#palette .rc-fab:disabled { background: #44525c; color: #aab6be; }
@media (max-width: 760px) { .recette { grid-template-columns: 1fr auto; } .rc-besoin { grid-column: 1; } .rc-fab { grid-column: 2; } }

/* Le parking : un bouton à part, hors de l'inventaire (porteur, 16 nov. 2026 : « un nouveau bouton, une icône d'engin »). */
#b-parking { position: absolute; left: 12px; top: 146px; width: 48px; height: 48px; display: grid; place-items: center; background: rgba(14, 22, 30, .55); border-radius: 3px; }
#b-parking[hidden], body.en-voiture #b-parking, body.en-palette #b-parking { display: none; }
#b-parking svg { filter: drop-shadow(0 1px 1px #0009); }
#parking-p { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; background: rgba(8, 12, 16, .6); }
#parking-p[hidden] { display: none; }
.parking-p { width: min(640px, 94vw); padding: 12px 16px 16px; background: #1c2a34; border-radius: 4px; box-shadow: 0 12px 34px rgba(0, 0, 0, .5); }
.pk-haut { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pk-haut b { font-family: Future, system-ui, sans-serif; font-size: 22px; color: #fff4dc; text-transform: uppercase; }
.pk-haut span { flex: 1; font-size: 13px; color: #9fb3c0; }
#pk-fermer { min-height: 40px; padding: 0 16px; background: rgba(255, 255, 255, .12); color: #fff; border-radius: 3px; }
#pk-liste { display: flex; gap: 10px; flex-wrap: wrap; }
#pk-liste .parking-place { width: 150px; min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(255, 255, 255, .06); border-radius: 3px; color: #fff; font-size: 13px; }
#pk-liste .parking-place.libre { opacity: .5; }
#pk-liste .parking-place canvas { width: 96px; height: 96px; }
/* « Passer le tutoriel » en haut à droite, loin du joystick (porteur, 16 nov. 2026). */
#b-passer { left: auto !important; right: max(12px, env(safe-area-inset-right)); top: 64px !important; }
body.en-voiture #b-passer { top: 120px !important; }
body.creation #consigne { max-width: calc(100vw - 460px); }

/* La quête accomplie passe par-dessus les boutiques et les fiches (porteur, 16 nov. 2026) ; puis la nouvelle quête. */
#quete-finie, #quete-pas { z-index: 95; }
#quete-neuve { position: fixed; z-index: 95; left: 50%; top: 22%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: min(560px, 90vw); padding: 12px 30px 14px; background: linear-gradient(#1f3240f2, #16232df2); border: 2px solid #ffdf73; border-radius: 4px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); pointer-events: none !important; text-align: center; }
#quete-neuve[hidden] { display: none; }
#quete-neuve small { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #ffdf73; }
#quete-neuve b { font-family: Future, system-ui, sans-serif; font-size: 28px; line-height: 1.05; text-transform: uppercase; color: #fff4dc; }
#quete-neuve span { font-size: 15px; line-height: 1.3; color: #d8e4ec; }
#quete-neuve.vient { animation: quete-vient 4.6s ease-out forwards; }
#consigne.change { animation: consigne-change .5s ease-in-out 6 alternate; }
@keyframes consigne-change { from { box-shadow: 0 0 0 0 rgba(255, 223, 115, 0); background: rgba(14, 22, 30, .68); } to { box-shadow: 0 0 0 3px #ffdf73; background: rgba(90, 72, 20, .85); } }

/* Le livre en deux onglets (porteur, 16 nov. 2026 : chapitres et quêtes à côté) : tout tient sans défilement sur le S9. */
#livre .livre { width: min(640px, calc(100vw - 24px)); padding: 10px 14px 12px; gap: 6px; }
.livre-haut { display: flex; align-items: center; gap: 12px; }
.livre-haut h2 { font-size: 19px !important; }
#livre-onglets { flex: 1; display: flex; gap: 6px; }
#livre-onglets button { padding: 6px 12px; border-radius: 4px; background: #e6d6b2; color: #6b4b22; font-size: 14px; font-weight: 700; }
#livre-onglets button.on { background: #6b4b22; color: #fff; }
#livre-fermer { margin-top: 0 !important; padding: 7px 18px !important; }
#livre h3 { margin: 2px 0 0 !important; font-size: 13px !important; }
.livre-quete { padding: 7px 10px; grid-template-columns: 1fr auto auto; }
.livre-quete .livre-suivre { grid-column: 3; grid-row: 1 / span 2; padding: 6px 12px; border-radius: 4px; background: #6b4b22; color: #fff; font-size: 13px; font-weight: 700; }
.livre-quete .livre-suivre:disabled { background: #4f8f3a; opacity: 1; }
.livre-quete.suivie { border-color: #4f8f3a; box-shadow: 0 0 0 2px #4f8f3a55; }
.livre-quete.cote { padding: 5px 10px; }
.livre-quete.cote b { font-size: 14px; }
.livre-quete.cote p { font-size: 13px; }
#livre-chapitres { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
#livre-chapitres li { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 4px; background: #fffaf0; border: 2px solid #d9c49a; font-size: 14px; }
#livre-chapitres li.fini { border-color: #4f8f3a; }
#livre-chapitres li.fini b::after { content: ' ✓'; color: #4f8f3a; }
#livre-chapitres li.encours { border-color: #c8901e; background: #fff3d4; }
#livre-chapitres li.ferme { opacity: .55; }

/* ---------- La disposition de l'écran (porteur, 16 nov. 2026 : « les encadrés se superposent, ça s'encombre… réfléchir à une
   disposition beaucoup plus ergonomique » ; maquette acceptée : « vas-y, fais »). Quatre coins, chacun son rôle :
   en haut à gauche l'état (pièces · heure · en ligne, puis vigueur, parking) ; en haut la quête, les messages dessous ;
   en haut à droite carte · livre · pause ; dessous, à droite, le petit bloc des outils de construction. */
#etat { position: absolute; left: max(12px, env(safe-area-inset-left)); top: 8px; display: flex; align-items: center; gap: 6px; pointer-events: none; }
#etat > * { position: static !important; margin: 0 !important; }
#etat #bourse, #etat #heure, #etat #en-ligne { height: 30px; box-sizing: border-box; display: flex; align-items: center; padding: 0 9px; background: rgba(14, 22, 30, .6); border-radius: 3px; }
#etat #bourse[hidden], #etat #heure[hidden], #etat #en-ligne[hidden] { display: none; }
#etat #bourse { padding-left: 4px; }
#vigueur { top: 46px !important; }
#b-parking { top: 60px !important; }
#b-signaler { top: 116px !important; }
body.creation #consigne { left: 250px !important; right: auto; transform: none !important; top: 8px; max-width: calc(100vw - 250px - 176px) !important; min-height: 30px; box-sizing: border-box; padding: 6px 12px; }
#toast { top: 64px; }
/* En haut à droite : carte, livre, pause. */
body.creation #b-pause { right: 8px; top: 4px; }
body.creation #b-livre { right: 60px; top: 4px; }
body.creation #b-carte { right: 112px; top: 4px; }
/* Dessous : la palette, puis zone, annuler, vue (et le relieur près d'un socle). */
body.creation #b-carnet { right: 8px; top: 56px; }
body.creation #b-zone { right: 60px; top: 56px; }
body.creation #b-annuler { right: 112px; top: 56px; }
body.creation #b-vue { right: 164px; top: 56px; }
body.creation #b-relieur { right: 216px; top: 56px; }
body.creation #b-appeler { right: 216px; top: 56px; }
/* En engin : « Descendre » prend la place du bloc d'outils ; la palette remonte dans la rangée du haut. */
body.creation.en-voiture #b-carnet { right: 164px; top: 4px; }
/* Le bandeau d'un succès passe sous la ligne de la quête, pas dessus. */
body.creation #succes-bandeau { top: 64px; transform: translate(-50%, calc(-100% - 90px)); }
body.creation #succes-bandeau.vu { transform: translate(-50%, 0); }
body.creation.en-voiture #consigne { max-width: calc(100vw - 250px - 228px) !important; }
.gc-leg .l-ruine { background: #d9c49a; border: 2px solid #3b2a17; box-sizing: border-box; }

/* Le bouton Esquive (porteur, 18 nov. 2026 : « l'esquive, on n'y comprend rien, impossible à faire ») : à gauche du saut,
   seulement là où des automates rôdent ; il s'allume en orange quand l'un d'eux charge son coup. */
#b-esquive { position: absolute; right: calc(max(14px, env(safe-area-inset-right)) + 150px); bottom: 150px; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(14, 22, 30, .45); border: 2px solid rgba(255, 255, 255, .45); }
#b-esquive[hidden], body.en-voiture #b-esquive { display: none; }
#b-esquive.alerte { background: #ff8a1e; border-color: #ffe0b0; animation: esquive-alerte .35s ease-in-out infinite alternate; }
@keyframes esquive-alerte { from { transform: scale(1); } to { transform: scale(1.14); } }

#b-coup .ic-tenu { width: 62%; height: 62%; filter: drop-shadow(0 1px 2px #0009); pointer-events: none; }

/* Les raccourcis du porteur pour essayer (adresse avec ?dev seulement) : jamais montrés à un joueur. */
#p-dev { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding-top: 6px; border-top: 1px dashed rgba(255, 255, 255, .3); }
#p-dev[hidden] { display: none; }
#p-dev select { max-width: 100%; min-height: 38px; font-size: 14px; border-radius: 4px; }
#p-dev .bouton { min-height: 38px; font-size: 14px; }

/* L'écran de gain grandit sur place (il partait de la gauche : l'animation des bandeaux le décalait de moitié). */
@keyframes gain-vient { from { opacity: 0; transform: scale(.85); } 60% { opacity: 1; transform: scale(1.04); } to { transform: scale(1); } }

/* ---------- L'interface rangée (porteur, 18 nov. 2026 : « regarde Minecraft, c'est grave minimaliste ») : des boutons carrés
   sombres, bord clair, icônes en pixel art ; en haut, la quête, Menu et Pause ; le reste dans le menu dépliant. */
#b-pause, #b-menu, #b-carnet, #tiroir-boutons button { background: rgba(10, 14, 20, .5) !important; border: 2px solid rgba(255, 255, 255, .28) !important; border-radius: 3px !important; box-sizing: border-box; }
#b-pause, #b-menu { position: absolute; top: 6px !important; width: 46px !important; height: 46px !important; display: grid !important; place-items: center; padding: 0; }
#b-pause { right: max(8px, env(safe-area-inset-right)) !important; }
#b-menu { right: calc(max(8px, env(safe-area-inset-right)) + 52px); }
#b-pause svg, #b-menu svg { width: 28px; height: 28px; }
#b-menu.on { background: rgba(255, 223, 115, .3) !important; border-color: #ffdf73 !important; }
#b-menu i { display: none; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; background: #ff5a3c; border: 2px solid #fff; border-radius: 50%; }
#b-menu.neuf i { display: block; }
body.en-palette #b-menu, body.en-palette #tiroir { display: none; }
/* Le menu déplié : l'état (pièces · heure · en ligne), puis les boutons en grille, avec leur nom. */
#tiroir { position: absolute; top: 58px; right: max(8px, env(safe-area-inset-right)); z-index: 25; padding: 8px; background: rgba(10, 14, 20, .78); border: 2px solid rgba(255, 255, 255, .22); border-radius: 4px; display: flex; flex-direction: column; gap: 8px; }
#tiroir[hidden] { display: none; }
#tiroir-etat #etat { position: static !important; display: flex; gap: 6px; flex-wrap: wrap; }
#tiroir-boutons { display: grid; grid-template-columns: repeat(3, 72px); gap: 6px; }
#tiroir-boutons button { position: relative !important; inset: auto !important; left: auto !important; right: auto !important; top: auto !important; width: 72px !important; height: 66px !important; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 3px; opacity: 1 !important; transform: none !important; }
#tiroir-boutons button[hidden] { display: none !important; }
#tiroir-boutons button svg { width: 30px; height: 30px; filter: none; }
#tiroir-boutons button span { font-size: 11px; color: #e8eef3; letter-spacing: .04em; }
#tiroir-boutons button.on { border-color: #ffdf73 !important; background: rgba(255, 223, 115, .22) !important; }
#tiroir-boutons #b-livre i { position: absolute; top: 4px; right: 6px; }
/* La quête : en haut à gauche, sur toute la largeur jusqu'au Menu. */
body.creation #consigne { left: max(12px, env(safe-area-inset-left)) !important; top: 6px !important; max-width: calc(100vw - 150px) !important; min-height: 46px; display: flex; align-items: center; }
body.creation.en-voiture #consigne { max-width: calc(100vw - 150px) !important; }
/* Le sac : collé au bout de la barre des blocs (placé par la page). */
#b-carnet { position: fixed !important; top: auto !important; right: auto !important; display: grid !important; place-items: center; padding: 0; }
#b-carnet svg { width: 70%; height: 70%; }
body.en-voiture #b-carnet { display: none !important; }
/* La vigueur : au-dessus de la barre, comme une barre de vie (seulement sur les îles dangereuses). */
#vigueur { top: auto !important; left: 50% !important; bottom: 64px; transform: translateX(-50%); width: 180px !important; }
body.en-voiture #vigueur { display: none; }
/* Ce qui ne sert qu'à certains moments, à droite au-dessus des boutons d'action. */
body.creation #b-relieur { top: auto !important; right: calc(max(14px, env(safe-area-inset-right)) + 150px) !important; bottom: 228px; background: rgba(10, 14, 20, .5); border: 2px solid rgba(255, 255, 255, .28); border-radius: 3px; }
#b-signaler { top: 58px !important; }

#pal-bourse { display: flex; align-items: center; gap: 5px; margin-left: auto; margin-right: 10px; font-weight: 700; color: #ffdf73; font-size: 15px; }
#pal-bourse[hidden] { display: none; }
#pal-bourse img { width: 22px; height: 22px; }
#pal-bourse i { font-style: normal; }

/* L'esquive au même dessin que Sauter (porteur, 18 nov. 2026 : « j'aime pas le bouton d'esquive… même design que les
   autres ») : rond, blanc discret ; pendant une charge, seulement un cercle orange qui bat. */
#b-esquive { right: calc(max(20px, env(safe-area-inset-right)) + 80px) !important; bottom: 110px !important; width: 66px !important; height: 66px !important; border-radius: 50% !important; background: rgba(255, 255, 255, .1) !important; border: 2px solid rgba(255, 255, 255, .34) !important; animation: none; }
#b-esquive.alerte { background: rgba(255, 150, 40, .28) !important; border-color: #ffb050 !important; box-shadow: 0 0 0 3px rgba(255, 150, 40, .45); animation: esquive-bat .4s ease-in-out infinite alternate; }
@keyframes esquive-bat { from { box-shadow: 0 0 0 2px rgba(255, 150, 40, .3); } to { box-shadow: 0 0 0 7px rgba(255, 150, 40, .6); } }
#b-esquive.app { background: rgba(255, 255, 255, .32) !important; }
/* La vigueur : en haut à gauche, sous la quête (elle était collée à la barre des blocs). */
#vigueur { top: 60px !important; bottom: auto !important; left: max(14px, env(safe-area-inset-left)) !important; transform: none !important; width: 140px !important; }
/* Les raccourcis de développement, avec leur titre. */
#p-dev::before { content: 'Essais : aller à une quête'; width: 100%; text-align: center; font-size: 13px; color: #ffdf73; }

/* Le studio des boutons : une barre en haut, chaque bouton cerclé de pointillés ; celui qu'on tient, en jaune. */
#studio { position: fixed; inset: 0 0 auto 0; z-index: 90; display: flex; justify-content: center; pointer-events: none; }
#studio[hidden] { display: none; }
.studio-barre { pointer-events: auto; margin-top: 6px; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: rgba(10, 14, 20, .9); border: 2px solid #ffdf73; border-radius: 4px; }
.studio-barre span { font-size: 14px; color: #fff4dc; padding: 0 6px; min-width: 150px; }
.studio-barre button { min-width: 40px; min-height: 38px; padding: 0 10px; background: rgba(255, 255, 255, .14); color: #fff; border-radius: 3px; font-size: 15px; }
.studio-barre #st-ok { background: #ffdf73; color: #2a1f05; font-weight: 700; }
body.studio #joy, body.studio #saut, body.studio #b-coup, body.studio #b-poser, body.studio #barre, body.studio #b-carnet, body.studio #b-menu, body.studio #b-pause, body.studio #consigne, body.studio #vigueur { outline: 2px dashed rgba(255, 223, 115, .8); outline-offset: 3px; cursor: grab; opacity: 1 !important; }
body.studio .studio-sel { outline: 3px solid #ffdf73 !important; }
body.studio #consigne { min-width: 120px; }

/* ---------- L'atelier d'essai (?dev seulement) : un volet à droite, des sections de boutons. */
#b-dev { position: absolute; top: 6px; right: calc(max(8px, env(safe-area-inset-right)) + 112px); height: 46px; padding: 0 10px; background: rgba(160, 40, 40, .7); border: 2px solid #ffb3a0; border-radius: 3px; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .08em; }
#b-dev[hidden] { display: none; }
#atelier { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 96vw); z-index: 92; display: flex; flex-direction: column; background: rgba(12, 16, 22, .95); border-left: 3px solid #ffb3a0; color: #fff; }
#atelier[hidden] { display: none; }
.at-haut { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid rgba(255, 255, 255, .15); }
.at-haut b { font-size: 17px; color: #ffb3a0; }
.at-haut span { flex: 1; font-size: 11px; color: #b9c6d0; line-height: 1.3; }
.at-haut button { min-height: 36px; padding: 0 12px; background: #ffdf73; color: #2a1f05; border-radius: 3px; font-weight: 700; }
#at-corps { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
#at-corps h3 { margin: 10px 0 4px; font-size: 13px; color: #ffdf73; letter-spacing: .06em; text-transform: uppercase; }
.at-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.at-grille button { min-height: 38px; padding: 4px 6px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); border-radius: 3px; color: #fff; font-size: 13px; text-align: center; }
.at-grille button.on { background: rgba(120, 220, 140, .3); border-color: #8fe0a0; }
.at-grille .at-large { grid-column: 1 / -1; }
.at-grille select { min-height: 38px; font-size: 13px; border-radius: 3px; }
.at-grille p { grid-column: 1 / -1; margin: 2px 0; font-size: 12px; color: #b9c6d0; }

/* Relieur en main : son bouton d'action relie ; le bouton Poser s'efface (porteur, 22 nov. 2026). */
body.relieur-tenu:not(.studio) #b-poser { display: none !important; }
#b-coup svg { width: 40px; height: 40px; pointer-events: none; }
/* Démarrer / Monter et Modifier : deux petits boutons posés au-dessus de l'engin (porteur, 22 nov. 2026). */
#eb { position: absolute; left: 0; top: 0; display: flex; gap: 10px; transform: translate(-50%, -100%); pointer-events: none; z-index: 6; }
#eb[hidden], #eb button[hidden] { display: none; }
#eb button { pointer-events: auto; width: 54px; height: 54px; border-radius: 50%; padding: 0; display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .85); background: rgba(20, 28, 36, .82); box-shadow: 0 3px 10px #0006; }
#eb button svg { width: 26px; height: 26px; }
#eb-go { background: #2fbf71 !important; }
#eb-go.gris { background: rgba(58, 64, 70, .85) !important; border-color: rgba(255, 255, 255, .35); }
#eb-go.gris svg { opacity: .4; }
#eb button:active { transform: scale(.94); }
body.en-voiture #eb { display: none; }
/* La boutique : l'objet que la quête demande clignote ; ce qu'on vient d'acheter s'illumine, « +16 » monte. */
.bv-objet { position: relative; }
.bv-objet.quete { outline: 3px solid #ffdf73; outline-offset: -3px; animation: bv-quete 1.1s ease-in-out infinite; }
@keyframes bv-quete { 50% { outline-color: rgba(255, 223, 115, .25); } }
.bv-objet.vient { animation: bv-achat .8s ease-out; }
@keyframes bv-achat { 0% { background: rgba(47, 191, 113, .6); transform: scale(1.03); } 100% { background: rgba(255, 255, 255, .06); transform: none; } }
.bv-plus { position: absolute; right: 14px; top: 2px; font-style: normal; font-weight: 800; font-size: 18px; color: #6cf0a4; text-shadow: 0 2px 3px #000a; pointer-events: none; animation: bv-monte 1.3s ease-out forwards; }
@keyframes bv-monte { 0% { opacity: 0; transform: translateY(10px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px); } }
#bv-bourse.baisse { animation: bv-bourse .7s ease-out; display: inline-block; }
@keyframes bv-bourse { 30% { color: #ff9b7d; transform: scale(1.18); } }

/* ---------- Sonde du 22 nov. 2026 : l'interface à l'épreuve des distraits (S9 740 × 360 et PC). */
/* Une seule pile, en haut au centre, par-dessus toutes les fenêtres : succès, quête accomplie, nouvelle quête, étape, message. */
#pile { position: fixed; z-index: 96; left: 50%; top: 58px; transform: translateX(-50%); width: max-content; max-width: 94vw; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
#pile #succes-bandeau, #pile #quete-finie, #pile #quete-neuve, #pile #quete-pas, #pile #toast { position: relative; left: auto; top: auto; transform: none; max-width: 94vw; pointer-events: none; }
#pile #succes-bandeau { display: none; transition: none; }
#pile #succes-bandeau.vu { display: flex; animation: pile-tombe .35s cubic-bezier(.2, .9, .3, 1.2); }
#pile #quete-finie.vient, #pile #quete-neuve.vient, #pile #quete-pas.vient { animation-name: pile-vient; }
@keyframes pile-vient { 0% { opacity: 0; transform: scale(.7); } 8% { opacity: 1; transform: scale(1.06); } 14% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes pile-tombe { from { opacity: 0; transform: translateY(-18px); } }
/* Les boutiques serrées : l'icône à gauche, le nom puis le prix-bouton (36 px au moins) à droite ; le sac compte les lots.
   Elles tiennent sur un écran de 360 de haut ; au pire, la liste défile au lieu d'être coupée. */
#boutique-ville { padding: 8px; }
.bv { touch-action: pan-y; }
.bv.serre { overflow-y: auto; }
.bv.serre #bv-fermer { min-height: 36px; }
.bv.serre .bv-objet { display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto 36px; column-gap: 5px; row-gap: 2px; align-items: center; padding: 3px; text-align: left; }
.bv.serre .bv-ic { grid-column: 1; grid-row: 1 / span 2; }
.bv.serre .bv-texte { grid-column: 2; grid-row: 1; min-width: 0; }
.bv.serre .bv-texte b { display: block; font-size: 11px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-sac { font-size: 10px; line-height: 1.1; color: #ffe36b; }
.bv.serre .bv-objet button { grid-column: 2; grid-row: 2; width: 100%; min-height: 36px; height: 36px; padding: 0 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 13px; line-height: 1; }
@media (min-height: 520px) { .bv.serre .bv-objet { grid-template-columns: 40px minmax(0, 1fr); } .bv.serre .bv-texte b { font-size: 12px; } }
.bv-prix { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.bv-prix img { width: 14px; height: 14px; }
.bv-objet button small { font-size: 9px; white-space: nowrap; }
/* Pas assez de pièces : grisé, « manque 340 » ; touché, il le redit en entier. */
.bv-objet button.manque { background: rgba(255, 255, 255, .12); color: #ffffffa0; }
.bv-objet button.manque small { color: #ffb09f; }
/* Le livre : l'onglet Chapitres défile au lieu d'être coupé ; un point rouge sur l'onglet qui a du nouveau. */
#livre-cours { flex: 1 1 auto; min-height: 0; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }
#livre-onglets button { position: relative; }
#livre-onglets button.neuf::after { content: ''; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: #e8483b; border: 2px solid #fff; }
/* Le menu : Signaler y entre ; Annuler grisé quand il n'y a rien à défaire ; sur PC, la touche de chacun dans son coin. */
#tiroir-boutons #b-signaler { padding: 0; }
#tiroir-boutons button.gris { opacity: .4 !important; }
#tiroir-boutons kbd { position: absolute; top: 3px; left: 5px; font: 400 10px/1 'Future', system-ui, sans-serif; color: #ffffff80; }
/* Un mot sous chaque rond de l'engin (« Démarrer », « Monter », « Modifier »), comme dans les bulles. */
#eb button { position: relative; }
#eb button span { position: absolute; left: 50%; top: calc(100% + 3px); transform: translateX(-50%); font-size: 12px; line-height: 1; white-space: nowrap; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; pointer-events: none; }
#eb-go.gris span { color: #ffffffa8; }
body:not(.tactile) #eb { gap: 26px; }
/* Relieur en main : « Relier » écrit sous l'icône du bouton d'action. */
#b-coup .mot { position: absolute; left: 0; right: 0; bottom: 11px; text-align: center; font-size: 12px; line-height: 1; color: #ffdf73; text-shadow: 0 1px 2px #000; pointer-events: none; }
#b-coup.relier svg { transform: translateY(-7px); }
/* En engin : Creuser et le nitro montent, au-dessus du frein (Creuser le chevauchait). */
#b-nitro { bottom: 168px; } #b-creuser { bottom: 100px; }
#pk-liste .parking-place.libre { cursor: default; }
/* Le tutoriel qui attend depuis longtemps : ce qu'il faut toucher clignote plus vite et plus fort (plus de bulle qui revient). */
@keyframes clignote-fort { 0%, 100% { filter: brightness(1); background-color: rgba(255, 223, 115, .15); } 50% { filter: brightness(2.3) drop-shadow(0 0 12px rgba(255, 223, 115, 1)); background-color: rgba(255, 223, 115, .75); } }
body.relance .eclaire { animation: clignote-fort .45s ease-in-out infinite; }

/* ---------- Les personnages (porteur, 22 nov. 2026 : « un JOLI menu », personnaliser avant d'entrer, supprimer). */
#persos { position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: min(300px, 40vw); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 2; }
#persos[hidden] { display: none; }
#perso-nom { font: 400 clamp(22px, 6vmin, 34px)/1 'Blocks', sans-serif; color: var(--creme); text-shadow: 0 3px 0 rgba(0, 0, 0, .6); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perso-actions { display: flex; gap: 8px; }
.perso-actions button { min-height: 40px; padding: 0 14px; display: flex; align-items: center; gap: 7px; font-size: 14px; color: #fff; background: rgba(20, 30, 38, .78); border: 2px solid rgba(255, 255, 255, .25); border-radius: 3px; }
.perso-actions button svg { width: 18px; height: 18px; }
#perso-suppr { padding: 0 10px; color: #ffb4a6; }
#perso-liste { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
#perso-liste button { width: 64px; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; background: rgba(20, 30, 38, .78); border: 2px solid rgba(255, 255, 255, .22); border-radius: 3px; color: #fff; font-size: 11px; }
#perso-liste button.actif { border-color: #ffdf73; background: rgba(60, 52, 20, .8); }
#perso-liste button svg { width: 30px; height: 30px; }
#perso-liste button span { max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#perso-liste .nouveau { border-style: dashed; color: #ffdf73; font-size: 30px; line-height: 1; }
#perso-liste .nouveau span { font-size: 11px; color: #fff; }
#atelier-perso { position: fixed; inset: 0; z-index: 25; display: flex; align-items: center; padding: 12px max(18px, env(safe-area-inset-left)); background: linear-gradient(90deg, rgba(10, 20, 28, .82) 0%, rgba(10, 20, 28, .55) 42%, rgba(10, 20, 28, 0) 64%); }
#atelier-perso[hidden] { display: none; }
.ap-boite { width: min(370px, 52vw); display: flex; flex-direction: column; gap: clamp(8px, 2.4vh, 14px); }
.ap-titre { font: 400 clamp(24px, 7vmin, 38px)/1 'Blocks', sans-serif; color: var(--creme); text-shadow: 0 3px 0 rgba(0, 0, 0, .6); }
.ap-champ { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px; background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .25); border-radius: 3px; }
.ap-champ svg { width: 20px; height: 20px; color: #ffdf73; flex: none; }
.ap-champ input { flex: 1; min-width: 0; font-size: 18px; color: #fff; background: none; border: 0; outline: 0; }
.ap-champ input::placeholder { color: #fff8; }
.ap-ligne { display: flex; align-items: center; gap: 8px; }
.ap-ligne b { flex: 1; text-align: center; font: 400 clamp(18px, 5vmin, 26px)/1 'Blocks', sans-serif; color: #fff; }
.ap-fleche { width: 48px; height: 46px; font-size: 30px; line-height: 1; color: #fff; background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .25); border-radius: 3px; }
#ap-teintes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
#ap-teintes button { height: clamp(26px, 7vh, 34px); border-radius: 3px; border: 2px solid rgba(0, 0, 0, .35); }
#ap-teintes button.on { outline: 3px solid #ffdf73; outline-offset: 1px; }
.ap-boutons { display: flex; gap: 10px; }
.ap-boutons .bouton { min-width: 0; flex: 1; min-height: 50px; font-size: 18px; }
@media (orientation: portrait) {
  #persos { right: 50%; transform: translateX(50%); width: min(340px, 90vw); }
  #atelier-perso { align-items: flex-end; background: linear-gradient(0deg, rgba(10, 20, 28, .85) 0%, rgba(10, 20, 28, .6) 50%, rgba(10, 20, 28, 0) 70%); }
  .ap-boite { width: 100%; }
}

#titre.en-atelier .menu-gauche, #titre.en-atelier #persos { visibility: hidden; }
.ap-fleche { display: grid; place-items: center; padding: 0; } .ap-fleche svg { width: 22px; height: 22px; }

/* Menu déplié : la flèche de quête ne passe plus par-dessus ses cases (regard S9 du 22 nov. 2026). */
body.tiroir-ouvert #repere { visibility: hidden; }
/* Boutiques serrées : les noms sur deux lignes, jamais coupés au milieu (« Pioche do… »). */
.bv.serre #bv-objets { grid-template-columns: repeat(auto-fill, minmax(134px, 1fr)); }
.bv.serre .bv-texte b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 10.5px; line-height: 1.12; }
#perso-liste[hidden] { display: none; }

/* Le site (contrat, 22 nov. 2026) : en haut à droite du menu, le retour à usrati.games, « Installer le jeu », « Changer de
   joueur » ; le nom du personnage vient du profil Usrati (pas de champ « nom ») ; le bouton du QG des amis (en bas à
   droite, au menu et dans la pause) ne passe jamais sur les boutons du personnage. */
#liens-plateforme { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); z-index: 3; display: flex; align-items: center; gap: 8px; }
#liens-plateforme .lien-p { min-height: 30px; padding: 0 11px; font-size: 13px; color: #e7f1f6; background: rgba(12, 22, 30, .72); border: 1px solid rgba(255, 255, 255, .18); border-radius: 3px; }
#liens-plateforme .lien-p[hidden] { display: none; }
#liens-plateforme .lien-p:active { transform: translateY(1px); }
#titre.en-atelier #liens-plateforme { visibility: hidden; }
.ap-champ[hidden] { display: none; }
#p-changer[hidden] { display: none; }
body.avec-qg #persos { right: max(86px, calc(env(safe-area-inset-right) + 70px)); }
@media (orientation: portrait) { body.avec-qg #persos { right: 50%; bottom: max(84px, calc(env(safe-area-inset-bottom) + 70px)); } }
