/* 018 CLUB — styles
   Encre et craie du blason, lumière sodium des city stades, ciel de nuit de Montmartre. */
:root {
  --band: #000;
  --ink: #000000;
  --chalk: #ffffff;
  --sodium: #f2a33a;
  --sodium-deep: #c97a12;
  --night: #1b2440;
  --pelouse: #3fa36b;
  --carton: #e0464f;
  --doute: #e8c547;
  --glass: rgba(9, 12, 24, 0.80);
  --glass-strong: rgba(9, 12, 24, 0.92);
  --line: rgba(255, 255, 255, 0.14);
  --muted: rgba(255, 255, 255, 0.68);
  --display: "Big Shoulders Display", "Arial Narrow", Impact, "Helvetica Neue", sans-serif;
  --text: "Barlow", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-panel: 16px;
  --r-ctrl: 10px;
  --rail: 232px;
  --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; background: var(--band, #000); }
/* Pendant l'animation, tout l'écran est blanc jusqu'en bas */
html.intro-white, html.intro-white body { background: #fff; }
html, body { transition: background-color .42s ease; }
body {
  font-family: var(--text); font-size: 16px; line-height: 1.5; color: var(--chalk);
  background: var(--band, #000); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; }
a { color: var(--sodium); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sodium); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Arrière-plans ---------- */
#bg { position: fixed; inset: 0; z-index: 0; background:
  radial-gradient(110% 55% at 50% 112%, rgba(242,163,58,.38), transparent 62%),
  linear-gradient(180deg, #0c1222 0%, #1b2440 58%, #2b2232 100%); }
.bg-layer { position: absolute; inset: 0; background-size: cover; background-repeat: no-repeat;
  opacity: 0; transition: opacity 1.4s ease; will-change: opacity; }
.bg-layer.is-on { opacity: 1; }
.bg-veil { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,calc(var(--veil, .45) * .7)) 0%, rgba(0,0,0,calc(var(--veil, .45) * .45)) 40%, rgba(0,0,0,calc(var(--veil, .45) * .6)) 68%, var(--band, #000) 94%, var(--band, #000) 100%);
  transition: background 1.4s ease; }

/* ---------- Intro : fond blanc → 0, 1, 8 → blason → accueil (animée en CSS dès le premier affichage) ---------- */
#intro { position: fixed; inset: 0; z-index: 100; background: #fff; display: grid; place-items: center; cursor: pointer; transition: opacity .42s ease; }
#intro.is-done, html.intro-skip #intro:not(.anim) { display: none; }
#intro.out { opacity: 0; pointer-events: none; }
.intro-stage { position: relative; width: min(64vmin, 360px); aspect-ratio: 1; }
.intro-logo { position: absolute; inset: 0; width: 100%; height: 100%; -webkit-clip-path: circle(0% at 50% 48%); clip-path: circle(0% at 50% 48%); }
.intro-digits { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.intro-digits text { font-family: var(--display); font-weight: 900; font-size: 250px; fill: #000; opacity: 0; transform-box: fill-box; }
html.intro-play #intro .intro-digits text, #intro.anim .intro-digits text { animation: d-in .42s cubic-bezier(.2,.7,.2,1) .15s forwards, d-out .3s ease-out 1.19s forwards; }
html.intro-play #intro .intro-digits text:nth-child(2), #intro.anim .intro-digits text:nth-child(2) { animation-delay: .34s, 1.19s; }
html.intro-play #intro .intro-digits text:nth-child(3), #intro.anim .intro-digits text:nth-child(3) { animation-delay: .53s, 1.19s; }
html.intro-play #intro .intro-logo, #intro.anim .intro-logo { animation: reveal .56s cubic-bezier(.6,0,.2,1) 1.03s forwards; }
@keyframes d-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes d-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes reveal { from { -webkit-clip-path: circle(0% at 50% 48%); clip-path: circle(0% at 50% 48%); } to { -webkit-clip-path: circle(75% at 50% 48%); clip-path: circle(75% at 50% 48%); } }
/* « Réduire les animations » activé : même séquence, en simples fondus, sans mouvement */
@keyframes f-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html.intro-play #intro .intro-digits text, #intro.anim .intro-digits text { animation: f-in .42s ease .15s forwards, d-out .3s ease-out 1.19s forwards; }
  html.intro-play #intro .intro-logo, #intro.anim .intro-logo { -webkit-clip-path: none; clip-path: none; opacity: 0; animation: f-in .56s ease 1.03s forwards; }
}

/* ---------- Coque ---------- */
/* Cadre d'application fixe : seul le contenu défile, le fond et la barre de menu ne bougent jamais */
#app { position: fixed; inset: 0; z-index: 1; }

#main { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; outline: none;
  padding: calc(6px + var(--safe-t)) max(16px, calc((100vw - 1120px) / 2)) calc(var(--tabbar) + 32px + var(--safe-b)); }
#rail { display: none; }
#tabbar { position: absolute; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + var(--safe-b));
  padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--glass-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none;
  color: var(--muted); font-size: 12px; font-weight: 600; position: relative; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--chalk); }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--sodium); }
.tab .dot { position: absolute; top: 9px; left: calc(50% + 8px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--carton); color: #fff; font-size: 11px; line-height: 16px; text-align: center; }

@media (min-width: 900px) {
  #tabbar { display: none; }
  #rail { display: flex; flex-direction: column; position: absolute; z-index: 20; top: 0; bottom: 0; left: 0; width: var(--rail);
    padding: 22px 14px; gap: 2px; background: var(--glass-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-right: 1px solid var(--line); overflow-y: auto; }
  #main { left: var(--rail); padding: 36px max(40px, calc((100vw - var(--rail) - 1120px) / 2)) 60px; }
  .rail-logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; color: var(--chalk); }
  .rail-logo img { width: 52px; height: 52px; filter: drop-shadow(0 0 1px rgba(255,255,255,.9)); }
  .rail-logo span { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .02em; }
  .rail-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-ctrl); color: var(--muted); text-decoration: none; font-weight: 500; }
  .rail-link svg { width: 20px; height: 20px; flex: none; }
  .rail-link:hover { background: rgba(255,255,255,.06); color: var(--chalk); }
  .rail-link[aria-current="page"] { background: rgba(242,163,58,.16); color: var(--chalk); }
  .rail-link .dot { margin-left: auto; min-width: 20px; height: 20px; border-radius: 99px; background: var(--carton); font-size: 12px; text-align: center; line-height: 20px; color: #fff; }
  .rail-sep { height: 1px; background: var(--line); margin: 10px 8px; }
  .rail-foot { margin-top: auto; }
}

/* ---------- Typo ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.02; margin: 0; letter-spacing: .01em; }
h1 { font-size: clamp(38px, 7vw, 60px); }
h2 { font-size: 28px; }
h3 { font-size: 21px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-family: var(--display); font-weight: 800; font-variant-numeric: tabular-nums; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 20px; flex-wrap: wrap; }
.page-head h1 { flex: 1; min-width: 0; }
.head-icons { display: flex; align-items: center; gap: 10px; }
.head-actions { width: 100%; }
@media (min-width: 900px) { .head-icons { display: none; } .head-actions { width: auto; } }
.page-head .logo-mini { width: 54px; height: 54px; filter: drop-shadow(0 0 1px rgba(255,255,255,.9)); }
@media (min-width: 900px) { .page-head .logo-mini { display: none; } }

/* ---------- Panneaux ---------- */
.panel { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px; }
.panel + .panel, .stack > * + * { margin-top: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.grid { display: grid; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; text-align: center; }
@media (min-width: 720px) { .kpis.six { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid > .panel { margin-top: 0; }
.grid > * { min-width: 0; }

/* Accueil : le prochain match est le moment fort */
.fixture { padding: 22px 0 26px; }
.fixture .when { font-weight: 600; color: var(--sodium); font-size: 17px; }
.fixture .teams { font-family: var(--display); font-weight: 900; font-size: clamp(46px, 11vw, 96px); line-height: .92; margin: 8px 0 10px; text-shadow: 0 2px 24px rgba(0,0,0,.45); }
.fixture .teams .vs { display: block; font-size: .36em; font-weight: 700; color: var(--muted); margin: .25em 0 .2em; }
.fixture .where { color: var(--muted); }
.score { font-family: var(--display); font-weight: 900; font-size: 32px; font-variant-numeric: tabular-nums; }

/* ---------- Listes ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; min-height: 52px; }
.row:last-child { border-bottom: 0; }
a.row:hover, button.row:hover { background: rgba(255,255,255,.04); }
button.row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.row > svg { width: 22px; height: 22px; flex: none; color: var(--sodium); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { color: var(--muted); font-size: 14px; }
.date-block { width: 50px; flex: none; text-align: center; line-height: 1; }
.date-block .d { font-family: var(--display); font-weight: 900; font-size: 28px; }
.date-block .m { font-size: 12px; color: var(--muted); font-weight: 600; }
.jersey { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #000; font-family: var(--display); font-weight: 900; font-size: 18px; }

.bell { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--chalk);
  background: rgba(255,255,255,.08); border: 1px solid var(--line); flex: none; }
.bell svg { width: 22px; height: 22px; }
.bell .dot { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--carton); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
@media (min-width: 900px) { .bell { display: none; } }
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; object-fit: cover; background: var(--sodium); color: #000;
  font-family: var(--display); font-weight: 800; line-height: 1; overflow: hidden; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.1); white-space: nowrap; }
.chip.ok { background: rgba(63,163,107,.22); color: #8fe0b2; }
.chip.ko { background: rgba(224,70,79,.22); color: #ffb0b5; }
.chip.wait { background: rgba(232,197,71,.2); color: #f5e08f; }
.chip.info { background: rgba(242,163,58,.2); color: #ffd39a; }

/* ---------- Boutons & formulaires ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-ctrl);
  border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--chalk); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: rgba(255,255,255,.14); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--sodium); border-color: var(--sodium); color: #000; }
.btn.primary:hover { background: #ffb653; }
.btn.danger { background: rgba(224,70,79,.18); border-color: rgba(224,70,79,.5); color: #ffc4c8; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.icon { width: 44px; padding: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: rgba(255,255,255,.07); border-radius: var(--r-ctrl); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--chalk); color: #000; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: var(--r-ctrl); border: 1px solid var(--line);
  background: rgba(0,0,0,.35); color: var(--chalk); }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--sodium); outline: none; }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--sodium); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .input { width: auto; min-height: 40px; padding: 6px 10px; }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
td.r, th.r { text-align: right; }
td input.input { min-height: 36px; padding: 4px 8px; width: 64px; }

.empty { padding: 26px 8px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 12px; }

/* ---------- Feuille modale ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: #0e1222; border: 1px solid var(--line);
  border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + var(--safe-b)); animation: sheet-in .22s ease; }
@media (min-width: 700px) { .sheet-back { align-items: center; } .sheet { border-radius: 20px; } }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.sheet h2 { margin-bottom: 16px; }
.sheet .actions { justify-content: flex-end; margin-top: 8px; }

#toast { position: fixed; z-index: 80; left: 50%; bottom: calc(var(--tabbar) + 18px + var(--safe-b)); transform: translateX(-50%);
  background: var(--chalk); color: #000; padding: 10px 16px; border-radius: 99px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.err { background: var(--carton); color: #fff; }
@media (min-width: 900px) { #toast { bottom: 28px; } }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .panel { width: 100%; max-width: 400px; }
.auth .crest { width: 140px; height: 140px; display: block; margin: 0 auto 10px; padding: 10px; background: #fff; border-radius: 50%; }

/* ---------- Composition à 7 ---------- */
.board { display: grid; gap: 14px; }
@media (min-width: 900px) { .board { grid-template-columns: minmax(320px, 440px) 1fr; align-items: start; } }
.pitch { position: relative; width: min(100%, calc((100dvh - var(--tabbar) - var(--safe-b) - var(--safe-t) - 360px) * 2 / 3)); min-width: 250px; margin: 0 auto; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; touch-action: none;
  background: repeating-linear-gradient(180deg, #2e7d4f 0 12.5%, #2a7349 12.5% 25%); border: 2px solid rgba(255,255,255,.7); }
.pitch .ln { position: absolute; border: 2px solid rgba(255,255,255,.7); pointer-events: none; }
.pitch .half { left: 0; right: 0; top: 50%; height: 0; border-width: 2px 0 0; }
.pitch .circle { left: 50%; top: 50%; width: 30%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); }
.pitch .box-b { left: 25%; right: 25%; bottom: -2px; height: 15%; }
.pitch .box-t { left: 25%; right: 25%; top: -2px; height: 15%; }
.slot { position: absolute; transform: translate(-50%, -50%); width: 68px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; background: none; padding: 0; cursor: grab; touch-action: none; }
.slot .disc { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center;
  font-family: var(--display); font-weight: 900; font-size: 20px; box-shadow: 0 3px 10px rgba(0,0,0,.4); border: 3px solid #000; }
.slot.gk .disc { background: var(--sodium); }
.slot.empty .disc { background: rgba(0,0,0,.45); color: #fff; border: 2px dashed rgba(255,255,255,.8); }
.slot .nm { font-size: 12px; font-weight: 700; background: rgba(0,0,0,.65); padding: 1px 6px; border-radius: 6px; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.dragging { cursor: grabbing; z-index: 3; }
.bench { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Apparence ---------- */
.amb { display: grid; gap: 12px; }
@media (min-width: 720px) { .amb { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .amb { grid-template-columns: repeat(3, 1fr); } }
.amb-card { padding: 14px; }
.amb-prev { display: grid; grid-template-columns: 9fr 16fr; gap: 8px; align-items: end; margin: 10px 0; }
.amb-prev .pv { position: relative; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.06); border: 1px dashed var(--line); background-size: cover; cursor: crosshair; }
.amb-prev .pv.m { aspect-ratio: 9 / 16; }
.amb-prev .pv.d { aspect-ratio: 16 / 9; }
.amb-prev .pv span { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); padding: 4px; }
.amb-prev .focal { position: absolute; width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px #000; }

/* ---------- Discussion ---------- */
.chat { display: flex; flex-direction: column; height: calc(100dvh - 248px - var(--safe-b) - var(--safe-t)); min-height: 320px; }
@media (min-width: 900px) { .chat { height: calc(100dvh - 200px); } }
.chat-log { flex: 1; overflow-y: auto; padding: 4px 2px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 14px; background: rgba(255,255,255,.1); align-self: flex-start; }
.msg.mine { align-self: flex-end; background: rgba(242,163,58,.22); }
.msg .who { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.msg .txt { white-space: pre-wrap; word-wrap: break-word; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .bg-layer, .bg-veil { transition: none; }
  .sheet { animation: none; }
}
td a { color: inherit; text-decoration: none; font-weight: 600; }

.avatar-edit { border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; position: relative; flex: none; }
.avatar-edit::after { content: "Modifier"; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); font-size: 11px; font-weight: 700;
  background: var(--chalk); color: #000; padding: 1px 7px; border-radius: 99px; }
.rail-link .avatar { width: 22px; height: 22px; }

/* Présences */
.pres { margin-bottom: 10px; }
.pres-num { display: flex; align-items: baseline; gap: 6px; }
.pres-num .num { font-size: 40px; line-height: 1; }
.pres-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.12); margin: 8px 0 6px; }
.pres-bar i { display: block; height: 100%; }
.pres-bar .ok, .bar .ok { background: var(--pelouse); }
.pres-bar .wait, .bar .wait { background: var(--doute); }
.pres-bar .ko, .bar .ko { background: var(--carton); }
.txt-ok { color: #8fe0b2; } .txt-ko { color: #ffb0b5; } .txt-wait { color: #f5e08f; }
.row.me { background: rgba(242,163,58,.1); border-radius: 10px; }
/* Statistiques */
.bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.12); }
.bar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 14px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: currentColor; }
td.lead { color: var(--sodium); font-weight: 800; }
/* Visionneuse de document */
.viewer { display: grid; place-items: center; min-height: calc(100dvh - 240px - var(--safe-b)); }
.viewer img { max-width: 100%; max-height: calc(100dvh - 240px - var(--safe-b)); object-fit: contain; border-radius: 10px; background: #000; }
.viewer iframe { width: 100%; height: calc(100dvh - 240px - var(--safe-b)); border: 0; border-radius: 10px; background: #fff; }

/* Lisibilité sur les photos claires */
.fixture .when, .fixture .where, .fixture .teams, .page-head h1, .page-head .muted { text-shadow: 0 1px 10px rgba(0,0,0,.75), 0 0 2px rgba(0,0,0,.6); }
.fixture .when { color: #ffb64d; }

/* iPhone : la zone tout en bas (barre de Safari, indicateur d'accueil) peut rester hors de la page.
   Le fond photo et la barre de menu se prolongent dessous, il n'y a donc plus jamais de bande vide. */
#bg { bottom: -200px; height: auto; }
#tabbar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 200px; background: rgba(9, 12, 24, 0.92); }
.sheet-back { bottom: -200px; height: auto; padding-bottom: 200px; }

/* Barre du menu transparente sur téléphone : seules les icônes restent, sur un fondu vers le noir */
@media (max-width: 899px) {
  #tabbar { background: linear-gradient(180deg, rgba(0,0,0,0) 0%, var(--band-a, rgba(0,0,0,.6)) 45%, var(--band, #000) 100%);
    backdrop-filter: none; -webkit-backdrop-filter: none; border-top: 0; }
  #tabbar::after { background: var(--band, #000); }
  .tab { color: rgba(255,255,255,.78); text-shadow: 0 1px 6px rgba(0,0,0,.9); }
  .tab svg { filter: drop-shadow(0 1px 4px rgba(0,0,0,.85)); }
  .tab[aria-current="page"] { color: #fff; }
  .tab[aria-current="page"]::before { top: 6px; }
}

/* Le voile s'arrête au bas de l'écran visible ; en dessous, la teinte unie du bas de la photo */
.bg-veil { bottom: 200px; z-index: 3; }
.bg-veil::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 200px; background: var(--band, #000); }

/* Discussion : suppression d'un message, annonce sur l'accueil */
.msg-del { margin-left: auto; border: 0; background: rgba(255,255,255,.12); color: var(--chalk); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.announce { border-color: rgba(242,163,58,.55); background: rgba(40,26,8,.82); }
.announce h3 { display: flex; align-items: center; gap: 8px; }
.announce h3 svg { width: 20px; height: 20px; color: var(--sodium); }

/* ---------- Coach 018 ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.coach-pitch { position: relative; width: min(100%, 420px); margin: 0 auto; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden;
  background: repeating-linear-gradient(180deg, #2e7d4f 0 12.5%, #2a7349 12.5% 25%); border: 2px solid rgba(255,255,255,.7); }
.coach-pitch .ln { position: absolute; border: 2px solid rgba(255,255,255,.7); pointer-events: none; }
.coach-pitch .half { left: 0; right: 0; top: 50%; height: 0; border-width: 2px 0 0; }
.coach-pitch .circle { left: 50%; top: 50%; width: 30%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); }
.coach-pitch .box-b { left: 25%; right: 25%; bottom: -2px; height: 15%; }
.coach-pitch .box-t { left: 25%; right: 25%; top: -2px; height: 15%; }
.coach-pitch .goal { position: absolute; left: 40%; right: 40%; height: 5px; background: rgba(255,255,255,.9); }
.coach-pitch .goal.t { top: 0; } .coach-pitch .goal.b { bottom: 0; }
.coach-pitch .tok, .coach-pitch .opp, .coach-pitch .ball { position: absolute; transform: translate(-50%, -50%); transition: left 1.2s ease-in-out, top 1.2s ease-in-out; }
.coach-pitch .tok { z-index: 2; border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.coach-pitch .tok .disc { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 15px; border: 3px solid #000; box-shadow: 0 3px 10px rgba(0,0,0,.4); }
.coach-pitch .tok.gk .disc { background: var(--sodium); }
.coach-pitch .tok.me .disc { outline: 3px solid var(--sodium); outline-offset: 2px; }
.coach-pitch .tok .nm { font-size: 11px; font-weight: 700; color: #fff; background: rgba(0,0,0,.65); padding: 0 5px; border-radius: 5px; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coach-pitch .opp { width: 22px; height: 22px; border-radius: 50%; background: #c62828; border: 2px solid #fff; z-index: 1; }
.coach-pitch .ball { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #111; z-index: 3; box-shadow: 0 0 0 3px rgba(0,0,0,.25); }
.coach-ctrl { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.coach-keys { margin: 6px 0 0 18px; display: grid; gap: 4px; }
@media (prefers-reduced-motion: reduce) { .coach-pitch .tok, .coach-pitch .opp, .coach-pitch .ball { transition: none; } }
.coach-pitch .tok .cap { position: absolute; top: -4px; right: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--sodium); color: #000; font-size: 11px; font-weight: 900; display: grid; place-items: center; border: 2px solid #000; }
.wu-now { text-align: center; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.05); }
.wu-name { font-weight: 800; font-size: 18px; margin: 4px 0; }
.wu-time { font-family: var(--display); font-weight: 900; font-size: 48px; line-height: 1.1; }
.chips-pick, .rt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; margin-bottom: 8px; }
.coach-pitch.focus .tok:not(.me), .coach-pitch.focus .opp { opacity: .4; }
.coach-pitch .tok.drag { z-index: 4; cursor: grab; touch-action: none; }
.coach-pitch .tok.drag .disc { outline: 3px dashed var(--sodium); outline-offset: 3px; }
.coach-pitch .ghost { position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 3px dashed #fff; transform: translate(-50%, -50%); z-index: 1; }
#ed .tok, #ed .opp, #ed .ball { user-select: none; -webkit-user-select: none; }
.coach-pitch .tri { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; opacity: 0; transition: opacity .4s; }
.coach-pitch .tri polygon { fill: rgba(255, 200, 60, .18); stroke: var(--sodium); stroke-width: .6; stroke-dasharray: 2 1.2; vector-effect: non-scaling-stroke; }
.coach-pitch.mini { width: min(100%, 230px); }
.coach-pitch.mini .tok .disc { width: 26px; height: 26px; font-size: 11px; border-width: 2px; }
.coach-pitch.mini .opp { width: 14px; height: 14px; }
.coach-pitch.mini .ball { width: 10px; height: 10px; }
.quiz-game .coach-ctrl, .quiz-game #cp-post, .quiz-game #cp-focus, .quiz-game #cp-game, .quiz-game #cp-quit { display: none; }
.qz-dots { display: flex; gap: 8px; margin: 6px 0 14px; }
.qz-dots span { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); transition: background .3s; }
.qz-dots span.cur { background: rgba(255,255,255,.45); }
.qz-dots span.ok { background: #3fb871; } .qz-dots span.ko { background: #d9534f; }
.qz-in { animation: qzIn .35s ease-out; }
@keyframes qzIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.qz-opt.qz-good { background: #2e8b57; border-color: #3fb871; color: #fff; animation: qzPop .4s; }
.qz-opt.qz-bad { background: #8b2e2e; border-color: #d9534f; color: #fff; animation: qzShake .4s; }
@keyframes qzPop { 50% { transform: scale(1.04); } }
@keyframes qzShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.qz-streak { margin-top: 8px; font-weight: 800; color: var(--sodium); animation: qzPop .5s; }
.qz-score { font-family: var(--display); font-weight: 900; font-size: 64px; line-height: 1; text-align: center; color: var(--sodium); }
.qz-score small { font-size: 28px; color: inherit; opacity: .7; }
.qz-end { text-align: center; }
.qz-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.1); margin-top: 6px; overflow: hidden; }
.qz-bar span { display: block; height: 100%; background: var(--sodium); transition: width .8s; }
@media (prefers-reduced-motion: reduce) { .qz-in, .qz-opt, .qz-streak { animation: none; } }
.cp-prog { height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); margin: 10px auto 0; width: min(100%, 420px); overflow: hidden; }
.cp-prog span { display: block; height: 100%; width: 0; background: var(--sodium); transition: width .6s ease; }
.quiz-game .cp-prog, .quiz-game #cp-speed { display: none; }
tr.ours td { background: rgba(255, 190, 60, .14); font-weight: 700; }
.motm-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.motm-pick button[aria-pressed="true"] { background: var(--sodium); color: #000; border-color: var(--sodium); }
/* 4.4 : lecteur des animations (porteur, trajectoires, niveaux) et onglet Entraînement */
.coach-pitch .trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.coach-pitch .trail line { stroke-width: .8; vector-effect: non-scaling-stroke; }
.coach-pitch .trail line.pass { stroke: #fff; stroke-width: 2.5; stroke-dasharray: 6 5; }
.coach-pitch .trail line.shot { stroke: #ff5252; stroke-width: 4; }
.coach-pitch .tok.carrier .disc { box-shadow: 0 0 0 4px #fff, 0 0 16px 6px rgba(255,255,255,.7); }
.cp-legend { text-align: center; margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 8px; }
.cp-legend span[class^="lg-"] { display: inline-block; vertical-align: middle; }
.lg-ball { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #111; }
.lg-car { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.5); }
.lg-opp { width: 11px; height: 11px; border-radius: 50%; background: #c62828; border: 2px solid #fff; }
.lg-pass { width: 18px; border-top: 2px dashed currentColor; }
.lg-shot { width: 18px; border-top: 3px solid #ff5252; }
.chip.lvl-deb { background: rgba(63,163,107,.22); color: #8fe0b2; }
.chip.lvl-int { background: rgba(232,197,71,.2); color: #f5e08f; }
.chip.lvl-av { background: rgba(224,70,79,.22); color: #ffb0b5; }
.coach-pitch.base-pitch { width: min(100%, 300px); }
.quiz-game .cp-legend, .quiz-game #cp-again0 { display: none; }
.tr-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.coach-ctrl { flex-wrap: wrap; }
/* 4.6 : schémas animés des exercices */
.ex-pitch { position: relative; width: min(100%, 440px); margin: 0 auto; height: 0; border-radius: 14px; overflow: hidden; background: repeating-linear-gradient(180deg, #2e7d4f 0 12.5%, #2a7349 12.5% 25%); border: 2px solid rgba(255,255,255,.7); }
.ex-pitch > * { position: absolute; }
.ex-zone { border: 2px dashed rgba(255,255,255,.55); border-radius: 6px; }
.ex-goal { height: 2%; min-height: 6px; background: #fff; border-radius: 2px; }
.ex-mini { width: 18px; height: 8px; border: 2px solid #fff; border-radius: 2px; transform: translate(-50%, -50%); }
.ex-cone { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 11px solid #ff9800; transform: translate(-50%, -60%); }
.ex-arrows { inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.ex-arrows line { vector-effect: non-scaling-stroke; }
.ex-pass { stroke: #fff; stroke-width: 2.5; stroke-dasharray: 6 5; } .exm-pass { fill: #fff; }
.ex-run { stroke: #ffe082; stroke-width: 2; stroke-dasharray: 2 4; } .exm-run { fill: #ffe082; }
.ex-shot { stroke: #ff5252; stroke-width: 4; } .exm-shot { fill: #ff5252; }
.ex-p { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; transform: translate(-50%, -50%); transition: left 1.2s ease-in-out, top 1.2s ease-in-out; z-index: 2; font-family: var(--display); font-weight: 900; font-size: 12px; border: 2px solid #000; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.ex-p.ex-a { background: #fff; color: #000; }
.ex-p.ex-o { background: #c62828; color: #fff; border-color: #fff; }
.ex-p.ex-j { background: #fdd835; color: #000; }
.ex-p.ex-g { background: var(--sodium); color: #000; }
.ex-p.carrier { box-shadow: 0 0 0 4px #fff, 0 0 14px 5px rgba(255,255,255,.7); }
.ex-ball { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 2px solid #111; transform: translate(-50%, -50%); transition: left 1.2s ease-in-out, top 1.2s ease-in-out; z-index: 3; }
.ex-cap { text-align: center; margin-top: 10px; min-height: 2.6em; font-weight: 600; }
.lg-joker { width: 11px; height: 11px; border-radius: 50%; background: #fdd835; border: 2px solid #000; }
.lg-run { width: 18px; border-top: 2px dotted #ffe082; }
@media (prefers-reduced-motion: reduce) { .ex-p, .ex-ball { transition: none; } }
/* 4.8 : rôles de pressing sur les schémas */
.ex-p.r-press { box-shadow: 0 0 0 4px #ff9800; }
.ex-p.r-close { box-shadow: 0 0 0 4px #fdd835; }
.ex-p.r-cover { box-shadow: 0 0 0 4px #42a5f5; }
.ex-p.r-zone { box-shadow: 0 0 0 4px #b0bec5; }
.lg-r { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #fff; vertical-align: middle; }
.lg-r.r-press { box-shadow: 0 0 0 3px #ff9800; } .lg-r.r-close { box-shadow: 0 0 0 3px #fdd835; } .lg-r.r-cover { box-shadow: 0 0 0 3px #42a5f5; } .lg-r.r-zone { box-shadow: 0 0 0 3px #b0bec5; }
.ex-pitch .ex-line { left: 0; right: 0; height: 0; border-top: 2px solid rgba(255,255,255,.6); }
.ex-pitch .ex-box { border: 2px solid rgba(255,255,255,.6); }
/* 4.9 : plan de match */
.mp-grid { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; }
@media (max-width: 420px) { .mp-grid { grid-template-columns: 96px 1fr; gap: 10px; } }
.mp-pitch { position: relative; aspect-ratio: 2 / 3; border-radius: 8px; background: repeating-linear-gradient(180deg, #2e7d4f 0 12.5%, #2a7349 12.5% 25%); border: 2px solid rgba(255,255,255,.7); }
.mp-pitch span { position: absolute; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #000; font: 900 9px/24px var(--display); text-align: center; border: 2px solid #000; }
.mp-pitch span.gk { background: var(--sodium); }
/* 5.4 : couleurs par poste (gardien jaune, défense bleue, milieu vert, attaque violette ; adversaires rouges), couleurs sobres */
.coach-pitch:not(.sober) .tok.l-gk .disc, .ex-pitch:not(.sober) .ex-p.l-gk, .mp-pitch:not(.sober) span.l-gk { background: #fdd835; color: #000; }
.coach-pitch:not(.sober) .tok.l-def .disc, .ex-pitch:not(.sober) .ex-p.l-def, .mp-pitch:not(.sober) span.l-def { background: #1e88e5; color: #fff; }
.coach-pitch:not(.sober) .tok.l-mid .disc, .ex-pitch:not(.sober) .ex-p.l-mid, .mp-pitch:not(.sober) span.l-mid { background: #43a047; color: #fff; }
.coach-pitch:not(.sober) .tok.l-att .disc, .ex-pitch:not(.sober) .ex-p.l-att, .mp-pitch:not(.sober) span.l-att { background: #8e24aa; color: #fff; }
.lg-l { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; border: 2px solid #000; }
.lg-l.l-gk { background: #fdd835; } .lg-l.l-def { background: #1e88e5; } .lg-l.l-mid { background: #43a047; } .lg-l.l-att { background: #8e24aa; }
.coach-pitch .trail line.run { stroke: #ffe082; stroke-width: 2.5; stroke-dasharray: 2 5; }
#ed { touch-action: none; }
/* mode présentation : pour le partage d'écran */
.present { position: fixed !important; inset: 0; z-index: 3000; background: #0b0f14; overflow: auto; padding: 58px 16px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: none !important; margin: 0 !important; border-radius: 0 !important; }
.present .coach-pitch { width: auto; height: min(76vh, 140vw); max-width: none; }
.present .ex-pitch { width: min(94vw, calc(76vh / var(--r, 1))); height: min(76vh, calc(94vw * var(--r, 1))); padding-top: 0 !important; }
.present #cp-cap, .present .ex-cap { font-size: clamp(1.1rem, 2.4vw, 1.7rem); text-align: center; max-width: 900px; min-height: 2.6em; }
.present .coach-ctrl .btn { font-size: 1.05rem; padding: 10px 18px; }
.present .actions, .present #cp-res, .present #cp-me, .present .coach-keys, .present .cp-prog { display: none !important; }
.present-close { position: fixed; top: 10px; right: 12px; z-index: 3001; }
body.presenting { overflow: hidden; }
.quiz-game #cp-present, .quiz-game .cp-lines { display: none; }
/* 5.5 : planning des rotations */
.ro-table td, .ro-table th { vertical-align: top; padding: 8px 6px; }
.ro-table .ro-min { font-family: var(--display); font-weight: 900; font-size: 18px; white-space: nowrap; }
.ro-table .ro-half td { text-align: center; font-weight: 700; color: var(--sodium); background: rgba(255,255,255,.04); }
.ro-in { display: inline-block; color: #8fe0b2; font-weight: 700; margin: 0 6px 2px 0; }
.ro-in::before { content: "↑ "; }
.ro-out { display: inline-block; color: #ffb0b5; font-weight: 700; margin: 0 6px 2px 0; }
.ro-out::before { content: "↓ "; }
.ro-chip { cursor: pointer; border: 1px dashed rgba(255,255,255,.4); margin: 2px; }
.ro-det { margin-top: 4px; }
/* rotations sur téléphone : une carte par changement, tout visible sans défiler de côté */
@media (max-width: 560px) {
  .ro-table thead { display: none; }
  .ro-table, .ro-table tbody, .ro-table tr, .ro-table td { display: block; width: 100%; }
  .ro-table tr { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .ro-table td { padding: 2px 0; }
  .ro-table td[data-label]::before { content: attr(data-label) " : "; font-weight: 700; opacity: .75; }
  .ro-table .ro-min { font-size: 22px; }
  .ro-table .ro-half td { padding: 6px 0; }
}
.ro-table td { white-space: normal; }
@media (max-width: 560px) { .ro-table td.ro-first { display: none; } }
/* 5.5 : visuel « tableau tactique » de la carte Coach 018 sur l'accueil (à fond perdu, coins arrondis de la carte) */
.home-coach { overflow: hidden; }
.home-coach-img { display: block; width: calc(100% + 36px); max-width: none; height: auto; aspect-ratio: 1098 / 476; object-fit: cover; margin: -18px -18px 14px; border-radius: calc(var(--r-panel) - 1px) calc(var(--r-panel) - 1px) 0 0; }
@media (min-width: 720px) { .home-coach-img { aspect-ratio: auto; height: 300px; } }
/* 5.6 : évolution des notes */
.ev-chart { width: 100%; max-width: 420px; height: auto; display: block; margin-top: 6px; }
.ev-chart .ev-line { fill: none; stroke: var(--sodium); stroke-width: 2.5; }
.ev-chart .ev-dot { fill: var(--sodium); }
.ev-chart .ev-mid { stroke: rgba(255,255,255,.2); stroke-dasharray: 4 4; }
