/* ════════════════════════════════════════════════════════════════
   golfbet — design system (repris d'inscription-gp : cream / vert / or)
   ════════════════════════════════════════════════════════════════ */
:root {
  --cream:       #f5f1e8;
  --cream-2:     #ece6d6;
  --cream-3:     #ddd5bf;
  --ink:         #0b1410;
  --ink-2:       #1a2620;
  --ink-muted:   #52605a;
  --ink-subtle:  #8a9690;
  --green:       #0f3d2e;
  --green-deep:  #092016;
  --green-soft:  #1d5a44;
  --gold:        #c8a15a;
  --gold-deep:   #a07d38;
  --line:        rgba(11,20,16,0.08);
  --line-strong: rgba(11,20,16,0.16);
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --bar-h: 57px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
#page-wrap { overflow-x: clip; padding-top: var(--bar-h); padding-bottom: 60px; }

/* ── APP BAR ── */
.app-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(245,241,232,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  height: var(--bar-h);
  padding: 0 max(20px, calc((100% - 680px) / 2));
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px rgba(200,161,90,0.2); flex-shrink: 0;
}
.brand-name { font-family: var(--font-display); font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.btn-account {
  font-size: 13px; font-weight: 600; color: var(--green);
  background: rgba(15,61,46,0.08); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 10px; transition: background .12s;
}
.btn-account:hover { background: rgba(15,61,46,0.14); }

/* ── HERO ── */
.hero {
  background: var(--green);
  background-image:
    radial-gradient(circle at 85% 15%, rgba(200,161,90,0.18), transparent 50%),
    radial-gradient(circle at 15% 85%, rgba(29,90,68,0.6), transparent 50%);
  padding: 26px 20px 30px; color: var(--cream); position: relative; overflow: hidden;
}
@media (min-width: 640px) {
  .hero { padding: 34px 36px 38px; max-width: 680px; margin: 16px auto; border-radius: 28px; }
}
.hero-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.hero h1 { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.08; letter-spacing: -0.02em; }
.hero p { margin-top: 12px; font-size: 14px; color: rgba(245,241,232,.78); max-width: 46ch; }
.hero-next {
  margin-top: 18px; display: inline-flex; align-items: center; gap: 10px;
  background: rgba(245,241,232,.08); border: 1px solid rgba(245,241,232,.16);
  border-radius: 14px; padding: 10px 14px; font-size: 13px;
}
.hero-next b { font-family: var(--font-display); font-weight: 500; }
.hero-next .pill {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); border: 1px solid rgba(200,161,90,.4); border-radius: 999px; padding: 3px 8px;
}

/* ── HERO STATUS : décompte / rappel d'équipe ── */
.hero-status { margin-top: 0; }
.hero-cd-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.hero-cd-time {
  font-family: var(--font-mono); font-size: 34px; font-weight: 500; letter-spacing: .02em;
  color: var(--cream); line-height: 1; margin-bottom: 14px;
}

/* ── CLASSEMENT LIVE (onglet tournoi) — réutilise le style res-card ── */
.res-card.top1 .res-head { background: linear-gradient(90deg, rgba(200,161,90,.08), transparent); }
.res-card.top1 .lb-rank, .res-card.top1 .res-name { color: var(--gold-deep); }
.live-body { display: none; }
.res-card.open .live-body { display: block; }
.live-pick {
  display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 16px; border-top: 1px solid var(--line); font-size: 13px;
}
.live-pick .pick-fin { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); }
.live-pick .pick-fin .pts { color: var(--green); font-weight: 600; }
.board-updated {
  text-align: center; font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-subtle); margin-top: 12px;
}

/* ── LAYOUT ── */
.wrap { max-width: 680px; margin: 0 auto; padding: 0 20px; }

