/* ============================================================
   Prono Volley — thème « salle de match » : noir profond + or
   Mobile-first, inspiré du visuel de référence
   ============================================================ */

:root {
  --bg:        #0d0b07;
  --bg-2:      #15110a;
  --card:      #1b1610;
  --card-2:    #241e14;
  --line:      #33291a;
  --gold:      #d8ab3c;
  --gold-2:    #f3cf6b;
  --gold-dim:  #8a6d2a;
  --txt:       #f2ead8;
  --txt-dim:   #a2947a;
  --ok:        #4ade80;
  --ko:        #f87171;
  --r:         14px;
  --font-d:    "Barlow Condensed", sans-serif;
  --font-b:    "Barlow", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  background-image: radial-gradient(1200px 400px at 50% -100px, #2a2110 0%, transparent 70%);
  color: var(--txt);
  font-family: var(--font-b);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
}

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(13,11,7,.97), rgba(13,11,7,.88));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-d);
  font-weight: 700; font-size: 20px; letter-spacing: 2.5px;
  display: flex; align-items: center; gap: 8px;
}
.brand em { font-style: normal; color: var(--gold); }
.brand-logo {
  width: 24px; height: 24px; border-radius: 6px;
  box-shadow: 0 0 10px rgba(216,171,60,.45);
}
.topbar-user { color: var(--txt-dim); font-size: 13px; font-weight: 600; }

/* ---------- Page ---------- */
.page {
  max-width: 520px; margin: 0 auto;
  padding: 16px 14px calc(84px + env(safe-area-inset-bottom));
}
.section-title {
  font-family: var(--font-d);
  font-size: 15px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 10px;
  margin: 22px 2px 10px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.muted { color: var(--txt-dim); }
.small { font-size: 12.5px; }

/* ---------- Compte à rebours ---------- */
.countdown {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; margin-bottom: 6px;
}
.countdown .label { color: var(--txt-dim); font-size: 12.5px; letter-spacing: .4px; }
.clock {
  font-family: var(--font-d); font-weight: 700; font-size: 24px;
  letter-spacing: 3px; color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

/* ---------- Cartes de match ---------- */
.day-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 18px 4px 8px;
}
.day-head .day {
  font-family: var(--font-d); font-weight: 600; font-size: 16px;
  letter-spacing: 1.5px; text-transform: capitalize;
}
.day-head .j { color: var(--txt-dim); font-size: 12px; }

.match-card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 12px 12px; margin-bottom: 12px;
}
.match-card.locked { opacity: .92; }
.match-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--txt-dim); margin-bottom: 10px;
}
.match-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 8px;
}
.team { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.team .name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.team .cote {
  font-family: var(--font-d); font-size: 13px; font-weight: 600;
  color: var(--gold); border: 1px solid var(--gold-dim);
  border-radius: 999px; padding: 1px 9px;
}
.badge {
  border-radius: 50%; object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.5), inset 0 0 0 2px rgba(255,255,255,.12);
}
.badge-txt {
  color: #fff; font-family: var(--font-d); font-weight: 700; font-size: 14px;
  letter-spacing: .5px; text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.score-mid {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-d); font-weight: 700; font-size: 26px;
  color: var(--txt);
}
.score-mid .box {
  min-width: 40px; padding: 4px 0; text-align: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.score-mid .box.win { border-color: var(--gold); color: var(--gold-2); }
.score-mid .vs { color: var(--txt-dim); font-size: 15px; letter-spacing: 1px; }

/* ---------- Sélecteur de prono ---------- */
.pick { margin-top: 12px; }
.pick-title { font-size: 12px; color: var(--txt-dim); margin-bottom: 6px; }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.chips.two-cols { grid-template-columns: repeat(6, 1fr); }
.chip {
  appearance: none; border: 1px solid var(--line); background: var(--bg);
  color: var(--txt); border-radius: 10px; padding: 8px 0;
  font-family: var(--font-d); font-weight: 600; font-size: 16px; letter-spacing: 1px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.chip:active { transform: scale(.97); }
.chip.sel {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #241a05; border-color: var(--gold);
  box-shadow: 0 2px 10px rgba(216,171,60,.35);
}
.pick-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; gap: 10px;
}
.gain { font-size: 12.5px; color: var(--txt-dim); }
.gain b { color: var(--gold-2); font-size: 14px; }

.btn {
  appearance: none; border: none; cursor: pointer;
  font-family: var(--font-d); font-weight: 700; font-size: 15px; letter-spacing: 1.5px;
  text-transform: uppercase; border-radius: 12px; padding: 10px 18px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #241a05; box-shadow: 0 3px 12px rgba(216,171,60,.3);
  text-decoration: none; display: inline-block; text-align: center;
}
.btn:disabled { opacity: .45; box-shadow: none; cursor: default; }
.btn-ghost {
  background: transparent; color: var(--gold);
  border: 1px solid var(--gold-dim); box-shadow: none;
}
.btn-block { width: 100%; }

.my-pick {
  margin-top: 10px; padding: 8px 10px; border-radius: 10px;
  background: rgba(216,171,60,.08); border: 1px dashed var(--gold-dim);
  font-size: 13px; display: flex; justify-content: space-between; align-items: center;
}
.my-pick b { color: var(--gold-2); }
.pts-pill {
  font-family: var(--font-d); font-weight: 700; font-size: 14px;
  padding: 2px 10px; border-radius: 999px;
}
.pts-pill.win  { background: rgba(74,222,128,.14); color: var(--ok); }
.pts-pill.zero { background: rgba(248,113,113,.12); color: var(--ko); }

/* ---------- Commentaires ---------- */
.comment-input {
  width: 100%; margin-top: 10px;
  padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg);
  color: var(--txt); font-family: var(--font-b); font-size: 13.5px;
}
.comment-input::placeholder { color: var(--txt-dim); opacity: .7; }
.comment-input:focus { outline: 2px solid var(--gold-dim); border-color: var(--gold-dim); }

