/* Zportif — version web. Charte : encre #262626 / #151515, orange #F59D00, League Gothic + Titillium Web. */
:root {
  --ink: #151515;
  --ink2: #262626;
  --ink3: #333333;
  --orange: #F59D00;
  --orange-soft: rgba(245, 157, 0, .16);
  --live: #21AD54;
  --live-soft: rgba(33, 173, 84, .14);
  --bg: #F4F3F0;
  --card: #FFFFFF;
  --text: #1C1C1C;
  --muted: #6B6B6B;
  --line: #E4E2DD;
  --danger: #D93A2B;
  --radius: 16px;
  --display: "League Gothic", "Arial Narrow", sans-serif;
  --body: "Titillium Web", system-ui, -apple-system, sans-serif;
  --top: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0E0E;
    --card: #1C1C1C;
    --text: #F2F2F2;
    --muted: #A3A3A3;
    --line: #2E2E2E;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0E0E; --card: #1C1C1C; --text: #F2F2F2; --muted: #A3A3A3; --line: #2E2E2E;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--orange); }
svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.o { color: var(--orange); }
.msg { min-height: 1.2em; color: var(--danger); font-size: 14px; margin: 10px 0 0; }
.msg.ok { color: var(--live); }
.stack { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Écrans plein page */
.screen { min-height: 100vh; min-height: 100dvh; background: var(--ink); color: #fff; display: grid; place-items: center; padding: 24px 16px; }
.center { place-content: center; justify-items: center; gap: 24px; }
.boot-logo { width: 84px; height: 84px; }
.boot-logo.small { width: 56px; height: 56px; margin-bottom: 4px; }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-card { width: 100%; max-width: 400px; display: grid; gap: 12px; }
.login-logo { height: 44px; width: auto; justify-self: start; margin-bottom: 8px; }
.login-card h1, .login-card h2 { font: 400 52px/0.95 var(--display); letter-spacing: .5px; margin: 6px 0 4px; text-transform: uppercase; }
.login-card h2 { font-size: 40px; }
.login-card .muted { color: #B5B5B5; margin: 0 0 8px; }
.login-card input, .login-card select { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid #3A3A3A; background: #222; color: #fff; }
.login-card label { display: grid; gap: 6px; font-size: 14px; color: #CFCFCF; }
.login-card .link { color: #DADADA; }
.sep { display: flex; align-items: center; gap: 10px; color: #8A8A8A; font-size: 13px; margin: 4px 0; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: #333; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 999px; padding: 13px 20px; font-weight: 700; cursor: pointer; transition: transform .15s ease, filter .15s ease, background-color .15s ease; text-decoration: none; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--orange); color: var(--ink); }
.btn.apple { background: #fff; color: #000; }
.btn.google { background: #fff; color: #1F1F1F; }
.btn.dark { background: var(--ink2); color: #fff; }
.btn.live { background: var(--live); color: #fff; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.block { width: 100%; }
.btn.sm { padding: 9px 14px; font-size: 14px; }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--orange); font-weight: 600; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--line); cursor: pointer; color: var(--text); }

/* Barre du haut */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 900; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; padding-top: env(safe-area-inset-top); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 34px; width: auto; display: block; }
.brand .word { height: 26px; }
.tabs { display: flex; gap: 4px; }
.tabs a { display: flex; align-items: center; gap: 8px; color: #CFCFCF; text-decoration: none; padding: 9px 14px; border-radius: 999px; font-weight: 600; }
.tabs a:hover { color: #fff; background: rgba(255,255,255,.06); }
.tabs a.active { color: var(--ink); background: var(--orange); }
.tabs svg { width: 20px; height: 20px; }

.tab { position: fixed; inset: var(--top) 0 0 0; }
.page { overflow-y: auto; padding: 24px 16px 40px; }
.page > * { max-width: 980px; margin-left: auto; margin-right: auto; }
.title { font: 400 44px/1 var(--display); text-transform: uppercase; letter-spacing: .5px; margin-top: 0; margin-bottom: 6px; }

/* Téléphone : onglets en bas */
@media (max-width: 760px) {
  :root { --top: 56px; }
  .brand .word { display: none; }
  .tabs { position: fixed; inset: auto 0 0 0; background: var(--ink); justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid #2A2A2A; z-index: 950; }
  .tabs a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 8px; border-radius: 12px; flex: 1; }
  .tabs a.active { background: transparent; color: var(--orange); }
  .tab { bottom: calc(62px + env(safe-area-inset-bottom)); }
  .topbar { justify-content: center; }
  .title { font-size: 38px; }
}

/* Carte */
#map { position: absolute; inset: 0; z-index: 1; background: #DDE3E6; }
.map-tools { position: absolute; z-index: 500; top: 12px; left: 12px; right: 12px; display: grid; gap: 8px; pointer-events: none; }
.map-tools > * { pointer-events: auto; }
.search { position: relative; max-width: 420px; }
.search input, .wide { width: 100%; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.wide { box-shadow: none; margin: 14px 0 10px; display: block; }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card); border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.18); max-height: 50vh; overflow-y: auto; }
.results button { display: flex; width: 100%; text-align: left; gap: 10px; padding: 11px 14px; border: 0; background: none; cursor: pointer; border-bottom: 1px solid var(--line); }
.results button:hover { background: var(--orange-soft); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; border-radius: 999px; padding: 7px 13px; background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.1); white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink2); color: #fff; }
.chip.live[aria-pressed="true"] { background: var(--live); }
.fab { position: absolute; z-index: 500; right: 14px; bottom: 22px; width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--card); color: var(--text); box-shadow: 0 6px 20px rgba(0,0,0,.2); cursor: pointer; display: grid; place-items: center; }
.live-pill { position: absolute; z-index: 500; left: 14px; bottom: 26px; background: var(--live); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.leaflet-container { font-family: var(--body); }

.pin { width: 16px; height: 16px; border-radius: 50%; background: var(--ink2); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pin.community { background: var(--orange); }
.pin.live { width: 30px; height: 30px; background: var(--live); color: #fff; display: grid; place-items: center; font: 700 14px/1 var(--body); margin: -7px 0 0 -7px; }
.pin.live::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--live); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { from { transform: scale(.8); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.pin.games { box-shadow: 0 0 0 3px var(--orange), 0 2px 6px rgba(0,0,0,.35); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(38,38,38,.25); }
.marker-cluster div { background: var(--ink2) !important; color: #fff; font: 700 13px/30px var(--body); }

/* Fiche latérale / bas de page */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 960; }
.sheet { position: fixed; z-index: 970; background: var(--card); color: var(--text); display: flex; flex-direction: column;
  top: calc(var(--top) + 12px); right: 12px; bottom: 12px; width: min(460px, calc(100vw - 24px)); border-radius: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: slideIn .25s ease; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 0; }
.grab { display: none; }
.sheet-body { overflow-y: auto; padding: 4px 20px 28px; flex: 1; }
@media (max-width: 760px) {
  .sheet { inset: auto 0 0 0; width: auto; max-height: 88dvh; border-radius: 22px 22px 0 0; animation: slideUp .25s ease; padding-bottom: env(safe-area-inset-bottom); }
  @keyframes slideUp { from { transform: translateY(40px); opacity: 0; } }
  .grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
}

.place-title { font: 400 36px/1 var(--display); text-transform: uppercase; letter-spacing: .5px; margin: 6px 0 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--orange-soft); font-size: 13px; font-weight: 600; }
.badge.live { background: var(--live-soft); color: var(--live); }
.badge.grey { background: var(--line); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.section { margin-top: 22px; }
.section h3 { font: 400 22px/1 var(--display); text-transform: uppercase; letter-spacing: .6px; margin: 0 0 10px; color: var(--muted); }
.box { background: var(--bg); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px; }
.big-count { display: flex; align-items: center; gap: 14px; }
.big-count .n { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font: 400 36px/1 var(--display); background: var(--line); color: var(--muted); flex: none; }
.big-count .n.on { background: var(--live-soft); color: var(--live); }
.big-count b { display: block; font-size: 17px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--line); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; border-radius: 10px; padding: 8px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.note { font-size: 13px; color: var(--muted); margin: 0; }
.ok-line { color: var(--live); font-weight: 700; display: flex; align-items: center; gap: 6px; }

.person { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink2) center/cover no-repeat; color: #fff; display: grid; place-items: center; font: 400 17px/1 var(--display); flex: none; border: 2px solid var(--orange); }
.avatar.lg { width: 84px; height: 84px; font-size: 38px; border-width: 3px; }
.person .who { flex: 1; min-width: 0; }
.person .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .who span { font-size: 13px; color: var(--muted); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--live); flex: none; }

.slot { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; color: var(--text); }
.slot:hover { border-color: var(--orange); }
.slot .ico { width: 42px; height: 42px; border-radius: 50%; background: var(--orange-soft); display: grid; place-items: center; font-size: 20px; flex: none; }
.slot .main { flex: 1; min-width: 0; }
.slot .when { font: 400 22px/1.05 var(--display); text-transform: uppercase; letter-spacing: .4px; }
.slot .meta { font-size: 13px; color: var(--muted); }
.slot .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; font-size: 13px; font-weight: 700; }
.t-live { color: var(--live); }
.t-o { color: var(--orange); }
.list { display: grid; gap: 10px; margin-top: 16px; }

form.card-form { display: grid; gap: 12px; }
form.card-form label, .field { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
form.card-form input, form.card-form select, form.card-form textarea, .field select {
  width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 400; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.switch input { width: 46px; height: 28px; appearance: none; background: var(--line); border-radius: 999px; position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked { background: var(--orange); }
.switch input:checked::after { transform: translateX(18px); }

/* Joueurs */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 12px; }
.pcard { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; text-align: left; color: var(--text); }
.pcard:hover { border-color: var(--orange); transform: translateY(-2px); transition: transform .15s; }
.pcard .avatar { width: 52px; height: 52px; font-size: 24px; }
.pcard b { display: block; }
.pcard span { font-size: 13px; color: var(--muted); }
.profile-head { display: flex; gap: 16px; align-items: center; margin: 6px 0 14px; }
.profile-head h2 { font: 400 38px/1 var(--display); text-transform: uppercase; margin: 0 0 4px; letter-spacing: .4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.stat { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font: 400 30px/1 var(--display); color: var(--orange); }
.stat span { font-size: 12px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 14px; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

.toast { position: fixed; z-index: 990; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink2); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: calc(100vw - 32px); text-align: center; }
.toast.err { background: var(--danger); }
[hidden] { display: none !important; }
