/* PCF — style repris du prototype. Règle absolue : aucun effet pendant l'échange. */
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: italic; font-display: swap; src: url(../fonts/barlow-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/barlow-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url(../fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/barlow-condensed-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url(../fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-style: normal; font-display: swap; src: url(../fonts/barlow-condensed-latin-800-normal.woff2) format("woff2"); }

:root {
  --court: #173F73; --court-deep: #0F2C52; --line: #F5F7FA; --me: #F4C542; --bot: #E8574A;
  --muted: #9DB4D3; --panel: rgba(255, 255, 255, .06);
  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --court: #12345F; --court-deep: #0A2140; } }
:root[data-theme="dark"] { --court: #12345F; --court-deep: #0A2140; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); height: 100%; }
*, *::before, *::after { box-sizing: inherit; }
body { margin: 0; min-height: 100%; background: var(--court); color: var(--line);
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
.wrap { max-width: 460px; margin: 0 auto; padding: 16px 16px 28px; display: flex; flex-direction: column; gap: 16px; }
header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.marque { display: flex; align-items: center; gap: 10px; }
.marque .logo { width: 46px; height: 46px; flex: none; border-radius: 50%; }
h1 { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 1.6rem; margin: 0; }
.rule { color: var(--muted); font-size: .85rem; }
.sound { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; user-select: none; }
.sound input { width: 20px; height: 20px; accent-color: var(--me); margin: 0; cursor: pointer; }
.test { font: inherit; font-size: .85rem; color: var(--muted); background: none; border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.sndnote { margin: 0; font-size: .88rem; line-height: 1.4; color: var(--line); background: var(--panel); border-radius: 8px; padding: 10px 12px; }
:is(button, input, select):focus-visible { outline: 3px solid var(--me); outline-offset: 2px; }

/* Tableau de score */
.board { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--line); border-radius: 6px; padding: 10px 8px 12px; position: relative; background: var(--court-deep); }
.board::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 2px solid var(--line); opacity: .25; }
.side { text-align: center; position: relative; z-index: 1; min-width: 0; }
.name { font-size: .9rem; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.name span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: clamp(4.2rem, 22vw, 6.5rem); line-height: .95; font-variant-numeric: tabular-nums; }
.side.me .score { color: var(--me); } .side.bot .score { color: var(--bot); }
.sets { display: flex; justify-content: center; gap: 5px; margin-top: 4px; }
.sets i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; opacity: .5; }
.sets i.on { background: currentColor; opacity: 1; }
.side.me .sets { color: var(--me); } .side.bot .sets { color: var(--bot); }
.status { grid-column: 1 / -1; text-align: center; font-size: .9rem; color: var(--muted); min-height: 1.3em; margin-top: 6px; position: relative; z-index: 1; }
.status.hot { color: var(--line); font-weight: 600; }
.done-sets { grid-column: 1 / -1; text-align: center; font-size: .85rem; color: var(--muted); position: relative; z-index: 1; min-height: 1.2em; }

/* Bandeau des annonces : arbitre + commentateur */
.band { min-height: 3.6em; padding: 10px 14px; border-left: 4px solid var(--line); background: var(--panel); border-radius: 0 8px 8px 0; transition: opacity .6s; }
.band.stale { opacity: .45; }
.band .arbitre { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.35rem; line-height: 1.2; }
/* Une icône par voix : 🧑‍⚖️ arbitre (sans icône, en gros), 🎙️ commentateur, 👠 commentatrice, 📣 speaker, 🎤 journaliste. */
.band :is(.commentateur, .commentatrice, .speaker, .journaliste), .voix-fin > div, .panel .com > div, .fo-speaker > div { font-style: italic; color: var(--muted); line-height: 1.35; margin-top: 2px; }
:is(.band, .voix-fin, .panel .com, .fo-speaker) .commentateur::before { content: "🎙️ "; font-style: normal; }
:is(.band, .voix-fin, .panel .com, .fo-speaker) .commentatrice::before { content: "👠 "; font-style: normal; }
:is(.band, .voix-fin, .panel .com, .fo-speaker) .speaker::before { content: "📣 "; font-style: normal; }
:is(.band, .voix-fin, .panel .com, .fo-speaker) .journaliste::before { content: "🎤 "; font-style: normal; }
.fo-speaker > .speaker { color: var(--line); }
.fo-speaker { text-align: center; font-size: .9rem; margin: -6px 0 12px; min-height: 1.3em; }
.fo-speaker:empty { display: none; }
.fo-surnom { font-size: .8rem; color: var(--me); font-style: italic; margin-top: 4px; line-height: 1.25; }
.fo-p.right .fo-surnom { color: var(--bot); }
.voix-fin { margin: 0 0 10px; }
.surnom { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 1.5rem; color: var(--me); margin: 4px 0 8px; }
.iv-champ { font-weight: 600; color: var(--me); margin: 10px 0 0; }
.iv-champ:empty { display: none; }
.iv-q { font-style: italic; line-height: 1.4; margin: 12px 0; }
.iv-q::before { content: "🎤 "; font-style: normal; }
.iv-rep { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.iv-rep button { font: inherit; text-align: left; padding: 10px 12px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .2); background: var(--panel); color: var(--line); cursor: pointer; }
.iv-moi { font-weight: 600; margin: 0 0 8px; }
.iv-moi::before { content: "« "; } .iv-moi::after { content: " »"; }
.band .idle { color: var(--muted); font-size: .9rem; }

/* L'échange : révélation immédiate, sans animation */
.arena { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 96px; }
.hand { font-size: 3.4rem; text-align: center; }
.hand.win { transform: scale(1.18); } .hand.lose { opacity: .4; }
.vs { font-family: "Barlow Condensed", sans-serif; font-weight: 700; color: var(--muted); }
.verdict { text-align: center; font-weight: 600; min-height: 1.4em; }
.timer { height: 6px; background: var(--panel); border-radius: 3px; overflow: hidden; }
.timer > div { height: 100%; width: 100%; background: var(--line); transform-origin: left; }
.timer.urgent > div { background: var(--bot); }
.moves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.moves button { font: inherit; color: var(--line); background: var(--panel); border: 2px solid rgba(255, 255, 255, .18);
  border-radius: 14px; padding: 14px 4px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.moves button .e { font-size: 2.4rem; line-height: 1; }
.moves button .l { font-size: .85rem; color: var(--muted); }
@media (hover: hover) { .moves button:hover:not(:disabled) { border-color: var(--me); } }
.moves button:disabled { opacity: .45; cursor: default; }

h2 { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.15rem; margin: 0 0 8px; }
.tape { overflow-x: auto; padding-bottom: 6px; }
.tape table { border-collapse: collapse; }
.tape th { text-align: left; font-weight: 500; font-size: .8rem; color: var(--muted); padding-right: 8px; white-space: nowrap; position: sticky; left: 0; background: var(--court); z-index: 1; }
.tape td { width: 34px; min-width: 34px; height: 34px; text-align: center; font-size: 1.2rem; border-left: 1px solid rgba(255, 255, 255, .08); }
.tape td.newset { border-left: 3px solid var(--line); }
.tape td.w-me { background: rgba(244, 197, 66, .18); } .tape td.w-bot { background: rgba(232, 87, 74, .18); }
.tape td.auto { outline: 1px dashed var(--muted); outline-offset: -4px; }
.empty { color: var(--muted); font-size: .9rem; margin: 0; }
.readout { font-size: .92rem; color: var(--muted); line-height: 1.45; margin: 0; }
.readout b { color: var(--line); font-weight: 600; }

.end { border: 2px solid var(--line); border-radius: 6px; padding: 16px; background: var(--court-deep); }
.end p { margin: 6px 0; line-height: 1.45; }
.bars { display: grid; gap: 6px; margin: 10px 0 14px; }
.bar { display: grid; grid-template-columns: 5.5rem 1fr 2.6rem; align-items: center; gap: 8px; font-size: .9rem; }
.bar .t { height: 10px; background: var(--panel); border-radius: 5px; overflow: hidden; }
.bar .t div { height: 100%; background: var(--me); }
.btn { font: inherit; font-weight: 600; background: var(--line); color: var(--court-deep); border: 0; border-radius: 10px; padding: 12px 18px; cursor: pointer; width: 100%; font-size: 1rem; }
.btn + .btn { margin-top: 8px; }
.btn.alt { background: transparent; color: var(--line); border: 2px solid rgba(255, 255, 255, .3); }
.record { text-align: center; color: var(--muted); font-size: .85rem; margin: 0; }
.tabs { display: flex; gap: 8px; }
.tabs button { flex: 1; font: inherit; font-weight: 600; color: var(--muted); background: transparent; border: 2px solid rgba(255, 255, 255, .18); border-radius: 10px; padding: 9px; cursor: pointer; }
.tabs button[aria-pressed=true] { color: var(--court-deep); background: var(--line); border-color: var(--line); }
.view { display: flex; flex-direction: column; gap: 16px; }
[hidden] { display: none !important; }
.mini { width: 22px; height: 22px; display: inline-flex; flex: none; }
.mini svg { width: 100%; height: 100%; }
.news { color: var(--me); font-weight: 600; }
.news:empty { display: none; }

/* Fiche joueur */
.card { border: 2px solid var(--line); border-radius: 6px; padding: 16px; background: var(--court-deep); }
.id { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.id .av svg { width: 96px; height: 96px; display: block; }
.id .pseudo { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 1.9rem; line-height: 1; word-break: break-word; }
.id .title { color: var(--me); font-weight: 600; margin-top: 4px; }
.id .elo { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 12px; text-align: center; }
.kpis b { display: block; font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 2rem; line-height: 1; }
.kpis span { font-size: .82rem; color: var(--muted); }
.card h2 { margin-bottom: 10px; }
.lines { display: grid; gap: 8px; }
.ln { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; border-bottom: 1px solid rgba(255, 255, 255, .08); padding-bottom: 7px; }
.ln:last-child { border-bottom: 0; padding-bottom: 0; }
.ln span:first-child { color: var(--muted); }
.ln span:last-child { font-weight: 600; text-align: right; }
.gauge { height: 12px; background: var(--panel); border-radius: 6px; overflow: hidden; margin: 8px 0 6px; }
.gauge div { height: 100%; background: linear-gradient(90deg, var(--bot), var(--me)); }
.big { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 2.2rem; line-height: 1; }
.hint { font-size: .85rem; color: var(--muted); line-height: 1.4; margin: 4px 0 0; }
.hint b { color: var(--line); }
.badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.badge { padding: 10px; border-radius: 10px; background: var(--panel); border: 1px solid rgba(255, 255, 255, .1); }
.badge .bn { font-weight: 600; }
.badge .bd { font-size: .8rem; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.badge.off { opacity: .45; }
.badge.on { border-color: var(--me); }
.badge .bu { font-size: .75rem; color: var(--me); margin-top: 4px; }
.spark svg { width: 100%; height: 90px; display: block; }
.hist-list .ln span:first-child { color: var(--line); font-weight: 400; }
.edit .lbl { display: block; font-size: .88rem; color: var(--muted); margin: 12px 0 6px; }
.edit input[type=text], .edit input[type=email], .edit input[type=search], .edit select { width: 100%; font: inherit; font-size: 1rem; padding: 10px 12px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .2); background: var(--panel); color: var(--line); }
.edit select option { color: #000; }
.sw { display: flex; flex-wrap: wrap; gap: 10px; }
.sw button { width: 38px; height: 38px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; position: relative; padding: 0; font-size: .8rem; }
.sw button[aria-pressed=true] { border-color: var(--line); box-shadow: 0 0 0 2px var(--court-deep) inset; }
.sw button.locked { opacity: .4; }
.sw button.locked::after { content: "🔒"; position: absolute; right: -6px; bottom: -6px; font-size: .75rem; }
.sw button.txt { width: auto; border-radius: 10px; padding: 0 12px; background: var(--panel); color: var(--line); border-color: rgba(255, 255, 255, .2); }
.sw button.txt[aria-pressed=true] { border-color: var(--me); }
.id .pseudo .num { color: var(--muted); font-size: .6em; font-weight: 700; margin-left: 2px; }
.edit input.code { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.8rem; letter-spacing: .3em; text-align: center; }
.locknote.erreur { color: #FF8A80; }
.btn.danger { color: #FF8A80; border-color: rgba(255, 138, 128, .5); }
.btn:disabled { opacity: .5; }
/* Duel en ligne */
.tabs button { position: relative; }
.pastille { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--bot); color: #fff; font-size: .75rem; line-height: 20px; }
.resultats { display: grid; gap: 8px; margin: 10px 0 14px; }
.resultats:empty { display: none; }
.joueur { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: var(--panel); border: 1px solid rgba(255, 255, 255, .1); }
.joueur .mini { width: 40px; height: 40px; }
.joueur .jn { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.joueur .jn small { color: var(--muted); font-weight: 500; }
.joueur .jd { font-size: .8rem; color: var(--muted); }
.joueur .actions { display: flex; gap: 6px; }
.petit { font: inherit; font-weight: 600; font-size: .88rem; padding: 8px 12px; border-radius: 10px; border: 0; cursor: pointer; background: var(--line); color: var(--court-deep); }
.petit.alt { background: transparent; color: var(--line); border: 2px solid rgba(255, 255, 255, .3); }
.petit:disabled { opacity: .5; }
.lien-partage { display: block; word-break: break-all; font-size: .85rem; color: var(--me); margin: 8px 0 0; }
.locknote { font-size: .85rem; color: var(--me); min-height: 1.2em; margin: 8px 0 0; }
.linkbtn { font: inherit; font-size: .85rem; color: var(--muted); background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0; }
.steps { margin: 6px 0 0; padding-left: 1.2em; font-size: .9rem; line-height: 1.5; }

/* Bandeau d'erreur (diagnostic) */
#erreur { position: fixed; left: 0; right: 0; top: 0; z-index: 100; background: #B3261E; color: #fff; font-size: .9rem; line-height: 1.35; padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; }

/* Présentation d'avant-match, façon boxe (hors échange : les effets sont permis) */
.inter.intro { background: radial-gradient(ellipse at 50% 35%, #173F73, #050E1E 75%); align-items: flex-start; padding-top: calc(env(safe-area-inset-top, 0px) + 12px); }
.fo { width: 100%; max-width: 440px; margin: auto; padding: 4px 0 8px; }
.fo-banner { text-align: center; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); padding: 6px 0 5px; margin-bottom: 14px; }
.fo-stage { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 1.35rem; letter-spacing: .12em; text-transform: uppercase; }
.fo-fmt { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.fo-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 4px; }
.fo-p { text-align: center; min-width: 0; }
.fo-av svg { width: min(100px, 25vw); height: min(100px, 25vw); display: block; margin: 0 auto 8px; border-radius: 50%; }
.fo-p.left .fo-av svg { box-shadow: 0 0 0 4px var(--me), 0 0 28px rgba(244, 197, 66, .45); }
.fo-p.right .fo-av svg { box-shadow: 0 0 0 4px var(--bot), 0 0 28px rgba(232, 87, 74, .45); }
.fo-name { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 1.75rem; line-height: 1; word-break: break-word; text-transform: uppercase; }
.fo-p.left .fo-name { color: var(--me); } .fo-p.right .fo-name { color: var(--bot); }
.fo-sub { font-size: .85rem; color: var(--line); margin-top: 4px; }
.fo-rec { font-size: .78rem; color: var(--muted); margin-top: 3px; line-height: 1.3; }
.fo-vs { position: relative; align-self: center; margin-top: -30px; font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 2.6rem; color: var(--line); text-shadow: 0 0 18px rgba(255, 255, 255, .5); }
.fo-rows { margin-top: 12px; }
.fo-row { display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: center; padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.fo-row:first-child { border-top: 1px solid rgba(255, 255, 255, .12); }
.fo-row span { text-align: center; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.fo-row span:first-child { color: var(--me); } .fo-row span:last-child { color: var(--bot); }
.fo-row span:nth-child(2) { font-family: "Barlow", sans-serif; font-weight: 500; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.fo-row .adv { position: relative; }
.fo-row .txt { font-size: 1rem; line-height: 1.1; }
.fo-row .adv::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -3px; height: 3px; border-radius: 2px; background: currentColor; }
.fo-key { font-size: .9rem; color: var(--line); text-align: center; line-height: 1.4; margin: 10px 0 12px; }
.fo-key b { color: var(--me); }
.fo-end { position: sticky; bottom: 0; padding: 10px 0 calc(env(safe-area-inset-bottom, 0px) + 6px); background: linear-gradient(rgba(5, 14, 30, 0), #050E1E 30%); }

/* La chorégraphie : bandeau, entrée des deux joueurs, VS, puis les stats une à une. */
.intro.show .fo-banner { animation: tomber .45s cubic-bezier(.2, .9, .3, 1) both; }
.intro.show .fo-p.left { animation: entreeG .6s .35s cubic-bezier(.2, 1.1, .3, 1) both; }
.intro.show .fo-p.right { animation: entreeD .6s .6s cubic-bezier(.2, 1.1, .3, 1) both; }
.intro.show .fo-vs { animation: vs .45s 1.1s cubic-bezier(.2, 1.7, .45, 1) both; }
.intro.show .fo-vs::after { content: ""; position: absolute; left: 50%; top: 50%; width: 160px; height: 160px; margin: -80px 0 0 -80px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 65%); animation: flash .6s 1.15s ease-out both; pointer-events: none; }
.intro.show .fo-row { animation: fade .35s calc(1.6s + var(--i) * .28s) both; }
.intro.show .fo-row span:first-child { animation: entreeG .4s calc(1.6s + var(--i) * .28s) cubic-bezier(.2, 1.1, .3, 1) both; }
.intro.show .fo-row span:last-child { animation: entreeD .4s calc(1.6s + var(--i) * .28s) cubic-bezier(.2, 1.1, .3, 1) both; }
.intro.show .fo-row .adv::after { animation: trait .35s calc(1.95s + var(--i) * .28s) ease-out both; }
.intro.show :is(.fo-key, .fo-end) { animation: fade .45s var(--fin, 3.2s) both; }
.intro.vite *, .intro.vite *::after { animation: none !important; }
.intro.vite .fo-vs::after { display: none; }
@keyframes tomber { from { transform: translateY(-30px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes entreeG { from { transform: translateX(-70px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes entreeD { from { transform: translateX(70px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes vs { from { transform: scale(3); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@keyframes flash { 0% { transform: scale(.2); opacity: 0 } 30% { opacity: 1 } 100% { transform: scale(1.6); opacity: 0 } }
@keyframes trait { from { transform: scaleX(0) } to { transform: scaleX(1) } }
@keyframes fade { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

.fmt-lbl { display: block; font-size: .88rem; color: var(--muted); margin: 0 0 6px; }
.seg { display: flex; gap: 8px; margin-bottom: 14px; }
.seg button { flex: 1; font: inherit; font-weight: 600; padding: 11px 6px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .2); background: var(--panel); color: var(--line); cursor: pointer; }
.seg button[aria-pressed=true] { border-color: var(--me); color: var(--me); background: rgba(244, 197, 66, .12); }
.opps { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 8px; }
.opp { font: inherit; color: var(--line); background: var(--panel); border: 2px solid rgba(255, 255, 255, .15); border-radius: 12px; padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.opp[aria-pressed=true] { border-color: var(--me); background: rgba(244, 197, 66, .1); }
.opp .oa svg { width: 40px; height: 40px; display: block; }
.opp .on { font-weight: 600; font-size: .88rem; }
.opp .ol { font-size: .75rem; color: var(--muted); }

/* Tableau du tournoi */
.rnd { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1rem; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.rnd:first-child { margin-top: 0; }
.bm { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 10px; background: var(--panel); margin-bottom: 6px; }
.bm.mine { outline: 2px solid var(--me); }
.bp { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: .9rem; }
.bp.r { justify-content: flex-end; }
.bp .bn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp.win .bn { font-weight: 700; }
.bp.lose { opacity: .45; }
.bp .mini { width: 24px; height: 24px; }
.bs { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.05rem; color: var(--muted); min-width: 2.6rem; text-align: center; }
.tmsg { font-weight: 600; margin: 14px 0 12px; line-height: 1.4; }

/* Panneaux entre deux sets */
.inter { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 10; overflow-y: auto;
  background: rgba(8, 24, 46, .84); padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px calc(env(safe-area-inset-bottom, 0px) + 20px); }
.inter.show { display: flex; }
.panel { width: 100%; max-width: 380px; border: 2px solid var(--line); border-radius: 6px; background: var(--court-deep); padding: 26px 20px 20px; text-align: center; animation: pop .35s ease-out; }
@keyframes pop { 0% { transform: scale(.92); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }
.panel .kick { color: var(--muted); font-size: .95rem; }
.panel .big { font-size: clamp(2.6rem, 13vw, 3.4rem); margin: 6px 0 4px; }
.panel .big.me { color: var(--me); } .panel .big.bot { color: var(--bot); }
.panel .sc { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.8rem; }
.panel .tally { color: var(--muted); font-size: .95rem; margin-top: 4px; }
.panel .com { font-style: italic; color: var(--muted); margin: 12px 0 0; line-height: 1.4; }
.panel .com:empty { display: none; }
.panel .next { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.4rem; margin: 20px 0 14px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .18); }
.panel .next:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .panel, .intro.show *, .intro.show *::after { animation: none !important; }
  .fo-vs::after { display: none; }
  .band { transition: none; }
}

/* Classement PCF, amis et cercles */
.cl-grand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 2px 0 6px; }
.cl-grand b { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 2.6rem; line-height: 1; color: var(--me); font-variant-numeric: tabular-nums; }
.cl-grand span { font-size: .9rem; color: var(--muted); }
.joueur.cliquable { cursor: pointer; }
.joueur .mini svg { width: 40px; height: 40px; display: block; }
.blason-choix { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; }
.blason-apercu svg { width: 64px; height: 70px; display: block; }
.sw.emblemes button { width: 38px; height: 38px; padding: 0; font-size: 1.2rem; border-radius: 10px; }
.cercle-tete { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; }
.cercle-tete h2 { margin: 0 0 4px; word-break: break-word; }
.cercle-tete .hint { margin: 0; }
.blason-grand svg { width: 72px; height: 79px; display: block; }
.classement { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.classement li { display: grid; grid-template-columns: 22px 36px 1fr auto auto; gap: 8px; align-items: center; padding: 8px; border-radius: 12px; background: var(--panel); border: 1px solid rgba(255, 255, 255, .1); }
.classement li.moi { border-color: var(--me); background: rgba(244, 197, 66, .08); }
.classement .mini svg { width: 36px; height: 36px; display: block; }
.classement .jn { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.classement .jn small { color: var(--muted); font-weight: 500; }
.classement .jd { font-size: .8rem; color: var(--muted); }
.cl-rang { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 1.3rem; text-align: center; color: var(--muted); }
.classement li:first-child .cl-rang { color: var(--me); }
.cl-points { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.petit.danger { color: #FF8A80; border-color: rgba(255, 138, 128, .5); }
#endClassement { font-weight: 700; color: var(--me); }
/* Cinq onglets sur un petit écran */
@media (max-width: 420px) {
  .tabs { gap: 4px; }
  .tabs button { padding: 9px 2px; font-size: .86rem; }
}
/* Tournois en ligne */
.trophee { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; font-size: 1.6rem; }
.trophee.grand { width: 72px; height: 72px; font-size: 3rem; }
.joueur.a-jouer { border-color: var(--me); background: rgba(244, 197, 66, .08); }
.actions-col { display: grid; gap: 10px; margin-top: 12px; }
.actions-col .linkbtn { justify-self: center; }

/* Navigation : menu « Jouer », pages et match en plein écran */
.icone { font-size: 1.25rem; line-height: 1; background: none; border: 1px solid rgba(255, 255, 255, .25); border-radius: 10px; padding: 6px 8px; cursor: pointer; }
.retour-hub { margin: 0 0 10px; }
.hub { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; width: 100%; text-align: left; font: inherit; color: var(--line);
  background: var(--court-deep); border: 2px solid rgba(255, 255, 255, .18); border-radius: 14px; padding: 14px; margin-bottom: 10px; cursor: pointer; }
.hub b { display: block; font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 1.35rem; line-height: 1.1; }
.hub small { display: block; color: var(--muted); font-size: .88rem; margin-top: 3px; line-height: 1.3; }
.hub-i { font-size: 2rem; text-align: center; }
.hub.alerte { border-color: var(--me); background: rgba(244, 197, 66, .1); }
.hub:active { transform: scale(.99); }
body.en-match .tabs, body.en-match .retour-hub, body.en-match #btnOptions { display: none; }

/* La Une */
.une-btn { margin-bottom: 8px; }
.une-panel { max-width: 440px; padding: 14px; }
.une-panel img { width: 100%; aspect-ratio: 4 / 5; display: block; border-radius: 4px; background: #F2ECDF; margin-bottom: 10px; }
.une-panel .hint:empty { display: none; }
a.btn { display: block; box-sizing: border-box; text-decoration: none; text-align: center; margin-top: 8px; }

/* La carte de joueur */
.carte-img { width: min(100%, 320px); aspect-ratio: 1080 / 1512; display: block; margin: 4px auto 10px; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .45)); }
.carte-aide { margin: 0 0 10px; font-size: .9rem; }
.carte-aide summary { cursor: pointer; color: var(--muted); }
.carte-aide ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.5; }
#cCarte .hint:empty { display: none; }

/* Partie rapide */
.rapide-choix { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; grid-template-columns: 1fr auto; padding: 12px; margin-bottom: 8px; }
.rapide-choix .jn, .rapide-choix .jd { display: block; }
.rapide-nb { color: var(--me); font-weight: 600; font-size: .85rem; white-space: nowrap; }
.rapide-radar { width: 96px; height: 96px; margin: 8px auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem;
  border: 3px solid var(--me); animation: radar 1.6s ease-out infinite; }
@keyframes radar { 0% { box-shadow: 0 0 0 0 rgba(244, 197, 66, .55); } 100% { box-shadow: 0 0 0 28px rgba(244, 197, 66, 0); } }
@media (prefers-reduced-motion: reduce) { .rapide-radar { animation: none; } }
.rapide-titre { text-align: center; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.4rem; margin: 0 0 6px; }
#rapideAttente .hint { text-align: center; }

/* La poignée de main */
.seg4 button { font-size: .85rem; padding: 10px 2px; }
.pm-panel { max-width: 400px; }
.pm-scene { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 14px 0 10px; position: relative; }
.pm-j { text-align: center; }
.pm-av svg { width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 0 0 4px var(--me); display: block; margin: 0 auto; }
.pm-av.adv svg { box-shadow: 0 0 0 4px var(--bot); }
.pm-style { font-size: .85rem; color: var(--muted); margin-top: 8px; min-height: 1.2em; }
.pm-main { font-size: 3rem; opacity: 0; transform: scale(.4); }
.pm-choix { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pm-choix button { font: inherit; font-size: .85rem; line-height: 1.4; padding: 8px 2px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .2); background: var(--panel); color: var(--line); cursor: pointer; }
.pm-choix button[aria-pressed=true] { border-color: var(--me); color: var(--me); }
.pm-temps { height: 5px; background: rgba(255, 255, 255, .12); border-radius: 3px; margin: 10px 0 0; overflow: hidden; }
.pm-temps div { height: 100%; background: var(--me); transform-origin: left; }
.pm-temps.court div { animation: pm-temps 3s linear forwards; }
@keyframes pm-temps { to { transform: scaleX(0); } }
/* Les joueurs se rapprochent, puis la main selon le style (celui du plus froid des deux). */
.pm-scene.go .pm-j:first-child { animation: pm-vers-d .5s ease-out forwards; }
.pm-scene.go .pm-j:last-child { animation: pm-vers-g .5s ease-out forwards; }
@keyframes pm-vers-d { to { transform: translateX(18px); } }
@keyframes pm-vers-g { to { transform: translateX(-18px); } }
.pm-scene.go .pm-main { animation: pm-apparait .3s .4s ease-out forwards; }
@keyframes pm-apparait { to { opacity: 1; transform: scale(1); } }
.pm-scene.go.franche .pm-main { animation: pm-apparait .3s .4s ease-out forwards, pm-secoue .22s .7s ease-in-out 3 alternate; }
.pm-scene.go.normale .pm-main { animation: pm-apparait .3s .4s ease-out forwards, pm-secoue .3s .7s ease-in-out 2 alternate; }
@keyframes pm-secoue { from { transform: scale(1) translateY(0); } to { transform: scale(1.05) translateY(-14px); } }
.pm-scene.go.legere .pm-main { animation: pm-effleure 1s .4s ease-out forwards; }
@keyframes pm-effleure { 0% { opacity: 0; transform: scale(.4); } 40% { opacity: 1; transform: scale(.75); } 100% { opacity: .5; transform: scale(.7); } }
.pm-scene.go.froide .pm-main { animation: pm-froid 1.3s .4s ease-out forwards; }
@keyframes pm-froid { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; transform: scale(.9); } 60% { opacity: 1; transform: scale(.9) translateX(0); } 100% { opacity: .15; transform: scale(.8) translateX(22px); } }
.pm-scene.go.froide::after { content: "❄️ ❄️ ❄️"; position: absolute; inset: -18px 0 auto; text-align: center; font-size: 1.1rem; letter-spacing: 10px; opacity: 0; animation: pm-givre 1s .8s forwards; }
.pm-scene.go.froide .pm-av svg { transition: filter 1s .6s; filter: saturate(.4) hue-rotate(180deg) brightness(1.1); }
@keyframes pm-givre { to { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .pm-scene.go * , .pm-scene.go::after { animation-duration: .01s !important; animation-delay: 0s !important; } .pm-scene.go .pm-main { opacity: 1; transform: none; } }

/* Signaler un joueur */
.sg-panel { text-align: left; }
.sg-panel .kick { text-align: center; }
.sg-motifs { display: grid; gap: 8px; margin-bottom: 12px; }
.sg-motifs button { font: inherit; text-align: left; padding: 10px 12px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .2); background: var(--panel); color: var(--line); cursor: pointer; }
.sg-motifs button[aria-pressed=true] { border-color: var(--bot); color: #FFB3AB; }
.sg-panel textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 10px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .2); background: var(--panel); color: var(--line); margin-bottom: 8px; resize: vertical; }

/* Passer la présentation */
.fo { position: relative; }
.fo-passer { position: absolute; top: -6px; right: 0; z-index: 2; font: inherit; font-size: .85rem; font-weight: 600; color: var(--line); background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.fo-passer:disabled { opacity: .6; cursor: default; }
.fo-passer.appel { background: var(--me); color: #1A1A1A; border-color: var(--me); }
.fo-banner { margin-top: 30px; }
.fo-attente { text-align: center; font-size: .9rem; font-weight: 600; color: var(--me); margin: 0 0 8px; }

/* Célébrations : le cri après un set gagné (bulle) et après le match (en grand, avec confettis) */
.arena { position: relative; }
.cri-bulle { position: absolute; top: -34px; left: 2%; max-width: 62%; display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 16px;
  background: var(--line); color: #10223D; font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 1.25rem; line-height: 1.05; z-index: 2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35); animation: cri-pop .35s cubic-bezier(.2, 1.6, .4, 1) both; pointer-events: none; }
.cri-bulle::after { content: ""; position: absolute; bottom: -7px; left: 28px; border: 8px solid transparent; border-top-color: var(--line); border-bottom: 0; }
.cri-bulle.adv { left: auto; right: 2%; flex-direction: row-reverse; padding: 5px 6px 5px 12px; }
.cri-bulle.adv::after { left: auto; right: 28px; }
.cri-bulle.fort { font-size: 1.6rem; background: var(--me); }
.cri-bulle.fort::after { border-top-color: var(--me); }
.cri-bulle.fort .cri-texte { text-transform: uppercase; }
.cri-poing svg { width: 34px; height: 34px; display: block; border-radius: 50%; animation: poing .45s .1s ease-in-out 2 alternate both; }
.cri-texte:empty { display: none; }
.celebration { position: fixed; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(ellipse at 50% 45%, rgba(5, 14, 30, .55), rgba(5, 14, 30, .88)); pointer-events: none; overflow: hidden; }
.celebration[hidden] { display: none; }
.cel-av svg { width: min(150px, 38vw); height: min(150px, 38vw); display: block; border-radius: 50%; box-shadow: 0 0 0 5px var(--c, var(--me)), 0 0 40px rgba(255, 255, 255, .25);
  animation: cri-pop .45s cubic-bezier(.2, 1.6, .4, 1) both, poing .4s .5s ease-in-out 3 alternate; }
.cel-cri { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: clamp(2.6rem, 13vw, 4.6rem); line-height: 1; text-align: center; padding: 0 16px;
  color: var(--c, var(--me)); text-shadow: 0 4px 24px rgba(0, 0, 0, .6); animation: cri-grand .55s .15s cubic-bezier(.2, 1.5, .4, 1) both; }
.celebration.fort .cel-cri { text-transform: uppercase; font-size: clamp(3rem, 15vw, 5.4rem); }
.cel-cri:empty { display: none; }
.cel-confettis { position: absolute; inset: 0; }
.cel-confettis i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: confetti var(--d, 2.4s) var(--r, 0s) linear both; }
@keyframes cri-pop { from { transform: scale(.3); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@keyframes cri-grand { from { transform: scale(2.4); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@keyframes poing { to { transform: translateY(-6px) scale(1.08) } }
@keyframes confetti { to { transform: translate(var(--x, 0), 110vh) rotate(var(--t, 540deg)); } }
@media (prefers-reduced-motion: reduce) {
  .cri-bulle, .cri-poing svg, .cel-av svg, .cel-cri { animation: none !important; }
  .cel-confettis { display: none; }
}

/* Palmarès par familles, et bandeau « Nouveau trophée » */
.badges .famille { grid-column: 1 / -1; margin: 8px 0 -2px; font-size: 1rem; font-family: "Barlow Condensed", sans-serif; font-weight: 700; }
.badges .famille:first-child { margin-top: 0; }
.badges .famille small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 80px); z-index: 20; max-width: 440px; margin: 0 auto;
  background: var(--me); color: #1A1A1A; font-weight: 600; line-height: 1.35; padding: 12px 14px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); cursor: pointer; }
.toast[hidden] { display: none; }

/* Aperçu de l'avatar, toujours visible pendant qu'on fait défiler les choix */
.av-apercu { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 6px); z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin: 14px -16px 0; padding: 8px 0 6px; background: var(--court-deep); box-shadow: 0 8px 10px -8px rgba(0, 0, 0, .5); }
.av-apercu svg { width: 84px; height: 84px; display: block; border-radius: 50%; }
.av-apercu small { font-size: .72rem; color: var(--muted); }