.comments {
  margin-top: 10px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.comment {
  font-size: 12.5px; color: var(--txt-dim); line-height: 1.4;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 10px;
}
.comment b { color: var(--gold); font-weight: 600; margin-right: 4px; }

.alert.welcome {
  font-family: var(--font-d); font-weight: 600; font-size: 16px;
  letter-spacing: .5px; text-align: center; padding: 14px 12px;
}

/* ---------- Classements ---------- */
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 5px; margin-bottom: 14px;
}
.seg a {
  text-align: center; padding: 8px 0; border-radius: 9px;
  color: var(--txt-dim); text-decoration: none;
  font-family: var(--font-d); font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; font-size: 14px;
}
.seg a.on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #241a05; }

.table-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
}
.trow {
  display: grid; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.trow:last-child { border-bottom: none; }
.trow.head { color: var(--txt-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 8px 12px; background: var(--bg-2); }
.trow.me { background: rgba(216,171,60,.07); }
.grid-teams  { grid-template-columns: 26px 1fr 34px 34px 44px; }
.grid-players{ grid-template-columns: 26px 1fr 60px 50px; }
.rank {
  font-family: var(--font-d); font-weight: 700; font-size: 15px;
  color: var(--txt-dim); text-align: center;
}
.trow:nth-child(2) .rank { color: var(--gold-2); }
.tname { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px; }
.num { text-align: center; font-variant-numeric: tabular-nums; }
.num.strong { font-family: var(--font-d); font-weight: 700; font-size: 16px; color: var(--gold-2); }

/* ---------- Formulaires ---------- */
.form-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 16px; margin-top: 14px;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--txt-dim); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg);
  color: var(--txt); font-family: var(--font-b); font-size: 15px;
}
.field input:focus, .field select:focus { outline: 2px solid var(--gold-dim); border-color: var(--gold-dim); }
.alert {
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13.5px;
}
.alert.err { background: rgba(248,113,113,.12); color: var(--ko); border: 1px solid rgba(248,113,113,.3); }
.alert.ok  { background: rgba(74,222,128,.1);  color: var(--ok); border: 1px solid rgba(74,222,128,.3); }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 380px; margin: 8vh auto 0; text-align: center; }
.auth-logo {
  font-family: var(--font-d); font-weight: 700; font-size: 34px;
  letter-spacing: 4px; margin-bottom: 4px;
}
.auth-logo em { font-style: normal; color: var(--gold); }
.auth-sub { color: var(--txt-dim); font-size: 13.5px; margin-bottom: 10px; }

/* ---------- Barre d'onglets bas ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 520px; margin: 0 auto;
  background: linear-gradient(180deg, #1d1810, #15110a);
  border-top: 1px solid var(--gold-dim);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -6px 24px rgba(0,0,0,.55);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--txt-dim); text-decoration: none;
  font-size: 10.5px; letter-spacing: .3px; padding: 4px 0;
}
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--gold-2); }
.tab.on svg { filter: drop-shadow(0 0 6px rgba(216,171,60,.6)); }

/* ---------- Admin ---------- */
.admin-list .trow { grid-template-columns: 44px 1fr auto; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select {
  padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--txt); font-size: 14px;
}
.color-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); padding: 0; background: none; }

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