/* ======================================
   VIEW RENCONTRES MOBILE – STYLE APPLE
   ====================================== */

/* Palette */
:root {
  --green-main: #006840;
  --green-dark: #00452b;
  --accent-soft: #ffd84d;
  --bg-page: #f3f5f7;
  --card-bg: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.85);
}

/* Fond général très clair */
body {
  background: var(--bg-page);
}

/* Conteneur global de la page mobile */
.rencontres-mobile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
  margin-top: 20px;
  box-sizing: border-box;
}

/* ===========================
   ONGLETS RENCONTRES
   =========================== */

.rencontre-tabs {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

/* Chaque onglet = gros pill glass */
.rencontre-tab {
  position: relative;
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;      /* tout centré */
  gap: 12px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.96),
    rgba(244, 252, 246, 0.98)
  );
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-bottom: 8px;
}

.create-match-section-title{
  color: #111827;
  font-size: 15px;
  font-weight: 650;
  text-align: center;
}

.rencontre-tab span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-team {
  text-align: center;
  width: 32%;
}

.tab-score {
  padding: 4px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green-main), var(--green-dark));
  color: #ffffff;
  font-weight: 800;
}

/* État actif */
.rencontre-tab.active {
  background: linear-gradient(to right, #17c07f, #008250);
  color: #e7f3ff;
  border-color: rgba(0, 104, 64, 0.35);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.22);
  transform: translateY(-1px);
}

/* ===========================
   PANELS CONTENU ONGLET
   =========================== */

.rencontre-panels {
  position: relative;
}

.rencontre-panel {
  display: none;
}

.rencontre-panel.active {
  display: block;
}

/* ===========================
   CARTE RENCONTRE
   =========================== */

.rencontre-panel .match-container {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(242, 250, 244, 1)
  );
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 14px 16px 16px;
  box-shadow:
    0 18px 32px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  min-height: 46vh;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  color: #0f172a;
}

/* accent fin en bas de carte */
.rencontre-panel .match-container::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--green-main),
    var(--accent-soft),
    var(--green-main)
  );
}

/* ===========================
   Scoreboard – Modern Clean (compact)
   =========================== */

:root{
  /* Palette */
  --sb-bg: #00452b;
  --sb-grad1: #006840;
  --sb-grad2: #00452b;
  --sb-border: rgba(255,255,255,.08);
  --sb-glow: rgba(30,130,255,.25);
  --yellow: #ffd84d;

  /* Texte */
  --tx-strong: #ffffff;
  --tx-muted: #b8c3d6;
  --tx-accent: #ffe37a;
  --tx-wo: #ffd1d1;

  /* Accents */
  --accent: #ffd84d;
  --accent-2: #ffd84d;
  --set-pill-bg: rgba(255,255,255,.06);
  --set-pill-br: rgba(255,255,255,.16);

  /* Dimensions */
  --radius: 12px;
  --pad: 12px;
  --gap: 10px;

  /* Fonts (défaut desktop + TV, déjà plus petits) */
  --fs-1: clamp(11px, .8vw, 13px);   /* détails (club/âge/rang) */
  --fs-2: clamp(12px, .9vw, 14px);   /* labels / court / durée */
  --fs-3: clamp(13px, 1.05vw, 17px); /* nom joueur */
  --fs-4: clamp(16px, 1.3vw, 20px);  /* sets */
}

/* Carte globale */
.scoreboard{
  background: linear-gradient(180deg, var(--sb-grad1), var(--sb-grad2));
  border: 1px solid var(--sb-border);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
  color: var(--tx-strong);
  overflow: hidden;
  width: min(96vw, 1100px);
  margin: 15px auto;
  box-sizing: border-box;
}

/* ===== Layout 2 colonnes : court (gauche) + joueurs (droite) ===== */
.match-container{
  display: grid;
  grid-template-columns: 110px 1fr; /* plus étroit */
  gap: 0;
}

/* ===== Panneau court/temps — GRID AREAS ===== */

/* La colonne de gauche (le panneau) */
.match-court{
  display: grid;                 /* grid au lieu de flex */
  place-items: center;           /* centre H & V le contenu */
  align-content: center;         /* compact verticalement */
  background: linear-gradient(to right, #0f8357, #006f44);
  border-right: 1px solid var(--sb-border);
  padding: 0;                    /* pas de padding qui crée des marges visuelles */
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
  grid-template-areas:
    "."
    "cours"   
    "sep"     
    "timer"     ;  
  grid-template-rows: 2px auto auto auto ;
}

.Cours{
  grid-area: cours;                
  margin: 0;
  padding: 0;
  color: var(--tx-strong);
  font-weight: 800;
  text-align: center;
}

/* On mappe les éléments existants sur des areas précises */
.séparations{
  grid-area: sep;
  width: 56%;
  height: 1px;
  background: var(--sb-border);
}

.Cours a{                        /* lien code (mode admin) */
  grid-area: code;
  display: inline-block;
  margin: 0;
  text-decoration: none;
  font-weight: 700;
  color: var(--tx-strong);
}

.match-timer{
  grid-area: timer;
  margin: 0;
  padding: 0;
  font-weight: 600;
  font-size: var(--fs-1);
  color: var(--tx-muted);
  line-height: 1;
}

/* Petit ajustement iOS */
@supports (-webkit-touch-callout: none){
  .match-court{ align-content: center; justify-content: center; }
}

/* Neutralise la “carte” interne éventuelle à droite */
.match-container > .scoreboard{
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
  width: 100%;
}

/* ===========================
   Lignes Joueurs
   =========================== */
.player-row{
  display: grid;
  grid-template-columns: 1fr auto;  /* infos | sets */
  align-items: center;
  gap: var(--gap);
  padding: 10px var(--pad);
  position: relative;
}
.player-row + .player-row{
  border-top: 1px solid var(--sb-border);
}

/* Service */
.ServiceDot{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent));
  box-shadow: 0 0 0 3px rgba(30,160,255,.18), 0 0 12px var(--glow);
}

