
    :root {
      color-scheme: light;
      --ink: #20332d;
      --muted: #74817b;
      --paper: #f5f5ef;
      --card: #fffefa;
      --line: #e6e8df;
      --green: #173c31;
      --green-2: #265b49;
      --lime: #d9ef7a;
      --gold: #c99c51;
      --red: #b95146;
      --shadow: 0 14px 36px rgba(27, 48, 39, .07);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 18px;
    }
    * { box-sizing: border-box; }
    body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.5; }
    button, input, select { font: inherit; }
    button { cursor: pointer; }

    /* ── Topbar ───────────────────── */
    .topbar { background: var(--green); color: white; border-bottom: 1px solid rgba(255,255,255,.12); }
    .topbar-inner { max-width: 1440px; margin: auto; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
    .brand { display:flex; align-items:center; gap: 11px; font-weight: 850; letter-spacing: .08em; font-size: 15px; }
    .brand-mark { height: 34px; width: 34px; display:grid; place-items:center; border:1px solid rgba(217,239,122,.4); color:var(--lime); border-radius: 11px; font-size: 18px; }
    .saved-pill { white-space:nowrap; display:flex; align-items:center; gap:8px; color:#cfdbd2; font-size: 13px; }
    .saved-dot { width:7px; height:7px; border-radius:50%; background:#78a96d; flex-shrink:0; }

    /* ── Main layout ──────────────── */
    main { max-width: 1200px; margin: auto; padding: 28px 28px 48px; }
    .hero { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:20px; }
    h1 { margin:0; font-size:clamp(32px, 4vw, 46px); line-height:1.08; letter-spacing:-.04em; }

    /* ── Stats bar ────────────────── */
    .stats { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:12px; margin-bottom:22px; }
    .stat { background:var(--card); border:1px solid var(--line); border-radius:15px; padding:15px 18px; box-shadow:0 2px 8px rgba(27,48,39,.025); }
    .stat-label { color:var(--muted); text-transform:uppercase; letter-spacing:.1em; font-size: 12px; font-weight:800; }
    .stat-value { font-size: 28px; font-weight:850; letter-spacing:-.04em; margin-top:3px; }

    /* ── Tab navigation ───────────── */
    .tab-nav { display:flex; gap:0; border-bottom:2px solid var(--line); margin-bottom:20px; }
    .tab-nav button { flex:1; padding:15px 10px; background:transparent; border:0; border-bottom:3px solid transparent; margin-bottom:-2px; font-size: 15px; font-weight:750; color:var(--muted); transition:color .15s, border-color .15s; white-space:nowrap; }
    .tab-nav button:hover { color: #3a5a4a; }
    .tab-nav button.active { color: var(--green); border-bottom-color: var(--green); }
    .tab-nav button .tab-num { display:inline-block; width:26px; height:26px; line-height:26px; text-align:center; border-radius:8px; background:#edf3df; color:var(--green-2); font-size:13px; font-weight:900; margin-right:7px; }
    .tab-nav button.active .tab-num { background:var(--green); color:white; }
    .tab-panel { display:none; }
    .tab-panel.active { display:block; }

    /* ── Cards ────────────────────── */
    .card { background:var(--card); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); overflow:hidden; }
    .card-head { padding:20px 22px 16px; border-bottom:1px solid #edf0e8; display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
    .card h2 { font-size: 19px; letter-spacing:-.02em; margin:0; }
    .card-body { padding:18px 22px 22px; }
    .card + .card { margin-top:18px; }

    /* ── Player form & roster ─────── */
    .add-form { display:grid; grid-template-columns:minmax(0,1fr) 120px; gap:9px; }
    input, select { min-width:0; padding:11px 13px; border:1px solid #dfe4da; border-radius:10px; color:var(--ink); background:#fff; outline:0; font-size: 15px; }
    input:focus, select:focus { border-color:#7d9e81; box-shadow:0 0 0 3px rgba(82,128,88,.12); }
    .add-button { grid-column:1/-1; }
    .btn { display:inline-flex; justify-content:center; align-items:center; gap:8px; padding:11px 15px; border:1px solid transparent; border-radius:10px; font-size:14px; font-weight:800; transition:transform .15s, background .15s; }
    .btn:active { transform:translateY(1px); }
    .btn-primary { background:var(--green); color:white; }
    .btn-primary:hover { background:var(--green-2); }
    .btn-soft { color:var(--green); background:#edf3e9; border-color:#e3ebdf; }
    .btn-soft:hover { background:#e4eddf; }
    .btn-quiet { color:#6a7971; background:transparent; border-color:var(--line); }
    .btn-quiet:hover { background:#f5f6f1; }
    .btn-danger { color:var(--red); background:#fff6f3; border-color:#f1ddd6; }
    .full { width:100%; }
    .roster-head { display:flex; align-items:center; justify-content:space-between; margin:18px 0 10px; }
    .roster-head strong { font-size: 14px; }
    .roster-head span { color:var(--muted); font-size: 13px; }
    .roster { display:grid; grid-template-columns:1fr 1fr; gap:12px; max-height:400px; overflow:auto; padding-right:2px; }
    .roster-col-head { font-size:13px; font-weight:750; color:#64736b; margin-bottom:6px; padding:0 2px; }
    .roster-col { display:grid; gap:8px; align-content:start; }
    .person { display:flex; align-items:center; gap:10px; padding:11px 12px; background:#fafbf7; border:1px solid #edf0e8; border-radius:11px; min-width:0; }
    .person-icon { width:30px; height:30px; display:grid; place-items:center; border-radius:9px; font-size:14px; font-weight:900; flex:0 0 30px; }
    .person-icon.adult { color:#27564a; background:#e5f0e9; }
    .person-icon.child { color:#8b6431; background:#fbf0d9; }
    .person-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size: 14px; font-weight:750; flex:1; }
    .tag { padding:4px 8px; font-size: 11px; font-weight:750; border-radius:999px; white-space:nowrap; }
    .tag.adult { color:#356354; background:#e9f3ec; }
    .tag.child { color:#8a6735; background:#fbf2df; }
    .remove-person { border:0; color:#9aa49d; background:transparent; width:26px; height:26px; border-radius:7px; font-size:18px; }
    .remove-person:hover { color:var(--red); background:#fff0eb; }
    .roster-empty { border:1px dashed #dfe4da; color:#8a9690; text-align:center; font-size: 14px; padding:24px 14px; border-radius:12px; }
    .split-line { border:0; border-top:1px solid #edf0e8; margin:18px 0 15px; }
    .tournament-count { display:grid; grid-template-columns:1fr 86px; align-items:center; gap:10px; margin:16px 0 10px; color:#64736b; font-size: 13px; font-weight:750; }
    .tournament-count input { padding:9px 10px; text-align:center; font-size: 15px; }

    /* ── Teams panel ──────────────── */
    .draw-empty { text-align:center; padding:32px 18px 36px; color:#77847d; }
    .empty-icon { width:56px; height:56px; margin:0 auto 14px; border-radius:16px; display:grid; place-items:center; background:#f0f3e9; color:var(--green-2); font-size:26px; }
    .draw-empty strong { display:block; font-size: 16px; color:#43574e; }
    .draw-empty p { margin:6px auto 0; max-width:380px; font-size: 14px; line-height:1.5; }
    .teams-wrap { padding:18px 22px 22px; }
    .draw-toolbar { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
    .draw-explainer { color:#75827a; font-size: 13px; line-height:1.4; }
    .pool-list { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px,1fr)); gap:14px; }
    .pool-card { border:1px solid #e7eadf; border-radius:15px; background:#fcfcf8; overflow:hidden; }
    .pool-title { padding:13px 14px; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid #e9ece4; }
    .pool-title strong { font-size: 14px; }
    .pool-title span { color:#829087; font-size: 12px; }
    .team-list { padding:10px; display:grid; gap:8px; }
    .team { padding:10px; border:1px solid #ecefe8; border-radius:11px; background:white; }
    .team-label { display:flex; justify-content:space-between; align-items:center; margin-bottom:7px; }
    .team-label strong { font-size: 13px; color:#456055; }
    .team-label span { color:#98a39b; font-size: 12px; }
    .team-members { display:flex; flex-wrap:wrap; gap:5px; }
    .member-chip { background:#f3f5f0; color:#4d5f55; padding:5px 8px; border-radius:7px; font-size: 12px; font-weight:700; }
    .waiting-badge { font-size:11px; font-weight:800; color:#8a6d2f; background:#fbf3dd; border:1px solid #f0e3bd; border-radius:999px; padding:3px 8px; flex:0 0 auto; }
    .remove-member { border:0; background:#f2e3e3; color:#a34444; width:24px; height:24px; line-height:1; border-radius:50%; font-size:16px; font-weight:900; cursor:pointer; flex:0 0 auto; }
    .remove-member:hover { background:#e9cbcb; color:#8a2f2f; }
    .member-chip.editable { display:inline-flex; align-items:center; gap:6px; padding:4px 4px 4px 9px; }
    .team-add-select { font:inherit; font-size:12px; font-weight:700; color:#2f6b56; background:#fff; border:1px dashed #b9cfc4; border-radius:8px; padding:5px 8px; cursor:pointer; }
    .draw-actions { display:flex; gap:10px; flex-wrap:wrap; }
    .unassigned-section { margin-top:18px; padding:14px; background:#fdfaf2; border:1px dashed #e6d9ae; border-radius:12px; }
    .unassigned-title { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
    .unassigned-title strong { font-size:14px; color:#7a5f22; }
    .unassigned-title span { color:#a08b4f; font-size:12px; }
    .unassigned-hint { margin:8px 0 0; color:#a08b4f; font-size:12px; }
    .pool-card.editing { outline:2px dashed #cfe2d4; }

    /* ── Schedule panel ───────────── */
    .schedule-pools { padding:0 22px 22px; display:grid; gap:20px; }
    .schedule-pool { border:1px solid #e8ebe2; border-radius:15px; overflow:hidden; }
    .schedule-pool-head { padding:14px 16px; background:#f8f9f4; display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid #e8ebe2; flex-wrap:wrap; }
    .schedule-pool-head h3 { font-size: 15px; margin:0; }
    .pool-state { border-radius:999px; padding:5px 9px; font-size: 11px; font-weight:850; white-space:nowrap; }
    .pool-state.active { color:#245540; background:#e4f1e4; }
    .pool-state.upcoming { color:#8a6935; background:#fbf1db; }
    .pool-state.done { color:#68776f; background:#edf0eb; }
    .pool-meta { color:#818d85; font-size: 12px; }
    .pool-body { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(250px,.8fr); }
    .match-list { padding:14px; display:grid; gap:8px; align-content:start; }
    .match { display:grid; grid-template-columns:36px minmax(0,1fr) minmax(175px,.8fr) minmax(0,1fr); align-items:center; gap:10px; padding:10px 11px; border:1px solid #edf0e9; border-radius:12px; background:#fff; transition:border-color .2s, background .2s; }
    .match.highlight { border-color:#c9b558; background:#fffef5; box-shadow:0 0 0 2px rgba(201,181,88,.18); }
    .match-order { color:#829087; text-align:center; font-size: 12px; font-weight:900; }
    .match-team { font-size: 13px; font-weight:750; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .match-team:last-child { text-align:right; }
    .match-control { display:grid; gap:5px; min-width:0; }
    .match-status { display:block; color:#8a958e; text-align:center; font-size: 11px; font-weight:800; }
    .match-status.ready { color:#2e674a; }
    .match-status.playing { color:#9a7134; }
    .match-status.done { color:#567266; }
    .match-status.waiting { color:#8a958e; }
    .match-select { width:100%; font-size: 12px; padding:8px 7px; border-radius:9px; }
    .match-start { padding:8px 9px; font-size: 12px; }
    .match-cancel { padding:5px; color:#8b716c; background:transparent; border:0; font-size: 10px; font-weight:750; }
    .match-cancel:hover { color:var(--red); }
    .match-start:disabled { cursor:not-allowed; opacity:.5; }
    .bye { padding:10px 12px; color:#9aa49d; font-size: 12px; }
    .standings { border-left:1px solid #e8ebe2; padding:14px; min-width:0; }
    .standings-title { display:flex; justify-content:space-between; align-items:center; margin:0 0 10px; }
    .standings-title strong { font-size: 13px; }
    .status-label { color:#8a958e; font-size: 11px; font-weight:750; text-transform:uppercase; letter-spacing:.08em; }
    .table-wrap { overflow-x:auto; }
    table { width:100%; border-collapse:collapse; min-width:290px; }
    th { text-align:right; color:#8b968f; font-size: 11px; font-weight:800; padding:7px 6px; border-bottom:1px solid #e9ece4; white-space:nowrap; }
    th:first-child, td:first-child { text-align:left; }
    td { text-align:right; font-size: 12px; padding:9px 6px; border-bottom:1px solid #f0f2ec; white-space:nowrap; }
    td:first-child { font-weight:800; max-width:130px; overflow:hidden; text-overflow:ellipsis; }
    tr:last-child td { border-bottom:0; }
    .rank-num { color:#91a097; width:20px; display:inline-block; }
    .rank-first { color:#b58a40; }
    .standings-note { color:#8c9890; font-size: 11px; margin:9px 0 0; line-height:1.45; }
    .standings tr.highlight td { background:#fffef5; font-weight:850; }
    .team-summary { margin:0 14px 8px; padding:11px 13px; background:#fafcf4; border:1px solid #e4e7d8; border-radius:10px; font-size:13px; color:#536156; }
    .team-summary strong { color:#203c2b; }
    .remaining-chips { display:flex; flex-wrap:wrap; gap:5px; margin-top:5px; }
    .remaining-chip { display:inline-block; padding:3px 9px; background:#faf4e0; color:#7a651f; border-radius:6px; font-size:12px; font-weight:750; }
    .remaining-chip.done { background:#e9f3ea; color:#3a6b44; }
    .team-filter-wrap { display:flex; align-items:center; gap:9px; }
    .team-filter-wrap label { font-size:13px; color:#75827a; font-weight:750; white-space:nowrap; }
    .team-filter-wrap select { font-size:13px; padding:7px 9px; min-width:200px; }
    .schedule-empty { padding:28px; text-align:center; color:#7d8982; font-size: 14px; }

    /* ── Toast ────────────────────── */
    .toast { position:fixed; left:50%; bottom:24px; z-index:5; transform:translate(-50%,12px); opacity:0; pointer-events:none; color:white; background:#203c32; padding:13px 17px; border-radius:11px; box-shadow:0 8px 30px rgba(0,0,0,.18); font-size: 14px; transition:.2s; }
    .toast.show { opacity:1; transform:translate(-50%,0); }

    /* ── Footer ───────────────────── */
    footer { color:#9aa49d; font-size: 12px; text-align:center; padding:28px 0 0; }

    /* ── Responsive ───────────────── */
    @media (max-width: 980px) {
      .pool-body { grid-template-columns:1fr; }
      .standings { border-left:0; border-top:1px solid #e8ebe2; }
    }
    @media (max-width: 720px) {
      :root { font-size: 16px; }
      main { padding:20px 12px 36px; }
      .topbar-inner { padding:10px 14px; }
      .hero { align-items:flex-start; flex-direction:column; gap:10px; }
      .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
      .stat { padding:13px 14px; }
      .stat-value { font-size: 24px; }
      .tab-nav button { font-size: 13px; padding:12px 6px; }
      .tab-nav button .tab-num { width:22px; height:22px; line-height:22px; font-size:11px; margin-right:4px; }
      .card-head { padding:16px; }
      .card-body, .teams-wrap { padding:14px 16px 16px; }
      .schedule-pools { padding:0 12px 16px; }
      .match { grid-template-columns:26px minmax(0,1fr) minmax(120px,.9fr) minmax(0,1fr); gap:5px; padding:9px 8px; }
      .match-team { font-size: 11px; }
      .saved-pill { font-size: 11px; }
      .pool-list { grid-template-columns:1fr; }
      .add-form { grid-template-columns:minmax(0,1fr) 100px; }
    }
    @media print {
      body { background:white; font-size:14px; }
      .topbar, .hero, .stats, .tab-nav, #tab-players, #tab-teams, footer, .saved-pill { display:none !important; }
      main { padding:0; max-width:none; }
      #tab-schedule { display:block !important; }
      .card { box-shadow:none; border-color:#bbb; margin-bottom:12px; break-inside:avoid; }
      .schedule-pools { padding:8px; }
      .schedule-pool { break-inside:avoid; }
      .schedule-pool-head, .pool-title { print-color-adjust:exact; }
    }


  
/* ── Mode appli partagée ─────────────────────────── */
.saved-pill.sync-error { background: #fdecea; color: #b3261e; border-color: #f2b8b5; }
.saved-pill.sync-error .saved-dot { background: #b3261e; }
.config-banner {
  max-width: 620px; margin: 2.2rem auto; padding: 1.5rem 1.8rem;
  background: #fff8e1; border: 1px solid #e6c75e; border-radius: 14px; line-height: 1.55;
}
.config-banner h2 { margin: 0 0 .6rem; font-size: 1.3rem; }
.config-banner ol { margin: .8rem 0 0; padding-left: 1.3rem; }
.config-banner li { margin-bottom: .5rem; }
.config-banner code { background: #f1efe6; padding: .1rem .35rem; border-radius: 4px; font-size: .9em; }
.config-banner a { color: #0a7d5f; }

/* ── Mode admin ── */
body:not(.admin) .stats, body:not(.admin) #tab-players, body:not(.admin) #tab-teams { display: none !important; }
.tab-nav { display: none !important; }
body.admin .tab-panel { display: block !important; margin-bottom: 14px; }
.tab-panel:not(.active) { display: none; }
.admin-badge { background:#c9b558; color:#142b25; border-radius:999px; padding:3px 10px; font-size:12px; font-weight:800; white-space:nowrap; }
.admin-badge[hidden] { display:none; }
.admin-link { margin-top:10px; background:none; border:0; color:#9aa49d; font-size:12px; text-decoration:underline; cursor:pointer; padding:6px; }
.pin-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.pin-box { background: #fff; color: #142b25; border-radius: 14px; padding: 22px; width: min(340px, 100%); box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.pin-box h3 { margin: 0 0 6px; }
.pin-box p { margin: 0 0 12px; font-size: 14px; }
.pin-box input { width: 100%; box-sizing: border-box; padding: 10px; font-size: 18px; border: 1px solid #b8c4bc; border-radius: 8px; }
.pin-error { color: #b3261e; font-size: 13px; min-height: 18px; margin-top: 6px; }
.pin-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* ── Vue tournois (joueurs) : cartes de match avec les joueurs de chaque équipe ── */
details.schedule-pool > summary { list-style: none; cursor: pointer; }
details.schedule-pool > summary::-webkit-details-marker { display: none; }
details.schedule-pool > summary::after { content: '▾'; color: #829087; margin-left: auto; }
details.schedule-pool:not([open]) > summary::after { content: '▸'; }
.match { display:flex; flex-direction:column; align-items:stretch; gap:8px; padding:11px 12px; }
.match-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.match-order { text-align:left; }
.match-status { text-align:right; }
.vs-row { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:8px; }
.vs-team { display:flex; flex-direction:column; gap:3px; min-width:0; }
.vs-team.right { align-items:flex-end; text-align:right; }
.tm { display:flex; align-items:center; gap:6px; font-size:15px; font-weight:750; min-width:0; }
.vs-team.right .tm { flex-direction:row-reverse; }
.tm-name { overflow-wrap:anywhere; }
.tm-ico { font-style:normal; flex:none; width:18px; height:18px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:10px; font-weight:900; background:#e6ece6; color:#40594c; }
.tm-ico.child { background:#f6ecc9; color:#7a651f; }
.match-vs { color:#98a39c; font-size:12px; font-weight:800; text-transform:uppercase; }
.match-score { font-size:20px; font-weight:900; letter-spacing:.02em; color:#203c2b; white-space:nowrap; }
.match-control { display:flex; flex-direction:column; gap:6px; }
.match-select { font-size:15px; padding:11px 9px; }
.match-start { padding:12px; font-size:15px; }
.match-cancel { font-size:12px; padding:8px; }
.match.playing { border-color:#e3c97a; background:#fffdf3; }
.match.done { background:#fafbf8; }
.done-matches { margin-top:4px; }
.done-matches > summary { cursor:pointer; color:#567266; font-size:13px; font-weight:800; padding:8px 2px; }
.done-matches[open] > summary { margin-bottom:8px; }
.done-matches > .match { margin-bottom:8px; }
.team-cell { display:inline-flex; flex-direction:column; vertical-align:middle; gap:1px; }
.tm-line { font-weight:700; }
table { min-width:0; }
.schedule-empty { padding:36px 20px; text-align:center; color:#6f7d75; line-height:1.6; }
@media (max-width: 720px) {
  main { padding-left:10px; padding-right:10px; }
  .schedule-pools { padding:0 8px 14px; gap:14px; }
  .match-list { padding:10px; }
  .standings { padding:12px 10px; }
  .team-filter-wrap { width:100%; }
  .team-filter-wrap select { min-width:0; flex:1; font-size:15px; padding:10px; }
  .card-head { flex-wrap:wrap; gap:10px; }
  .tm { font-size:14px; }
}

/* ── Sections repliables du mode admin ── */
.sec-num { display:none; }
body.admin .sec-num { display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; margin-right:10px; border-radius:50%; background:#e3ede6; color:#2e674a; font-size:13px; font-weight:900; vertical-align:middle; }
body.admin .card-head { cursor:pointer; align-items:center; position:relative; padding-right:44px; }
body.admin .card-head::after { content:'▾'; position:absolute; right:18px; top:50%; transform:translateY(-50%); color:#829087; font-size:16px; transition:transform .2s; }
body.admin .card.collapsed > .card-head::after { transform:translateY(-50%) rotate(-90deg); }
body.admin .card.collapsed > .card-head { border-bottom-color:transparent; }
.card.collapsed > :not(.card-head) { display:none !important; }
body.admin .card-head:focus-visible { outline:2px solid #2e674a; outline-offset:-2px; }
@media (max-width: 720px) {
  body.admin .card-head h2 { font-size:17px; }
  body.admin .stats { grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; margin-bottom:12px; }
  body.admin .stat { padding:9px 8px; text-align:center; }
  body.admin .stat-label { font-size:10px; letter-spacing:.04em; }
  body.admin .stat-value { font-size:20px; }
}
