/* =========================================================
   VolleyBallTournament — Design "Filet"
   Palette canard profond + crème, sobre et lumineux
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Couleurs */
  --teal-900: #0f3d3e;   /* canard très foncé (texte fort, fonds sombres) */
  --teal-700: #1a5a5b;   /* canard principal */
  --teal-500: #2a7e7f;   /* canard clair (accents, hover) */
  --teal-100: #d7e7e5;   /* canard pâle (fonds doux) */
  --sand:     #f6f2e9;   /* crème de fond */
  --sand-2:   #efe9db;   /* crème un peu plus marquée */
  --paper:    #fdfbf6;   /* blanc cassé pour cartes */
  --ink:      #1d2624;   /* texte principal */
  --ink-soft: #51605c;   /* texte secondaire */
  --line:     #e2dccd;   /* filets / bordures */
  --gold:     #c08a3e;   /* accent chaud, rare */
  --danger:   #b04a3f;
  --success:  #2f7d54;

  /* Type */
  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Mesures */
  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1120px;
  --shadow: 0 1px 2px rgba(15,61,62,.04), 0 8px 24px rgba(15,61,62,.06);
  --shadow-lg: 0 18px 50px rgba(15,61,62,.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--sand);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.1; color: var(--teal-900); margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: var(--teal-700); text-decoration: none; }
a:hover { color: var(--teal-500); }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(253,251,246,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.navbar nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.navbar nav a {
  padding: 8px 14px; border-radius: 999px;
  color: var(--ink-soft); font-weight: 500; font-size: .94rem;
  transition: background .15s, color .15s;
}
.navbar nav a:hover { background: var(--teal-100); color: var(--teal-900); }
.navbar nav a.active { background: var(--teal-700); color: #fff; }
.navbar nav a.btn-small {
  background: var(--teal-900); color: #fff; padding: 8px 18px;
}
.navbar nav a.btn-small:hover { background: var(--teal-700); }
.navbar nav a.btn-small.active { background: var(--teal-700); }

/* ---------- Logo ---------- */
.logo {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--display); font-weight: 600; color: var(--teal-900);
  font-size: 1.15rem; letter-spacing: -.01em;
}
.logo:hover { color: var(--teal-900); }
.logo svg { display: block; }
.logo .brand-name-small { white-space: nowrap; }

/* ---------- Layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 80px; }
section { scroll-margin-top: 80px; }

.page-header {
  max-width: var(--maxw); margin: 0 auto; padding: 56px clamp(16px, 4vw, 48px) 28px;
}
.page-header h1 { margin-bottom: .25em; }
.page-header p { max-width: 56ch; font-size: 1.08rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--teal-900) 0%, var(--teal-700) 70%, var(--teal-500) 130%);
  color: #fff;
  padding: clamp(64px, 11vw, 130px) clamp(16px, 4vw, 48px) clamp(72px, 12vw, 140px);
  text-align: center;
}
.hero h1 { color: #fff; max-width: 16ch; margin-inline: auto; }
.hero p { color: rgba(255,255,255,.82); max-width: 50ch; margin: 0 auto 2em; font-size: 1.15rem; }
.hero .eyebrow { color: var(--teal-100); }
/* filet décoratif en bas du hero */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.16) 0 2px, transparent 2px 26px),
                    repeating-linear-gradient(0deg, rgba(255,255,255,.16) 0 2px, transparent 2px 26px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000);
          mask-image: linear-gradient(to bottom, transparent, #000);
  pointer-events: none;
}

.eyebrow {
  display: inline-block; font-family: var(--body); font-weight: 600;
  text-transform: uppercase; letter-spacing: .14em; font-size: .74rem;
  color: var(--teal-500); margin-bottom: 1em;
}