/* ── TABS ── */
/* ── HERO DONATION (sticky sous l'app-bar, onglets dessous) ── */
.hero-donation {
  padding: 8px 20px; max-width: 680px; margin: 0 auto;
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
  position: sticky; top: var(--bar-h); z-index: 60;
  background: var(--cream);
}
.hero-donation::before {
  content: ''; position: absolute; top: -2px; left: 0; right: 0; height: 2px;
  background: var(--cream);
}
.donation-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cream-2); border: 1px solid var(--line-strong);
  color: var(--ink); font-family: var(--font-body);
  font-size: 13px; font-weight: 500;
  padding: 9px 18px; border-radius: 100px; transition: background 0.12s;
}
.donation-btn:hover { background: var(--cream-3); }

.tabs {
  background: var(--cream); border-bottom: 1px solid var(--line);
  display: flex; gap: 4px; padding: 8px max(20px, calc((100% - 680px) / 2));
  overflow-x: auto;
}
.tab {
  font-size: 13px; font-weight: 600; color: var(--ink-muted);
  padding: 8px 14px; border-radius: 10px; white-space: nowrap; transition: all .12s;
}
.tab.active { background: var(--ink); color: var(--cream); }
.panel { display: none; padding-top: 22px; }
.panel.active { display: block; }
.section-title {
  font-family: var(--font-display); font-size: 20px; font-weight: 500;
  letter-spacing: -0.01em; margin-bottom: 4px;
}
.section-sub { font-size: 13px; color: var(--ink-muted); margin-bottom: 16px; }

/* ── SELECT inline ── */
.inline-select {
  display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap;
}
.inline-select select {
  font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 12px;
}

/* ── LEADERBOARD ── */
.lb { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.lb-row {
  display: grid; grid-template-columns: 38px 1fr auto; align-items: center;
  gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.lb-row:last-child { border-bottom: none; }
.lb-rank { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--ink-subtle); text-align: center; }
.lb-row.top1 .lb-rank, .lb-row.top1 .lb-name { color: var(--gold-deep); }
.lb-row.top1 { background: linear-gradient(90deg, rgba(200,161,90,.08), transparent); }
.lb-name { font-weight: 600; font-size: 15px; }
.lb-detail { font-size: 11px; color: var(--ink-subtle); font-family: var(--font-mono); margin-top: 2px; }
.lb-pts { font-family: var(--font-mono); font-weight: 600; font-size: 15px; color: var(--green); }
.lb-pts small { color: var(--ink-subtle); font-weight: 400; }
.medal { font-size: 15px; }

/* ── RÉSULTATS : carte joueur dépliable ── */
.res-card { background: #fff; border: 1px solid var(--line); border-bottom: none; }
.res-card:first-child { border-radius: 16px 16px 0 0; }
.res-card:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 16px 16px; }
.res-head {
  display: grid; grid-template-columns: 38px 1fr auto; align-items: center;
  gap: 12px; padding: 13px 16px; cursor: pointer;
}
.res-head:hover { background: var(--cream); }
.res-card.open .res-head { background: var(--cream); }
.res-name { font-weight: 600; font-size: 15px; }
.res-stats { display: flex; gap: 10px; align-items: center; }
.stat { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.stat-dim { color: var(--ink-subtle); font-weight: 400; }
.stat .ico { vertical-align: -2px; }
.res-body { display: none; padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.res-card.open .res-body { display: block; }

/* ── GRILLE façon Wikipédia (majeur × année) ── */
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
table.grid th, table.grid td {
  border: 1px solid var(--line); padding: 7px 6px; text-align: center;
  font-family: var(--font-mono);
}
table.grid th { background: var(--green); color: var(--cream); font-weight: 600; font-size: 12px; }
table.grid td.g-major {
  text-align: left; font-family: var(--font-body); font-weight: 600;
  background: var(--cream); white-space: nowrap;
}
table.grid td.g-empty { background: var(--cream-2); }
table.grid td.g-podium { background: #f6e6bf; font-weight: 600; }
table.grid td.g-win { background: var(--gold); color: var(--ink); font-weight: 700; }
table.grid td.g-link { cursor: pointer; }
table.grid td.g-link:hover { box-shadow: inset 0 0 0 2px var(--green-soft); }

/* ── HISTORIQUE : carte tournoi → classement (façon board) ── */
.major-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  margin-bottom: 14px; overflow: hidden; scroll-margin-top: 70px;
}
.major-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; cursor: pointer; gap: 10px;
}
.major-head:hover { background: var(--cream); }
.major-title { font-family: var(--font-display); font-size: 16px; font-weight: 500; }
.major-year { font-family: var(--font-mono); font-size: 11px; color: var(--ink-subtle); }
.major-winner { font-size: 12px; color: var(--ink-muted); }
.major-winner b { color: var(--gold-deep); }
.major-body { display: none; border-top: 1px solid var(--line); padding: 12px; background: var(--cream); }
.major-card.open .major-body { display: block; }

/* libellés des golfeurs (partagés board live / historique) */
.pick-slot { font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-subtle); }
.pick-golfer { font-weight: 500; }

/* ── PICK FLOW (Mon équipe) ── */
.slot-block { margin-bottom: 16px; }
.slot-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.slot-label .tag { color: var(--gold-deep); }
.golfer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 8px; }
.golfer-opt {
  display: flex; align-items: center; gap: 8px; text-align: left;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 9px 11px; font-size: 13px; transition: all .1s;
}
.golfer-opt:hover { border-color: var(--green-soft); }
.golfer-opt.sel { background: var(--green); color: var(--cream); border-color: var(--green); }
.golfer-opt .gr { font-family: var(--font-mono); font-size: 10px; color: var(--ink-subtle); }
.golfer-opt.sel .gr { color: var(--gold); }
.golfer-opt .gn { font-weight: 500; }
.bonus-input {
  width: 100%; font-family: var(--font-body); font-size: 14px;
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 13px; background: #fff;
  margin-bottom: 8px;
}
.bonus-list { max-height: 230px; overflow-y: auto; padding: 2px; }
.submit-bar {
  position: sticky; bottom: 0; background: rgba(245,241,232,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); padding: 12px 0; margin-top: 20px;
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
}
.submit-summary { font-size: 12px; color: var(--ink-muted); font-family: var(--font-mono); }
.btn-primary {
  background: var(--green); color: var(--cream); font-weight: 600; font-size: 14px;
  padding: 12px 22px; border-radius: 12px; transition: background .12s;
}
.btn-primary:hover { background: var(--green-deep); }
.btn-primary:disabled { background: var(--ink-subtle); cursor: not-allowed; }

