/* =====================================================================
   FC Vendlincourt — Caisse d'équipe
   Mobile d'abord. Couleurs du club : bleu marine + jaune.
   ===================================================================== */

:root {
  --navy-900: #06112b;
  --navy-800: #0a1a3f;
  --navy-700: #12285c;
  --navy-600: #1c3a7a;
  --gold: #f5b800;
  --gold-soft: #fff4cc;
  --blue: #1d4ed8;

  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --line: #e3e7ef;
  --text: #0b1530;
  --text-2: #55607a;
  --text-3: #8a93a8;

  --ok: #11845b;
  --ok-soft: #e3f6ee;
  --warn: #b25e00;
  --warn-soft: #fff1dc;
  --danger: #c62828;
  --danger-soft: #fde8e8;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(10 26 63 / .06), 0 4px 16px rgb(10 26 63 / .06);
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;

  --bottomnav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --gutter: max(16px, var(--safe-left), var(--safe-right));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(76px + env(safe-area-inset-top, 0px)); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--bottomnav-h) + var(--safe-bottom));
}
img { display: block; max-width: 100%; }
a { color: var(--blue); }
h1, h2 { font-family: var(--font-display); font-style: italic; font-weight: 800; text-transform: uppercase; letter-spacing: .01em; margin: 0; line-height: 1.05; }
h1 { font-size: 1.9rem; color: var(--navy-800); }
h2 { font-size: 1.2rem; color: var(--navy-800); }
p { margin: 0 0 .5em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--navy-900); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.strong { font-weight: 700; color: inherit; text-decoration: none; }
a.strong:hover { text-decoration: underline; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------------
   Barre du haut
   --------------------------------------------------------------------- */
.topbar {
  background: var(--navy-800);
  background-image: linear-gradient(115deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
  color: #fff;
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 3px solid var(--gold);
}
.topbar__inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--gutter);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { width: 40px; height: auto; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.brand__club { font-family: var(--font-display); font-style: italic; font-weight: 800; text-transform: uppercase; color: var(--gold); font-size: 1.05rem; white-space: nowrap; }
.brand__app { font-size: .78rem; opacity: .8; white-space: nowrap; }
.topnav { display: none; }
.session { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.session__who { display: none; font-size: .85rem; opacity: .85; }

.demo-banner {
  background: var(--gold-soft); color: #6b4f00; font-size: .78rem; line-height: 1.3; text-align: center;
  padding: 6px var(--gutter); border-bottom: 1px solid #f1dc8f;
}

/* ---------------------------------------------------------------------
   Navigation du bas (mobile)
   --------------------------------------------------------------------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bottomnav-h) + var(--safe-bottom));
  padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgb(10 26 63 / .06);
}
.bottomnav__link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: 600 .7rem var(--font); color: var(--text-2); text-decoration: none;
  background: none; border: 0; padding: 0; cursor: pointer; position: relative;
}
.bottomnav__link .nav-ico { font-size: 1.3rem; line-height: 1; filter: grayscale(1); opacity: .7; }
.bottomnav__link.is-active { color: var(--navy-800); }
.bottomnav__link.is-active .nav-ico { filter: none; opacity: 1; }
.bottomnav__link.is-active::before {
  content: ''; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold);
}

.sheet {
  border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%;
  border-radius: 20px 20px 0 0; background: var(--surface);
  padding-bottom: var(--safe-bottom);
}
.sheet::backdrop { background: rgb(6 17 43 / .5); }
.sheet__nav { display: flex; flex-direction: column; padding: 10px 8px 14px; }
.sheet__nav::before { content: ''; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 8px; }
.sheet__link {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px;
  color: var(--text); text-decoration: none; font: 600 1rem var(--font); background: none; border: 0; text-align: left; cursor: pointer;
}
.sheet__link.is-active { background: var(--surface-2); color: var(--navy-800); }
.sheet__link .nav-ico { font-size: 1.25rem; width: 28px; text-align: center; }

/* ---------------------------------------------------------------------
   Mise en page
   --------------------------------------------------------------------- */
.view { max-width: 1120px; margin: 0 auto; padding: 16px var(--gutter) 32px; outline: none; }
.view > * + * { margin-top: 16px; }
.loading { padding: 40px; text-align: center; color: var(--text-2); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back { display: inline-block; text-decoration: none; font-weight: 600; font-size: .9rem; }
.view > .back + .page-head { margin-top: 6px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cols { display: grid; gap: 16px; }
.summary { color: var(--text-2); margin: 0; }

.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px;
}
.card > h2 { margin-bottom: 12px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; }
.card:not(.card--flush) > .card__head { padding: 0 0 10px; }
.link { font-weight: 600; text-decoration: none; font-size: .9rem; }
.empty { padding: 28px 16px; text-align: center; color: var(--text-2); }
.notice { background: var(--gold-soft); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .9rem; }

/* ---------------------------------------------------------------------
   Boutons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 0;
  background: var(--navy-800); color: #fff; font: 700 .95rem var(--font);
  text-decoration: none; cursor: pointer; transition: transform .08s, background .15s, opacity .15s;
  touch-action: manipulation;
}
.btn:hover { background: var(--navy-700); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn--small { min-height: 36px; padding: 6px 12px; font-size: .85rem; border-radius: 10px; }
.btn--ghost { background: var(--surface); color: var(--navy-800); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #a61f1f; }
.btn--on-dark { background: rgb(255 255 255 / .12); color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .25); }
.btn--on-dark:hover { background: rgb(255 255 255 / .2); }
.btn--block { width: 100%; }
.btn--big { min-height: 54px; font-size: 1.05rem; border-radius: 14px; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--blue); font: 600 .85rem var(--font); cursor: pointer; min-height: 32px; }
.link-btn--danger { color: var(--danger); }
.icon-btn { background: none; border: 0; font-size: 1.1rem; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); }

/* ---------------------------------------------------------------------
   Formulaires (16px minimum pour éviter le zoom iOS)
   --------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-size: .82rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; padding: 0; }
.hint { color: var(--text-3); font-size: .8rem; }
input, select, textarea {
  font: 500 16px var(--font); color: var(--text);
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2355607a' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgb(28 58 122 / .15); }
input[type=date] { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--navy-800); }
.search { background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a93a8' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E") no-repeat 12px center; padding-left: 36px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); font-weight: 700;
}
.chip input:checked + span { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.filters .field > span { font-size: .72rem; }
.filters input, .filters select { min-height: 42px; padding-top: 8px; padding-bottom: 8px; }
.filters .link-btn { justify-self: start; }
.filters--inline { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.seg { display: inline-flex; background: #e6eaf2; border-radius: 12px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg--full { display: flex; width: 100%; }
.seg--full .seg__btn { flex: 1; }
.seg__btn { padding: 8px 12px; border-radius: 9px; text-decoration: none; color: var(--text-2); font-weight: 700; font-size: .85rem; white-space: nowrap; text-align: center; }
.seg__btn.is-active { background: var(--surface); color: var(--navy-800); box-shadow: 0 1px 3px rgb(10 26 63 / .12); }

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__btn { flex: none; padding: 9px 14px; border-radius: 999px; text-decoration: none; color: var(--text-2); font-weight: 700; font-size: .88rem; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.tabs__btn.is-active { background: var(--navy-800); color: #fff; box-shadow: none; }

/* ---------------------------------------------------------------------
   Listes
   --------------------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.list > .item:first-child { border-top: 0; }
.card__head + .list > .item:first-child { border-top: 1px solid var(--line); }
.item__icon { font-size: 1.35rem; width: 30px; text-align: center; flex: none; line-height: 1.3; }
.item__main { flex: 1; min-width: 0; }
.item__title { font-weight: 500; overflow-wrap: anywhere; }
.item__meta { font-size: .82rem; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.item__end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.item__end--row { flex-direction: row; gap: 14px; align-items: center; }
.item--cancelled .item__title, .item--cancelled .item__icon { opacity: .5; }
.row-actions { display: flex; gap: 16px; margin-top: 2px; }
.more { padding: 12px 16px; text-align: center; border-top: 1px solid var(--line); }

.amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount--strike { text-decoration: line-through; color: var(--text-3); }
.amount--payment, .amount--income { color: var(--ok); }
.amount--expense { color: var(--danger); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
  font-family: var(--font); font-style: normal; vertical-align: middle;
}
.badge--pending { background: var(--warn-soft); color: var(--warn); }
.badge--partial { background: #e8efff; color: var(--blue); }
.badge--paid { background: var(--ok-soft); color: var(--ok); }
.badge--cancelled { background: var(--surface-2); color: var(--text-3); text-decoration: line-through; }

/* Tableau → cartes sur mobile */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); padding: 10px 16px; background: var(--surface-2); }
.table td { padding: 12px 16px; border-top: 1px solid var(--line); }
.table tfoot th { background: var(--surface-2); color: var(--text); font-size: .85rem; border-top: 2px solid var(--line); }
.table .is-inactive td { opacity: .55; }
.due { color: var(--warn); }
.credit { color: var(--ok); font-weight: 700; }
.ok { color: var(--ok); font-weight: 700; }

@media (max-width: 639px) {
  .table thead { display: none; }
  .table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
  .table tbody tr:first-child { border-top: 0; }
  .table td { padding: 0; border: 0; }
  .table td:first-child { grid-column: 1; grid-row: 1; }
  .table td:nth-child(2), .table td:nth-child(3) { grid-column: 1; font-size: .8rem; color: var(--text-2); text-align: left; }
  .table td:nth-child(2)::before { content: 'Amendes '; }
  .table td:nth-child(3)::before { content: 'Payé '; }
  .table td:nth-child(2) { grid-row: 2; }
  .table td:nth-child(3) { grid-row: 3; }
  .table td:nth-child(4) { grid-column: 2; grid-row: 1; font-size: 1.1rem; }
  .table td:nth-child(5) { grid-column: 2; grid-row: 2 / span 2; align-self: end; }
  .table tfoot tr { background: var(--surface-2); border-top: 2px solid var(--line); }
  .table tfoot th { padding: 0; background: none; border: 0; text-align: left; }
  .table tfoot th:nth-child(2), .table tfoot th:nth-child(3) { display: none; }
  .table tfoot th:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
}

/* ---------------------------------------------------------------------
   Accueil
   --------------------------------------------------------------------- */
.hero { display: grid; gap: 12px; }
.hero__main {
  color: #fff; border-radius: 18px; padding: 18px 18px 14px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  box-shadow: 0 10px 30px rgb(10 26 63 / .25);
}
.hero__main::after {
  content: ''; position: absolute; right: -40px; top: -30px; width: 180px; height: 180px; border-radius: 50%;
  border: 18px solid rgb(245 184 0 / .14);
}
.eyebrow { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .75; margin: 0; }
.hero__amount { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 2.6rem; line-height: 1.05; margin: 2px 0 10px; color: var(--gold); position: relative; z-index: 1; }
.hero__accounts { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid rgb(255 255 255 / .15); display: grid; gap: 4px; position: relative; z-index: 1; }
.hero__accounts li { display: flex; justify-content: space-between; font-size: .92rem; }
.hero__accounts span { opacity: .8; }
.hero__due {
  display: block; background: var(--surface); border-radius: 18px; padding: 16px 18px; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); border-left: 5px solid var(--gold);
}
.hero__due .eyebrow { color: var(--text-2); opacity: 1; }
.hero__due-amount { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 2rem; color: var(--warn); margin: 2px 0 0; }
.hero__due-sub { color: var(--blue); font-weight: 600; font-size: .9rem; margin: 0; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick__btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 84px; padding: 10px 6px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--navy-800);
  font-weight: 700; font-size: .85rem; text-align: center; line-height: 1.15;
}
.quick__btn span { font-size: 1.5rem; }
.quick__btn--primary { background: var(--gold); color: var(--navy-900); }