/* ---------- Boutons ---------- */
.button-link, button {
  font-family: var(--body); font-weight: 600; font-size: .96rem;
  cursor: pointer; border: none; border-radius: 999px;
  padding: 12px 24px; transition: transform .12s, background .15s, box-shadow .15s;
}
.button-link, button:not(.tab-button):not(.favorite):not(.map-point) {
  background: var(--teal-900); color: #fff;
}
.hero .button-link { background: #fff; color: var(--teal-900); }
.hero .button-link:hover { background: var(--teal-100); }
.button-link:hover, button:not(.tab-button):not(.favorite):not(.map-point):hover {
  background: var(--teal-700); color: #fff; transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.button-link.secondary, button.secondary {
  background: transparent; color: var(--teal-700);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.button-link.secondary:hover, button.secondary:hover {
  background: var(--paper); color: var(--teal-900); box-shadow: inset 0 0 0 1.5px var(--teal-500);
}
button.danger { background: var(--danger); }
button.danger:hover { background: #97402f; }
button.success { background: var(--success); }
button.success:hover { background: #246241; }

/* ---------- Sections titres ---------- */
.section-title { text-align: center; padding-top: 64px; margin-bottom: 14px; }
.section-title p { max-width: 56ch; margin-inline: auto; }

/* ---------- Cartes infos (accueil) ---------- */
.cards { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 30px; }
.info-box {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 30px 28px; box-shadow: var(--shadow);
}
.info-box h2, .info-box h3 { margin-top: 0; }
.features .info-box { position: relative; padding-top: 56px; }
.features .info-box::before {
  content: ""; position: absolute; top: 28px; left: 28px;
  width: 14px; height: 14px; border-radius: 4px;
  background: var(--teal-500); box-shadow: 6px 0 0 var(--teal-100), 12px 0 0 var(--gold);
}

/* ---------- Tournois : cartes ---------- */
.tournament-card, .card {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--teal-100); }
.tournament-cover {
  display: flex; align-items: flex-end; padding: 16px;
  height: 96px; color: #fff; font-family: var(--display); font-size: 1.05rem;
  background: linear-gradient(135deg, var(--teal-700), var(--teal-500));
}
.card[data-type="herbe"] .tournament-cover,
.card[data-type="green"] .tournament-cover { background: linear-gradient(135deg, #3a6b4a, #5a9268); }
.card[data-type="indoor"] .tournament-cover { background: linear-gradient(135deg, #45556b, #6c7f9c); }
.card h3 { padding: 16px 18px 0; }
.card p { padding: 0 18px; margin: 0 0 .5em; font-size: .94rem; }
.card p:last-of-type { margin-bottom: 14px; }
.card .tag {
  position: absolute; top: 14px; right: 14px;
  background: rgba(253,251,246,.92); color: var(--teal-900);
  font-size: .72rem; font-weight: 600; padding: 5px 11px; border-radius: 999px;
}
.badge-source {
  display: inline-block; margin: 0 18px 12px; padding: 4px 10px;
  font-size: .72rem; font-weight: 600; color: var(--teal-700);
  background: var(--teal-100); border-radius: 6px; width: fit-content;
}
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 0 18px 18px; margin-top: auto; }
.card-actions .button-link, .card-actions button { padding: 9px 16px; font-size: .88rem; }

.favorite {
  background: transparent; color: var(--ink-soft);
  box-shadow: inset 0 0 0 1.5px var(--line); padding: 9px 14px; font-size: .85rem;
}
.favorite:hover { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold); transform: none; }
.favorite.is-favorite { color: var(--gold); box-shadow: inset 0 0 0 1.5px var(--gold); background: #fbf4e8; }

/* ---------- Filtres ---------- */
.filters-panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow);
}
.filters-panel h2 { margin-top: 0; }
.search-box { display: flex; flex-wrap: wrap; gap: 12px; }
.search-box input, .search-box select { flex: 1 1 180px; }
.search-box button { flex: 0 0 auto; }

input, select, textarea {
  font-family: var(--body); font-size: .96rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 11px 14px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--teal-500);
  box-shadow: 0 0 0 3px var(--teal-100);
}
textarea { min-height: 110px; resize: vertical; }
label { display: block; font-weight: 600; font-size: .88rem; color: var(--teal-900); margin: 14px 0 6px; }

/* ---------- Formulaires ---------- */
.form-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px; box-shadow: var(--shadow);
}
.form-card h2 { margin-top: 0; }
.form-card input, .form-card select, .form-card textarea { margin-bottom: 4px; }
.form-card button[type="submit"] { margin-top: 22px; width: 100%; }
.field-hint { font-size: .82rem; color: var(--ink-soft); margin: 2px 0 0; }
.field-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px){ .field-row { grid-template-columns: 1fr; } }

.checkbox-line { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; }
.checkbox-line input { width: auto; margin-top: 4px; }
.checkbox-line label { margin: 0; font-weight: 500; color: var(--ink-soft); }

/* ---------- Grilles ---------- */
.grid-2 { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 820px){ .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Stats ---------- */
.stats-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 24px 0; }
.stat-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; text-align: center;
}
.stat-card strong { display: block; font-family: var(--display); font-size: 2rem; color: var(--teal-700); line-height: 1; margin-bottom: 6px; }

/* ---------- Profil joueur ---------- */
.player-profile { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.avatar {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--display); font-size: 1.6rem; font-weight: 600;
  background: linear-gradient(135deg, var(--teal-700), var(--teal-500)); color: #fff;
}
.player-profile h3 { margin: 0; }
.player-profile p { margin: 2px 0; font-size: .92rem; }

