* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #07070c; }
body { font-family: 'Inter', sans-serif; font-weight: 800; color: #fff; user-select: none; }
.cache { display: none !important; }
svg { display: block; }
#c3d { position: fixed; inset: 0; width: 100vw; height: 100vh; cursor: pointer; }

/* Colonne verticale du milieu (format téléphone) : porte tout l'affichage */
#scene { position: fixed; top: 0; bottom: 0; left: 0; right: 0; margin: 0 auto; width: min(100vw, calc(100vh * 9 / 16)); container-type: size; pointer-events: none; }

/* ── Haut : noms, wins, vies, chrono ── */
#haut { position: absolute; top: 1.2cqh; left: 2.5%; right: 2.5%; display: flex; flex-direction: column; gap: .5cqh; }
.ligne-noms, .ligne-vies, .ligne-infos { position: relative; display: flex; align-items: center; gap: 1.2cqh; }
.camp { flex: 1; display: flex; align-items: center; gap: .9cqh; min-width: 0; }
.camp.d { justify-content: flex-end; }
.nom { font-family: 'Anton', sans-serif; font-size: 2.7cqh; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 .3cqh .6cqh rgba(0,0,0,.8), 0 0 1.4cqh rgba(0,0,0,.5); }
.camp.g .nom { color: #ff6b78; } .camp.d .nom { color: #7fb2ff; }
.wins { flex: none; font-family: 'Anton', sans-serif; font-size: 2.9cqh; line-height: 1; padding: .55cqh 1.2cqh .4cqh; border-radius: 1cqh; color: #2a1800; background: linear-gradient(180deg, #fff1a8, #f2c45f 45%, #c98a1c); border: .3cqh solid #fff; box-shadow: 0 .45cqh 0 rgba(0,0,0,.55), 0 0 1.6cqh rgba(242,196,95,.65); text-shadow: 0 .1cqh 0 rgba(255,255,255,.5); letter-spacing: .3px; }
.wins small { font-size: .55em; margin-left: .2em; }
.camp.g .wins { border-color: #ff4d5e; }
.camp.d .wins { border-color: #4d95ff; }
.wins.tete { box-shadow: 0 .45cqh 0 rgba(0,0,0,.55), 0 0 2.6cqh rgba(255,215,90,.95); }
.wins.pop { animation: pop .4s ease-out; }
@keyframes pop { 40% { transform: scale(1.22); } }
.couronne { position: absolute; top: -1.4cqh; font-size: 3cqh; filter: drop-shadow(0 .3cqh .4cqh rgba(0,0,0,.6)); animation: couronne 1.6s ease-in-out infinite; }
.couronne.g { left: -.6cqh; } .couronne.d { right: -.6cqh; }
@keyframes couronne { 50% { transform: translateY(-.5cqh) rotate(-8deg); } }

.vie { position: relative; flex: 1; height: 2.6cqh; border-radius: .7cqh; background: rgba(10, 10, 16, .78); border: .25cqh solid rgba(255,255,255,.85); overflow: hidden; box-shadow: 0 .4cqh 1cqh rgba(0,0,0,.6); }
.vie-plein, .vie-trace { position: absolute; top: 0; bottom: 0; width: 100%; transition: width .12s; }
.vie.g .vie-plein, .vie.g .vie-trace { right: 0; }      /* la barre de gauche se vide vers l'extérieur */
.vie.d .vie-plein, .vie.d .vie-trace { left: 0; }
.vie-trace { background: #fff; transition: none; }
.vie.g .vie-plein { background: linear-gradient(180deg, #ff7b88, #d62839 55%, #8f0f1c); }
.vie.d .vie-plein { background: linear-gradient(180deg, #7fb2ff, #1f6fd6 55%, #0c3a80); }
.vie-segments { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(0,0,0,.55) calc(10% - 2px) 10%); }
.chrono { flex: none; min-width: 9cqh; text-align: center; font-family: 'Anton', sans-serif; font-size: 3.6cqh; line-height: 1; padding: .6cqh 1cqh .5cqh; border-radius: 1cqh; background: rgba(10,10,16,.85); border: .25cqh solid #ffd23f; color: #ffd23f; box-shadow: 0 .4cqh 0 rgba(0,0,0,.5); }
.chrono.urgent { color: #ff4d5e; border-color: #ff4d5e; animation: clignote .5s steps(1) infinite; }
@keyframes clignote { 50% { opacity: .45; } }
.info { flex: 1; display: flex; flex-direction: column; gap: .2cqh; text-shadow: 0 .2cqh .4cqh rgba(0,0,0,.9); }
.info.d { align-items: flex-end; text-align: right; }
.info b { font-family: 'Anton', sans-serif; font-weight: normal; font-size: 2.6cqh; line-height: 1.05; }
.info small { font-size: 1.25cqh; font-weight: 700; color: #d8d4cc; line-height: 1.3; }
.round { flex: none; font-family: 'Anton', sans-serif; font-weight: normal; font-size: 2.1cqh; color: #fff; padding: .3cqh 1.2cqh .2cqh; border-radius: 99px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3); align-self: flex-start; }

/* ── Légendes des cadeaux sur les côtés ── */
.legende { position: absolute; top: 24%; display: flex; flex-direction: column; gap: .7cqh; }
.legende.g { left: 2%; align-items: flex-start; } .legende.d { right: 2%; align-items: flex-end; }
.l-ligne { display: flex; align-items: center; gap: .6cqh; padding: .45cqh .9cqh .45cqh .5cqh; border-radius: 99px; background: rgba(10,10,16,.72); border: 1px solid rgba(255,255,255,.18); font-size: 1.55cqh; }
.legende.d .l-ligne { flex-direction: row-reverse; padding: .45cqh .5cqh .45cqh .9cqh; }
.l-ico { font-size: 1.9cqh; line-height: 1; max-width: 12cqh; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l-ligne b { font-family: 'Anton', sans-serif; font-weight: normal; letter-spacing: .3px; }
.legende.g .coup b { color: #ff7b88; } .legende.d .coup b { color: #7fb2ff; }
.l-ligne.soin b { color: #7dff9e; } .l-ligne.win b { color: #ffd23f; }

/* ── Annonces ── */
#annonce { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-family: 'Anton', sans-serif; font-size: 8cqh; line-height: 1.05; color: #fff; text-shadow: 0 .6cqh 0 rgba(0,0,0,.55), 0 0 3cqh rgba(0,0,0,.6); animation: annonce 2.2s ease-out both; text-transform: uppercase; }
#annonce small { display: block; font-size: .42em; color: #fff3c4; margin-top: .5cqh; }
#annonce.rouge { color: #ff4d5e; } #annonce.bleu { color: #5fa0ff; } #annonce.or { color: #ffd23f; }
@keyframes annonce { 0% { transform: scale(.3); opacity: 0; } 12% { transform: scale(1.12); opacity: 1; } 20% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-2cqh); } }
#chargement { position: absolute; left: 0; right: 0; top: 48%; text-align: center; font-family: 'Anton', sans-serif; font-size: 3cqh; color: #ffd23f; animation: clignote 1s steps(1) infinite; }

/* Chiffres des dégâts qui volent */
.degat { position: fixed; z-index: 20; pointer-events: none; transform: translateX(-50%); font-family: 'Anton', sans-serif; color: #fff; -webkit-text-stroke: 2px rgba(0,0,0,.75); paint-order: stroke fill; animation: degat 1s ease-out forwards; white-space: nowrap; }
.degat.rouge { color: #ff6b78; } .degat.bleu { color: #7fb2ff; } .degat.vert { color: #7dff9e; }
@keyframes degat { 0% { transform: translate(-50%, 10px) scale(.5); opacity: 0; } 15% { transform: translate(-50%, 0) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -70px) scale(1); opacity: 0; } }

/* Boutons ronds (accueil, paramètres) : en haut à gauche de la fenêtre */
.btn-rond { position: fixed; z-index: 40; top: 16px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(14, 13, 12, .55); 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; }
@media (max-width: 700px) { #btn-accueil, #btn-params { top: auto; bottom: 14px; } }

/* 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; }

#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; }

#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); }
#params { position: fixed; z-index: 45; }
#params .p-onglets { grid-template-columns: repeat(3, 1fr); }
#params input[type=text] { 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: 170px; }
#params .p-action { flex-wrap: wrap; gap: 6px; }
#params .p-action select { width: auto; max-width: 110px; padding: 6px; font-size: 13px; }
#params .p-action input.p-court { width: 78px; }
#params .p-action input.p-label { width: 90px; }

/* Choix des persos (façon Minerio) */
#params .p-onglets { grid-template-columns: repeat(4, 1fr); }
#params .p-camps { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0 6px; }
#params .p-camps button { padding: 10px 6px; border-radius: 12px; border: 2px solid transparent; background: rgba(255,255,255,.06); color: #ece8e1; font-weight: 800; font-size: 13px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#params .p-camps button[data-camp=g].actif { border-color: #ff4d5e; background: rgba(214,40,57,.2); }
#params .p-camps button[data-camp=d].actif { border-color: #4d95ff; background: rgba(31,111,214,.2); }
#params .p-persos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#params .p-groupe { grid-column: 1 / -1; color: #8d877d; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; margin: 10px 2px 0; }
#params .p-skin { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 8px; background: rgba(255,255,255,.045); border: 2px solid transparent; border-radius: 14px; color: #c9c4ba; font-size: 11px; font-weight: 800; line-height: 1.15; text-align: center; }
#params .p-skin:hover { border-color: rgba(255,255,255,.18); }
#params .p-skin.actif { border-color: #e9b44c; background: rgba(233,180,76,.13); color: #fff; }
#params .p-img { width: 100%; aspect-ratio: 104 / 160; border-radius: 10px; background: radial-gradient(circle at 50% 35%, #2c2c3a, #0f0f15); display: grid; place-items: center; overflow: hidden; }
#params .p-img canvas { width: 100%; height: 100%; display: block; }
#params .p-img.charge::after { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); border-top-color: #f2c45f; animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
#params .p-badge { position: absolute; top: 4px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; }
#params .p-badge.g { left: 4px; background: #d62839; }
#params .p-badge.d { right: 4px; background: #1f6fd6; }

/* ── HUD des camps, style combat (panneaux inclinés, barres brillantes) ── */
#haut { top: 1cqh; left: 1.5%; right: 1.5%; gap: .7cqh; }
#haut::before { content: ''; position: absolute; left: -4%; right: -4%; top: -1.2cqh; height: 13.5cqh; z-index: -1; background: linear-gradient(180deg, rgba(4,4,10,.92), rgba(4,4,10,.55) 70%, rgba(4,4,10,0)); }
.ligne-noms { gap: .6cqh; }
.camp { position: relative; isolation: isolate; padding: .6cqh 1.3cqh .5cqh; gap: .7cqh; }
.camp::before { content: ''; position: absolute; inset: 0; z-index: -1; transform: skewX(-18deg); border-radius: .5cqh; }
.camp.g::before { background: linear-gradient(90deg, #e0283c, rgba(150,14,30,.75) 65%, rgba(150,14,30,0)); border-left: .6cqh solid #ffd23f; box-shadow: inset 0 .3cqh 0 rgba(255,255,255,.25); }
.camp.d::before { background: linear-gradient(270deg, #2475e0, rgba(12,52,130,.75) 65%, rgba(12,52,130,0)); border-right: .6cqh solid #ffd23f; box-shadow: inset 0 .3cqh 0 rgba(255,255,255,.25); }
.camp .nom, .camp.g .nom, .camp.d .nom { color: #fff; font-style: italic; font-size: 2.8cqh; letter-spacing: .6px; text-shadow: 0 .25cqh 0 rgba(0,0,0,.55), 0 0 1.4cqh rgba(255,255,255,.25); }
.camp.g .nom::before { content: '/ '; color: #ffd23f; }
.camp.d .nom::after { content: ' \5C'; color: #ffd23f; }
.multi { flex: none; font-family: 'Anton', sans-serif; font-size: 2cqh; line-height: 1; padding: .45cqh .9cqh .35cqh; border-radius: .8cqh; color: #fff; background: linear-gradient(180deg, #d58cff, #7b2cbf); border: .25cqh solid #fff; box-shadow: 0 .35cqh 0 rgba(0,0,0,.5), 0 0 1.4cqh rgba(199,125,255,.8); animation: multi 1s ease-in-out infinite; white-space: nowrap; }
@keyframes multi { 50% { transform: scale(1.08); } }
.ligne-vies { gap: .7cqh; }
.vie { height: 3.3cqh; border: 0; border-radius: 0; background: #0a0a12; box-shadow: none; filter: drop-shadow(0 .4cqh .5cqh rgba(0,0,0,.7)); }
.vie.g { clip-path: polygon(1.8cqh 0, 100% 0, 100% 100%, 0 100%); }
.vie.d { clip-path: polygon(0 0, calc(100% - 1.8cqh) 0, 100% 100%, 0 100%); }
.vie::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 42%; background: linear-gradient(180deg, rgba(255,255,255,.4), rgba(255,255,255,0)); pointer-events: none; }
.vie.g .vie-plein { background: linear-gradient(180deg, #ff9aa4, #e0283c 50%, #7a0a16); }
.vie.d .vie-plein { background: linear-gradient(180deg, #9cc4ff, #2475e0 50%, #0a3070); }
.vie-segments { background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 3px), rgba(0,0,0,.65) calc(10% - 3px) 10%); }
.chrono { font-size: 4.3cqh; min-width: 11cqh; padding: .45cqh 1.2cqh .3cqh; color: #2a1800; background: linear-gradient(180deg, #fff1a8, #f2c45f 50%, #c98a1c); border: .3cqh solid #fff; border-radius: 1.1cqh; box-shadow: 0 .45cqh 0 rgba(0,0,0,.55), 0 0 2.2cqh rgba(242,196,95,.6); }
.chrono.urgent { color: #fff; background: linear-gradient(180deg, #ff8a95, #e0283c 55%, #8a0c1a); border-color: #fff; }
.info b { font-size: 3cqh; font-style: italic; letter-spacing: .5px; }
.info.g b { color: #ffb3ba; } .info.d b { color: #b8d4ff; }
.round { color: #f2c45f; background: rgba(10,10,16,.85); border: .2cqh solid rgba(242,196,95,.7); font-style: italic; }

/* Badges un peu plus compacts pour laisser la place au nom ; le multi passe sous la vie */
.wins { font-size: 2.4cqh; padding: .45cqh 1cqh .35cqh; }
.camp .nom, .camp.g .nom, .camp.d .nom { font-size: 2.6cqh; }
.info .multi { align-self: flex-start; margin-top: .3cqh; font-size: 1.9cqh; }
.info.d .multi { align-self: flex-end; }
.camp { padding: .6cqh 1cqh .5cqh; gap: .5cqh; }
.wins { font-size: 2.2cqh; padding: .45cqh .8cqh .35cqh; }
.camp .nom, .camp.g .nom, .camp.d .nom { flex: 0 1 auto; min-width: 7cqh; }
/* Noms des camps bien lisibles : panneau plus sombre derrière le texte + contour noir */
.camp.g::before { background: linear-gradient(90deg, #6e0812, #b3172a 45%, rgba(150,14,30,.6) 80%, rgba(150,14,30,0)); }
.camp.d::before { background: linear-gradient(270deg, #0a2a66, #1c5fc4 45%, rgba(12,52,130,.6) 80%, rgba(12,52,130,0)); }
.camp .nom, .camp.g .nom, .camp.d .nom { font-size: 3cqh; color: #fff; -webkit-text-stroke: .28cqh #000; paint-order: stroke fill; text-shadow: 0 .3cqh 0 #000, 0 0 1cqh rgba(0,0,0,.8); }
/* Le contour noir élargit les lettres : de la place entre le nom et le badge des wins */
.camp { gap: 1.1cqh; }
.camp .nom, .camp.g .nom, .camp.d .nom { padding: 0 .5cqh; overflow: visible; }
.wins { font-size: 2.05cqh; padding: .45cqh .7cqh .35cqh; }