/* Infos joueurs */
.player-info{
  display: grid;
  grid-auto-rows: min-content;
  gap: 4px;
  padding-left: 16px; /* espace pour le dot */
  min-width: 0;
}
.player-block{
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.player-name{
  font-size: var(--fs-3);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-name.winner{
  background: linear-gradient(to right, #17c07f, #008250) ;
  color: #ffffff;
  border-radius: 999px;
  padding: 0.1vw 0.45vw;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}
.player-club, .player-age, .player-ranking{
  font-size: var(--fs-1);
  color: var(--tx-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-age, .player-ranking{
  background: rgba(255,255,255,.06);
  border: 1px solid var(--set-pill-br);
  border-radius: 8px;
  padding: 1px 6px;
}

/* ===========================
   Sets / Scores
   =========================== */
.player-scores{
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.set-score{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1em;
  height: 1.8em;
  padding: 0 .45em;
  border-radius: 8px;
  font-size: var(--fs-4);
  font-weight: 800;
  line-height: 1;
  background: var(--set-pill-bg);
  border: 1px solid var(--set-pill-br);
  color: var(--tx-strong);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.set-won{
  background: linear-gradient(to right, #17c07f, #008250);
  color: #ffffff !important;
  border: linear-gradient(to right, #17c07f, #008250) 2px solid;
  box-shadow: 0 0 0 2px rgba(34,209,255,.10), 0 4px 12px rgba(34,209,255,.14);
}
.set-encours{
  outline: 2px solid var(--accent-2);
  outline-offset: 0;
  box-shadow: 0 0 0 2px rgba(34,209,255,.10), inset 0 0 0 1px rgba(34,209,255,.2);
  transform: translateY(-1px);
}
.set-score.wo{
  color: var(--tx-wo);
  background: rgba(255,120,120,.08);
  border-color: rgba(255,120,120,.35);
}

/* Points (option) */
.PtsBox{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  background: rgba(30,160,255,.1);
  border: 1px solid rgba(30,160,255,.35);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  min-width: 2.8em;
  height: 2.4em;
  line-height: 1;
  border-radius: 10px;
  padding: 0 .45em;
}
.Pts{
  font-size: var(--fs-4);
  font-weight: 800;
  color: var(--tx-strong);
}

/* ===========================
   Liens / Boutons (admin)
   =========================== */
a.btn.btn-primary.btn-sm{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  text-decoration: none;
  background: rgba(30,160,255,.12);
  border: 1px solid rgba(30,160,255,.35);
  color: #e7f3ff;
  font-weight: 700;
  font-size: var(--fs-1);
}

/* Hover subtil (desktop) */
@media (hover:hover) and (pointer:fine){
  .set-score:hover{ transform: translateY(-2px); }
}

/* ===========================
   Responsive
   =========================== */

/* Tablettes */
@media (max-width: 1024px){
  .match-container{ grid-template-columns: 96px 1fr; }
  .player-name{ font-size: clamp(13px, 1.3vw, 16px); }
  .player-scores .set-score{ font-size: clamp(15px, 1.6vw, 18px); }
}

/* Mobile ≤ 640px : très compact partout */
@media (max-width: 640px){
  .match-timer{ font-size: 10px; }
  .scoreboard{ width: 93vw; margin: 8px auto; }
  .match-container{ grid-template-columns: 60px 1fr; }
  .match-court{ padding: 3px 3px; }
  .Cours{ font-size: 11px; line-height: 1.1; }
  .séparations{ width: 52%; margin: 4px 0; }

  .player-row{ padding: 8px 8px; gap: 6px; }
  .ServiceDot{ left: 10px; width: 7px; height: 7px; }
  .player-info{ padding-left: 14px; gap: 3px; }
  .player-block{ gap: 5px; }

  .player-name{ font-size: 13px; }
  .player-club, .player-age, .player-ranking{ font-size: 10.5px; }
  .player-age, .player-ranking{ padding: 1px 5px; border-radius: 7px; }

  .player-scores{ gap: 5px; }
  .set-score{ min-width: 1.8em; height: 1.6em; font-size: 14px; padding: 0 .35em; border-radius: 7px; }
  .PtsBox{ min-width: 2.2em; height: 2em; font-size: 14px; padding: 0 .35em; border-radius: 7px; }
  .Pts{ font-size: 12px; }

  a.btn.btn-primary.btn-sm{ font-size: 11px; padding: 4px 6px; border-radius: 7px; }
}

/* Très petits écrans ≤ 360px : micro */
@media (max-width: 360px){
  .match-container{ grid-template-columns: 64px 1fr; }
  .Cours{ font-size: 10px; }
  .player-name{ font-size: 12.5px; }
  .player-club, .player-age, .player-ranking{ font-size: 10px; }
  .set-score{ min-width: 1.7em; height: 1.5em; font-size: 13px; }
}

/* TV / grands écrans */
@media (min-width: 1800px){
  .scoreboard{ width: min(88vw, 1300px); }
  .match-container{ grid-template-columns: 130px 1fr; }
}

/* =========================================================
   Conteneur liste des matchs + hooks autoscroll
   ========================================================= */

.page-container{
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Zone scrollable qui contient la liste des .scoreboard */
.match-block{
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  padding-bottom: calc(var(--pub-h, 0px) + 12px);
  background: #f6f6f6;
  scroll-behavior: smooth;
}

/* PC/TV : masque scrollbar + fade top/bottom */
@media (min-width: 801px){
  .match-block{
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(to bottom, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
  }
  .match-block::-webkit-scrollbar{ display: none; }
}

@keyframes verticalAutoScroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

@media (min-width: 1200px){
  .match-block.autoscroll .autoscroll-track{
    will-change: transform;
    animation: verticalAutoScroll 45s linear infinite;
  }
  @media (hover:hover){
    .match-block.autoscroll:hover .autoscroll-track{
      animation-play-state: paused;
    }
  }
}

@media (prefers-reduced-motion: reduce){
  .match-block{ scroll-behavior: auto; }
  .match-block.autoscroll .autoscroll-track{
    animation: none !important;
  }
}

.prog {
  margin-top: 10px;
  margin-left: 18vw;
  width: min(15vw, 1100px);
  background: linear-gradient(180deg, var(--yellow), #ffd34d);
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  text-align: center;
}

.date-prog{
  color: #002b40;
  font-weight: 700;
  margin: 0;
}

@media (max-width: 1200px) {
  .prog, .date-prog{
    display: none;
  }
}

.ended-match{
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 13px; 
  font-weight: bold;
  margin: 12px;
}

.ended-match p {
  margin: 0;
  padding: 5px;
  background-color: var(--accent);
  color: var(--sb-grad1);
  border-radius: 5px;
}

/* Horloge moderne en style HappyScore */
.live-clock {
  position: absolute;
  bottom: 20px;
  right: 30px;
  background: linear-gradient(180deg, var(--accent-2), #f3c22b);
  color: #013d5b;
  font-weight: 900;
  font-size: clamp(1rem, 10vw, 2rem);
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
  border: 1px solid rgba(0,0,0,.1);
  text-align: center;
  min-width: 90px;
}

@media (max-width: 768px){
  .live-clock{
    display: none;
  }
}

/* Mode tablette / laptop moyen */
@media (min-width: 768px) and (max-width: 1400px) {
  .live-clock {
    font-size: clamp(0.8rem, 4vw, 1.4rem);
    padding: 4px 10px;
    border-radius: 10px;
    bottom: 12px;
    right: 20px;
    min-width: 70px;
    box-shadow: 0 4px 10px rgba(0,0,0,.2);
  }
}

/* Patch TABLETTE (iPad / écrans ~10–12") */
@media (min-width: 768px) and (max-width: 1180px){

  .match-block{
    padding-top: 86px;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  .match-container{
    grid-template-columns: 84px 1fr !important;
  }
  .match-court{
    padding: 6px 6px !important;
  }
  .Cours{
    font-size: 12px;
    line-height: 1.1;
    white-space: nowrap;
  }
  .match-timer{
    font-size: 10.5px;
    white-space: nowrap;
  }

  .player-scores{
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 44vw;
  }
  .set-score{
    min-width: 2.1em;
    height: 1.8em;
    font-size: 16px;
    padding: 0 .45em;
  }

  .scoreboard{
    overflow: visible;
    margin: 10px auto;
  }

  .player-row{
    padding: 10px 12px;
    gap: 8px;
  }
  .player-row + .player-row{
    border-top-color: rgba(255,255,255,.07);
  }
}

/* padding bas du match-block */
@media (min-width: 769px) {
  .match-block {
    padding-bottom: 50px !important;
  }
}

@media (max-width: 768px) {
  .match-block {
    padding-bottom: 12px;
  }
}


.navbar-overlay {
  background-color: #00452b !important;
}

.tag-libelle{
  color: #111827;
  text-align: center;
  font-weight: 650;
  font-size: 17px;
}

