/* Pages Clubs (clubs.html, club.html) et fiches de match / joueur.
   Reprend les couleurs et polices de css/style.css, sans rien y changer. */

/* Classement : le nom du club devient un lien vers sa fiche */
.stand td.club a { display: inline-flex; align-items: center; gap: 8px; color: inherit; }
.stand td.club a:hover span { text-decoration: underline; }
.score-mini.has-fiche { cursor: pointer; transition: background 0.15s; }
.score-mini.has-fiche:hover { background: var(--paper-2); }

/* ---------- Liste des clubs ---------- */
.club-conf { margin-top: 30px; }
.club-conf h2 { font-size: 1.5rem; margin-bottom: 14px; }
.club-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.club-tile {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px 10px 16px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.club-tile img { width: 64px; height: 64px; object-fit: contain; }
.club-tile span { font-weight: 600; font-size: 0.95rem; line-height: 1.2; }
.club-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(22, 24, 29, 0.1); }

/* ---------- Fiche d'un club ---------- */
.club-back { display: inline-block; margin-bottom: 16px; color: var(--blue); font-weight: 600; }
.club-hero {
  display: grid; grid-template-columns: 112px 1fr; gap: 24px; align-items: center;
  background: var(--club, var(--blue-deep)); color: #fff; border-radius: 8px; padding: 28px;
  background-image: linear-gradient(135deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.3));
}
.club-hero .kicker { color: rgba(255, 255, 255, 0.82); }
.club-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05; margin-top: 6px; }
.club-hero.light { color: var(--ink); background-image: none; }
.club-hero.light .kicker { color: var(--ink-soft); }
.club-crest { width: 112px; height: 112px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22); }
.club-crest img { width: 78px; height: 78px; object-fit: contain; }
.club-form { display: flex; gap: 6px; margin-top: 14px; }
.club-form b { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 4px; font-size: 0.8rem; color: #fff; }
.club-form .V { background: #1f7a4a; } .club-form .N { background: #8a8f99; } .club-form .D { background: var(--terracotta); }
.club-hero.light .club-form b { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.club-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.club-kpis div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 8px; text-align: center; }
.club-kpis b { display: block; font-family: var(--serif); font-size: 1.7rem; font-weight: 600; white-space: nowrap; }
.club-kpis span { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.club-cols { display: grid; grid-template-columns: 1fr 1.15fr; gap: 32px; margin-top: 10px; align-items: start; }
.club-cols h2 { font-size: 1.45rem; margin: 26px 0 4px; }
.club-pos { font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.club-pos span { color: var(--terracotta); }
.club-players { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.club-player {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; width: 100%;
  text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 9px 14px; color: var(--ink);
}
.club-player:first-child { border-top: 0; }
.club-player:hover { background: var(--cream); }
.club-player strong { display: block; font-weight: 600; }
.club-player small { color: var(--muted); font-size: 0.85rem; }
.club-player em { font-style: normal; font-weight: 700; color: var(--muted); }
.club-ava { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--paper-2); display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.club-ava img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ---------- Fenêtre : fiche match / fiche joueur ---------- */
body.cm-open { overflow: hidden; }
.cm-bg { position: fixed; inset: 0; z-index: 200; background: rgba(18, 32, 51, 0.55); display: grid; place-items: center; padding: 20px; }
.cm-bg[hidden] { display: none; }
.cm-box { position: relative; width: min(520px, 100%); max-height: 88vh; overflow-y: auto; background: var(--cream); border-radius: 10px; padding: 28px 26px 24px; box-shadow: var(--shadow); text-align: left; }
.cm-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; background: none; font-size: 1.7rem; line-height: 1; color: var(--muted); }
.cm-box .kicker { text-align: center; }
.cm-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; margin: 14px 0 18px; }
.cm-score a { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 600; line-height: 1.2; }
.cm-score img { width: 64px; height: 64px; object-fit: contain; }
.cm-score strong { display: block; font-family: var(--serif); font-size: 2.6rem; font-weight: 600; color: var(--blue-deep); white-space: nowrap; }
.cm-score em { display: block; font-style: normal; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.cm-score em.live { color: var(--terracotta); }
.cm-events { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 2px 14px; }
.cm-ev { display: grid; grid-template-columns: 1fr 48px 1fr; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 0.93rem; }
.cm-ev:first-child { border-top: 0; }
.cm-ev .h { text-align: right; }
.cm-ev b { text-align: center; color: var(--muted); font-size: 0.85rem; }
.cm-ev small { color: var(--muted); }
.cm-red { display: inline-block; width: 10px; height: 14px; background: var(--terracotta); border-radius: 2px; vertical-align: -2px; }
.cm-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin-top: 16px; font-size: 0.93rem; }
.cm-info dt { color: var(--muted); }
.cm-player { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: center; }
.cm-player .club-ava { width: 96px; height: 96px; font-size: 1.6rem; }
.cm-player .kicker { text-align: left; }
.cm-player h2 { font-size: 1.7rem; line-height: 1.1; margin-top: 4px; }
.cm-num { font-family: var(--serif); font-size: 2rem; color: var(--terracotta); }

/* Statistiques de la saison (fiche joueur) */
.stats-title { font-family: var(--sans); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stats-grid div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 4px 8px; text-align: center; }
.stats-grid b { display: block; font-size: 1.3rem; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-grid span { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); line-height: 1.15; display: block; margin-top: 2px; }
.st-y, .st-r { display: inline-block; width: 9px; height: 12px; border-radius: 2px; background: #f2c200; margin: 0 3px 0 0; vertical-align: 0; }
.st-r { background: #b90c22; margin-left: 4px; }
.stats-src { font-size: 0.75rem; color: var(--muted); margin-top: 8px; }
.stats-none { color: var(--muted); font-size: 0.92rem; }

/* Actualité du club */
.club-news { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cn-item { display: block; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 6px; padding: 11px 14px; color: var(--ink); }
.cn-item:hover { background: var(--cream); }
.cn-item strong { display: block; font-weight: 600; line-height: 1.3; margin-top: 4px; }
.cn-item small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.cn-tag { display: inline-block; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; background: var(--blue); padding: 2px 7px; border-radius: 3px; }
.club-news-wrap { max-width: 760px; }
.club-news-wrap h2 { font-size: 1.45rem; margin: 30px 0 4px; }
.cn-more { display: block; text-align: center; margin-top: 4px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--blue); font-weight: 600; font-size: 0.95rem; }
.cn-more:hover { background: var(--cream); }
.cn-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.cn-head img { width: 72px; height: 72px; object-fit: contain; }
.cn-head h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; margin-top: 4px; }
.cn-page { max-width: 760px; }
.cn-tag.merc { background: var(--terracotta); }

/* Direct : but marqué pendant que la fiche est ouverte */
@keyframes cmgoal { 0%, 100% { background: transparent; } 20%, 60% { background: #fde7ea; } }
.cm-score.goal { animation: cmgoal 3s ease 2; border-radius: 8px; }
.cm-score.goal strong { color: var(--terracotta); }

/* Accueil : matchs en direct dans le bloc « Matchs et classements » */
.home-live .score-mini-list { max-width: 760px; margin: 16px auto 4px; text-align: left; }

/* Cloche d'un match (notifications du score en direct) */
.score-mini { position: relative; }
.m-bell { position: absolute; top: 5px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); cursor: pointer; z-index: 2; }
.m-bell svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m-bell:hover { background: rgba(30, 58, 95, 0.1); color: var(--blue-deep); }
.m-bell.on { color: #fff; background: var(--terracotta); }
.m-bell.on svg { fill: currentColor; }
.score-mini.goal::after { right: 40px; }

/* Choix des notifications d'un match */
.bell-pick-bg { position: fixed; inset: 0; z-index: 210; background: rgba(18, 32, 51, 0.5); display: grid; place-items: center; padding: 16px; }
.bell-pick { position: relative; width: min(380px, 100%); background: var(--cream, #fbfaf7); border-radius: 12px; padding: 22px 20px 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); color: var(--ink); text-align: left; }
.bell-pick h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; line-height: 1.2; margin: 4px 0 6px; }
.bp-kicker { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red, var(--terracotta)); font-weight: 700; margin: 0; }
.bp-sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 8px; }
.bp-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--line); font-weight: 600; cursor: pointer; }
.bp-row input { width: 20px; height: 20px; accent-color: var(--red, var(--terracotta)); }
.bp-ok, .bp-off { display: block; width: 100%; margin-top: 12px; padding: 12px; border-radius: 10px; border: 0; font-weight: 700; font-size: 0.98rem; cursor: pointer; }
.bp-ok { background: var(--blue-deep); color: #fff; }
.bp-off { margin-top: 8px; background: none; color: var(--red, var(--terracotta)); border: 1px solid var(--line); }
.bp-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; }
@media (max-width: 720px) {
  .bell-pick-bg { place-items: end center; padding: 0; }
  .bell-pick { width: 100%; border-radius: 16px 16px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
}

.stats-retry { margin-left: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--blue); font-weight: 600; cursor: pointer; }

/* Histoire et palmarès d'un club */
.histo-h { font-size: 1.45rem; margin: 26px 0 10px; }
.histo { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.histo-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.histo-facts b { display: block; font-family: var(--serif); font-size: 1.6rem; font-weight: 600; color: var(--blue-deep); }
.histo-facts span { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.histo-stade { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.histo-stade span { display: block; color: var(--muted); font-size: 0.88rem; margin-top: 2px; }
.histo-groupe { margin: 10px 0 0; font-weight: 600; color: var(--ink-soft); }
.histo-record { margin: 12px 0 0; font-weight: 700; color: var(--blue-deep); }
.histo-note { color: var(--ink-soft); margin: 12px 0 0; font-size: 0.95rem; }
.histo-titres { list-style: none; margin: 12px 0 0; padding: 0; }
.histo-titres li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; padding: 9px 0; border-top: 1px solid var(--line); }
.histo-cup { font-weight: 700; }
.histo-years { color: var(--muted); font-variant-numeric: tabular-nums; }
.histo-none { color: var(--muted); margin: 12px 0 0; }

/* Carrière en MLS (fiche joueur) */
.hist-t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.92rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.hist-t th { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 8px 6px; text-align: center; background: var(--paper-2); }
.hist-t td { padding: 7px 6px; text-align: center; border-top: 1px solid var(--line); }
.hist-t small { font-size: 0.8em; color: var(--muted); font-weight: 500; }
.hist-t th small { text-transform: none; letter-spacing: 0; }
.hist-t .hc { text-align: left; }
.hist-t td:first-child { font-weight: 700; color: var(--ink-soft); }
.hist-t tr.hist-po td { border-top: 0; padding-top: 2px; color: var(--ink-soft); font-size: 0.92em; }
.hist-t tr.hist-po .hc { font-style: italic; color: var(--muted); }
.hist-t tfoot td { font-weight: 700; background: var(--paper-2); }
.hist-t tfoot td:first-child { text-align: left; font-size: 0.82rem; }

@media (max-width: 860px) {
  .club-cols { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 720px) {
  .club-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .club-tile { padding: 14px 6px 12px; }
  .club-tile img { width: 50px; height: 50px; }
  .club-tile span { font-size: 0.82rem; }
  .club-hero { grid-template-columns: 76px 1fr; gap: 14px; padding: 18px; }
  .club-crest { width: 76px; height: 76px; }
  .club-crest img { width: 54px; height: 54px; }
  .club-hero h1 { font-size: 1.7rem; }
  .club-kpis { gap: 6px; }
  .club-kpis b { font-size: 1.15rem; }
  .club-kpis span { font-size: 0.62rem; letter-spacing: 0.06em; }
  /* Sur téléphone, la fiche monte du bas de l'écran */
  .cm-bg { place-items: end center; padding: 0; }
  .cm-box { width: 100%; border-radius: 16px 16px 0 0; max-height: 86vh; padding: 26px 18px 28px; }
}
