/* FOOTKULTURE — app unifiée : accueil, lobby, saisie PC, barres mobiles. Les règles de jeu viennent de game-wide.css / game-narrow.css (scopées html.wide / html.narrow). */

/* ---------- écrans "shell" (accueil + lobby) ---------- */
.screen.shell{overflow-y:auto}
html.wide .screen.shell{padding:1.6rem 2.2rem 2.2rem}
html.narrow .screen.shell{padding:64px 16px 24px;align-items:center}

/* ---------- accueil ---------- */
.hm-wrap{width:100%;max-width:34rem;margin:auto;display:flex;flex-direction:column;align-items:center;gap:1rem;text-align:center}
.hm-wrap .logo{font-family:var(--f-display);font-size:clamp(3rem,15vw,5.6rem);line-height:.9;color:var(--chalk);text-transform:uppercase;
  text-shadow:0 .1em 0 #0a1230,0 .18em 0 rgba(0,0,0,.35);transform:rotate(-3deg);animation:hmLogo .8s var(--ease-pop) both}
html.wide .hm-wrap .logo{font-size:5.4rem}
.hm-wrap .logo span{color:var(--yellow)}
.hm-wrap .logo small{display:block;font-size:.22em;letter-spacing:.18em;color:var(--grass-lt);margin-top:.5em;text-shadow:0 .1em 0 #0a1230}
@keyframes hmLogo{from{transform:rotate(-12deg) scale(.2);opacity:0}}
.hm-card{width:100%;display:flex;flex-direction:column;gap:.9rem;background:rgba(10,18,48,.82);backdrop-filter:blur(6px);border:3px solid rgba(255,255,255,.14);border-radius:1.2rem;padding:1.1rem 1.2rem 1.2rem;box-shadow:0 .35rem 0 rgba(0,0,0,.35);animation:pop .6s var(--ease-pop) .1s both;text-align:left}
.hm-top{display:flex;gap:.9rem;align-items:center}
.hm-prev{font-size:4.6rem;line-height:1;flex:none;filter:drop-shadow(0 .3rem 0 rgba(0,0,0,.35));transition:transform .2s var(--ease-pop)}
.hm-prev.b{animation:bounce .5s var(--ease-pop)}
.hm-id{flex:1;min-width:0}
.hm-card label{display:block;font-size:.95rem;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;margin-bottom:.15rem}
.hm-card .field{font-size:1.5rem;padding:.3em .5em}
.hm-card .field.pin{font-size:1.7rem}
.hm-kit{display:flex;flex-direction:column;gap:.7rem}
.hm-sw{display:flex;gap:clamp(3px,1.6vw,9px);justify-content:space-between}
.hm-sw button{flex:1 1 0;min-width:0;max-width:2.6rem;aspect-ratio:1/1;border-radius:50%;border:3px solid rgba(255,255,255,.3);cursor:pointer;padding:0;transition:transform .15s var(--ease-pop)}
.hm-sw button.on{border-color:#fff;transform:scale(1.14);box-shadow:0 0 0 2px var(--yellow);position:relative;z-index:1}
.hm-num{display:flex;align-items:center;justify-content:center;gap:1rem}
.hm-num button{width:2.8rem;height:2.8rem;border-radius:50%;border:0;background:rgba(255,255,255,.15);color:#fff;font-size:1.6rem;font-family:var(--f-display);cursor:pointer;line-height:1}
.hm-num output{font-family:var(--f-display);font-size:2.2rem;min-width:2.2em;text-align:center}
.hm-card .err{color:#ff8a8a;min-height:1.2em;font-size:1.05rem;text-align:center}
.hm-actions{display:flex;flex-direction:column;gap:.7rem}
.hm-actions .btn.big{font-size:1.8rem;width:100%}
.hm-or{display:flex;align-items:center;gap:.7rem;color:var(--muted);font-size:.95rem;text-transform:uppercase;letter-spacing:.08em}
.hm-or::before,.hm-or::after{content:'';flex:1;height:2px;background:rgba(255,255,255,.18)}
.hm-join{display:flex;gap:.6rem;align-items:stretch}
.hm-join .field{flex:1.2;min-width:0}
.hm-join .btn{width:auto!important;flex:1;font-size:1.5rem!important;padding:.4em .6em}
.hm-chip{flex:1.2;display:flex;align-items:center;justify-content:center;gap:.6em;font-size:1.05rem;background:rgba(10,18,48,.7);border:3px solid rgba(255,255,255,.18);border-radius:99px;padding:.15em .5em .15em 1em;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.hm-chip b{font-family:var(--f-display);font-weight:400;font-size:1.5rem;color:var(--yellow);letter-spacing:.15em}
.hm-chip button{border:0;background:rgba(255,255,255,.15);color:#fff;border-radius:99px;padding:.15em .7em;font-size:.9rem;cursor:pointer}
.hm-old{font-size:.9rem;color:var(--muted);opacity:.8}
.hm-old a{color:var(--chalk)}

/* ---------- lobby partagé ---------- */
.lb-leave{position:absolute;top:.8rem;left:.9rem;z-index:3}
.screen.lb{gap:1rem}
html.wide .screen.lb{display:grid;grid-template-columns:minmax(18rem,28%) 1fr;gap:2rem;align-items:stretch;padding-top:3.4rem;overflow:hidden}
html.wide .screen.lb::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(180deg,rgba(5,10,32,.82) 0,rgba(5,10,32,.5) 22%,rgba(5,10,32,.38) 55%,rgba(5,10,32,.86) 100%)}
html.narrow .screen.lb{padding-top:60px;gap:12px;justify-content:flex-start}
.lb-join{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.7rem;text-align:center;min-width:0}
.lb-join .logo{font-family:var(--f-display);font-size:3.4rem;line-height:.9;transform:rotate(-3deg);text-shadow:0 .25rem 0 #0a1230}
.lb-join .logo span{color:var(--yellow)}
.lb-pinbox{background:var(--chalk);color:var(--ink);border-radius:1.1rem;padding:.4rem 1.4rem .8rem;box-shadow:0 .45rem 0 rgba(0,0,0,.4);transform:rotate(1deg)}
.lb-pinbox small{display:block;font-size:1.1rem;letter-spacing:.1em;text-transform:uppercase;color:#4a5a8a}
.lb-pin{font-family:var(--f-display);font-size:5rem;line-height:1;letter-spacing:.08em}
.lb-url{font-size:1.1rem;color:var(--chalk);background:rgba(10,18,48,.8);padding:.1em .8em;border-radius:99px;word-break:break-all;max-width:100%}
.lb-copy{box-shadow:0 .25rem 0 #b8940a!important;white-space:normal}
#qr{background:#fff;padding:.5rem;border-radius:.8rem;line-height:0}
#qr svg,#qr img,#qr canvas{width:9rem;height:9rem;display:block}
html.wide #qr svg,html.wide #qr img,html.wide #qr canvas{width:11rem;height:11rem}
html.narrow .lb-join{flex-direction:row;flex-wrap:wrap;gap:10px;justify-content:center}
html.narrow .lb-join .logo{display:none}
html.narrow .lb-pin{font-size:3.4rem}
html.narrow .lb-pinbox{padding:.2rem 1rem .5rem}
html.narrow .lb-url{flex:1 1 100%;font-size:.95rem}
html.narrow .lb-copy{flex:1 1 100%}
html.narrow #qr svg,html.narrow #qr img,html.narrow #qr canvas{width:6.5rem;height:6.5rem}
.lb-main{display:flex;flex-direction:column;gap:.9rem;min-height:0;min-width:0;width:100%}
.lb-head h2{font-size:2.6rem;text-shadow:0 .15rem 0 #0a1230;text-align:left}
html.narrow .lb-head h2{font-size:1.8rem;text-align:center}
.lb-head h2 b{color:var(--yellow)}
.lb-players{flex:1;min-height:6rem;overflow-y:auto;overflow-x:hidden;display:grid;grid-template-columns:repeat(auto-fill,minmax(10.5rem,1fr));gap:.7rem;align-content:start;padding:.7rem .4rem .4rem;background:rgba(5,10,32,.55);border-radius:1.2rem}
html.narrow .lb-players{grid-template-columns:repeat(3,minmax(0,1fr));flex:none;max-height:none;overflow:visible;min-height:0}
.lb-pl{position:relative;display:flex;flex-direction:column;align-items:center;gap:.1rem;background:rgba(255,255,255,.12);border-radius:1rem;padding:.5rem .3rem .4rem;animation:pop .55s var(--ease-pop) both;min-width:0}
.lb-pl.me{background:rgba(255,210,31,.2);outline:2px solid rgba(255,210,31,.7)}
.lb-pl .jw{position:relative;font-size:4rem;line-height:1}
.lb-pl .jw .jersey{filter:drop-shadow(0 .2rem 0 rgba(0,0,0,.35));transition:transform .2s}
.lb-pl:hover .jw .jersey{transform:rotate(-8deg) scale(1.08)}
.lb-pl .crown{position:absolute;top:-.5rem;right:-.5rem;font-size:.42em;transform:rotate(14deg)}
.lb-pl .nm{font-size:1.4rem;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
html.narrow .lb-pl .jw{font-size:3rem}
html.narrow .lb-pl .nm{font-size:1.05rem}
.lb-pl.off{opacity:.45}
.lb-pl .kick{position:absolute;top:.2rem;right:.3rem;border:0;background:rgba(0,0,0,.55);color:#fff;width:1.9rem;height:1.9rem;border-radius:50%;cursor:pointer;opacity:0;font-size:1.1rem;line-height:1}
.lb-pl:hover .kick,.lb-pl .kick:focus-visible{opacity:1}
@media (hover:none){.lb-pl .kick{opacity:.85}}
.lb-settings{display:flex;gap:.6rem 1.2rem;flex-wrap:wrap;align-items:center;justify-content:center;background:rgba(5,10,32,.6);padding:.5rem .9rem;border-radius:1rem}
.lb-seg{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;justify-content:center}
.lb-seg label{color:var(--chalk);font-size:1rem;text-transform:uppercase;letter-spacing:.05em}
.lb-segb{display:flex;gap:.3rem}
.lb-seg button{border:3px solid rgba(255,255,255,.25);background:rgba(10,18,48,.6);color:var(--chalk);font-family:var(--f-display);font-size:1.1rem;padding:.2em .6em;border-radius:.6rem;cursor:pointer;transition:all .15s}
.lb-seg button:hover{border-color:var(--yellow)}
.lb-seg button.on{background:var(--yellow);color:var(--ink);border-color:var(--yellow);transform:scale(1.06)}
.lb-sum{display:flex;gap:.5rem;flex-wrap:wrap;justify-content:center}
.lb-sum span{background:rgba(255,255,255,.12);padding:.1em .8em;border-radius:99px;font-size:1.1rem}
.lb-start{display:flex;flex-direction:column;align-items:center;gap:.4rem}
html.wide .lb-start{align-items:flex-end}
.lb-start .btn.big{font-size:2rem}
html.narrow .lb-start{position:sticky;bottom:0;margin:auto -16px -24px;padding:10px 16px calc(14px + env(safe-area-inset-bottom,0px));background:linear-gradient(180deg,transparent,rgba(10,18,48,.94) 35%);align-self:stretch}
html.narrow .lb-start .btn.big{width:100%;max-width:420px}
.lb-hint{font-size:1rem;color:var(--muted)}
.lb-wait{display:flex;align-items:center;gap:.9rem;background:rgba(10,18,48,.85);border:3px solid rgba(255,255,255,.18);border-radius:1.1rem;padding:.7rem 1.2rem;text-align:left}
.lb-wait b{display:block;font-family:var(--f-display);font-weight:400;text-transform:uppercase;font-size:1.6rem;color:var(--yellow)}
.lb-wait small{display:block;font-size:1.05rem;color:var(--chalk)}
.lb-ball{font-size:2.6rem;animation:lbBall 1s cubic-bezier(.3,0,.4,1) infinite;display:block}
@keyframes lbBall{0%,100%{transform:translateY(5px) scale(1.1,.9)}50%{transform:translateY(-10px) rotate(180deg)}}
html.narrow .lb-start{margin-top:auto}

/* ---------- PC : saisie de la réponse sous la question ---------- */
html.wide .afw{display:flex;gap:1rem;flex:none;align-items:stretch}
html.wide .afield{flex:1;min-width:0;font-family:var(--f-body);font-weight:700;font-size:2.6rem;padding:.12em .6em;border-radius:1rem;border:.3rem solid var(--night3);background:var(--chalk);color:var(--ink);outline:none}
html.wide .afield:focus{border-color:var(--yellow);box-shadow:0 0 0 .3rem rgba(255,210,31,.4)}
html.wide .afw .btn{font-size:2.2rem;padding:.2em 1.2em}
html.wide .lkw{flex:none;display:flex;align-items:center;gap:1rem;min-height:4.6rem;background:rgba(10,18,48,.9);border:.3rem solid var(--grass-lt);border-radius:1rem;padding:.2rem 1.2rem}
html.wide .lkw .lkt{font-family:var(--f-display);text-transform:uppercase;color:var(--grass-lt);font-size:1.7rem}
html.wide .lkw b{flex:1;min-width:0;font-size:2.4rem;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.wide .lkw .lkb{font-size:2.2rem;animation:lbBall 1s cubic-bezier(.3,0,.4,1) infinite}
html.wide .lkw.over{border-color:var(--red)}
html.wide .lkw.over .lkt{color:#ff7b7b}
html.wide .me-res{font-family:var(--f-display);font-size:2.3rem;padding:.1em .7em;border-radius:99px;background:rgba(10,18,48,.85);border:.2rem solid rgba(255,255,255,.25);white-space:nowrap}
html.wide .me-res.ok{border-color:var(--grass-lt);color:var(--grass-lt)}
html.wide .me-res.ko{border-color:#ff5a5a;color:#ff8a8a}
html.wide .me-res.check{border-color:var(--yellow);color:var(--yellow)}

/* ---------- PC : ce que seul le chef voit ---------- */
html.wide body:not(.is-host) .rv-ctl,html.wide body:not(.is-host) .rv-pod,html.wide body:not(.is-host) #replay,html.wide body:not(.is-host) .hint{display:none!important}
html.wide body.is-host .wait-host{display:none}
html.wide .wait-host{align-self:center;font-family:var(--f-display);text-transform:uppercase;font-size:1.5rem;background:rgba(10,18,48,.9);padding:.3em 1em;border-radius:99px;border:.2rem solid rgba(255,255,255,.25)}
html.wide .ent[title^="Cliquer pour contester"]:hover{border-color:var(--orange)}

/* ---------- mobile : éléments propres au chef + contestation ---------- */
html.narrow .wait-host{background:rgba(10,18,48,.85);padding:.3em 1em;border-radius:99px;color:var(--chalk);font-size:1.05rem}
html.narrow body.is-host .wait-host{display:none}
html.narrow .checks{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
html.narrow .chk{border:3px dashed var(--yellow);background:rgba(10,18,48,.9);color:var(--chalk);padding:.25em .7em;border-radius:.7rem;font-size:1.05rem;cursor:pointer;font-weight:700}
html.narrow .v-ov{border:2px solid rgba(255,255,255,.25);background:rgba(255,255,255,.1);color:#fff;border-radius:99px;min-width:36px;height:36px;font-size:1rem;cursor:pointer}
html.narrow .pdm #leave{margin-top:6px}
html.narrow body.is-host .screen.reveal,html.narrow body.is-host .screen.pdm,html.narrow body.is-host .screen.res{padding-bottom:170px}
html.narrow body.is-host .screen.question{padding-top:110px}
html.narrow .hint{display:none}

/* ---------- barre de réactions + contrôles du chef ---------- */
.reactbar2{position:fixed;z-index:30;display:flex;gap:.6rem;padding:.4rem .7rem;background:rgba(10,18,48,.92);border:3px solid rgba(255,255,255,.2);border-radius:99px;box-shadow:0 .35rem 0 rgba(0,0,0,.35)}
.reactbar2 button{width:3.2rem;height:3.2rem;border-radius:50%;border:0;background:rgba(255,255,255,.12);font-size:1.6rem;cursor:pointer;line-height:1}
.reactbar2 button.hit{animation:rHit2 .4s var(--ease-pop)}
@keyframes rHit2{0%{transform:scale(1)}40%{transform:scale(1.4) rotate(-8deg);background:var(--yellow)}100%{transform:scale(1)}}
html.wide .reactbar2{left:1.2rem;bottom:.6rem}
html.narrow .reactbar2{left:50%;bottom:calc(10px + env(safe-area-inset-bottom,0px));transform:translateX(-50%)}
html.narrow .reactbar2 button{width:56px;height:56px;font-size:1.9rem}
body.kb .reactbar2{display:none}
.hostbar{position:fixed;z-index:31;left:0;right:0;display:flex;gap:8px;justify-content:center;flex-wrap:wrap;padding:0 10px}
.hostbar .btn{font-size:1.05rem;padding:.35em .8em}
html.narrow .hostbar{bottom:calc(84px + env(safe-area-inset-bottom,0px))}
html.narrow body[data-phase="intro"] .hostbar,html.narrow body[data-phase="question"] .hostbar{bottom:auto;top:64px;left:8px;right:auto;padding:0}
html.narrow body[data-phase="intro"] .hostbar .btn,html.narrow body[data-phase="question"] .hostbar .btn{font-size:.85rem;padding:.2em .6em;box-shadow:0 3px 0 rgba(0,0,0,.35)}
html.narrow body[data-phase="podium"] .hostbar .btn{font-size:1.4rem}
body[data-phase="home"] .hint{display:none}

/* barre du haut (PC) : la catégorie s'écrase avant de pousser le reste hors écran */
html.wide .topbar{min-width:0}
html.wide .topbar .cat{min-width:0;overflow:hidden;text-overflow:ellipsis}
html.wide .me-res{flex:none;font-size:1.9rem}

/* lobby mobile : pas de QR (on partage le lien), barre de lancement au-dessus des réactions */
html.narrow #qr{display:none}
html.narrow .screen.lb{padding-bottom:96px}
html.narrow .lb-start{position:sticky;bottom:calc(84px + env(safe-area-inset-bottom,0px));margin:auto -16px 0;padding:10px 16px 10px;z-index:5}
html.narrow .lb-wait{width:100%;max-width:420px;padding:.5rem .9rem}
html.narrow .lb-wait b{font-size:1.25rem}
html.narrow .lb-wait small{font-size:.95rem}
html.narrow .screen.lb>*{flex:none}
html.narrow .lb-main{min-height:auto;flex:none}
html.narrow .lb-players{overflow:visible;flex:none}
html.narrow .lb-start{position:static;margin:4px 0 0;padding:0}
html.narrow .lb-start.is-h{position:sticky;bottom:calc(84px + env(safe-area-inset-bottom,0px));margin:4px -16px 0;padding:10px 16px}
html.narrow body.is-host .fk-hurry{left:60%}
.hm-actions .btn.big{white-space:nowrap}
.hm-actions.invited .hm-join{order:0}.hm-actions.invited .hm-or{order:1}.hm-actions.invited #create{order:2}
html.narrow .hm-actions .btn.big{font-size:1.6rem}
html.narrow .hm-join{flex-direction:column}
html.narrow .hm-join .btn{width:100%!important;font-size:1.6rem!important}
html.narrow .hm-chip{flex:none;padding:.3em .6em .3em 1em}
