/* Gestion TCB — feuille de style
   Palette : vert grillage, jaune balle, terre battue. Titres et chiffres en Barlow Condensed (tableau de score). */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  --green: #12403A; --green-2: #1B574F; --green-soft: #DCE8E3;
  --ball: #D9E832; --ball-ink: #2B3000;
  --bg: #EEF2EF; --surface: #FFFFFF; --line: #D5DED9; --line-2: #E6ECE8;
  --ink: #0F2622; --ink-2: #4B605B; --ink-3: #6F827D;
  --clay: #B4502D; --clay-soft: #F7E4DC;
  --ok: #1F7A4D; --ok-soft: #DDF0E5;
  --warn: #B7791F; --warn-soft: #FAEFD7;
  --r-s: 6px; --r-m: 10px; --r-l: 16px;
  --tabs-h: calc(62px + env(safe-area-inset-bottom, 0px));
  --text: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Barlow Condensed", "Barlow", "Arial Narrow", system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--text); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: progress; opacity: .6; }
small { font-size: .8125rem; }
[hidden] { display: none !important; }
svg.ic { flex: none; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: var(--r-s); }
.side :focus-visible, .auth-court :focus-visible { outline-color: var(--ball); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; letter-spacing: .005em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.1875rem; font-weight: 600; }

/* utilitaires */
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--ink-3); }
.small { font-size: .8125rem; }
.center { text-align: center; }
.pad { padding: 16px; }
.link { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.link:hover { text-decoration-color: var(--ball); }
.prose { max-width: 68ch; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 12px; }

/* démarrage */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--green); color: #fff; font: 700 1.5rem var(--display); letter-spacing: .02em; }
.boot-mark, .brand-ball { border-radius: 50%; background: var(--ball); position: relative; overflow: hidden; }
.boot-mark { width: 56px; height: 56px; animation: bounce 1s ease-in-out infinite alternate; }
.boot-mark::before, .brand-ball::before { content: ""; position: absolute; inset: -30% 55% -30% -45%; border: 2px solid rgba(255,255,255,.85); border-radius: 50%; }
.boot-mark::after, .brand-ball::after { content: ""; position: absolute; inset: -30% -45% -30% 55%; border: 2px solid rgba(255,255,255,.85); border-radius: 50%; }
@keyframes bounce { from { transform: translateY(-10px); } to { transform: translateY(6px); } }
#app > .empty { min-height: 100dvh; display: grid; place-content: center; justify-items: center; }

/* ossature */
.shell { min-height: 100dvh; }
.side { display: none; }
#view { display: block; padding-bottom: var(--tabs-h); outline: none; }
.view-wrap { max-width: 860px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 28px; }
.view-wrap.full { max-width: 900px; padding: 0; height: calc(100dvh - var(--tabs-h)); }
.loading { height: 40dvh; display: grid; place-content: center; }
.loading::after { content: ""; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tabs { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: var(--tabs-h); padding-bottom: env(safe-area-inset-bottom, 0px); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-top: 1px solid var(--line); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-3); font-size: .6875rem; font-weight: 500; }
.tab.active { color: var(--green); font-weight: 600; }
.tab.active::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; background: var(--ball); border-radius: 0 0 3px 3px; box-shadow: 0 0 0 1px rgba(18,64,58,.15); }
.tab .badge { position: absolute; top: 6px; left: calc(50% + 6px); }
.badge { display: inline-grid; place-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--clay); color: #fff; font: 700 .8125rem/1 var(--display); letter-spacing: .02em; }
.badge.muted { background: var(--ink-3); color: #fff; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .tabs { display: none; }
  #view { padding-bottom: 0; }
  .view-wrap { padding: 32px 32px 56px; }
  .view-wrap.full { height: 100dvh; border-inline: 1px solid var(--line); background: var(--surface); }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 22px 14px; background: var(--green); color: #fff; overflow-y: auto;
    background-image: linear-gradient(rgba(255,255,255,.08), rgba(255,255,255,.08)); background-size: 2px 100%; background-position: right 22px top; background-repeat: no-repeat; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; font: 600 1.375rem/1.1 var(--display); }
  .brand b { font-weight: 700; color: var(--ball); }
  .brand-ball { width: 26px; height: 26px; flex: none; }
  .side nav { display: grid; gap: 2px; }
  .side-link { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-m); color: rgba(255,255,255,.82); font-weight: 500; }
  .side-link:hover { background: rgba(255,255,255,.08); color: #fff; }
  .side-link.active { background: var(--ball); color: var(--ball-ink); font-weight: 600; }
  .side-link .badge { margin-left: auto; }
  .side-foot { margin-top: auto; padding: 16px 12px 0; color: rgba(255,255,255,.6); font-size: .8125rem; }
  h1 { font-size: 2.375rem; }
}

