/* Thème Lumiscores : bleu marine + bleu lumineux + orange (couleurs du logo) */
:root {
  --bg: #f2f6fb; --card: #fff; --ink: #0b1f3a; --muted: #5a6b85; --line: #dbe4ef;
  --brand: #1677c9; --brand-2: #1b8fd6; --brand-ink: #fff; --accent: #e4570c; --accent-2: #f7a530; --accent-ink: #fff;
  --navy: #06203f; --field: #f7f9fc; --warn: #c2410c; --danger: #dc2626; --ok: #16a34a;
  --shadow: 0 1px 2px rgba(11, 31, 58, .05), 0 6px 20px rgba(11, 31, 58, .08);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #061222; --card: #0d1c31; --ink: #e8f0fb; --muted: #91a3bd; --line: #1f3350;
    --brand: #3aa8f0; --brand-2: #22c3f0; --brand-ink: #04172b; --accent: #ff7a2e; --accent-2: #ffb347; --accent-ink: #1f0c00;
    --navy: #030b17; --field: #0a1729; --warn: #fb923c; --danger: #f87171; --ok: #4ade80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }

/* En-tête : dégradé marine → bleu, liseré orange */
header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; position: sticky; top: 0; z-index: 5; color: #fff;
  background: linear-gradient(120deg, var(--navy) 0%, #0b3d73 55%, #1677c9 100%);
  box-shadow: 0 4px 18px rgba(6, 32, 63, .3);
}
header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #1b8fd6, #22c3f0 35%, var(--accent) 65%, var(--accent-2)); }
header h1 { font-size: 20px; margin: 0; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; font-weight: 800; text-transform: uppercase; }
header h1 em { font-style: normal; color: #ff8a3d; }
header h1 small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .12em; opacity: .8; }
header h1 span { line-height: 1.05; }
header .mark { width: 42px; height: 42px; border-radius: 50%; background: #fff; object-fit: cover; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5), 0 2px 10px rgba(34, 195, 240, .45); }
header .who { font-size: 12px; background: rgba(255, 255, 255, .16); padding: 4px 10px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
header .who:empty { display: none; }
header .hright { display: flex; align-items: center; gap: 8px; min-width: 0; }
header .hright .who { max-width: none; min-width: 0; }
header .logout { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 7px 11px; border-radius: 999px; font-size: 12px; background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .28); box-shadow: none; }
header .logout:hover { background: var(--accent); border-color: var(--accent); filter: none; }
@media (max-width: 520px) { header .logout span { display: none; } header .logout { padding: 7px; } header .hright .who { max-width: 38vw; } }
.hero { text-align: center; margin: 4px 0 16px; }
.hero img { width: min(280px, 75%); height: auto; border-radius: 24px; background: #fff; padding: 10px; box-shadow: var(--shadow); }
main { max-width: 760px; margin: 0 auto; padding: 18px 16px; }

/* Barre d'onglets flottante */
nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
  max-width: 600px; margin: 0 auto; display: flex; gap: 2px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  z-index: 6; overflow-x: auto;
}
nav:empty { display: none; }
nav a { flex: 1 0 auto; min-width: 58px; text-align: center; padding: 7px 6px; color: var(--muted); text-decoration: none; font-size: 11px; border-radius: 16px; transition: background .15s, color .15s; }
nav a b { display: block; font-size: 20px; line-height: 1.15; font-weight: normal; }
nav a.on { color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-weight: 700; }

h2 { font-size: 24px; margin: 4px 0 14px; letter-spacing: -.02em; }
h3 { font-size: 15px; margin: 0 0 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }

label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 5px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
textarea { min-height: 70px; resize: vertical; }

button, .btn {
  font: inherit; border: 0; border-radius: 12px; padding: 10px 16px; cursor: pointer; text-decoration: none; display: inline-block;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); font-weight: 700;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 30%, transparent); transition: transform .08s, filter .15s;
}
button:hover, .btn:hover { filter: brightness(1.06); }
button:active, .btn:active { transform: scale(.97); }
button.sec { background: transparent; color: var(--brand); border: 1.5px solid var(--line); box-shadow: none; }
button.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--line); box-shadow: none; }
button.sm { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
button.full { width: 100%; margin-top: 16px; padding: 12px 16px; }
button:disabled { opacity: .5; cursor: default; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--field); border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: transparent; }
.badge.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: transparent; }
.badge.brand { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); border-color: transparent; }
.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.neg { color: var(--danger); } .pos { color: var(--ok); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { border: 1.5px solid var(--line); background: var(--field); border-radius: 999px; padding: 5px 12px; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; transition: background .12s, border-color .12s, transform .08s; }
.chip.sel { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.chip.dim { opacity: .45; }
.chip .x { font-weight: 700; opacity: .6; }
.day { cursor: pointer; user-select: none; }
.day:active { transform: scale(.95); }
.days { display: flex; flex-wrap: wrap; gap: 6px; }

.empty { text-align: center; color: var(--muted); padding: 32px 12px; background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot { border-left: 4px solid var(--brand-2); padding-left: 10px; margin: 8px 0; }
.err { color: var(--danger); font-size: 14px; margin-top: 8px; min-height: 1em; }
.sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 8px; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

#toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; opacity: 0; transition: .25s; pointer-events: none; z-index: 40; max-width: 90vw; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: translateX(-50%); }

.dialog-bg { position: fixed; inset: 0; background: rgba(8, 14, 30, .5); backdrop-filter: blur(3px); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.dialog { background: var(--card); width: 100%; max-width: 760px; max-height: 92vh; overflow: auto; border-radius: 24px 24px 0 0; padding: 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); }
@media (min-width: 700px) { .dialog-bg { align-items: center; } .dialog { border-radius: 24px; } }
pre.msg { white-space: pre-wrap; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; font-size: 14px; margin: 8px 0; }
.logo { width: 40px; height: 40px; flex: none; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.logo.lg { width: 64px; height: 64px; font-size: 30px; }
.sec-btn { background: transparent; color: var(--brand); border: 1.5px solid var(--line); box-shadow: none; font-size: 14px; text-transform: none; letter-spacing: 0; padding: 8px 12px; }

/* Admin : sous-onglets (4 colonnes, icône + libellé, comme la barre du bas) */
.subnav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; margin: 0 0 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.subnav a { text-align: center; padding: 6px 2px; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.subnav a b { display: block; font-size: 18px; font-weight: normal; line-height: 1.2; }
.subnav a.on { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); }

/* recherche + filtres */
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; color: var(--muted); }
.search:focus-within { border-color: var(--brand); }
.search input { border: 0; background: transparent; padding: 10px 0; box-shadow: none !important; }
.filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin: 8px 0 10px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { white-space: nowrap; font-size: 13px; }
.chip .n { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--muted); }
.chip.sel .n { background: rgba(255, 255, 255, .3); color: inherit; }
.dates { margin-bottom: 10px; }
.dates label { margin-top: 0; }

/* listes compactes (membres, clubs, journal) */
.card.list { padding: 4px 14px; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); cursor: pointer; }
.li:first-child { border-top: 0; }
.li:active { opacity: .7; }
.li .tags { display: flex; gap: 4px; flex: none; }
.chev { color: var(--muted); font-size: 22px; line-height: 1; flex: none; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brk { overflow-wrap: anywhere; }
.avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--accent)); }
.avatar.lg { width: 54px; height: 54px; font-size: 22px; }
.menu { display: grid; gap: 8px; margin-top: 14px; }
.menu button, .menu .btn { width: 100%; text-align: left; }
.sec-link { background: transparent; color: var(--brand); border: 1.5px solid var(--line); box-shadow: none; }

/* journal */
.log { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.day-sep + .log, .logs > .log:first-child { border-top: 0; }
.log .ic { width: 30px; height: 30px; flex: none; border-radius: 10px; background: var(--field); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.log.bad .ic { background: color-mix(in srgb, var(--danger) 15%, transparent); }
.log.bad b { color: var(--danger); }
.day-sep { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 12px 0 4px; border-top: 1px solid var(--line); }
.logs > .day-sep:first-child { border-top: 0; padding-top: 8px; }
/* fenêtre du match : groupes de joueurs */
.chips .grp { flex-basis: 100%; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); margin: 10px 0 2px; }
.chips .grp:first-child { margin-top: 2px; }
.chips .grp .muted { font-size: 12px; }
#ps + .chips, .search + #pl { margin-top: 8px; }
/* carte du match : étiquettes + places vides */
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.warn-line { margin-top: 6px; padding: 6px 10px; border-radius: 10px; color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); font-weight: 600; }
