* { 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, foin — panneaux en verre fumé */
#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, #foin.pop { animation: pop .35s ease-out; }
@keyframes pop { 40% { transform: scale(1.12); } }
#foin { 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; }
#foin .ble { font-size: .6em; }
#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; }

/* Mains : styles + couleurs */
#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: 12px; 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 svg { width: 26px; height: 26px; margin-bottom: 6px; color: #b9b2a6; }
#params .p-style b { font-size: 15px; 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); }
#params .p-style.actif svg { color: #f2c45f; }
#params .p-couleurs { display: flex; flex-wrap: wrap; gap: 9px; }
#params .p-couleur { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); padding: 0; color: #8d877d; }
#params .p-couleur svg { width: 18px; height: 18px; }
#params .p-couleur.actif { border-color: #fff; box-shadow: 0 0 0 3px #e9b44c; }
#params input[type=checkbox] { width: 22px; height: 22px; accent-color: #e9b44c; cursor: pointer; }

/* Victoire (aiguille trouvée) */
#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-creuse { width: 120px; } #params #o-vol-creuse-n { white-space: nowrap; min-width: 42px; text-align: right; }