.profile-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.profile-tags span { background: var(--teal-100); color: var(--teal-900); font-size: .8rem; font-weight: 600; padding: 4px 11px; border-radius: 999px; }

/* ---------- Annonces (coéquipiers / covoiturage) ---------- */
.listing { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); margin-top: 24px; }
.listing-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px;
}
.listing-card .meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.listing-card .meta .avatar { width: 46px; height: 46px; font-size: 1.1rem; }
.listing-card h3 { font-size: 1.05rem; margin: 0; }
.listing-card .role { font-size: .82rem; color: var(--ink-soft); }

/* ---------- Onglets (fiche tournoi) ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 24px 0 0; }
.tab-button {
  background: transparent; color: var(--ink-soft); padding: 10px 18px; border-radius: 10px 10px 0 0;
  font-weight: 600; font-size: .92rem;
}
.tab-button:hover { background: var(--sand-2); color: var(--teal-900); transform: none; }
.tab-button.active-tab { background: var(--paper); color: var(--teal-900); box-shadow: inset 0 -2px 0 var(--teal-700); }
.tab-content { display: none; padding: 24px 0; }
.tab-content.active-content { display: block; }

/* ---------- Divers ---------- */
.notice {
  background: var(--teal-100); color: var(--teal-900); border-radius: var(--radius);
  padding: 16px 20px; font-size: .94rem; font-weight: 500;
}
.message-box {
  background: #fbf4e8; border: 1px solid #ecd9b8; color: #6e5326;
  border-radius: var(--radius); padding: 16px 20px; font-size: .9rem;
}
.ff-source {
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--teal-500);
  border-radius: 10px; padding: 14px 18px; font-size: .92rem; margin-bottom: 8px;
}
.share-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.admin-actions { display: flex; gap: 10px; padding: 0 18px 18px; }
.ad-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.ad-card h3 { margin-top: 6px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--teal-900); color: #fff; padding: 13px 22px; border-radius: 999px;
  font-weight: 500; font-size: .92rem; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Footer ---------- */
footer {
  background: var(--teal-900); color: rgba(255,255,255,.7);
  text-align: center; padding: 40px 20px; margin-top: 60px; font-size: .9rem;
}
footer a { color: var(--teal-100); }

/* ---------- Carte ---------- */
.map-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.map-wrap img { width: 100%; height: auto; border-radius: var(--radius); display: block; }

/* ---------- Accessibilité ---------- */
:focus-visible { outline: 3px solid var(--teal-500); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Carte interactive (image + pastilles) ---------- */
.map-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 880px){ .map-layout { grid-template-columns: 1fr; } }

.map-canvas {
  position: relative; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow);
}
.map-canvas img { width: 100%; height: auto; display: block; border-radius: var(--radius); }
.map-points { position: absolute; inset: 16px; }

.map-point {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; padding: 0; cursor: pointer;
  transition: transform .14s;
}
.map-point:hover { transform: translate(-50%, -50%) scale(1.12); }
.map-point .mp-count {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font-family: var(--body); font-weight: 700; font-size: 1rem; color: #fff;
  border: 2.5px solid var(--paper); box-shadow: 0 3px 8px rgba(15,61,62,.28);
}
.map-point.mp-active .mp-count { background: var(--teal-700); }
.map-point.mp-empty .mp-count { background: #b8b09c; width: 16px; height: 16px; border-width: 2px; }
.map-point.selected .mp-count { background: var(--gold); transform: scale(1.05); }

.map-point .mp-name {
  font-size: .72rem; font-weight: 600; color: var(--teal-900);
  background: rgba(253,251,246,.9); padding: 1px 7px; border-radius: 999px;
  white-space: nowrap; opacity: 0; transition: opacity .14s; pointer-events: none;
}
.map-point:hover .mp-name, .map-point.selected .mp-name, .map-point:focus-visible .mp-name { opacity: 1; }
.map-point:focus-visible { outline: none; }
.map-point:focus-visible .mp-count { outline: 3px solid var(--gold); outline-offset: 2px; }

.map-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 90px; }
.region-panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow); min-height: 150px;
}
.region-panel h3 { margin-top: 0; }
.region-panel .button-link { margin-top: 8px; display: inline-block; }

.map-legend { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: .88rem; color: var(--ink-soft); }
.legend-swatch { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.swatch-active { background: var(--teal-700); }
.swatch-empty { background: #b8b09c; }

@media (max-width: 880px){
  .map-point .mp-count { width: 28px; height: 28px; font-size: .85rem; }
  .map-side { position: static; }
}
