/* ===== Polices (locales, fonctionnent hors ligne) — Bebas/Barlow réservées aux cartes ===== */
@font-face { font-family: "Bebas Neue"; src: url(../fonts/bebas-neue-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(../fonts/barlow-condensed-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(../fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(../fonts/barlow-condensed-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }

/* ===== Thème neutre : clair par défaut, sombre si le téléphone est en mode sombre ===== */
:root {
  color-scheme: light;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --bg: #ffffff;
  --surface: #ffffff;
  --fill: rgba(0, 0, 0, .045);
  --fill-2: rgba(0, 0, 0, .08);
  --line: rgba(0, 0, 0, .08);
  --text: #18181b;
  --muted: #71717a;
  --ink: #18181b;
  --ink-text: #ffffff;
  --accent: #c8102e;
  --accent-text: #ffffff;
  --accent-soft: rgba(200, 16, 46, .08);
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, .1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .08);
  --amber: #b45309;
  --amber-soft: rgba(217, 119, 6, .12);
  --blue: #2b5fe0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .05);
  --overlay: rgba(9, 9, 11, .45);
  /* couleurs des cartes (inchangées) */
  --gold: #e8c46a;
  --gold-hi: #fff2c2;
  --gold-lo: #9a6d26;
  --cream: #ffeab3;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  /* Forme de la carte (bord découpé façon FUT) */
  --shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 440' preserveAspectRatio='none'%3E%3Cpath d='M58 14 Q150 1 242 14 Q258 39 294 41 L294 360 Q294 388 262 402 L172 434 Q150 442 128 434 L38 402 Q6 388 6 360 L6 41 Q42 39 58 14 Z'/%3E%3C/svg%3E");
  --tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 440' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23fff' stroke-linecap='round'%3E%3Cpath d='M-20 120 C60 80 120 160 200 110 S300 60 340 90' stroke-width='26' stroke-opacity='.05'/%3E%3Cpath d='M-30 210 C40 170 140 250 220 190 S310 160 350 170' stroke-width='14' stroke-opacity='.06'/%3E%3Cpath d='M-20 300 C70 260 130 330 210 280 S300 240 340 260' stroke-width='34' stroke-opacity='.04'/%3E%3Cpath d='M-10 360 C80 330 150 390 230 350 S300 330 330 340' stroke-width='10' stroke-opacity='.06'/%3E%3Cpath d='M-20 40 C50 20 120 70 190 40 S290 0 340 20' stroke-width='12' stroke-opacity='.05'/%3E%3C/g%3E%3C/svg%3E");
}


* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 28px);
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
/* Remise à zéro des boutons : Safari (iPhone) ajoute une marge intérieure qui décentrait les icônes */
button {
  font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation;
  padding: 0; margin: 0; -webkit-appearance: none; appearance: none; border-radius: 0; text-align: center;
}
input, select, textarea { margin: 0; }
svg { flex-shrink: 0; }
input { font: inherit; color: inherit; }
img { -webkit-user-drag: none; user-select: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num-font { font-variant-numeric: tabular-nums; }

/* ===== Barre du haut : bandeau marine vintage, filet doré, se compacte au défilement ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: calc(14px + var(--safe-t)) 16px 14px;
  color: #f3e3b5; overflow: hidden;
  background:
    radial-gradient(120% 140% at 15% 0%, rgba(120,160,255,.22), transparent 55%),
    linear-gradient(160deg, #1d3263 0%, #132650 55%, #0b1733 100%);
  border-radius: 0 0 22px 22px;
  box-shadow: 0 8px 24px rgba(11, 23, 51, .28);
  transition: padding .3s ease, border-radius .3s ease;
}
/* grain + lion filigrane + filet doré */
.topbar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .85 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.topbar::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, #e8c46a 20%, #fff2c2 50%, #e8c46a 80%, transparent);
}
.topbar-crest {
  width: 44px; height: auto; position: relative; z-index: 1;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.45)) drop-shadow(0 0 10px rgba(232,196,106,.25));
  transition: width .3s ease;
}
.topbar-title { display: flex; flex-direction: column; line-height: 1; flex: 1; min-width: 0; position: relative; z-index: 1; }
.topbar-title strong {
  font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: 30px; letter-spacing: .05em;
  color: #f3e3b5; text-shadow: 0 2px 8px rgba(0,0,0,.35); transition: font-size .3s ease;
}
.topbar-title span {
  margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #e8c46a;
  transition: opacity .25s, margin .3s;
}
.topbar .icon-btn {
  position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 50%;
  color: #f3e3b5; background: rgba(255,255,255,.1); border: 1px solid rgba(232,196,106,.45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
}
.topbar .icon-btn:active { background: rgba(232,196,106,.2); }
/* version compacte quand on fait défiler */
.topbar.compact { padding-top: calc(8px + var(--safe-t)); padding-bottom: 8px; border-radius: 0 0 18px 18px; }
.topbar.compact .topbar-crest { width: 34px; }
.topbar.compact .topbar-title strong { font-size: 24px; }
.topbar.compact .topbar-title span { opacity: 0; margin-top: -11px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--fill); color: var(--text); }
.icon-btn:active { transform: scale(.94); }

