/* Composants « game UI » — extraits littéralement de docs/maquettes.html.
   Les maquettes font foi (cadrage annexe B) : les valeurs ci-dessous en sont
   reprises telles quelles. Toute divergence est un bug, pas un choix. */

.dots {
  background-image: radial-gradient(rgba(0,0,0,.5) 1.3px, transparent 1.4px);
  background-size: 9px 9px;
}

/* ═══════ HUD haut : logo 3D ═══════ */
.hud { display: flex; align-items: center; gap: 20px; padding: 20px 26px 4px; position: relative; z-index: 5; }
.hud .tagline { font-family: var(--mark); color: var(--yel); transform: rotate(-3deg); font-size: 15px; }
.player-chip {
  margin-left: auto; background: var(--blk); border: 3px solid var(--wht); border-radius: 40px;
  padding: 7px 18px 7px 10px; display: flex; align-items: center; gap: 10px;
  transform: rotate(1.2deg); box-shadow: 4px 4px 0 rgba(0,0,0,.55);
  color: var(--wht); text-decoration: none;
}
.player-chip .ava {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  background: conic-gradient(var(--blu), var(--amb), var(--blu)); border: 2.5px solid var(--wht);
}
.player-chip b { font-weight: 900; font-style: italic; letter-spacing: .02em; }
.player-chip .elo { font-family: var(--bang); font-size: 21px; color: var(--yel); letter-spacing: .05em; }

/* ═══════ MENU latéral façon jeu ═══════ */
.gamemenu { position: fixed; left: 0; top: 120px; z-index: 40; display: flex; flex-direction: column; gap: 10px; }
.gbtn {
  appearance: none; border: none; cursor: pointer; position: relative; text-decoration: none;
  font-family: var(--bang); font-size: 21px; letter-spacing: .06em; color: var(--wht);
  background: var(--blk); padding: 10px 26px 9px 20px; text-align: left; min-width: 172px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
  border-left: 6px solid var(--blu); transform: skewX(-6deg) translateX(-8px);
  transition: transform .15s ease, background .15s ease;
  text-shadow: 2px 2px 0 rgba(0,0,0,.8);
}
.gbtn i { font-style: normal; font-family: var(--rub); font-weight: 900; font-size: 11px; color: var(--blu2); margin-right: 9px; vertical-align: 3px; }
.gbtn:hover { transform: skewX(-6deg) translateX(2px); }
.gbtn.on {
  background: var(--wht); color: var(--blk); border-left-color: var(--amb); text-shadow: none;
  transform: skewX(-6deg) translateX(10px) scale(1.06); box-shadow: 6px 6px 0 rgba(0,0,0,.5);
}
.gbtn.on i { color: var(--red); }

/* ═══════ zone écran ═══════ */
.stage { max-width: 1010px; margin: 0 auto; padding: 16px 24px 90px 200px; position: relative; }
.screen { animation: smash .4s cubic-bezier(.2,1.4,.4,1); }
@keyframes smash { 0% { transform: translateX(60px) skewX(-4deg); opacity: 0 } 100% { transform: none; opacity: 1 } }
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none }
  .float, .burst, .quest, .tagalert { animation: none !important }
}

/* cartes cartoon 3D */
.card {
  background: var(--wht); color: var(--blk); border: 4px solid var(--blk); border-radius: 16px;
  box-shadow: 8px 8px 0 var(--blk), 8px 8px 0 3px rgba(255,255,255,.08); position: relative;
}
.card.dark { background: var(--blk); color: var(--wht); border-color: var(--wht); box-shadow: 8px 8px 0 rgba(0,0,0,.6); }
.tilt-l { transform: rotate(-1.4deg) }
.tilt-r { transform: rotate(1.2deg) }
.float { animation: float 5s ease-in-out infinite }
@keyframes float { 50% { transform: translateY(-6px) rotate(-1.4deg) } }

