/* 018 CLUB — styles
   Encre et craie du blason, lumière sodium des city stades, ciel de nuit de Montmartre. */
:root {
  --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; }
body {
  font-family: var(--text); font-size: 16px; line-height: 1.5; color: var(--chalk);
  background: var(--night); -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,var(--veil, .45)) 55%, rgba(0,0,0,calc(var(--veil, .45) + .2)) 100%);
  transition: background 1.4s ease; }

/* ---------- Intro ---------- */
#intro { position: fixed; inset: 0; z-index: 100; background: #fff; display: grid; place-items: center; cursor: pointer; }
#intro.is-done { display: none; }
.intro-stage { position: relative; width: min(64vmin, 360px); aspect-ratio: 1; }
.intro-logo { position: absolute; inset: 0; width: 100%; height: 100%; 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; }

/* ---------- Coque ---------- */
#app { position: relative; z-index: 1; min-height: 100%; }
#main { padding: calc(20px + var(--safe-t)) 16px calc(var(--tabbar) + 28px + var(--safe-b)); max-width: 1120px; margin: 0 auto; outline: none; }
#rail { display: none; }
#tabbar { position: fixed; 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: fixed; 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 { margin-left: var(--rail); padding: 36px 40px 60px; max-width: calc(1120px + var(--rail)); }
  .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: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 20px; flex-wrap: wrap; }
.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; }

/* 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; }

.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: 100%; 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(100vh - 220px - var(--safe-b)); min-height: 360px; }
.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; }
.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; }
.page-head .actions .btn ~ .logo-mini { display: none; }