/* ===== Barre d'onglets flottante « liquid glass » ===== */
.tabbar {
  position: fixed; z-index: 30;
  left: 50%; bottom: calc(12px + var(--safe-b));
  width: min(440px, calc(100% - 24px)); height: var(--nav-h);
  transform: translateX(-50%);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px;
  border-radius: 999px; isolation: isolate;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.32));
  border: 1px solid rgba(255,255,255,.7);
  backdrop-filter: blur(18px) saturate(190%) contrast(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(190%) contrast(1.05);
  box-shadow:
    0 12px 32px rgba(15, 18, 30, .18), 0 2px 6px rgba(15, 18, 30, .08),
    inset 0 1px 0 rgba(255,255,255,.95), inset 0 -1px 0 rgba(0,0,0,.06),
    inset 0 0 18px rgba(255,255,255,.25);
  transition: transform .45s cubic-bezier(.2,.9,.25,1), opacity .3s;
}
/* reflet spéculaire du verre */
.tabbar::before {
  content: ""; position: absolute; inset: 1px; border-radius: inherit; pointer-events: none; z-index: -1;
  background: linear-gradient(120deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.08) 38%, transparent 55%, rgba(255,255,255,.18) 100%);
}
.tabbar.hide { transform: translate(-50%, calc(100% + 24px + var(--safe-b))); opacity: 0; }
/* bulle de verre qui glisse sous l'onglet actif */
.tab-bubble {
  position: absolute; top: 6px; bottom: 6px; left: 6px; width: 0; z-index: 0; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.6));
  box-shadow: 0 4px 14px rgba(15,18,30,.12), inset 0 1px 0 #fff, inset 0 -2px 6px rgba(0,0,0,.05);
  transition: left .5s cubic-bezier(.3,1.35,.4,1), width .5s cubic-bezier(.3,1.35,.4,1);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-weight: 600; font-size: 11px; position: relative; z-index: 1; border-radius: 999px; }