/* bandeau titre d'écran */
.scr-title {
  display: inline-block; font-family: var(--bang); font-size: 40px; letter-spacing: .05em; color: var(--blk);
  background: var(--wht); border: 4px solid var(--blk); padding: 4px 26px 2px; transform: rotate(-2deg) skewX(-4deg);
  box-shadow: 7px 7px 0 var(--blk); margin: 8px 0 4px; position: relative; z-index: 2;
}
.scr-title.blu { background: var(--blu); color: var(--wht); -webkit-text-stroke: 1.2px var(--blk); }
.scr-sub { font-weight: 700; font-style: italic; color: var(--blu2); margin: 10px 0 20px; transform: rotate(-.5deg); }

/* burst manga */
.burst {
  position: absolute; display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--bang); color: var(--blk); background: var(--yel); border: 3.5px solid var(--blk);
  clip-path: polygon(50% 0%,60% 12%,76% 5%,78% 21%,95% 20%,88% 35%,100% 44%,88% 55%,97% 70%,80% 71%,81% 88%,65% 81%,55% 97%,45% 82%,29% 92%,28% 74%,10% 76%,18% 60%,2% 50%,17% 39%,8% 23%,26% 24%,24% 7%,40% 14%);
  animation: burst 3s ease-in-out infinite;
}
@keyframes burst { 50% { transform: rotate(6deg) scale(1.06) } }
.speed {
  position: absolute; inset: -40px; pointer-events: none; opacity: .5;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.10) 0 2.5deg, transparent 2.5deg 11deg);
  -webkit-mask-image: radial-gradient(circle, transparent 34%, black 60%, transparent 74%);
          mask-image: radial-gradient(circle, transparent 34%, black 60%, transparent 74%);
}

/* jauges de combat */
.gauge { margin: 10px 0 2px }
.gauge .lab { display: flex; justify-content: space-between; font-weight: 900; font-style: italic; font-size: 13px; letter-spacing: .03em; }
.gauge .bar { height: 20px; border: 3px solid var(--blk); border-radius: 12px; background: #E8E2D0; overflow: hidden; box-shadow: inset 0 3px 0 rgba(0,0,0,.12); }
.gauge .fill {
  height: 100%; border-right: 3px solid var(--blk); border-radius: 8px 0 0 8px;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,.3) 0 8px, transparent 8px 16px), var(--blu);
}
.gauge.warn .fill { background: repeating-linear-gradient(-45deg, rgba(255,255,255,.3) 0 8px, transparent 8px 16px), var(--red); }
.gauge.gold .fill { background: repeating-linear-gradient(-45deg, rgba(255,255,255,.35) 0 8px, transparent 8px 16px), var(--amb); }
.tagalert {
  display: inline-block; font-family: var(--bang); font-size: 14px; background: var(--red); color: #fff;
  border: 2.5px solid var(--blk); padding: 1px 9px; transform: rotate(-3deg); letter-spacing: .06em;
  box-shadow: 3px 3px 0 var(--blk); animation: blink 1.1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: .45 } }