.podium { list-style: none; margin: 0; padding: 0 16px 8px; }
.card:not(.card--flush) .podium { padding: 0; }
.podium__row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.podium__row:first-child { border-top: 0; }
.podium__rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); color: var(--text-2); flex: none; font-size: .9rem; }
.podium__row:first-child .podium__rank { background: var(--gold); color: var(--navy-900); }
.podium__name { flex: 1; font-weight: 600; text-decoration: none; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium__amount { font-weight: 800; font-variant-numeric: tabular-nums; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat span { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); font-weight: 700; }
.stat strong { font-family: var(--font-display); font-style: italic; font-size: 1.5rem; font-weight: 800; color: var(--navy-800); }
.stat--accent { background: var(--navy-800); }
.stat--accent span { color: rgb(255 255 255 / .75); }
.stat--accent strong { color: var(--gold); }

/* Caisse */
.accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.account { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 2px; border: 2px solid transparent; min-width: 0; }
.account.is-active { border-color: var(--navy-800); }
.account__name { font-size: .8rem; font-weight: 700; text-transform: uppercase; color: var(--text-2); letter-spacing: .03em; }
.account__amount { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 1.6rem; color: var(--navy-800); }
.account__desc { font-size: .78rem; color: var(--text-3); }
.account--total { background: var(--navy-800); }
.account--total .account__name { color: rgb(255 255 255 / .75); }
.account--total .account__amount { color: var(--gold); }

/* Paiement */
.pay-due { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .95rem; }
.pay-preview:empty { display: none; }
.excess { background: var(--gold-soft); border-radius: var(--radius-sm); padding: 12px; gap: 10px; }
.excess > legend { float: left; width: 100%; margin-bottom: 4px; color: #6b4f00; }
.excess .check { align-items: flex-start; font-size: .95rem; }
.excess .check input { margin-top: 1px; flex: none; }
.pay-preview { background: var(--ok-soft); color: #0b5e41; border-radius: var(--radius-sm); padding: 10px 12px; font-size: .95rem; }

/* ---------------------------------------------------------------------
   Saisie rapide
   --------------------------------------------------------------------- */
.entry { display: flex; flex-direction: column; gap: 16px; }
.entry__step { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.step-title { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; }
.step-title .muted { font-family: var(--font); font-style: normal; text-transform: none; font-weight: 600; letter-spacing: 0; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--navy-900); display: grid; place-items: center; font-size: .95rem; font-style: normal; flex: none; }

.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.type-btn {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  text-align: left; padding: 10px; min-height: 64px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit;
  touch-action: manipulation; transition: border-color .12s, background .12s, transform .08s;
}
.type-btn:active { transform: scale(.97); }
.type-btn__icon { grid-row: 1 / span 2; font-size: 1.45rem; }
.type-btn__label { font-weight: 700; font-size: .86rem; line-height: 1.15; }
.type-btn__amount { font-size: .78rem; color: var(--blue); font-weight: 700; }
.type-btn.is-selected { border-color: var(--navy-800); background: var(--navy-800); color: #fff; box-shadow: 0 4px 14px rgb(10 26 63 / .25); }
.type-btn.is-selected .type-btn__amount { color: var(--gold); }
.fixed-amount { display: flex; align-items: center; min-height: 46px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-weight: 800; font-size: 1.1rem; color: var(--navy-800); font-variant-numeric: tabular-nums; }
.step-title__action { margin-left: auto; font-size: .9rem; text-transform: none; font-style: normal; letter-spacing: 0; }
.is-collapsed .search, .is-collapsed .type-btn:not(.is-selected) { display: none; }
.is-collapsed .type-grid { grid-template-columns: 1fr; }


.stepper { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.stepper input { border: 0; border-radius: 0; text-align: center; font-weight: 700; font-size: 1.1rem; min-width: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.stepper input:focus { box-shadow: none; }
.stepper:focus-within { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgb(28 58 122 / .15); }
.stepper__btn { width: 48px; flex: none; border: 0; background: var(--surface-2); font-size: 1.4rem; font-weight: 700; color: var(--navy-800); cursor: pointer; touch-action: manipulation; }
.stepper__btn:active { background: var(--line); }

.player-tools { display: flex; flex-direction: column; gap: 8px; }
.player-tools__btns { display: flex; gap: 6px; flex-wrap: wrap; }
.player-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.player-chip {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 10px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); font: 600 .92rem var(--font); color: var(--text); text-align: left;
  touch-action: manipulation; transition: background .12s, border-color .12s; overflow-wrap: anywhere;
}
.player-chip__check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; font-size: .8rem; flex: none; }
.player-chip.is-selected { background: var(--gold-soft); border-color: var(--gold); }
.player-chip.is-selected .player-chip__check { background: var(--gold); border-color: var(--gold); color: var(--navy-900); }

.submit-bar {
  position: sticky; bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 8px); z-index: 10;
  padding: 0; margin-top: -4px;
}
.submit-bar .btn { box-shadow: 0 8px 24px rgb(10 26 63 / .3); }
.submit-bar .btn:not(:disabled), .submit-bar .btn:not(:disabled):hover { background: var(--gold); color: var(--navy-900); }
.submit-bar .btn:disabled { opacity: 1; background: #c9cfdb; color: #fff; box-shadow: none; }

/* ---------------------------------------------------------------------
   Règlement (façon affiche)
   --------------------------------------------------------------------- */
.rules { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.rules__head { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #fff; text-align: center; padding: 22px 16px 18px; border-bottom: 4px solid var(--gold); }
.rules__logo { margin: 0 auto 8px; width: 64px; height: 64px; }
.rules__club { font-family: var(--font-display); font-style: italic; font-weight: 800; text-transform: uppercase; color: var(--gold); margin: 0; font-size: 1.1rem; letter-spacing: .03em; }
.rules__title { color: #fff; font-size: 2.6rem; margin: 2px 0; }
.rules__sub { font-family: var(--font-display); font-style: italic; font-weight: 700; text-transform: uppercase; color: rgb(255 255 255 / .8); margin: 0; letter-spacing: .05em; }
.rules__table { width: 100%; border-collapse: collapse; }
.rules__table th { background: var(--navy-800); color: #fff; font-family: var(--font-display); font-style: italic; text-transform: uppercase; text-align: left; padding: 10px 12px; font-size: 1rem; }
.rules__table td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.rules__table .muted { font-size: .82rem; }
.rules__icon { width: 40px; text-align: center; font-size: 1.3rem; padding-right: 0 !important; }
.rules__amount { font-family: var(--font-display); font-style: italic; font-weight: 800; color: var(--navy-700); font-size: 1.1rem; white-space: normal; min-width: 80px; }
.rules__motto { text-align: center; font-family: var(--font-display); font-style: italic; text-transform: uppercase; color: var(--navy-800); letter-spacing: .08em; padding: 14px; margin: 0; border-top: 3px solid var(--gold); }

/* Connexion */
.login { max-width: 420px; margin: 24px auto 0; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.login__logo { margin: 0 auto 4px; }
.login .form { text-align: left; margin-top: 6px; }
.login .notice { text-align: left; }
.login__who { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; }
.code-input { font-family: ui-monospace, Menlo, monospace; font-size: 1.4rem; letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.code-box { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: baseline; background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 16px; }
.code-box__code { font-family: ui-monospace, Menlo, monospace; font-size: 1.8rem; letter-spacing: .25em; color: var(--navy-800); }

/* ---------------------------------------------------------------------
   Modales & toasts
   --------------------------------------------------------------------- */
.modal {
  border: 0; padding: 0; width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh;
  border-radius: 20px 20px 0 0; background: var(--surface); color: var(--text);
  box-shadow: 0 -10px 40px rgb(6 17 43 / .25);
}
.modal::backdrop { background: rgb(6 17 43 / .5); }
.modal__form { display: flex; flex-direction: column; max-height: 92dvh; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 12px 8px 18px; }
.modal__body { padding: 6px 18px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal__foot { display: flex; gap: 10px; padding: 12px 18px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); }
.modal__foot .btn { flex: 1; }

/* Mobile : en haut, sous la barre, loin de la grille de saisie et des boutons du bas */
.toasts {
  position: fixed; inset: calc(70px + env(safe-area-inset-top, 0px)) calc(12px + var(--safe-right)) auto calc(12px + var(--safe-left));
  z-index: 1000; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; width: auto; height: auto;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; color: inherit;
}
.toasts:popover-open { display: flex; }
.toasts[popover]:not(:popover-open) { display: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: 520px; width: 100%;
  background: var(--navy-900); color: #fff; padding: 12px 14px 12px 16px; border-radius: 12px; font-weight: 500;
  box-shadow: 0 10px 30px rgb(6 17 43 / .35); animation: toast-in .2s ease-out;
}
.toast span { flex: 1; }
.toast--error { background: var(--danger); }
.toast--out { opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s; }
.toast__action { background: none; border: 0; border-left: 1px solid rgb(255 255 255 / .2); color: var(--gold); font: 800 .9rem var(--font); text-transform: uppercase; cursor: pointer; padding: 8px 4px 8px 14px; min-height: 40px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }

/* ---------------------------------------------------------------------
   Tablette / ordinateur
   --------------------------------------------------------------------- */
@media (min-width: 640px) {
  .view { padding: 24px max(24px, var(--safe-left), var(--safe-right)) 40px; }
  h1 { font-size: 2.3rem; }
  .hero { grid-template-columns: 1.4fr 1fr; }
  .hero__amount { font-size: 3.2rem; }
  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .player-grid { grid-template-columns: repeat(3, 1fr); }
  .player-tools { flex-direction: row; align-items: center; }
  .player-tools .search { flex: 1; }
  .accounts { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .filters { grid-template-columns: repeat(3, 1fr) auto; }
  .filters--inline { display: flex; gap: 12px; }
  .filters--inline .field { width: 220px; }
  .modal { max-width: 520px; margin: auto; border-radius: 20px; }
  .modal__foot { padding-bottom: 12px; }
  .modal__foot .btn { flex: none; }
  .modal__foot { justify-content: flex-end; }
  .sheet { max-width: 420px; margin: auto; border-radius: 20px; }
  .rules { max-width: 760px; margin-left: auto; margin-right: auto; }
  .rules__title { font-size: 3.4rem; }
  .session__who { display: inline; }
}

@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .bottomnav { display: none; }
  .topnav { display: flex; gap: 2px; margin-left: 12px; overflow-x: auto; }
  .topnav__link {
    display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; color: rgb(255 255 255 / .8);
    text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap;
  }
  .topnav__link:hover { background: rgb(255 255 255 / .08); color: #fff; }
  .topnav__link.is-active { background: rgb(255 255 255 / .12); color: #fff; box-shadow: inset 0 -3px 0 var(--gold); }
  .topnav__link .nav-ico { font-size: 1rem; }
  .cols { grid-template-columns: 1.5fr 1fr; align-items: start; }
  .type-grid { grid-template-columns: repeat(4, 1fr); }
  .player-grid { grid-template-columns: repeat(4, 1fr); }
  .submit-bar { bottom: 16px; }
  .toasts { inset: auto 24px 24px auto; align-items: flex-end; }
  .toast { width: auto; min-width: 320px; }
  @keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
  .entry { display: grid; grid-template-columns: 1.15fr 1fr; align-items: start; }
  .entry > .entry__step:first-child { grid-row: span 3; }
  .entry__details { grid-column: 2; }
  .entry > .entry__step:nth-child(3) { grid-column: 2; }
  .submit-bar { grid-column: 2; }
}

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