/* en-tête de page */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.page-head > .grow { flex: 1 1 180px; }
.page-head h1 { overflow-wrap: break-word; }
.page-head .sub { color: var(--ink-2); margin-top: 2px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.icon-btn { flex: none; display: inline-grid; place-content: center; width: 42px; height: 42px; border-radius: 50%; color: var(--ink); }
.icon-btn:hover { background: var(--green-soft); }

.block { margin-top: 26px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.block-head h2 { position: relative; padding-left: 12px; }
.block-head h2::before { content: ""; position: absolute; left: 0; top: .12em; bottom: .12em; width: 4px; background: var(--ball); box-shadow: 0 0 0 1px rgba(18,64,58,.18); }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px; border-radius: var(--r-m); border: 1.5px solid transparent; font-weight: 600; line-height: 1.2; white-space: nowrap; transition: background-color .12s, border-color .12s; }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-2); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--green); }
.btn.ghost:hover { border-color: var(--green); }
.btn.danger { background: var(--clay); color: #fff; }
.btn.danger:hover { background: #9C4225; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: .875rem; border-radius: var(--r-s); }
.btn.block { display: flex; width: 100%; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.actions.wrap { flex-wrap: wrap; justify-content: flex-start; margin: 14px 0; }
.actions.center { justify-content: center; }
.center-btn { display: flex; margin: 0 auto 12px; }

/* formulaires */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.form > * { grid-column: 1 / -1; min-width: 0; }
.form > .half { grid-column: span 1; }
.field { display: grid; gap: 5px; align-content: start; }
.field > label { font-weight: 600; font-size: .9375rem; }
.field small, .field.check small { display: block; color: var(--ink-3); font-weight: 400; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-m); font-size: 1rem; }
textarea { resize: vertical; line-height: 1.45; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312403A' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,64,58,.16); }
input::placeholder, textarea::placeholder { color: #8A9B96; }
input[type=file] { width: 100%; padding: 10px; border: 1.5px dashed var(--line); border-radius: var(--r-m); background: var(--surface); }
input[type=checkbox] { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--green); flex: none; }
.field.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.form-section { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 1.125rem; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.toolbar > input[type=search] { flex: 1 1 220px; }
.toolbar > select { flex: 0 1 190px; }

/* feuilles (dialog) */
dialog.sheet { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: 0; border: 0; border-radius: var(--r-l) var(--r-l) 0 0; background: var(--bg); color: var(--ink); overflow: hidden; }
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-up .2s ease-out; }
dialog.sheet::backdrop { background: rgba(9,32,29,.55); }
dialog.sheet > header { display: flex; align-items: center; gap: 10px; padding: 14px 10px 10px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
dialog.sheet > header h2 { flex: 1; font-size: 1.375rem; }
.sheet-body { padding: 18px 18px calc(20px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; }
.sheet-body > p + p { margin-top: 10px; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) {
  dialog.sheet { width: min(540px, calc(100vw - 40px)); margin: auto; border-radius: var(--r-l); max-height: 88dvh; }
  dialog.sheet.wide { width: min(820px, calc(100vw - 40px)); }
}
.menu-list { display: grid; gap: 2px; margin: -6px -6px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 10px 12px; border-radius: var(--r-m); font-weight: 500; }
.menu-item:hover { background: var(--green-soft); }
.menu-item.danger { color: var(--clay); }
.menu-item.danger:hover { background: var(--clay-soft); }

/* toasts */
#toasts { position: fixed; z-index: 1000; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + 12px); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { max-width: 520px; padding: 11px 16px; border-radius: var(--r-m); background: var(--ink); color: #fff; font-weight: 500; box-shadow: 0 6px 20px rgba(9,32,29,.3); border-left: 5px solid var(--ball); animation: sheet-up .18s ease-out; }
.toast.ok { border-left-color: #58C58C; }
.toast.err { border-left-color: #F08A63; }
.toast.warn { border-left-color: #F0C05A; }
@media (min-width: 900px) { #toasts { bottom: 24px; left: 264px; } }

/* étiquettes */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; background: var(--green-soft); color: var(--green); font-size: .8125rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: #15603B; }
.chip.bad { background: var(--clay-soft); color: #8E3B1E; }
.chip.warn { background: var(--warn-soft); color: #7A4F0E; }
.chip.dark { background: var(--ink); color: #fff; }
.chip.ball { background: var(--ball); color: var(--ball-ink); }
.chip.link { text-decoration: underline; text-underline-offset: 2px; }
.chip.score, .tag { font-family: var(--display); font-weight: 700; letter-spacing: .03em; }
.chip.score { background: var(--ink); color: var(--ball); border-radius: var(--r-s); font-size: .9375rem; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; border: 1.5px solid var(--green); color: var(--green); font-size: .875rem; line-height: 1.35; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips:empty { display: none; }

.avatar { flex: none; display: inline-grid; place-content: center; width: 42px; height: 42px; border-radius: 50%; background: var(--green); color: var(--ball); font: 700 1rem/1 var(--display); letter-spacing: .04em; }
.avatar.sm { width: 32px; height: 32px; font-size: .8125rem; }
.avatar.lg { width: 68px; height: 68px; font-size: 1.625rem; }
.avatar-gap { flex: none; width: 32px; }

.empty { padding: 36px 20px; text-align: center; border: 1.5px dashed var(--line); border-radius: var(--r-l); color: var(--ink-2); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* listes */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line-2); }
.row, .row-link { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; }
.row-link:hover { background: #F6F9F7; }
.row-link.dim { opacity: .55; }
.row-link.selected { background: #F6F8D2; }
.row { flex-wrap: wrap; }
.row > .grow { min-width: 120px; }
.presence { flex: none; margin-left: auto; }
@media (max-width: 560px) { .row > .presence { flex: 1 0 100%; } .row > .presence .pr { flex: 1; } }
.row small, .row-link small { color: var(--ink-3); }
.list.ordered { counter-reset: n; }
.list.ordered > li { counter-increment: n; position: relative; }
.list.ordered > li > * { padding-left: 50px; }
.list.ordered > li::before { content: counter(n); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 26px; text-align: center; font: 700 1.25rem/1 var(--display); color: var(--ink-3); }

/* agenda : éléments */
.item { position: relative; display: flex; gap: 14px; padding: 14px 14px 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.item + .item { margin-top: 10px; }
.item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--green); }
.item.k-match::before { background: var(--clay); }
.item.k-event::before { background: var(--warn); }
.item.k-booking::before { background: var(--ball); box-shadow: inset -1px 0 0 rgba(18,64,58,.2); }
.item.cancelled { background: #F7F8F7; }
.item.cancelled .item-title { text-decoration: line-through; color: var(--ink-3); }
.item-title { display: inline-block; font: 600 1.25rem/1.15 var(--display); letter-spacing: .005em; }
.item-title:hover { text-decoration: underline; text-decoration-color: var(--ball); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.item-meta { color: var(--ink-2); font-size: .9375rem; margin-top: 2px; }

.date-badge { flex: none; align-self: flex-start; display: grid; justify-items: center; width: 54px; padding: 6px 0 5px; border-radius: var(--r-s); background: var(--ink); color: #fff; line-height: 1; }
.date-badge .dow, .date-badge .mon { font-size: .6875rem; font-weight: 600; letter-spacing: .04em; color: rgba(255,255,255,.72); text-transform: lowercase; }
.date-badge .dnum { font: 700 1.75rem/1 var(--display); color: var(--ball); margin: 2px 0 1px; }

/* réponses et appel */
.answer, .presence, .segmented { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--r-m); overflow: hidden; background: var(--surface); }
.answer { margin-top: 10px; max-width: 100%; }
.ans { white-space: nowrap; }
@media (max-width: 420px) { .ans { padding: 6px 9px; font-size: .875rem; } }
.ans, .pr, .segmented button { min-height: 40px; padding: 6px 14px; font-weight: 600; font-size: .9375rem; color: var(--ink-2); }
.ans + .ans, .pr + .pr, .segmented button + button { border-left: 1.5px solid var(--line); }
.ans:hover, .pr:hover, .segmented button:hover { background: var(--green-soft); }
.ans.yes.on, .pr.present.on { background: var(--ok); color: #fff; }
.ans.maybe.on, .pr.late.on { background: var(--warn); color: #fff; }
.ans.no.on, .pr.absent.on { background: var(--clay); color: #fff; }
.pr.excused.on { background: var(--ink-2); color: #fff; }
.pr { min-width: 44px; padding: 6px 10px; text-align: center; font: 700 1.0625rem var(--display); }
.segmented button.on { background: var(--green); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.filter { min-height: 36px; padding: 4px 14px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 500; font-size: .9375rem; color: var(--ink-2); }
.filter.on, .filter[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* accueil */
.hello { position: relative; margin: calc(-14px - env(safe-area-inset-top, 0px)) -16px 0; padding: calc(26px + env(safe-area-inset-top, 0px)) 16px 24px; background: var(--green); color: #fff; overflow: hidden; }
.hello::before { content: ""; position: absolute; right: -40px; top: -20px; bottom: -20px; width: 210px; border: 2px solid rgba(255,255,255,.16); border-right: 0; background: linear-gradient(rgba(255,255,255,.16), rgba(255,255,255,.16)) left 50% / 100% 2px no-repeat; transform: skewX(-8deg); pointer-events: none; }
.hello h1 { position: relative; font-size: 2.5rem; }
.hello-date { position: relative; color: var(--ball); font-weight: 600; }
.hello-date::first-letter { text-transform: uppercase; }
.hello-todo { position: relative; margin-top: 10px; max-width: 46ch; color: rgba(255,255,255,.88); }
@media (min-width: 900px) { .hello { margin: 0; padding: 30px 28px; border-radius: var(--r-l); } .hello h1 { font-size: 3rem; } }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.stat { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.stat b { font: 700 2.125rem/1 var(--display); color: var(--green); }
.stat span { color: var(--ink-2); font-size: .875rem; line-height: 1.3; }
a.stat:hover { border-color: var(--green); }
.stat.alert { background: var(--clay-soft); border-color: #E9BBA8; }
.stat.alert b { color: var(--clay); }
.announce { display: block; padding: 14px 16px; background: #F8FAD9; border: 1px solid #DDE68A; border-left: 5px solid var(--ball); border-radius: var(--r-m); }
.announce + .announce { margin-top: 8px; }
.announce p { white-space: pre-wrap; overflow-wrap: anywhere; }
.announce small { display: block; margin-top: 6px; color: var(--ink-2); }
.notes { display: grid; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.notes li { position: relative; padding-left: 16px; max-width: 72ch; }
.notes li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--ball); box-shadow: 0 0 0 1px rgba(18,64,58,.35); }
.banner { padding: 12px 14px; border-radius: var(--r-m); font-weight: 600; margin-bottom: 14px; background: var(--green-soft); }
.banner.bad { background: var(--clay-soft); color: #8E3B1E; }
.banner.warn { background: var(--warn-soft); color: #7A4F0E; }

.day { margin-top: 22px; }
.day-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 1.1875rem; font-weight: 600; color: var(--ink-2); }

/* terrains */
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; margin: 0 -16px; scrollbar-width: none; scroll-snap-type: x proximity; }
.date-strip::-webkit-scrollbar { display: none; }
.day-pill { flex: none; scroll-snap-align: start; display: grid; justify-items: center; min-width: 58px; padding: 8px 10px; border-radius: var(--r-m); border: 1.5px solid var(--line); background: var(--surface); font-size: .8125rem; font-weight: 500; line-height: 1.15; color: var(--ink-2); }
.day-pill b { font: 700 1.5rem/1.05 var(--display); color: var(--ink); }
.day-pill.on { background: var(--ink); border-color: var(--ink); color: rgba(255,255,255,.8); }
.day-pill.on b { color: var(--ball); }
.court-grid-wrap { overflow: auto; max-height: 68dvh; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.court-grid { display: grid; grid-template-columns: 54px repeat(var(--cols, 2), minmax(104px, 1fr)); gap: 4px; padding: 0 6px 6px 0; min-width: max-content; }
.cg-corner, .cg-head { position: sticky; top: 0; z-index: 3; background: var(--green); color: #fff; }
.cg-corner { left: 0; z-index: 4; }
.cg-head { display: grid; align-content: center; padding: 8px 8px; text-align: center; line-height: 1.15; box-shadow: inset 2px 0 0 rgba(255,255,255,.25); }
.cg-head b { font: 700 1.125rem var(--display); letter-spacing: .02em; }
.cg-head small { color: rgba(255,255,255,.75); font-size: .6875rem; }
.cg-time { position: sticky; left: 0; z-index: 2; display: grid; place-content: start center; padding-top: 4px; background: var(--surface); font: 600 .9375rem var(--display); color: var(--ink-2); }
.cg-cell { min-height: 46px; display: grid; place-content: center; padding: 4px 6px; border-radius: var(--r-s); font-size: .8125rem; font-weight: 600; line-height: 1.2; text-align: center; overflow: hidden; overflow-wrap: anywhere; }
.cg-cell.free { border: 1.5px dashed #B9C9C2; color: var(--green); font-weight: 500; }
.cg-cell.free:hover { background: var(--ball); border-style: solid; border-color: var(--ball-ink); color: var(--ball-ink); }
.cg-cell.past { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--line-2) 6px 7px); }
.cg-cell.mine { background: var(--ball); color: var(--ball-ink); }
.cg-cell.taken { background: var(--green-soft); color: var(--green); }
.cg-cell.training { background: var(--green); color: #fff; }
.cg-cell.blocked { background: #D9DFDC; color: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .8125rem; color: var(--ink-2); }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .lg::before { content: ""; width: 14px; height: 14px; border-radius: 3px; background: var(--green-soft); }
.legend .lg.free::before { background: none; border: 1.5px dashed #9DB1A9; }
.legend .lg.mine::before { background: var(--ball); box-shadow: 0 0 0 1px rgba(43,48,0,.3); }
.legend .lg.training::before { background: var(--green); }
.legend .lg.blocked::before { background: #D9DFDC; }

/* cartes groupes / équipes */
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.card-link { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.card-link:hover { border-color: var(--green); }
.card-link h3 { font-size: 1.3125rem; font-weight: 700; }
.card-side { flex: none; display: grid; justify-items: center; min-width: 58px; padding: 6px 8px; border-radius: var(--r-s); background: var(--ink); color: rgba(255,255,255,.75); line-height: 1.1; }
.card-side b { font: 700 1.5rem/1 var(--display); color: var(--ball); }
.card-side small { font-size: .6875rem; }
.scoreline { flex: none; display: flex; gap: 2px; padding: 3px; border-radius: var(--r-s); background: var(--ink); }
.scoreline span { display: grid; justify-items: center; min-width: 34px; padding: 4px 4px 3px; border-radius: 4px; background: #1C3A35; color: #fff; font: 700 1.375rem/1 var(--display); }
.scoreline small { font: 600 .625rem/1.3 var(--text); color: rgba(255,255,255,.6); }
.scoreline .w { color: var(--ball); }
.scoreline .l { color: #F3A486; }
.scoreboard { display: grid; gap: 3px; padding: 4px; margin-bottom: 16px; border-radius: var(--r-m); background: var(--ink); max-width: 520px; }
.scoreboard > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; border-radius: 7px; background: #1C3A35; color: #fff; }
.scoreboard small { font: 600 1.25rem/1.1 var(--display); letter-spacing: .02em; overflow-wrap: anywhere; }
.scoreboard b { font: 700 2.5rem/1 var(--display); color: var(--ball); min-width: 1.2em; text-align: right; }

/* fiches */
.facts { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.facts dt, .facts dd { padding: 11px 14px; border-top: 1px solid var(--line-2); }
.facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; }
.facts dt { color: var(--ink-3); font-size: .9375rem; }
.facts dd { font-weight: 500; overflow-wrap: anywhere; }
.profile-card { display: flex; align-items: center; gap: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.profile-card h2 { font-size: 1.625rem; }
.temp-pw { margin: 14px 0; padding: 14px; border-radius: var(--r-m); background: var(--ink); color: var(--ball); font: 700 1.75rem/1.2 var(--display); letter-spacing: .08em; text-align: center; user-select: all; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-top: 1px solid var(--line-2); white-space: nowrap; }
.table thead th { border-top: 0; background: #F3F6F4; color: var(--ink-2); font-weight: 600; font-size: .8125rem; position: sticky; top: 0; }
.table td:last-child { white-space: normal; }
.table td:not(:first-child), .table th:not(:first-child) { font-variant-numeric: tabular-nums; }
.meter { height: 12px; margin: 14px 0 4px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ok); border-radius: 6px; transition: width .4s ease-out; }
.amount { flex: none; font: 700 1.1875rem var(--display); font-variant-numeric: tabular-nums; }

/* menu */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.menu-tile { display: grid; gap: 10px; align-content: start; min-height: 96px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); font-weight: 600; color: var(--ink); }
.menu-tile svg { color: var(--green); }
.menu-tile:hover { border-color: var(--green); }

/* sélecteur de membres */
.picker { display: grid; gap: 8px; }
.picker-list { max-height: 260px; overflow-y: auto; border: 1.5px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.pick { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 12px; }
.pick + .pick { border-top: 1px solid var(--line-2); }
.pick:hover { background: #F6F9F7; }
.pick.on { background: #F6F8D2; font-weight: 600; }

/* connexion */
.auth { min-height: 100dvh; display: grid; grid-template-rows: minmax(150px, 26dvh) 1fr; background: var(--surface); }
.auth-court { background-color: var(--green); background-repeat: no-repeat;
  background-image: linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), radial-gradient(circle at center, var(--ball) 0 13px, transparent 14px);
  background-size: 100% 3px, 3px 100%, 3px 100%, 64% 3px, 3px 50%, 40px 40px;
  background-position: 0 50%, 18% 0, 82% 0, 50% 100%, 50% 100%, 74% 28%; opacity: 1; }
.auth-card { width: 100%; max-width: 440px; margin: 0 auto; padding: 26px 20px calc(36px + env(safe-area-inset-bottom, 0px)); }
.auth-card h1 { margin: 4px 0 6px; font-size: 2.25rem; }
.auth-card .form { margin-top: 20px; }
.auth-card .btn.primary { width: 100%; }
.auth-brand { font: 600 1.125rem var(--display); letter-spacing: .02em; color: var(--ink-2); }
.auth-brand b { color: var(--green); font-weight: 700; }
.auth-foot { margin-top: 20px; text-align: center; color: var(--ink-2); }
@media (min-width: 900px) {
  .auth { grid-template-rows: none; grid-template-columns: minmax(0, 1fr) minmax(440px, 40vw); }
  .auth-court { background-size: 100% 4px, 4px 100%, 4px 100%, 64% 4px, 4px 50%, 56px 56px; }
  .auth-card { align-self: center; padding: 40px; }
}

/* discussions */
.channel { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; }
.channel:hover { background: #F6F9F7; }
.channel .grow { display: grid; }
.channel .grow small { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel.unread b { font-weight: 700; }
.channel.unread .grow small { color: var(--ink); font-weight: 500; }
.ch-icon { flex: none; display: inline-grid; place-content: center; width: 42px; height: 42px; border-radius: var(--r-m); background: var(--green-soft); color: var(--green); font: 700 1rem var(--display); }
.ch-icon.announce { background: var(--ball); color: var(--ball-ink); }
.ch-icon.team { background: var(--clay-soft); color: var(--clay); }
.ch-icon.dm { border-radius: 50%; background: var(--green); color: var(--ball); }
.ch-side { flex: none; display: grid; justify-items: end; gap: 4px; color: var(--ink-3); }

.chat { height: 100%; display: flex; flex-direction: column; background: var(--surface); }
.chat > .page-head { flex: none; flex-wrap: nowrap; align-items: center; margin: 0; padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px; border-bottom: 1px solid var(--line); }
.chat > .page-head h1 { font-size: 1.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat > .page-head .sub { font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pinned { flex: none; display: flex; gap: 10px; padding: 8px 14px; background: #F8FAD9; border-bottom: 1px solid #DDE68A; font-size: .875rem; max-height: 92px; overflow-y: auto; }
.pinned svg { margin-top: 2px; color: var(--green); }
.pinned p { overflow-wrap: anywhere; }
.msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px 8px; background: var(--bg); }
.msgs:focus-visible { outline-offset: -3px; }
.day-sep { margin: 14px 0 10px; text-align: center; font-size: .8125rem; font-weight: 600; color: var(--ink-3); }
.day-sep::first-letter { text-transform: uppercase; }
.msg { display: flex; gap: 8px; margin-top: 12px; max-width: 100%; }
.msg.grouped { margin-top: 3px; }
.msg-main { min-width: 0; max-width: min(82%, 560px); }
.msg-head { margin-bottom: 2px; font-size: .8125rem; color: var(--ink-3); }
.msg-head b { color: var(--ink); font-weight: 600; font-size: .875rem; }
.bubble-row { display: flex; align-items: center; gap: 2px; }
.bubble { padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.bubble a { color: var(--green); text-decoration: underline; font-weight: 500; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .avatar-gap { display: none; }
.msg.mine .msg-main { display: grid; justify-items: end; }
.msg.mine .msg-head { text-align: right; }
.msg.mine .bubble-row { flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--green); border-color: var(--green); color: #fff; border-radius: 14px 4px 14px 14px; }
.msg.mine .bubble a { color: var(--ball); }
.msg-more { flex: none; width: 32px; height: 32px; border-radius: 50%; color: var(--ink-3); display: inline-grid; place-content: center; opacity: .55; }
.msg-more:hover, .msg-more:focus-visible { opacity: 1; background: var(--green-soft); }
.pinned-mark { display: inline-block; margin-left: 6px; color: var(--warn); font-weight: 600; }
.composer { flex: none; display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { min-height: 46px; max-height: 140px; resize: none; border-radius: 22px; padding: 10px 16px; }
.composer.readonly { justify-content: center; padding: 14px; color: var(--ink-3); font-size: .9375rem; }
.send { flex: none; width: 46px; height: 46px; border-radius: 50%; display: inline-grid; place-content: center; background: var(--ball); color: var(--ball-ink); box-shadow: 0 0 0 1.5px rgba(43,48,0,.25); }
.send:hover { background: #CBDA22; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .side, .tabs, #toasts, .head-actions, .composer { display: none !important; }
  body { background: #fff; }
}
.auth-foot a, .auth-card .muted a { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Logo du club (remplace la balle par défaut) */
.brand-logo { width: 30px; height: 30px; object-fit: contain; border-radius: 7px; background: #fff; padding: 2px; flex: none; }
.auth-logo { display: block; height: 72px; max-width: 200px; object-fit: contain; margin-bottom: 12px; }

/* Photos dans les messages */
.msg-photo { display: block; max-width: 260px; border-radius: 12px; overflow: hidden; background: var(--line-2); }
.msg-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bubble-img { padding: 3px; background: none; border: 0; }
.bubble-img .msg-photo { max-width: 260px; }
.msg-caption { margin-top: 6px; }
.msg.mine .bubble-img { background: none; }
.composer .send.photo { background: var(--surface); color: var(--green); box-shadow: inset 0 0 0 1.5px var(--line); }
.composer .send.photo:hover { background: var(--green-soft); }

/* Newsletter */
.news-item { display: block; padding: 14px 16px; }
.news-item h3 { font-size: 1.25rem; }
.news-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.news-body p { margin-bottom: .8em; }

/* Galerie photos des newsletters */
.news-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.news-photo { position: relative; border-radius: 12px; overflow: hidden; background: var(--line-2); max-height: 300px; }
.news-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.news-photo .photo-del { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-content: center; background: rgba(15,38,34,.72); color: #fff; }
.news-photo .photo-del:hover { background: var(--clay); }

/* Bandeau d'installation */
.install-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 2px; padding: 10px 14px calc(10px); background: var(--green); color: #fff; font-weight: 500; }
.install-bar svg { flex: none; color: var(--ball); }
.install-bar .grow { font-size: .9375rem; line-height: 1.25; }
.install-bar .btn.primary { background: var(--ball); color: var(--ball-ink); border-color: var(--ball); }
.install-bar .btn.primary:hover { background: #CBDA22; }
.install-x { flex: none; display: grid; place-content: center; width: 30px; height: 30px; border-radius: 50%; color: rgba(255,255,255,.85); }
.install-x:hover { background: rgba(255,255,255,.15); }
@media (min-width: 900px) { .install-bar { border-radius: 0; } }
.steps-num { counter-reset: st; display: grid; gap: 12px; }
.steps-num li { counter-increment: st; position: relative; padding-left: 40px; line-height: 1.4; }
.steps-num li::before { content: counter(st); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; font: 700 1rem/28px var(--display); text-align: center; }
.ios-share { display: inline-grid; place-content: center; width: 26px; height: 26px; border-radius: 6px; background: #007aff; color: #fff; vertical-align: middle; }
.ios-share svg { color: #fff; }

/* Invite notifications sur l'accueil */
.notif-cta { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; background: #F8FAD9; border: 1px solid #DDE68A; border-left: 5px solid var(--ball); border-radius: var(--r-m); }
.notif-cta svg { flex: none; color: var(--green); }
.notif-cta .grow b { font-family: var(--display); font-size: 1.125rem; }
.notif-cta .grow p { color: var(--ink-2); }
.notif-x { flex: none; display: grid; place-content: center; width: 30px; height: 30px; border-radius: 50%; color: var(--ink-3); }
.notif-x:hover { background: rgba(0,0,0,.06); }