/* combo W/L */
.combo { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.combo i {
  width: 30px; height: 30px; border: 3px solid var(--blk); border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--bang); font-size: 18px; font-style: normal;
  transform: rotate(-4deg); box-shadow: 3px 3px 0 var(--blk);
}
.combo i:nth-child(2n) { transform: rotate(3deg) }
.combo i.w { background: var(--blu); color: #fff }
.combo i.l { background: var(--wht); color: var(--amb); border-color: var(--amb); box-shadow: 3px 3px 0 rgba(0,0,0,.35); }

/* tier list */
.tier {
  display: grid; grid-template-columns: 66px 1fr; border: 4px solid var(--blk); border-radius: 14px;
  overflow: hidden; background: var(--wht); color: var(--blk); box-shadow: 8px 8px 0 var(--blk);
}
.tier .t {
  font-family: var(--bang); font-size: 34px; display: flex; align-items: center; justify-content: center;
  border-bottom: 3.5px solid var(--blk); color: #fff; -webkit-text-stroke: 1.5px var(--blk);
}
.tier .row { border-bottom: 3.5px solid var(--blk); padding: 8px 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tier .t:last-of-type, .tier .row:last-of-type { border-bottom: none }
.tS { background: var(--amb) }
.tA { background: var(--blu) }
.tC { background: #9aa3b8 }
.mapchip { font-weight: 900; font-style: italic; font-size: 16px }
.mapstat { font-weight: 700; font-size: 12.5px; color: #5c5646; background: var(--cream); border: 2.5px solid var(--blk); border-radius: 20px; padding: 2px 10px; }
.banned {
  position: relative; display: inline-block; font-family: var(--bang); color: var(--red);
  border: 3px solid var(--red); border-radius: 6px; padding: 0 8px; transform: rotate(-8deg);
  letter-spacing: .1em; font-size: 15px; background: rgba(255,255,255,.7);
}

/* battle log */
.blog { display: flex; flex-direction: column; gap: 14px }
.brow {
  display: flex; align-items: center; gap: 16px; background: var(--wht); color: var(--blk);
  border: 4px solid var(--blk); border-radius: 14px; padding: 10px 16px;
  box-shadow: 6px 6px 0 var(--blk); transform: rotate(-.4deg); text-decoration: none;
}
.brow:nth-child(2n) { transform: rotate(.5deg) }
.flag {
  font-family: var(--bang); font-size: 19px; letter-spacing: .04em; color: #fff; background: var(--blu);
  border: 3px solid var(--blk); padding: 3px 14px;
  clip-path: polygon(0 0,100% 0,calc(100% - 10px) 50%,100% 100%,0 100%);
  transform: rotate(-3deg); min-width: 104px; text-align: center;
}
.flag.l { background: var(--amb); color: var(--blk) }
.brow .map { font-weight: 900; font-style: italic; font-size: 19px; min-width: 92px }
.brow .sc { font-family: var(--bang); font-size: 23px; letter-spacing: .05em; min-width: 76px }
.brow .kda { font-weight: 700; font-size: 13px; color: #5c5646; min-width: 88px }
.brow .rt { font-weight: 900; min-width: 60px }
.brow .elo { font-family: var(--bang); font-size: 19px }
.elo.up { color: var(--blu) }
.elo.dn { color: var(--amb) }
.done {
  font-family: var(--bang); font-size: 13px; background: var(--grn); color: var(--blk);
  border: 2.5px solid var(--blk); border-radius: 8px; padding: 2px 9px;
  transform: rotate(2deg); box-shadow: 2px 2px 0 var(--blk);
}
.quest {
  font-family: var(--bang); font-size: 14px; background: var(--yel); border: 3px solid var(--blk);
  border-radius: 10px; padding: 3px 11px; transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--blk);
  cursor: pointer; animation: bounce 1.6s ease-in-out infinite; color: var(--blk); text-decoration: none;
}
.quest b { color: var(--red); font-family: var(--bang) }
@keyframes bounce { 50% { transform: rotate(-2deg) translateY(-4px) } }
.bigbtn {
  display: inline-block; font-family: var(--bang); font-size: 25px; letter-spacing: .05em; color: var(--blk);
  background: linear-gradient(180deg, var(--yel), var(--amb)); border: 4px solid var(--blk); border-radius: 16px;
  padding: 12px 30px; box-shadow: 0 8px 0 var(--blk); cursor: pointer; transform: rotate(-1deg);
  transition: all .12s; text-decoration: none;
}
.bigbtn:hover { transform: rotate(-1deg) translateY(3px); box-shadow: 0 5px 0 var(--blk) }
.bigbtn.small {
  font-size: 17px; padding: 7px 16px; border-width: 3.5px; border-radius: 12px;
  box-shadow: 0 5px 0 var(--blk);
}
.bigbtn.small:hover { transform: rotate(-1deg) translateY(2px); box-shadow: 0 3px 0 var(--blk) }

/* bandeau d'action du battle log, au-dessus de la liste */
.blogbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 0 0 20px;
}
.blogbar p {
  flex: 1 1 260px; font-weight: 700; font-size: 12px; color: #7C86AD;
  line-height: 1.45; margin: 0;
}

/* écran résultat */
.victory { position: relative; text-align: center; margin: 2px 0 8px }
.victory .v {
  font-family: var(--bang); font-size: 88px; letter-spacing: .05em; display: inline-block;
  transform: rotate(-3deg); color: var(--blu2);
  text-shadow: 3px 3px 0 var(--blk), 6px 6px 0 var(--blk), 9px 9px 0 var(--blu), 12px 12px 0 var(--blk), 0 0 44px rgba(61,123,255,.6);
}
.victory .v.defeat {
  color: var(--amb2);
  text-shadow: 3px 3px 0 var(--blk), 6px 6px 0 var(--blk), 9px 9px 0 var(--amb), 12px 12px 0 var(--blk), 0 0 44px rgba(255,174,46,.55);
}
.victory .sc { font-family: var(--bang); font-size: 44px; color: var(--wht); text-shadow: 3px 3px 0 var(--blk); display: block; margin-top: -8px; }
.sb2 { width: 100%; border-collapse: separate; border-spacing: 0 8px }
.sb2 td {
  background: var(--wht); color: var(--blk); border-top: 3.5px solid var(--blk);
  border-bottom: 3.5px solid var(--blk); padding: 7px 10px; font-weight: 700; font-size: 13.5px;
}
.sb2 td:first-child { border-left: 3.5px solid var(--blk); border-radius: 12px 0 0 12px; font-style: italic; font-weight: 900; font-size: 15px; }
.sb2 td:last-child { border-right: 3.5px solid var(--blk); border-radius: 0 12px 12px 0 }
.sb2 tr.me td { background: var(--yel) }
.sb2 tr.head td { background: transparent; border: none; color: var(--blu2); font-family: var(--bang); font-size: 13px; letter-spacing: .1em; padding: 0 10px; }
.sb2 .r-hi { color: var(--blu); font-weight: 900 }
.sb2 .r-lo { color: #B8741A; font-weight: 900 }
.mvp { font-family: var(--bang); font-size: 12px; background: var(--amb); border: 2.5px solid var(--blk); border-radius: 7px; padding: 1px 7px; margin-left: 7px; transform: rotate(-3deg); display: inline-block; }
.you { font-family: var(--bang); font-size: 12px; background: var(--blu); color: #fff; border: 2.5px solid var(--blk); border-radius: 7px; padding: 1px 7px; margin-left: 7px; display: inline-block; transform: rotate(2deg); }

/* annotations manuscrites du coach */
.marker { font-family: var(--mark); color: var(--yel); }
.marker.red { color: var(--red) }

/* filtres globaux, repliés par défaut */
.filterbox { margin: 0 0 22px }
.filterbox > summary {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  cursor: pointer; list-style: none; user-select: none;
}
.filterbox > summary::-webkit-details-marker { display: none }
.filter-toggle {
  font-family: var(--rub); font-weight: 900; font-style: italic; font-size: 12.5px;
  letter-spacing: .05em; background: var(--yel); color: var(--blk);
  border: 3px solid var(--blk); box-shadow: 3px 3px 0 var(--blk);
  padding: 5px 13px; transform: skewX(-6deg); white-space: nowrap;
}
.filter-toggle::after { content: ' ▾' }
.filterbox[open] .filter-toggle::after { content: ' ▴' }
.filterbox > summary:hover .filter-toggle { transform: skewX(-6deg) translate(-1px, -1px) }
.filter-digest {
  font-family: var(--bang); font-size: 15px; letter-spacing: .06em; color: var(--blu2);
}
.filterbox[open] .filters { margin-top: 14px }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 22px; }
.filters select, .filters input {
  font-family: var(--rub); font-weight: 900; font-style: italic; font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .04em;
  background: var(--blk); color: var(--wht); border: 3px solid var(--wht);
  padding: 6px 12px; transform: skewX(-6deg); cursor: pointer;
}
.filters label { font-family: var(--bang); font-size: 14px; color: var(--blu2); letter-spacing: .06em; }

/* grille clutch */
.clutchgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px }
.clutchcell {
  background: var(--wht); color: var(--blk); border: 3.5px solid var(--blk); border-radius: 12px;
  padding: 8px 6px; text-align: center; box-shadow: 5px 5px 0 var(--blk);
}
.clutchcell:nth-child(2n) { transform: rotate(1.2deg) }
.clutchcell:nth-child(2n+1) { transform: rotate(-1deg) }
.clutchcell .sit { font-family: var(--bang); font-size: 20px; letter-spacing: .05em }
.clutchcell .wl { font-weight: 900; font-style: italic; font-size: 15px }
.clutchcell .pct { font-family: var(--bang); font-size: 22px; color: var(--blu) }
.clutchcell.empty { opacity: .45 }
.clutchcell.empty .pct { color: #5c5646 }

/* statistiques en vis-à-vis */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px }
.statbox { background: var(--blk); color: var(--wht); border: 3.5px solid var(--wht); border-radius: 12px; padding: 10px 14px; transform: rotate(-.5deg) }
.statbox:nth-child(2n) { transform: rotate(.7deg) }
.statbox .k { font-family: var(--bang); font-size: 14px; letter-spacing: .06em; color: var(--blu2) }
.statbox .v { font-family: var(--bang); font-size: 30px; letter-spacing: .03em }
.statbox .n { font-weight: 700; font-size: 11.5px; color: #8a93b8 }

/* tableau des coéquipiers */
.mates { width: 100%; border-collapse: separate; border-spacing: 0 8px }
.mates td, .mates th { background: var(--wht); color: var(--blk); border-top: 3.5px solid var(--blk); border-bottom: 3.5px solid var(--blk); padding: 7px 10px; font-weight: 700; font-size: 13.5px; text-align: left }
.mates td:first-child, .mates th:first-child { border-left: 3.5px solid var(--blk); border-radius: 12px 0 0 12px; font-style: italic; font-weight: 900 }
.mates td:last-child, .mates th:last-child { border-right: 3.5px solid var(--blk); border-radius: 0 12px 12px 0 }
.mates tr.head th { background: transparent; border: none; color: var(--blu2); font-family: var(--bang); font-size: 13px; letter-spacing: .1em; padding: 0 10px }
.delta-up { color: var(--blu); font-weight: 900 }
.delta-dn { color: #B8741A; font-weight: 900 }

/* tutoriel en BD, et page d'appairage */
.strip { display: grid; grid-template-columns: 1fr 1fr; gap: 16px }
.case {
  background: var(--wht); color: var(--blk); border: 4px solid var(--blk); border-radius: 6px;
  padding: 12px 14px 14px; box-shadow: 6px 6px 0 var(--blk); position: relative; min-height: 150px;
}
.case .no {
  position: absolute; top: -16px; left: -14px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--blu); color: #fff; border: 3.5px solid var(--blk);
  font-family: var(--bang); font-size: 20px; display: flex; align-items: center;
  justify-content: center; transform: rotate(-6deg); box-shadow: 3px 3px 0 var(--blk);
}
.case p { font-weight: 700; font-size: 13.5px; line-height: 1.4; margin-top: 6px }
.case .fx { font-family: var(--bang); color: var(--red); font-size: 17px; letter-spacing: .04em }
.tokenchip {
  font-family: var(--rub); font-weight: 700; font-size: 11.5px; background: var(--blk);
  color: var(--grn); border-radius: 8px; padding: 3px 8px; display: inline-block; margin-top: 4px;
}
.hint-note { font-weight: 500; font-size: 11.5px; color: #5c5646; margin-top: 6px }
.case code, .hint-note code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px;
  background: rgba(22,19,31,.08); padding: 1px 5px; border-radius: 4px;
}

/* révélation de la clé d'appairage */
.token-reveal { display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
.token-reveal code {
  flex: 1 1 320px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px;
  background: var(--blk); color: var(--grn); border: 3px solid var(--blk);
  padding: 9px 12px; word-break: break-all;
}
.copy-btn, .revoke-btn {
  appearance: none; cursor: pointer; font-family: var(--rub); font-weight: 900;
  font-style: italic; font-size: 12px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--blk); background: var(--yel); border: 3px solid var(--blk);
  box-shadow: 3px 3px 0 var(--blk); padding: 7px 14px; transform: skewX(-5deg);
}
.revoke-btn { background: var(--wht); color: #B3122F }
.copy-btn:hover, .revoke-btn:hover { transform: skewX(-5deg) translate(-1px, -1px) }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace }

.filter-note { font-weight: 700; font-style: italic; font-size: 11.5px; color: var(--amb2) }
.filter-note a { color: var(--yel) }
.empty-note { font-weight: 700; font-size: 13px; color: #7C86AD; margin-top: 10px }
.note { color: #7C86AD; font-size: 12px; font-weight: 500; margin-top: 26px; max-width: 70ch }

/* ── Écran LE COACH — planches de BD (annexe B) ───────────────────────── */
.coachbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 0 0 22px }
.coach-flash {
  font-weight: 900; font-style: italic; font-size: 13px; color: var(--amb2);
  background: rgba(255, 174, 46, .12); border-left: 4px solid var(--amb);
  padding: 9px 14px; margin: 0 0 18px;
}
.coach-flash.ko { color: #FF9AAB; background: rgba(255, 61, 90, .12); border-left-color: var(--red) }

.toasts { margin-bottom: 18px }
.toast {
  display: inline-block; font-family: var(--bang); font-size: 15px; letter-spacing: .04em;
  background: var(--blk); color: var(--wht); border: 3px solid var(--wht); border-radius: 12px;
  padding: 5px 14px; margin: 0 8px 10px 0; transform: rotate(-1deg);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .5);
}
.toast b { color: var(--grn) }
.toast u { text-decoration: none; color: var(--red) }

/* La planche : le coach d'un côté, sa bulle de l'autre. Les cases sont
   empilées et une seule porte `.on` — on feuillette, on ne défile pas. */
.panelbook { position: relative }
.plate { display: none; align-items: flex-end; gap: 0; min-height: 300px }
.plate.on { display: flex; animation: panel-in .28s ease-out both }
.plate.flip { flex-direction: row-reverse }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(12px) }
  to { opacity: 1; transform: translateY(0) }
}

.coach-art {
  width: 260px; flex: none; align-self: flex-end;
  filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, .45));
  /* Les illustrations sont détourées sur fond blanc : un léger débord sous la
     bulle donne la profondeur d'une case de BD sans découpe supplémentaire. */
  margin-bottom: -6px;
}

.bubble {
  position: relative; flex: 1 1 auto; align-self: center;
  background: var(--wht); color: var(--blk);
  border: 4px solid var(--blk); border-radius: 22px;
  box-shadow: 10px 10px 0 var(--blk);
  padding: 22px 26px 20px; margin: 0 0 26px -26px;
}
.plate.flip .bubble { margin: 0 -26px 26px 0 }

/* La queue de la bulle, en deux triangles : le noir porte le contour, le crème
   le remplissage. Pas d'image, pas de SVG — deux pseudo-éléments suffisent. */
.bubble::before, .bubble::after {
  content: ""; position: absolute; bottom: 34px; width: 0; height: 0;
  border-style: solid;
}
.bubble::before {
  left: -30px; border-width: 16px 30px 16px 0;
  border-color: transparent var(--blk) transparent transparent;
}
.bubble::after {
  left: -21px; border-width: 11px 22px 11px 0;
  border-color: transparent var(--wht) transparent transparent;
}
.plate.flip .bubble::before {
  left: auto; right: -30px; border-width: 16px 0 16px 30px;
  border-color: transparent transparent transparent var(--blk);
}
.plate.flip .bubble::after {
  left: auto; right: -21px; border-width: 11px 0 11px 22px;
  border-color: transparent transparent transparent var(--wht);
}

/* Bleu pour ce qui va bien, ambre pour ce qui coûte des matchs. Jamais de
   vert ni de rouge pour un résultat (annexe B). */
.plate.good .bubble { border-color: var(--blu); box-shadow: 10px 10px 0 var(--blk) }
.plate.good .bubble::before { border-right-color: var(--blu) }
.plate.good.flip .bubble::before { border-left-color: var(--blu) }
.plate.bad .bubble { border-color: var(--amb) }
.plate.bad .bubble::before { border-right-color: var(--amb) }
.plate.bad.flip .bubble::before { border-left-color: var(--amb) }

.bubble .who {
  position: absolute; top: -19px; left: 24px;
  font-family: var(--bang); font-size: 17px; letter-spacing: .05em;
  background: var(--blu); color: #fff; border: 3.5px solid var(--blk);
  padding: 1px 14px; transform: rotate(-2deg); box-shadow: 4px 4px 0 var(--blk);
}
.plate.bad .bubble .who { background: var(--amb); color: var(--blk) }
.bubble h3 {
  font-family: var(--bang); font-size: 27px; letter-spacing: .04em; line-height: 1.05;
  color: var(--blk); transform: rotate(-1deg); margin: 4px 0 10px;
}
.bubble p { font-weight: 500; font-size: 15.5px; line-height: 1.55; margin-bottom: 8px }
.bubble p:last-child { margin-bottom: 0 }
.bubble ul { margin: 0 0 8px 20px }
.bubble li { font-weight: 500; font-size: 15px; line-height: 1.5; margin-bottom: 4px }
.bubble b { font-weight: 900 }
.bubble .hl { background: var(--yel); padding: 0 4px; border-radius: 4px; font-weight: 900 }
.bubble code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px;
  background: rgba(22, 19, 31, .08); padding: 1px 5px; border-radius: 4px;
}
.coach-wait { font-size: 12.5px !important; color: #5c5646 }

/* Feuilletage */
.pager { display: flex; align-items: center; gap: 16px; margin-top: 6px }
.pagebtn {
  appearance: none; cursor: pointer; font-family: var(--bang); font-size: 19px;
  letter-spacing: .05em; color: var(--blk);
  background: linear-gradient(180deg, var(--yel), var(--amb));
  border: 3.5px solid var(--blk); border-radius: 12px; padding: 5px 16px;
  box-shadow: 0 5px 0 var(--blk); transition: all .1s;
}
.pagebtn:hover:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--blk) }
.pagebtn:disabled { opacity: .35; cursor: default; box-shadow: 0 5px 0 var(--blk) }
.pagedots { display: flex; gap: 9px }
.pagedots i {
  width: 13px; height: 13px; border-radius: 50%; cursor: pointer;
  background: transparent; border: 3px solid var(--wht); transition: background .15s;
}
.pagedots i.on { background: var(--yel); border-color: var(--yel) }

.questgrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px; margin-top: 34px;
}
.questcard {
  background: var(--cream); color: var(--blk); border: 4px solid var(--blk); border-radius: 14px;
  padding: 12px 18px 14px; box-shadow: 7px 7px 0 var(--blk); transform: rotate(.8deg);
}
.questcard:nth-child(2n) { transform: rotate(-.8deg) }
.questcard h4 { font-family: var(--bang); font-size: 19px; letter-spacing: .04em; color: var(--red) }
.questcard:nth-child(2n) h4 { color: var(--blu) }
.questcard .obj { font-weight: 700; font-size: 14px; margin-top: 4px; line-height: 1.45 }
.questcard .why { font-weight: 500; font-size: 12.5px; color: #5c5646 }
.questcard .prog { font-family: var(--bang); color: var(--blu); font-size: 16px }

@media (max-width: 980px) {
  .plate, .plate.flip { flex-direction: column; align-items: center }
  .coach-art { width: 190px; margin-bottom: -18px }
  .bubble, .plate.flip .bubble { margin: 0; padding-top: 28px }
  .bubble::before, .bubble::after { display: none }
}

/* match de placement dans le battle log */
.placement {
  font-family: var(--bang); font-size: 12px; letter-spacing: .06em;
  background: var(--blu2); color: var(--blk);
  border: 2.5px solid var(--blk); border-radius: 7px;
  padding: 1px 7px; transform: rotate(-2deg); display: inline-block; flex: none;
}

/* carte d'identité du profil */
.idcard {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 18px 22px; transform: rotate(-.4deg);
}
.idcard-ava {
  width: 78px; height: 78px; flex: none; border-radius: 50%;
  border: 4px solid var(--blk); object-fit: cover;
  background: linear-gradient(140deg, var(--blu), var(--amb));
  box-shadow: 4px 4px 0 var(--blk);
}
/* Classe explicite et non `.idcard > div` : l'avatar de repli est lui aussi
   un div, et se retrouvait étiré en ellipse par le `flex-basis`. */
.idcard-body { flex: 1 1 240px }
.idcard-name {
  font-family: var(--bang); font-size: 40px; line-height: 1;
  letter-spacing: .03em; color: var(--blk); text-shadow: 3px 3px 0 var(--amb);
}
.idcard-meta { font-weight: 700; font-size: 12px; color: #5c5646; margin-top: 5px }
.idcard-meta.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px }
.bigbtn.logout { flex: none; background: linear-gradient(180deg, var(--wht), #E8E2D0) }

/* stats verrouillées tant que l'extension n'a rien remonté */
.lockbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--cream); color: var(--blk);
  border: 4px solid var(--blk); border-left: 12px solid var(--yel); border-radius: 8px;
  box-shadow: 7px 7px 0 var(--blk); padding: 13px 18px;
  margin: 0 0 26px; transform: rotate(-.5deg);
}
.lockbar .lock { font-size: 30px; line-height: 1; flex: none }
.lockbar > div { flex: 1 1 320px }
.lockbar b {
  font-family: var(--bang); font-size: 21px; letter-spacing: .06em; display: block;
}
.lockbar p { font-weight: 700; font-size: 13px; line-height: 1.4; margin-top: 3px }
.cta.small { font-size: 13px; padding: 8px 16px; flex: none }

.gauge.locked .lab { opacity: .62 }
.gauge.locked .bar {
  background: repeating-linear-gradient(-45deg, #DED8C6 0 7px, #E8E2D0 7px 14px);
}
.lockmark { font-size: 13px }
.bigLock {
  font-family: var(--bang); font-size: 58px; line-height: 1; color: #5c5646;
  display: flex; align-items: baseline; gap: 12px;
}
.bigLock span {
  font-family: var(--rub); font-weight: 900; font-style: italic; font-size: 14px;
  letter-spacing: .03em; color: #5c5646;
}

/* encart de synchronisation, ancré en bas à gauche sur tous les écrans */
.syncdock {
  position: fixed; left: 18px; bottom: 18px; z-index: 60;
  display: flex; align-items: center; gap: 11px;
  max-width: 320px; padding: 10px 15px 11px;
  background: var(--blk); color: var(--wht);
  border: 3.5px solid var(--yel); border-radius: 12px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .55); transform: rotate(-1.2deg);
  animation: syncdock-in .35s ease-out both;
}
/* Rien à montrer, mais l'élément reste dans le DOM : c'est lui qui continue
   d'interroger le serveur, au ralenti, en attendant le prochain rattrapage. */
.syncdock.idle { display: none }
.syncdock-text { display: flex; flex-direction: column; line-height: 1.25 }
.syncdock b {
  font-family: var(--bang); font-size: 15px; letter-spacing: .07em; color: var(--yel);
}
.syncdock span { font-weight: 700; font-size: 11.5px; color: #C9CEE6 }
.syncdock .spark {
  flex: none; width: 15px; height: 15px; border-radius: 50%;
  background: var(--yel); box-shadow: 0 0 0 0 rgba(255, 224, 77, .7);
  animation: syncdock-pulse 1.4s ease-out infinite;
}
@keyframes syncdock-in {
  from { opacity: 0; transform: rotate(-1.2deg) translateY(14px) }
  to { opacity: 1; transform: rotate(-1.2deg) translateY(0) }
}
@keyframes syncdock-pulse {
  70% { box-shadow: 0 0 0 11px rgba(255, 224, 77, 0) }
  100% { box-shadow: 0 0 0 0 rgba(255, 224, 77, 0) }
}
@media (prefers-reduced-motion: reduce) {
  .syncdock, .syncdock .spark { animation: none }
}

@media (max-width: 880px) {
  .gamemenu { position: static; flex-direction: row; flex-wrap: wrap; padding: 8px 16px; top: auto }
  .gbtn { min-width: 0; font-size: 17px; padding: 8px 18px 7px 14px; transform: skewX(-6deg) }
  .gbtn.on { transform: skewX(-6deg) scale(1.05) }
  .stage { padding: 12px 16px 80px }
  .logo3d { font-size: 34px }
  .victory .v { font-size: 56px }
  .clutchgrid { grid-template-columns: repeat(2, 1fr) }
}