/* ── EMPTY / LOCKED / MSG ── */
.notice {
  text-align: center; padding: 40px 20px; color: var(--ink-muted); font-size: 14px;
}
.notice b { color: var(--ink); }
.locked-banner {
  background: rgba(160,125,56,.1); border: 1px solid rgba(200,161,90,.4);
  color: var(--gold-deep); border-radius: 12px; padding: 12px 14px; font-size: 13px;
  margin-bottom: 16px; text-align: center;
}

/* ── MODAL (login) ── */
.modal-bg {
  position: fixed; inset: 0; z-index: 200; background: rgba(11,20,16,.5);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--cream); border-radius: 22px; padding: 26px 24px; width: 100%; max-width: 380px;
  box-shadow: 0 24px 60px rgba(11,20,16,.3);
}
.modal h2 { font-family: var(--font-display); font-weight: 500; font-size: 21px; margin-bottom: 6px; }
.modal p { font-size: 13px; color: var(--ink-muted); margin-bottom: 18px; }
.modal input {
  width: 100%; font-family: var(--font-body); font-size: 15px;
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: #fff;
}
.modal .btn-primary { width: 100%; justify-content: center; }
.modal-close { position: absolute; top: 16px; right: 18px; color: var(--ink-muted); font-size: 22px; }
.modal-err { color: #b03a2e; font-size: 12px; margin-bottom: 12px; min-height: 16px; }
.modal-step2 { display: none; }
.modal.code .modal-step1 { display: none; }
.modal.code .modal-step2 { display: block; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--cream); padding: 11px 18px; border-radius: 12px;
  font-size: 13px; z-index: 300; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }
