* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }
body { font-family: 'Inter', sans-serif; font-weight: 800; color: #fff; user-select: none; }
#scene { position: fixed; inset: 0; }
#c3d { position: absolute; inset: 0; width: 100%; height: 100%; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ccircle cx='8' cy='8' r='4' fill='white' stroke='rgba(0,0,0,.45)' stroke-width='1.2'/%3E%3C/svg%3E") 8 8, crosshair; }   /* petit point blanc */
.cache { display: none !important; }
svg { display: block; }

/* Haut : titre, wins, altitude, record */
#haut { position: absolute; top: 14px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
#titre { font-family: 'Luckiest Guy', sans-serif; font-size: clamp(30px, 5vw, 56px); color: #fff3c4; -webkit-text-stroke: 3px #5a3a1a; paint-order: stroke fill; text-shadow: 0 5px 0 #5a3a1a, 0 0 18px rgba(255, 182, 39, .6); letter-spacing: 1px; }
#wins { font-family: 'Luckiest Guy', sans-serif; font-size: clamp(24px, 3.4vw, 40px); color: #6b3a00; background: linear-gradient(180deg, #ffd96b, #f0a623); border: 4px solid #8a5a12; border-radius: 16px; padding: 4px 24px 0; box-shadow: 0 5px 0 #6b4410; }
#wins.pop, #alt.pop { animation: pop .35s ease-out; }
@keyframes pop { 40% { transform: scale(1.12); } }
#alt { display: flex; align-items: center; gap: 22px; font-family: 'Luckiest Guy', sans-serif; font-size: clamp(36px, 5.5vw, 66px); color: #5a3a1a; background: linear-gradient(180deg, #fff6d8, #f5dfa0); border: 4px solid #c9a24a; border-radius: 18px; padding: 6px 30px 0; box-shadow: 0 6px 0 #a07a2a; min-width: 340px; justify-content: center; }
#alt .ico { font-size: .55em; } #alt .km { font-size: .5em; margin-left: -10px; }
#multi { font-family: 'Luckiest Guy', sans-serif; font-size: clamp(18px, 2.4vw, 26px); color: #fff; background: linear-gradient(180deg, #c77dff, #7b2cbf); border: 3px solid #4a1580; border-radius: 12px; padding: 3px 16px 0; box-shadow: 0 4px 0 #3a0f66; }

/* Boutons ronds (accueil, paramètres) */
.btn-rond { position: absolute; top: 16px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(14, 13, 12, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.22); box-shadow: 0 6px 18px rgba(0,0,0,.3); cursor: pointer; transition: transform .2s, background .2s; }
.btn-rond svg { width: 22px; height: 22px; }
.btn-rond:hover { transform: scale(1.07); background: rgba(14, 13, 12, .75); }
#btn-accueil { left: 16px; }
#btn-params { left: 74px; }

/* Annonces */
#annonce { position: absolute; left: 0; right: 0; top: 42%; text-align: center; pointer-events: none; font-family: 'Luckiest Guy', sans-serif; font-size: clamp(34px, 6vw, 72px); color: #fff; -webkit-text-stroke: 3px #3a2410; paint-order: stroke fill; text-shadow: 0 6px 0 rgba(0,0,0,.35); animation: annonce 2.4s ease-out both; }
#annonce small { display: block; font-size: .45em; color: #ffe08a; }
#annonce.vert { color: #7dff9e; } #annonce.rouge { color: #ff6b6b; } #annonce.or { color: #ffd23f; }
@keyframes annonce { 0% { transform: scale(.3); opacity: 0; } 12% { transform: scale(1.1); opacity: 1; } 20% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }

#aide { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: 92vw; background: rgba(14, 13, 12, .78); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: 12px 18px; font-size: 13px; font-weight: 700; line-height: 1.7; text-align: center; }

/* Paramètres */
#params { position: absolute; top: 76px; left: 16px; width: min(470px, calc(100vw - 32px)); max-height: calc(100vh - 100px); display: flex; flex-direction: column; z-index: 30; background: rgba(20, 19, 18, .94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.12); border-radius: 20px; font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; color: #ece8e1; box-shadow: 0 24px 60px rgba(0,0,0,.55); overflow: hidden; }
#params.cache { display: none !important; }
#params button { font-family: 'Inter', sans-serif; cursor: pointer; }
#params svg { width: 18px; height: 18px; }
#params .p-tete { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 10px; font-size: 19px; font-weight: 800; }
#params .p-tete button { display: grid; place-items: center; background: rgba(255,255,255,.07); border: 0; color: #ece8e1; width: 32px; height: 32px; border-radius: 50%; }
#params .p-tete button:hover { background: rgba(255,255,255,.14); }
#params .p-onglets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 14px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
#params .p-onglets button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 4px 8px; background: transparent; border: 0; border-radius: 12px; color: #9c968c; font-size: 12px; font-weight: 700; transition: background .15s, color .15s; }
#params .p-onglets button svg { width: 20px; height: 20px; }
#params .p-onglets button:hover { color: #ece8e1; background: rgba(255,255,255,.05); }
#params .p-onglets button.actif { background: rgba(233, 180, 76, .16); color: #f2c45f; }
#params .p-corps { flex: 1; overflow-y: auto; padding: 4px 18px 16px; }
#params section.cache { display: none !important; }
#params h4 { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 8px; font-size: 11px; font-weight: 800; color: #8d877d; text-transform: uppercase; letter-spacing: .12em; }
#params .p-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 6px 12px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.05); border-radius: 12px; margin-bottom: 6px; }
#params .p-ligne small { color: #8d877d; font-weight: 600; font-size: 11px; }
#params .p-liste .p-ligne { justify-content: flex-start; }
#params .p-droite { display: flex; gap: 8px; align-items: center; }
#params input[type=range] { width: 180px; accent-color: #e9b44c; }
#params select, #params input[type=number] { background: rgba(0,0,0,.35); color: #fff; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; padding: 7px 9px; font: 700 14px 'Inter', sans-serif; width: 120px; }
#params input.p-court { width: 70px; }
#params .p-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#params .p-case { display: flex; justify-content: space-between; align-items: center; gap: 6px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.05); border-radius: 12px; padding: 6px 6px 6px 11px; font-size: 13px; }
#params .btn-touche { min-width: 58px; padding: 7px 9px; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; font-weight: 800; font-size: 13px; }
#params .btn-touche.ecoute { border-color: #f2c45f; color: #f2c45f; }
#params .p-unite { color: #8d877d; font-weight: 700; }
#params .p-suppr { display: grid; place-items: center; margin-left: auto; background: none; border: 0; color: #7d776e; padding: 6px; border-radius: 8px; }
#params .p-suppr svg { width: 16px; height: 16px; }
#params .p-suppr:hover { color: #ff8a80; background: rgba(255,138,128,.1); }
#params .p-plus, #params .p-rond { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 0; background: #e9b44c; color: #1d1608; padding: 0; }
#params .p-plus svg { width: 15px; height: 15px; }
#params .p-rond { background: rgba(255,255,255,.1); color: #fff; }
#params .p-rond svg { width: 13px; height: 13px; }
#params .p-liste:empty::before { content: attr(data-vide); display: block; padding: 11px; border: 1px dashed rgba(255,255,255,.14); border-radius: 12px; color: #7d776e; font-size: 13px; text-align: center; }
#params .p-bas { display: flex; justify-content: space-between; align-items: center; padding: 11px 18px; border-top: 1px solid rgba(255,255,255,.08); }
#params .p-lien { background: none; border: 0; color: #7d776e; font-size: 12px; text-decoration: underline; }
#params #o-ok { color: #8ff0a8; font-size: 12px; }

#params input[type=checkbox] { width: 22px; height: 22px; accent-color: #e9b44c; cursor: pointer; }

/* Victoire (Lune atteinte) */
#victoire { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; pointer-events: none; font-family: 'Luckiest Guy', sans-serif; animation: victoire-entree .9s cubic-bezier(.2, 1.6, .4, 1) both; z-index: 5; }
#victoire .v-haut { font-size: clamp(24px, 4vw, 44px); color: #fff3c4; -webkit-text-stroke: 2px #5a3a1a; paint-order: stroke fill; text-shadow: 0 4px 0 #5a3a1a; }
#victoire .v-titre { font-size: clamp(64px, 13vw, 160px); line-height: 1.05; color: #ffd23f; -webkit-text-stroke: 4px #6b3a00; paint-order: stroke fill; text-shadow: 0 8px 0 #6b3a00, 0 0 40px rgba(255, 210, 63, .8), 0 0 90px rgba(255, 160, 40, .6); animation: victoire-pulse 1.1s ease-in-out .9s infinite; }
#victoire .v-gain { display: inline-block; margin-top: 10px; font-size: clamp(26px, 4.4vw, 48px); color: #6b3a00; background: linear-gradient(180deg, #ffd96b, #f0a623); border: 4px solid #8a5a12; border-radius: 16px; padding: 4px 26px 0; box-shadow: 0 5px 0 #6b4410; }
@keyframes victoire-entree { 0% { transform: scale(.2) rotate(-8deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes victoire-pulse { 50% { transform: scale(1.06); } }
#params select.p-large { width: 230px; max-width: 60%; }
/* Barre de défilement des paramètres, aux couleurs du panneau */
#params .p-corps { scrollbar-width: thin; scrollbar-color: rgba(233, 180, 76, .45) transparent; }
#params .p-corps::-webkit-scrollbar { width: 8px; }
#params .p-corps::-webkit-scrollbar-track { background: transparent; margin: 6px 0; }
#params .p-corps::-webkit-scrollbar-thumb { background: rgba(233, 180, 76, .35); border-radius: 8px; border: 2px solid rgba(20, 19, 18, .94); }
#params .p-corps::-webkit-scrollbar-thumb:hover { background: rgba(233, 180, 76, .65); }
#params #o-vol-clic { width: 120px; } #params #o-vol-clic-n { white-space: nowrap; min-width: 42px; text-align: right; }

/* Record */
#record { font-family: 'Luckiest Guy', sans-serif; font-size: clamp(15px, 2vw, 21px); color: #fff3c4; background: rgba(20, 14, 40, .72); border: 3px solid #ffd23f; border-radius: 12px; padding: 4px 16px 1px; box-shadow: 0 4px 0 #8a6a12; letter-spacing: .5px; }
#record b { color: #ffd23f; font-weight: normal; margin-left: 4px; }
#record span { color: #9fd8ff; margin-left: 10px; }
#record.pop { animation: pop .5s ease-out 2; }

/* Trajet Terre → Lune (à gauche) */
#trajet { position: absolute; left: 22px; top: 96px; bottom: 40px; width: 40px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
#trajet .t-lune, #trajet .t-terre { font-size: 28px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }
#trajet .t-rail { position: relative; flex: 1; width: 10px; border-radius: 6px; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.35); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
#trajet .t-plein { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; border-radius: 6px; background: linear-gradient(0deg, #3ddcff, #c77dff, #ffd23f); }
#trajet .t-record { position: absolute; left: -9px; right: -9px; height: 4px; bottom: 0%; background: #ffd23f; border-radius: 2px; box-shadow: 0 0 8px #ffd23f; }
#trajet .t-fusee { position: absolute; left: 50%; bottom: 0%; transform: translate(-50%, 50%) rotate(-45deg); font-size: 24px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }

/* Carburant (à droite) */
#carbu { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
#carbu .c-ico { font-size: 30px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }
#carbu .c-tube { position: relative; width: 34px; height: min(42vh, 300px); border-radius: 18px; background: rgba(15, 10, 30, .7); border: 4px solid #fff3c4; box-shadow: 0 5px 0 #8a6a12, inset 0 0 12px rgba(0,0,0,.6); overflow: hidden; }
#carbu .c-niveau { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(0deg, #ff7b1c, #ffd23f); box-shadow: 0 0 18px rgba(255, 180, 40, .8); transition: height .15s; }
#carbu .c-graduations { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 calc(10% - 2px), rgba(255,255,255,.25) calc(10% - 2px) 10%); }
#carbu .c-pct { font-family: 'Luckiest Guy', sans-serif; font-size: 22px; color: #fff3c4; -webkit-text-stroke: 2px #5a3a1a; paint-order: stroke fill; text-shadow: 0 3px 0 #5a3a1a; }
#carbu.bas .c-niveau { background: linear-gradient(0deg, #c0182c, #ff6b6b); animation: clignote .5s steps(1) infinite; }
#carbu.bas .c-pct { color: #ff6b6b; }
#carbu.pop .c-tube { animation: pop .25s ease-out; }
@keyframes clignote { 50% { opacity: .35; } }

/* États en cours (turbo, panne, bouclier) */
#etats { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; pointer-events: none; }
#etats .etat { font-family: 'Luckiest Guy', sans-serif; font-size: clamp(16px, 2.2vw, 24px); color: #fff; border-radius: 12px; padding: 4px 16px 1px; border: 3px solid rgba(0,0,0,.35); box-shadow: 0 4px 0 rgba(0,0,0,.35); }
#etats .turbo { background: linear-gradient(180deg, #5ee7ff, #1f8fd6); }
#etats .panne { background: linear-gradient(180deg, #ff6b6b, #b3261e); animation: clignote .6s steps(1) infinite; }
#etats .bouclier { background: linear-gradient(180deg, #7dff9e, #23a35a); }

/* Repère franchi (nuages, espace, station…) */
#repere { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); pointer-events: none; font-family: 'Luckiest Guy', sans-serif; font-size: clamp(20px, 3vw, 32px); color: #fff; background: rgba(10, 8, 30, .6); border: 2px solid rgba(255,255,255,.4); border-radius: 14px; padding: 6px 18px 2px; white-space: nowrap; animation: repere 2.8s ease-out both; }
@keyframes repere { 0% { opacity: 0; transform: translate(-50%, 12px); } 12% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* Petit « +1 % » qui monte là où on clique */
.bulle { position: absolute; pointer-events: none; font-family: 'Luckiest Guy', sans-serif; font-size: 20px; color: #ffd23f; -webkit-text-stroke: 2px #5a3a1a; paint-order: stroke fill; animation: bulle .8s ease-out forwards; z-index: 4; }
@keyframes bulle { to { transform: translateY(-50px); opacity: 0; } }

#victoire .v-temps { margin-top: 10px; font-size: clamp(18px, 2.6vw, 28px); color: #9fd8ff; -webkit-text-stroke: 2px #10234a; paint-order: stroke fill; }
#params .p-aide { margin: -2px 0 8px; font-size: 12px; color: #8d877d; font-weight: 600; line-height: 1.4; }
#params .p-btn { background: rgba(255,138,128,.12); color: #ff8a80; border: 1px solid rgba(255,138,128,.35); border-radius: 9px; padding: 7px 10px; font-weight: 800; font-size: 12px; }
#params .p-btn:hover { background: rgba(255,138,128,.22); }
@media (max-width: 640px) { #trajet { left: 8px; width: 30px; } #carbu { right: 8px; } #carbu .c-tube { width: 26px; } }

/* Styles de fusée (paramètres) */
#params .p-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
#params .p-style { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px; text-align: left; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); border-radius: 14px; color: #ece8e1; transition: border-color .15s, background .15s; }
#params .p-style .apercu { width: 100%; height: 70px; margin-bottom: 4px; border-radius: 10px; background: radial-gradient(circle at 50% 30%, #1b2a55, #050914); display: grid; place-items: center; }
#params .p-style .apercu svg { width: auto !important; height: 60px !important; }
#params .p-style b { font-size: 14px; font-weight: 800; }
#params .p-style small { font-size: 11px; font-weight: 600; color: #8d877d; line-height: 1.35; }
#params .p-style:hover { background: rgba(255,255,255,.07); }
#params .p-style.actif { border-color: #e9b44c; background: rgba(233, 180, 76, .12); }

/* ── Format téléphone (cadre vertical 9:16 au centre) ── */
body { background: #05060a; }
#scene { top: 0; bottom: 0; left: 0; right: 0; margin: 0 auto; width: min(100vw, calc(100vh * 9 / 16)); overflow: hidden; container-type: size; box-shadow: 0 0 80px rgba(0,0,0,.7); }
.btn-rond { position: fixed; z-index: 40; }             /* maison + réglages : restent en haut à gauche de la fenêtre */
#params { position: fixed; z-index: 45; }
/* Haut plus compact */
#haut { top: 1.4cqh; gap: .8cqh; }
#titre { font-size: 5cqh; -webkit-text-stroke-width: 2px; }
#wins { font-size: 3.3cqh; border-width: 3px; padding: .3cqh 2.2cqh 0; border-radius: 1.4cqh; box-shadow: 0 .5cqh 0 #6b4410; }
#multi { font-size: 2.4cqh; }
#alt { font-size: 4.4cqh; min-width: 0; gap: 1.2cqh; padding: .4cqh 2.4cqh 0; border-width: 3px; border-radius: 1.6cqh; box-shadow: 0 .5cqh 0 #a07a2a; }
#alt .km { margin-left: -.4cqh; }
/* Les 2 barres près de la fusée */
#trajet { left: 21%; top: 26%; bottom: 15%; width: 30px; }
#trajet .t-lune, #trajet .t-terre { font-size: 2.8cqh; }
#trajet .t-fusee { font-size: 2.4cqh; }
#carbu { right: 21%; }
#carbu .c-tube { width: 26px; height: 34cqh; border-width: 3px; }
#carbu .c-ico { font-size: 2.8cqh; }
#carbu .c-pct { font-size: 2.2cqh; }
/* Textes à la taille du cadre */
#annonce { font-size: 5.6cqh; }
#repere { font-size: 2.4cqh; top: 30%; }
#etats .etat { font-size: 2.2cqh; }
#victoire .v-haut { font-size: 3.2cqh; }
#victoire .v-titre { font-size: 9.5cqh; }
#victoire .v-gain { font-size: 3.6cqh; }
#victoire .v-temps { font-size: 2.4cqh; }
#aide { max-width: 94%; font-size: 1.5cqh; }

/* ── Le fond 3D couvre toute la page ; le haut et les barres restent dans la colonne verticale du milieu ── */
#c3d { position: fixed; inset: 0; width: 100vw; height: 100vh; }
#scene { box-shadow: none; pointer-events: none; }
#scene > * { pointer-events: auto; }
#haut, #trajet, #carbu, #etats, #annonce, #repere, #victoire { pointer-events: none; }
/* Les 2 barres sur les bords de la colonne */
#trajet { left: 4%; top: 25%; bottom: 9%; }
#carbu { right: 4%; top: 25%; bottom: 9%; transform: none; justify-content: flex-start; }
#carbu .c-tube { height: auto; flex: 1; }