.tab svg { width: 23px; height: 23px; transition: transform .3s cubic-bezier(.3,1.4,.4,1); }
.tab:active svg { transform: scale(.88); }
.tabbar .tab:not(.active) { color: #52525b; }
.tab.active { color: var(--text); }
.tab.active svg { color: var(--accent); transform: translateY(-1px) scale(1.06); }


/* ===== Mise en page ===== */
main { padding: 16px; max-width: 1200px; margin: 0 auto; outline: none; }
.view-enter { animation: viewIn .25s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 8px; line-height: 1.1; }
.sub { color: var(--muted); font-size: 14px; margin: -2px 0 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 0 14px; height: 48px; margin-bottom: 10px;
}
.search svg { flex: none; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 16px; }
.search input::placeholder { color: var(--muted); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap;
}
.chip.on { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 20px; border-radius: 12px;
  font-weight: 700; font-size: 16px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  transition: transform .12s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.gold { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn.block { width: 100%; }
.btn.sm { height: 40px; font-size: 14px; padding: 0 14px; }
.btn:disabled { opacity: .4; }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* ===== Grilles de cartes ===== */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }   /* 3 cartes par ligne sur téléphone */
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 12px; } }
@media (min-width: 820px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1080px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.grid .fcard { animation: cardIn .4s backwards cubic-bezier(.2,.8,.2,1); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* ===== Carte joueur (style FUT, couleurs CSW) ===== */
.fcard {
  container-type: inline-size;
  position: relative; width: 100%; aspect-ratio: 300 / 440;
  perspective: 1400px; cursor: pointer; user-select: none;
  font-family: "Barlow Condensed", sans-serif; font-weight: 500; line-height: 1.2;
}
.fcard .flipper { position: absolute; inset: 0; transform-style: preserve-3d; }
.fcard.flipped .flipper { transform: rotateY(180deg); }
.fcard .flipper { -webkit-transform-style: preserve-3d; }
/* Safari (iPhone) ignore parfois backface-visibility avec les masques : la face cachée est aussi masquée (échange à 90°, voir flip()) */
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: rotateY(0deg) translateZ(.1px); }
.face.back { transform: rotateY(180deg) translateZ(.1px); visibility: hidden; }
.fcard.flipped .face.front { visibility: hidden; }
.fcard.flipped .face.back { visibility: visible; }
.shape { position: absolute; inset: 0; -webkit-mask: var(--shape) center / 100% 100% no-repeat; mask: var(--shape) center / 100% 100% no-repeat; }
.shape.gold { background: linear-gradient(140deg, #fff4c8 0%, #e2b85e 18%, #8f6223 38%, #f6dc8f 55%, #b9883a 72%, #fff0b5 88%, #a87a2e 100%); }
.shape.rim { inset: 1.5cqw; background: #0a1224; }
.shape.gold2 { inset: 2.6cqw; background: linear-gradient(120deg, #f8de93, #a7772b 40%, #f3d384 70%, #b08032); }
/* fond bleu marine vintage : dégradé, grain papier, vignettage */
.shape.body {
  inset: 3.2cqw; overflow: hidden;
  background:
    radial-gradient(90% 60% at 60% 30%, rgba(255, 236, 190, .10), transparent 70%),
    radial-gradient(130% 100% at 50% 40%, #22355c 0%, #172747 50%, #0c1630 100%);
}
.face.back .shape.body { background: radial-gradient(130% 100% at 50% 30%, #1d2e52 0%, #142340 55%, #0a1328 100%); }
.tex {
  position: absolute; inset: 0; opacity: .5; mix-blend-mode: overlay;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .85 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    repeating-linear-gradient(118deg, rgba(255,255,255,.05) 0 .4cqw, transparent .4cqw 2.4cqw);
}
.shape.body::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(3, 8, 20, .55) 100%); }
/* blason en filigrane */
.crest-bg {
  position: absolute; left: 50%; top: 44%; width: 82cqw; height: 112cqw; transform: translate(-50%, -50%);
  background: url(../img/crest.png) center / contain no-repeat;
  opacity: .14; filter: sepia(.35) saturate(.8);
}
.face.back .crest-bg { top: 50%; width: 86cqw; height: 117cqw; opacity: .07; }
.sheen { position: absolute; inset: -20%; background: linear-gradient(115deg, transparent 38%, rgba(255,236,190,.22) 48%, transparent 58%); transform: translateX(-70%); pointer-events: none; }
.fcard:hover .face.front .sheen, .spot .fcard .face.front .sheen { animation: sheen 1.4s ease-out; }
@keyframes sheen { to { transform: translateX(70%); } }

.photo {
  position: absolute; right: 1cqw; top: 8%; width: 74cqw; height: 63%;
  object-fit: contain; object-position: center bottom;
  -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent 99%);
  mask-image: linear-gradient(180deg, #000 80%, transparent 99%);
  filter: drop-shadow(0 1.2cqw 2cqw rgba(0,0,0,.5));
}
.photo.none { opacity: .55; filter: none; }
.num {
  position: absolute; left: 9cqw; top: 10.5%; min-width: 22cqw; text-align: center;
  font-family: "Bebas Neue", sans-serif; font-size: 25cqw; line-height: .82;
  color: #f3e3b5; text-shadow: 0 .6cqw 1.2cqw rgba(0,0,0,.45);
}
.pos {
  position: absolute; left: 9cqw; top: 29.5%; min-width: 22cqw; text-align: center;
  font-family: "Bebas Neue", sans-serif; font-size: 10cqw; line-height: 1; letter-spacing: .04em;
  color: #e8c46a;
}
.pos::after { content: ""; display: block; margin: 1.4cqw auto 0; width: 14cqw; height: .5cqw; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.name {
  /* bande exacte entre les deux traits dorés ; les majuscules Bebas sont recentrées (+0,082em) */
  position: absolute; left: 6cqw; right: 6cqw; bottom: calc(16.5% + .55cqw); height: 19.98cqw;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: "Bebas Neue", sans-serif; font-size: 15.5cqw; line-height: 19.98cqw; letter-spacing: .03em;
  transform: translateY(.082em);
  color: #f3e3b5; text-shadow: 0 .5cqw 1cqw rgba(0,0,0,.5);
}
.name.long { font-size: 12.5cqw; }
.rule { position: absolute; left: 12cqw; right: 12cqw; height: .55cqw; background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-hi) 50%, var(--gold) 80%, transparent); }
.rule.r1 { bottom: 30.5%; }
.rule.r2 { bottom: 16.5%; }
.crest-bot { position: absolute; left: 50%; bottom: 4.6%; width: 10.5cqw; transform: translateX(-50%); filter: drop-shadow(0 .5cqw .8cqw rgba(0,0,0,.5)); }

/* Verso */
.bk { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 7% 9cqw 0; }
.bk-head { display: flex; align-items: baseline; gap: 2.5cqw; font-family: "Bebas Neue", sans-serif; color: #f3e3b5; line-height: 1; margin-top: 1%; }
.bk-head b { font-weight: 400; font-size: 12cqw; color: #e8c46a; }
.bk-head span { font-size: 9.5cqw; letter-spacing: .03em; max-width: 52cqw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-title {
  width: 100%; display: flex; align-items: center; gap: 2cqw; margin: 3.2cqw 0 2cqw;
  font-weight: 800; font-size: 5cqw; letter-spacing: .12em; color: #d6b46a;
}
.bk-title::before, .bk-title::after { content: ""; flex: 1; height: .4cqw; background: linear-gradient(90deg, transparent, rgba(214,180,106,.6)); }
.bk-title::after { transform: scaleX(-1); }
.pres { width: 100%; display: flex; align-items: flex-end; justify-content: space-between; color: #f3e3b5; }
.pres .big { font-family: "Bebas Neue", sans-serif; font-size: 15cqw; line-height: .85; }
.pres .lbl { font-size: 4.6cqw; color: rgba(243,227,181,.6); line-height: 1.1; }
.pres .pct { font-family: "Bebas Neue", sans-serif; font-size: 14cqw; line-height: .85; color: #e8c46a; text-align: right; }
.gauge { width: 100%; height: 3.6cqw; margin-top: 2.4cqw; border-radius: 99px; background: rgba(0,0,0,.35); overflow: hidden; }
.gauge i { display: block; height: 100%; border-radius: inherit; width: 0; transition: width 1s .35s cubic-bezier(.2,.8,.2,1); background: linear-gradient(90deg, #ef4444, #f5a524); }
.gauge i.mid { background: linear-gradient(90deg, #f5a524, #e8c46a); }
.gauge i.hi { background: linear-gradient(90deg, #16a34a, #4ade80); }
.mstats { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2cqw; }
.mstat { background: rgba(255,255,255,.05); border: .3cqw solid rgba(214,180,106,.3); border-radius: 2.6cqw; padding: 1.2cqw 0 1cqw; text-align: center; }
.mstat b { display: block; font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: 9.5cqw; line-height: .95; color: #f3e3b5; }
.mstat span { display: flex; align-items: center; justify-content: center; gap: 1cqw; font-size: 4.2cqw; font-weight: 700; color: rgba(243,227,181,.6); letter-spacing: .04em; }
.ycard, .rcard { display: inline-block; width: 2.6cqw; height: 3.6cqw; border-radius: .5cqw; background: #facc15; }
.rcard { background: #ef233c; }
.bk-edit {
  position: absolute; left: 50%; bottom: 15.5%; transform: translateX(-50%);
  height: 8.6cqw; padding: 0 5cqw; border-radius: 99px;
  font-weight: 800; font-size: 4.2cqw; letter-spacing: .08em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff2c2, #e8c46a 50%, #9a6d26); color: #14213d; display: inline-flex; align-items: center; gap: 1.6cqw;
  box-shadow: 0 1cqw 3cqw rgba(0,0,0,.2);
}
.bk-notebtn {
  position: absolute; left: 50%; bottom: 4.6%; transform: translateX(-50%);
  width: 11cqw; height: 11cqw; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.08); border: .4cqw solid rgba(214,180,106,.55); color: #f3e3b5;
  box-shadow: 0 1cqw 3cqw rgba(0,0,0,.25);
}
.bk-notebtn .ic { width: 5.4cqw; height: 5.4cqw; display: block; }
.bk-notebtn.has { background: linear-gradient(180deg, #fff2c2, #e8c46a 50%, #9a6d26); color: #14213d; border-color: transparent; }
.note-area { width: 100%; min-height: 150px; resize: vertical; padding: 12px 14px; border-radius: 14px; font: inherit; font-size: 16px; line-height: 1.4; border: 1px solid var(--line, rgba(0,0,0,.15)); background: var(--fill, rgba(0,0,0,.04)); color: inherit; box-sizing: border-box; }
.bk-note { position: absolute; left: 12cqw; right: 12cqw; bottom: 14.5%; text-align: center; font-size: 4cqw; color: rgba(243,227,181,.65); font-style: italic; line-height: 1.15; max-height: 8.5cqw; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Mini cartes (séance, podium) */
.fcard.mini { cursor: pointer; }
.fcard.mini .pos { display: none; }
.fcard.mini .num { font-size: 27cqw; top: 9%; }

/* ===== Spotlight (carte agrandie) ===== */
.spot {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  background: rgba(9, 9, 11, .88);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fadeIn .25s ease-out;
}
.spot .fcard { width: min(86vw, calc((100dvh - 170px) * .6818), 420px); animation: spotIn .5s cubic-bezier(.2,1.2,.3,1); }
@keyframes spotIn { from { transform: scale(.55) translateY(40px); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
.spot-hint { color: #a1a1aa; font-size: 14px; }
.spot-nav { display: flex; gap: 14px; align-items: center; }
.spot .icon-btn { background: rgba(255,255,255,.12); color: #fff; }
.spot-nav .icon-btn { width: 56px; height: 56px; border-radius: 50%; }
.spot-close { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; }

/* ===== Feuilles du bas (bottom sheet) ===== */
.sheet-bg { position: fixed; inset: 0; z-index: 80; background: var(--overlay); animation: fadeIn .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81;
  max-height: calc(100dvh - 72px - var(--safe-t)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(18px + var(--safe-b));
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
  animation: sheetUp .3s cubic-bezier(.2,.9,.25,1);
}
@media (min-width: 700px) { .sheet { left: 50%; right: auto; width: 560px; transform: translateX(-50%); bottom: 24px; border-radius: 20px; animation: none; } }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--fill-2); margin: 0 auto 10px; }
.sheet h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin: 4px 0 4px; line-height: 1.15; }
.sheet h3 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
.sheet p { color: var(--muted); margin: 6px 0 12px; line-height: 1.4; }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head img { width: 52px; height: 52px; object-fit: cover; object-position: top; border-radius: 12px; background: var(--fill); }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }

/* Steppers +/- */
.step { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step-l { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; line-height: 1.2; }
.step-l .ico { width: 28px; text-align: center; font-size: 20px; flex: none; display: grid; place-items: center; }
.step-l .ycard, .step-l .rcard { width: 15px; height: 21px; border-radius: 3px; }
.step-c { display: flex; align-items: center; gap: 6px; }
.sbtn {
  width: 60px; height: 60px; border-radius: 16px; flex: none;
  font-size: 32px; font-weight: 500; line-height: 1; display: grid; place-items: center;
  background: var(--fill); transition: transform .1s;
}
.sbtn:active { transform: scale(.9); }
.sbtn.plus { background: var(--ink); color: var(--ink-text); }
.sbtn:disabled { opacity: .35; }
.step output { width: 50px; text-align: center; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.35); color: var(--accent); } }

.poste-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.poste-grid button { height: 46px; border-radius: 12px; background: var(--fill); font-weight: 700; font-size: 15px; }
.poste-grid button.on { background: var(--ink); color: var(--ink-text); }
.field { width: 100%; height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--fill); padding: 0 14px; font-size: 17px; font-weight: 600; text-transform: uppercase; outline: none; }
.field:focus { border-color: var(--text); }
input[type="date"].field { text-transform: none; }

.menu-list { display: grid; gap: 8px; }
.menu-item { display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px; border-radius: 14px; background: var(--fill); }
.menu-item:active { transform: scale(.98); }
.menu-item .mi-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; background: var(--surface); flex: none; }
.menu-item b { display: block; font-size: 16px; font-weight: 700; }
.menu-item small { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; }
.menu-item.danger b { color: var(--danger); }

/* ===== Entraînements ===== */
.next-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 18px 16px; border-radius: 18px; margin-bottom: 18px;
  background: var(--ink); color: var(--ink-text);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.next-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.next-card .lbl { font-size: 12px; letter-spacing: .08em; font-weight: 700; text-transform: uppercase; opacity: .65; }
.next-card .d { font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.next-card .ninfo { margin-top: 4px; font-weight: 600; font-size: 14px; opacity: .8; }
.next-card .go { margin-left: auto; font-weight: 700; font-size: 14px; background: var(--accent); color: #fff; border-radius: 99px; padding: 9px 14px; white-space: nowrap; }
.sec-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.tlist { display: grid; gap: 8px; }
.trow {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  min-height: 66px;
}
.trow:active { transform: scale(.985); }
.tdate { width: 48px; height: 48px; border-radius: 12px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--fill); line-height: 1; }
.tdate b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tdate small { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 2px; }
.trow.ok .tdate { background: var(--green-soft); color: var(--green); }
.trow.todo .tdate { background: var(--amber-soft); color: var(--amber); }
.trow.today { border-color: var(--text); }
.tmain { flex: 1; min-width: 0; }
.tmain b { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmain small { color: var(--muted); font-size: 13px; }
.tbar { height: 5px; border-radius: 9px; background: var(--fill-2); margin-top: 6px; overflow: hidden; }
.tbar i { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.tag { flex: none; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 99px; }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.todo { background: var(--amber-soft); color: var(--amber); }
.tag.soon { background: var(--fill); color: var(--muted); }

.sess-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sess-head .h1 { margin: 0; font-size: 24px; }
.sess-count { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; color: var(--muted); }
.sess-count b { font-size: 24px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
@media (min-width: 560px) { .pick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 820px) { .pick-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.pick { position: relative; display: block; width: 100%; padding: 0; text-align: center; }
.pick .fcard { transition: transform .2s, filter .25s, opacity .25s; }
.pick:active .fcard { transform: scale(.94); }
.pick .chk {
  position: absolute; top: 4%; right: 2%; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; z-index: 2;
  background: rgba(0,0,0,.5); border: 2px solid rgba(255,255,255,.8);
  transition: transform .2s;
}
.pick.on .chk { background: var(--green); border-color: #fff; }
.pick.on .chk::after { content: ""; width: 11px; height: 6px; border: solid #fff; border-width: 0 0 3px 3px; transform: translateY(-2px) rotate(-45deg); }
.pick.abs .fcard { filter: grayscale(1) brightness(.6); opacity: .6; }
.pick.abs .chk { background: var(--danger); border-color: #fff; transform: scale(1.06); }
.pick.abs .chk::after { content: "✕"; color: #fff; font-weight: 800; font-size: 14px; line-height: 1; }
.pick .st { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 600; }
.pick.abs .st { color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.g { background: var(--green); }
.dot.r { background: var(--danger); }
.dot.n { background: var(--fill-2); }
.pop { animation: pop .3s; }
@keyframes pop { 50% { transform: scale(1.15); } }
.hint { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--fill); font-size: 14px; line-height: 1.35; color: var(--muted); }
.hint b { color: var(--danger); }
.hint b.g { color: var(--green); }
.abs-txt { color: var(--danger); }

.dock {
  position: fixed; left: 0; right: 0; z-index: 25;
  bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  padding: 10px 16px; display: flex; gap: 10px;
  background: linear-gradient(180deg, transparent, var(--bg) 35%);
}
.dock .btn { flex: 1; height: 54px; font-size: 17px; }
.dock .btn.ghost { flex: 0 0 auto; background: var(--surface); }
.has-dock { padding-bottom: 90px; }

/* ===== Classements ===== */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 10px; margin: 26px auto 8px; max-width: 520px; }
.pod { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pod .fcard { width: 92%; }
.pod.p1 .fcard { width: 104%; }
.pod-val { font-size: 18px; font-weight: 800; line-height: 1; margin: 8px 0 6px; white-space: nowrap; }
.pod-step {
  width: 100%; border-radius: 10px 10px 4px 4px; display: grid; place-items: center;
  font-size: 28px; font-weight: 800; color: rgba(0,0,0,.45);
  transform-origin: bottom; animation: rise .7s backwards cubic-bezier(.2,.9,.3,1.2);
}
.p1 .pod-step { height: 84px; background: linear-gradient(180deg, #f6e3a3, #d9b356); animation-delay: .35s; }
.p2 .pod-step { height: 62px; background: linear-gradient(180deg, #eceef3, #b9bfcc); animation-delay: .15s; }
.p3 .pod-step { height: 46px; background: linear-gradient(180deg, #f1c9a5, #c58a5a); animation-delay: .5s; }
@keyframes rise { from { transform: scaleY(0); } }
.pod .medal { font-size: 24px; margin-bottom: 4px; }
.rank-list { display: grid; gap: 8px; margin-top: 14px; }
.rk { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); width: 100%; text-align: left; }
.rk .n { width: 24px; font-size: 16px; font-weight: 700; color: var(--muted); text-align: center; }
.rk img { width: 42px; height: 42px; border-radius: 11px; object-fit: cover; object-position: top; background: var(--fill); flex: none; }
.rk .who { flex: 1; min-width: 0; line-height: 1.2; }
.rk .who b { display: block; font-size: 16px; font-weight: 700; }
.rk .who small { color: var(--muted); font-size: 13px; }
.rk .v { font-size: 17px; font-weight: 800; white-space: nowrap; }

/* ===== Toast & célébrations ===== */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 84px); z-index: 120;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--ink-text); font-weight: 600; font-size: 15px;
  padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; top: -20px; z-index: 110; width: 10px; height: 16px; border-radius: 2px; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); } }
.burst { position: fixed; z-index: 110; font-size: 34px; pointer-events: none; animation: burst .9s ease-out forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.4) rotate(var(--rot)); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== Groupes & équipes ===== */
.teams-btn { margin: 0 0 12px; height: 46px; font-size: 15px; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 6px 0 14px; border-radius: 12px; background: var(--fill); }
.seg3 button { height: 42px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg3 button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.gcount { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.gc { border-radius: 14px; padding: 10px 12px; font-weight: 600; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.gc b { font-size: 26px; font-weight: 800; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.gc.g1 b { color: var(--accent); }
.gc.g2 b { color: var(--blue); }
.plist { display: grid; gap: 8px; }
.prow { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 7px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.prow img { width: 44px; height: 44px; border-radius: 11px; object-fit: cover; object-position: top; background: var(--fill); flex: none; }
.pwho { flex: 1; min-width: 0; line-height: 1.2; }
.pwho b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pwho b span { color: var(--muted); font-weight: 500; }
.pwho small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.pchip { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--fill-2); color: var(--text); }
.gtoggle { display: flex; gap: 4px; flex: none; padding: 3px; border-radius: 12px; background: var(--fill); }
.gtoggle button { width: 50px; height: 42px; border-radius: 9px; font-weight: 700; font-size: 15px; color: var(--muted); }
.gtoggle button[data-grp="1"].on { background: var(--accent); color: #fff; }
.gtoggle button[data-grp="2"].on { background: var(--blue); color: #fff; }
.nteams { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--fill); }
.nteams button { width: 48px; height: 42px; border-radius: 9px; font-size: 18px; font-weight: 800; color: var(--muted); }
.nteams button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.teams { display: grid; gap: 14px; margin-top: 16px; }
@media (min-width: 760px) { .teams { grid-template-columns: repeat(2, 1fr); } }
.team { display: grid; gap: 6px; padding: 8px; border-radius: 16px; background: var(--fill); animation: cardIn .4s backwards; }
.team + .team { animation-delay: .08s; }
.team-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 11px; }
.team-h b { font-size: 19px; font-weight: 800; line-height: 1.1; }
.team-h span { font-size: 13px; font-weight: 600; opacity: .9; }
.team-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 2px; }
.mv { width: 44px; height: 44px; border-radius: 11px; flex: none; font-size: 20px; background: var(--fill); }

/* ===== Icônes ===== */
.ic { flex: none; vertical-align: -.15em; }
.btn .ic, .chip .ic { vertical-align: middle; }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; }
.next-card .go { display: inline-flex; align-items: center; gap: 6px; }
.mstat span .ic { width: 3.6cqw; height: 3.6cqw; }
.bk-edit .ic { width: 3.8cqw; height: 3.8cqw; }
.step-l .ico { color: var(--text); }
.eq { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--ink); color: var(--ink-text); font-size: 14px; font-weight: 800; }
.ycard.px, .rcard.px { width: 11px; height: 15px; border-radius: 2px; vertical-align: -2px; }
.burst .ycard.px, .burst .rcard.px { width: 20px; height: 28px; border-radius: 3px; }
.bb { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.cards { display: inline-flex; align-items: center; gap: 5px; }
.cards .rcard { margin-left: 6px; }
.rk .v small, .pod-val small { font-size: 12px; font-weight: 600; color: var(--muted); }
.cdot { width: 22px; height: 22px; border-radius: 50%; display: block; border: 2px solid var(--line); }

/* ===== Match ===== */
.mrow { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.mrow:active { transform: scale(.985); }
.mmain { flex: 1; min-width: 0; display: grid; gap: 6px; }
.mmain > b { font-size: 16px; font-weight: 700; }
.mline { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mline .eq { width: 22px; height: 22px; font-size: 12px; border-radius: 6px; }
.mvs { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mvs i { color: var(--muted); }
.seg2 { grid-template-columns: repeat(2, 1fr); }
.seg2 button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg2 button .ic { color: var(--green); }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; margin-bottom: 6px; }
.mcard-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mfield { grid-column: 1 / -1; display: grid; gap: 4px; min-width: 0; }
.mfield.half { grid-column: auto; }
.mfield > span { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.mfield input, .mfield select { width: 100%; min-width: 0; height: 46px; border-radius: 11px; border: 1px solid var(--line); background: var(--fill); padding: 0 12px; font-size: 16px; font-weight: 600; outline: none; }
.mfield select { appearance: none; -webkit-appearance: none; color: var(--text); }
.mfield input:focus, .mfield select:focus { border-color: var(--text); background: var(--surface); }
.mfield input::placeholder { color: var(--muted); font-weight: 400; }
.pick.sel.off .fcard { filter: grayscale(.6); opacity: .55; }
.pick.sel .st { color: var(--muted); }
.pick.sel.on .st { color: var(--text); }
.danger-chip { color: var(--danger); }

/* Aperçu du visuel des équipes */
.vis-prev { margin: 10px 0 4px; max-height: 58dvh; overflow-y: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--fill); }
.vis-prev img { display: block; width: 100%; height: auto; }

/* Couleurs d'équipe */
.tcolor { display: inline-flex; align-items: center; gap: 8px; color: inherit; padding: 2px 8px 2px 0; border-radius: 8px; }
.tcolor .ic { opacity: .8; }
.color-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.color-grid button { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border-radius: 12px; background: var(--fill); font-weight: 700; font-size: 16px; border: 2px solid transparent; }
.color-grid button.on { border-color: var(--text); background: var(--surface); }

/* Téléphone : moins de marge sur les côtés, cartes plus larges */
@media (max-width: 559px) {
  main { padding: 12px 8px; }
  .grid { gap: 10px 6px; }
  .pick-grid { gap: 10px 6px; }
}

/* Aperçu des visuels : de bord à bord */
.vis-prev { margin: 10px -16px 4px; border-radius: 0; border: 0; max-height: 66dvh; background: #000; }

/* Interrupteur */
.toggle { flex: none; width: 50px; height: 30px; border-radius: 99px; background: var(--fill-2); position: relative; transition: background .25s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s cubic-bezier(.3,1.3,.5,1); }
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(20px); }

/* En-têtes de page : titre + bouton bien séparés du contenu */
.row > .h1 { margin: 0; }
.row:has(> .h1) { margin: 4px 0 18px; min-height: 44px; }
.row:has(> .h1) + .sub { margin-top: -8px; }

/* Confirmation d'enregistrement automatique */
.saved-tag { opacity: .75; }
.saved-tag.flash { animation: savedFlash .9s ease-out; }
@keyframes savedFlash { 0% { transform: scale(1); opacity: .75; } 25% { transform: scale(1.12); opacity: 1; background: var(--green); color: #fff; } 100% { transform: scale(1); opacity: .75; } }

/* Zone de boutons masquée (séance à venir : enregistrement automatique) */
.dock[hidden], .dock:empty { display: none !important; }

/* Boutons-icônes : centrage strict de l'icône, quel que soit le téléphone */
.icon-btn, .sbtn, .mv, .spot-nav .icon-btn, .spot-close {
  display: inline-flex !important; align-items: center; justify-content: center; padding: 0 !important; line-height: 0;
}
.icon-btn > svg, .mv > svg, .sbtn > svg { display: block; margin: 0; }
.btn, .chip, .tag, .menu-item, .bk-edit, .next-card .go, .seg3 button, .gtoggle button, .nteams button, .poste-grid button, .color-grid button {
  -webkit-appearance: none; appearance: none;
}
.btn .ic, .chip .ic, .tag .ic, .bk-edit .ic, .next-card .go .ic, .seg3 .ic { display: block; vertical-align: 0; }
.pick .chk { display: grid; place-items: center; line-height: 0; padding: 0; }

/* Haut des fenêtres : poignée + croix de fermeture toujours visibles (collées en haut au défilement) */
.sheet-top {
  position: sticky; top: -10px; z-index: 5; margin: -10px -16px 6px; padding: 10px 16px 6px;
  background: var(--surface); display: flex; justify-content: center; align-items: center; min-height: 40px;
}
.sheet-top .grab { margin: 0; }
.sheet-x {
  position: absolute; right: 12px; top: 8px; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex !important; align-items: center; justify-content: center; padding: 0 !important;
  background: var(--fill-2); color: var(--text);
}
.sheet-x:active { transform: scale(.92); }
.sheet-x svg { display: block; }

/* ===== Match joué ===== */
.played { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 14px 0 4px; border-radius: 14px; background: var(--fill); border: 1px solid var(--line); }
.played > div { flex: 1; min-width: 0; line-height: 1.25; }
.played b { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.played small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.played.ok { background: var(--green-soft); border-color: rgba(22,163,74,.3); }
.played.ok b { color: var(--green); }
.mstat-row { display: flex; gap: 8px; flex: none; font-weight: 800; font-size: 14px; }
.mstat-row span { display: inline-flex; align-items: center; gap: 3px; }
.played-list { display: grid; gap: 8px; }
.pl-row { border-radius: 14px; border: 1px solid var(--line); padding: 8px; transition: opacity .2s; }
.pl-row.off { opacity: .45; }
.pl-who { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
.pl-who img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; object-position: top; background: var(--fill); }
.pl-who b { display: block; font-size: 15px; }
.pl-who small { color: var(--muted); font-size: 12px; }
.pl-chk { width: 24px; height: 24px; border-radius: 50%; flex: none; border: 2px solid var(--fill-2); display: grid; place-items: center; }
.pl-row.on .pl-chk { background: var(--green); border-color: var(--green); }
.pl-row.on .pl-chk::after { content: ""; width: 10px; height: 5px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg); }
.pl-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.mini-step { display: flex; align-items: center; justify-content: space-between; gap: 2px; padding: 3px; border-radius: 11px; background: var(--fill); }
.mini-step button { width: 32px; height: 32px; border-radius: 9px; font-size: 20px; font-weight: 600; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.mini-step button:active { transform: scale(.9); }
.mini-step .ms-ico { display: inline-flex; align-items: center; }
.mini-step output { min-width: 14px; text-align: center; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }

/* Champs date/heure : sur iPhone ils dépassaient de leur cadre (largeur minimale imposée par Safari) */
input[type="date"], input[type="time"] {
  -webkit-appearance: none; appearance: none; display: block;
  width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
}
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
/* Fenêtres « Nouveau match » / « Nouvel entraînement » : date centrée */
.field[type="date"], .field[type="time"] { text-align: center; }
.field[type="date"]::-webkit-date-and-time-value, .field[type="time"]::-webkit-date-and-time-value { text-align: center; }
/* Empêcher tout déplacement horizontal de l'écran */
body { overflow-x: clip; }
.sheet { overflow-x: hidden; }
.sheet > *:not(.sheet-top) { max-width: 100%; }

/* Fiche du match : date, coup d'envoi et heure du RDV centrés dans leur encart (horizontal + vertical, iPhone compris) */
.mfield input[type="date"], .mfield input[type="time"] { text-align: center; line-height: 44px; padding-top: 0; padding-bottom: 0; }
.mfield input[type="date"]::-webkit-date-and-time-value, .mfield input[type="time"]::-webkit-date-and-time-value { text-align: center; margin: 0 auto; line-height: 44px; }
.field[type="date"], .field[type="time"] { line-height: 50px; padding-top: 0; padding-bottom: 0; }
.field[type="date"]::-webkit-date-and-time-value, .field[type="time"]::-webkit-date-and-time-value { margin: 0 auto; line-height: 50px; }

/* Aperçu des visuels (convocation, équipes, classements) : centré dans la fenêtre */
/* (pas de flex ici : Safari étirait l'image et la déformait) */
.sheet > .vis-prev { margin: 10px auto 4px; width: 100%; max-width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--fill); display: block; text-align: center; }
.vis-prev img { display: block; width: 100%; max-width: 520px; height: auto !important; aspect-ratio: auto; object-fit: contain; margin: 0 auto; align-self: flex-start; }

/* Liste des matchs : n° de semaine + un bloc par jour */
.tdate.wk small { order: -1; margin: 0 0 2px; font-weight: 700; }
.tdate.wk b { font-size: 22px; }
.mday + .mday { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.mday { display: grid; gap: 6px; }
.mday > b { font-size: 15px; font-weight: 700; }
/* Gardiens : clean sheet */
.csl { font-style: normal; font-size: 3.4cqw; letter-spacing: .02em; }
.cs-box { grid-column: span 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px !important; height: 38px; border-radius: 11px; background: var(--fill); font-size: 12px; font-weight: 700; line-height: 1.1; }
.cs-chk { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--fill-2); flex: none; display: grid; place-items: center; }
.cs-box.on { background: var(--green-soft); color: var(--green); }
.cs-box.on .cs-chk { background: var(--green); border-color: var(--green); }
.cs-box.on .cs-chk::after { content: ""; width: 8px; height: 4px; border: solid #fff; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.cs-tag { color: var(--green); }

/* Au défilement vers le bas : menu ET boutons du bas se cachent (toutes les pages) */
.dock { transition: transform .45s cubic-bezier(.2,.9,.25,1), opacity .3s; }
body.nav-hidden .dock { transform: translateY(calc(100% + var(--nav-h) + 30px + var(--safe-b))); opacity: 0; pointer-events: none; }

/* Boutons du bas : plus de fond (le dégradé blanc formait une bande), le bouton flotte avec une ombre */
.dock { background: none !important; padding-top: 0; padding-bottom: 8px; pointer-events: none; }
.dock .btn { pointer-events: auto; box-shadow: 0 8px 22px rgba(15, 18, 30, .22); }
.dock .btn.ghost { background: var(--surface); }

/* Liste des matchs : les noms d'adversaires longs ne font plus déborder l'encart */
.mday, .mday > *, .mline { min-width: 0; }
.mline .mvs { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mline .tag { flex: none; margin-left: auto; }
.mline .eq { flex: none; }
