/* 1xBet Mobile Style - Ultra High Fidelity Pixel-Accurate CSS */
:root {
  --bg-app: #f1f4f8;
  --bg-page: #dce4ee;
  --bg-card: #ffffff;
  
  --primary-blue: #2476e7;
  --primary-blue-dark: #185ec1;
  --primary-blue-light: #e4effc;
  
  --text-dark: #112340;
  --text-navy: #233e65;
  --text-muted: #7e8ea1;
  --text-sub: #50637b;

  /* Bleus marine de la fiche coupon */
  --ink: #223E5A;        /* titre, valeurs, « Nombre d'événements », « terminés » */
  --ink-soft: #627F95;   /* libellés : Cote, Mise, Gains, Statut */
  
  --status-green: #1bb05b;
  --status-red: #eb2a29;
  --status-blue: #2476e7;
  
  --border-color: #e5ebf3;
  --border-dashed: #d5dee8;   /* couleur du pointillé : haut, bas et entre les matchs */
  --notch: 5px;               /* rayon des encoches (hauteur = 2 x cette valeur) */

  /* Couleurs des icônes de la barre du bas */
  --icon-steel: #5282A0;      /* Populaire, Favoris, Menu */
  --icon-blue:  #488DD2;      /* Coupon, Historique */
  
  --nav-bg: #ffffff;
  --nav-inactive: #8796a8;
  --nav-active: #2476e7;

  /* Avatar silhouette (Morpion players) — sampled from reference image */
  --avatar-ring: #7a95aa;
  --avatar-fill: #adb6bd;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-dark);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Mobile Screen Container */
.mobile-wrapper {
  width: 100%;
  max-width: 460px;
  background-color: var(--bg-app);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.12);
}

/* Top Header Bar */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.top-header .left-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-header .back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  color: #27436b;
}

.top-header .header-title {
  font-size: 19px;
  font-weight: 700;
  color: #27436b;
  letter-spacing: -0.2px;
}

.top-header .right-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #27436b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

/* Main Content Area (Scrollable) */
.content-scrollable {
  flex: 1;
  padding: 12px 12px 95px 12px;
  background-color: var(--bg-page);
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ==========================================================
   COUPON SUMMARY CARD (Ticket Header)
   ========================================================== */
.coupon-summary-card {
  background: var(--bg-card);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  padding: 20px 16px 20px 16px;
  position: relative;
  border-bottom: 1px dashed var(--border-dashed);
  z-index: 10;
}

/* Perforation Notches on Summary Card (petites encoches à fin contour) */
.coupon-summary-card::before,
.coupon-summary-card::after {
  content: "";
  position: absolute;
  bottom: calc(var(--notch) * -1 - 0.5px);
  width: var(--notch);
  height: calc(var(--notch) * 2);
  background-color: var(--bg-page);
  border: 1px solid var(--border-dashed);
  z-index: 11;
}

.coupon-summary-card::before {
  left: 0;
  border-left: none;
  border-radius: 0 var(--notch) var(--notch) 0;
}

.coupon-summary-card::after {
  right: 0;
  border-right: none;
  border-radius: var(--notch) 0 0 var(--notch);
}

.coupon-meta-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.coupon-date {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 400;
}

.league-tag {
  background-color: #3c72eb;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.2px;
}

/* Titre : « Combiné » grand et gras, « № … » petit et léger */
.coupon-title-row {
  margin-bottom: 19px;
}

.coupon-type-number {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.coupon-type-word {
  font-size: 19px;
  font-weight: 700;
}

.coupon-number-part {
  font-size: 15px;
  font-weight: 400;
}

/* Events Count Row (Only for Combiné) : sous le séparateur pointillé du haut */
.coupon-events-count {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink);
  font-weight: 700;
  margin-top: 0;
  padding-top: 10px;           /* espace sous le séparateur */
  padding-bottom: 0;
  margin-bottom: 14px;
  border-bottom: none;
  gap: 8px;
}

/* Séparateur du haut : même trait pointillé que celui du bas */
.coupon-events-count::before {
  content: "";
  position: absolute;
  left: -16px;                /* = padding de la carte : le trait touche les bords */
  right: -16px;
  top: 0;
  border-top: 1px dashed var(--border-dashed);
  pointer-events: none;
}

/* Encoches du séparateur du haut : mêmes taille, couleur et contour que celles du bas */
.coupon-events-count::after {
  content: "";
  position: absolute;
  left: -16px;
  right: -16px;
  top: calc(var(--notch) * -1 - 0.5px);
  height: calc(var(--notch) * 2);
  pointer-events: none;
  background:
    radial-gradient(circle at 0 50%,
      var(--bg-page) 0 calc(var(--notch) - 1px),
      var(--border-dashed) calc(var(--notch) - 1px) var(--notch),
      transparent calc(var(--notch) + 0.5px)) left center / var(--notch) calc(var(--notch) * 2) no-repeat,
    radial-gradient(circle at 100% 50%,
      var(--bg-page) 0 calc(var(--notch) - 1px),
      var(--border-dashed) calc(var(--notch) - 1px) var(--notch),
      transparent calc(var(--notch) + 0.5px)) right center / var(--notch) calc(var(--notch) * 2) no-repeat;
}

.events-left-info {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  min-width: 0;
}

.events-left-info svg {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  color: var(--icon-steel);   /* les rectangles de l'icône utilisent currentColor */
}

.events-right-info {
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

/* Key Value Table */
.summary-table {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.summary-label {
  color: var(--ink-soft);
  font-weight: 400;
}

.summary-val {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

.summary-val.payout-green {
  color: var(--status-green);
  font-size: 15px;
  font-weight: 800;
}

.status-badge-val {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 14px;
}

.status-badge-val.paid {
  color: var(--status-green);
}

.status-badge-val.accepted {
  color: var(--status-blue);
}

/* ==========================================================
   MATCHES LIST (Ticket Body)
   ========================================================== */
.matches-list {
  display: flex;
  flex-direction: column;
  position: relative;
}

.match-card {
  background: var(--bg-card);
  padding: 14px 10px;
  position: relative;
  border-bottom: 1px dashed var(--border-dashed);
}

.match-card:last-child {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  border-bottom: none;
}

/* Perforation Notches on Match Cards (identiques à celles de la fiche) */
.match-card:not(:last-child)::before,
.match-card:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: calc(var(--notch) * -1 - 0.5px);
  width: var(--notch);
  height: calc(var(--notch) * 2);
  background-color: var(--bg-page);
  border: 1px solid var(--border-dashed);
  z-index: 3;
}

.match-card:not(:last-child)::before {
  left: 0;
  border-left: none;
  border-radius: 0 var(--notch) var(--notch) 0;
}

.match-card:not(:last-child)::after {
  right: 0;
  border-right: none;
  border-radius: var(--notch) 0 0 var(--notch);
}

/* Match Header : Icône/FIFA à gauche, Catégorie + Date/Badge à droite */
.match-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.match-sport-col {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  min-width: 20px;
}

.match-sport-col .fifa-sport-mark {
  font-size: 11px;
  font-weight: 800;
  color: #607d9b;
  letter-spacing: 0.5px;
  line-height: 1.2;
  text-transform: uppercase;
  user-select: none;
}

.match-sport-col .sport-ball-ico {
  display: block;
  color: #607d9b;
}

.match-sport-col .sport-morpion-ico {
  display: block;
  color: #273e5c;
}

.match-meta-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.match-category-text {
  font-size: 13px;
  font-weight: 600;
  color: #273e5c;
  line-height: 1.3;
}

.match-date-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.2;
}

.match-time-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 400;
}

.fifa-badge {
  font-size: 12px;
  font-weight: 900;
  color: #122543;
  letter-spacing: 0.5px;
}

.match-category-icon {
  font-size: 13px;
  display: flex;
  align-items: center;
}

.match-category-name {
  font-weight: 600;
  color: #273e5c;
}

.match-date-badge {
  color: var(--text-muted);
  font-weight: 500;
}

.live-badge {
  background-color: #eb2a29;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  line-height: 1.2;
}

.live-badge::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffffff;
  display: inline-block;
  flex-shrink: 0;
}

/* Teams Confrontation */
.teams-confrontation,
.teams-container {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  width: 100%;
}

.team-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
}

.team-box.team-left {
  justify-content: flex-end;
  text-align: right;
}

.team-box.team-right {
  justify-content: flex-start;
  text-align: left;
}

.team-name {
  font-size: 13px;
  font-weight: 700;
  color: #10223f;
  line-height: 1.25;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

/* Multi-line teams with explicit break */
.team-name br {
  display: block;
  content: "";
}

/* ==========================================================
   TEAM LOGO STYLES:
   1. Country 3D Spheres with Vignette + Curved Glass Reflection
   2. Club Crests Raw ("Brut" without circle)
   3. eSport Kit Jerseys with mini country flag badge
   ========================================================== */
.flag-sphere {
  width: 40px;
  height: 40px;
  min-width: 40px;
  max-width: 40px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  /* Bordure arrondie ombrée nette qui détache la bille du fond (comme sur l'original Tonga) */
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.40),
    0 3px 8px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.flag-sphere img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

/* 1. Contour 3D intérieur subtil + grand croissant flouté blanc en bas (rebond lumineux caractéristique) */
.flag-sphere::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    /* Grand croissant blanc en bas : flouté, diffus, très visible (comme sur Tonga) */
    radial-gradient(ellipse 85% 42% at 50% 90%, 
      rgba(255, 255, 255, 0.70) 0%, 
      rgba(255, 255, 255, 0.45) 45%, 
      rgba(255, 255, 255, 0) 80%),
    /* Vignette sphérique progressive pour donner la rondeur 3D */
    radial-gradient(circle at 50% 50%,
      rgba(0, 0, 0, 0) 58%,
      rgba(0, 0, 0, 0.20) 76%,
      rgba(0, 0, 0, 0.45) 92%,
      rgba(0, 0, 0, 0.60) 100%);
  /* Fin liseré intérieur pour une bordure parfaitement arrondie et nette */
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 2;
}

/* 2. Arc / croissant blanc très net et courbé en haut (reflet spéculaire brillant type bille de verre) */
.flag-sphere::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 76%;
  height: 44%;
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(255, 255, 255, 0.75) 30%,
    rgba(255, 255, 255, 0.20) 68%,
    rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 3;
}

/* 2. Club Crest Raw ("Brut" - No circle) */
.club-crest {
  width: 38px;
  height: 38px;
  min-width: 38px;
  max-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: transparent;
  flex-shrink: 0;
}

.club-crest img {
  max-width: 38px;
  max-height: 38px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

/* 2b. Player Portrait Square (eSports CS 2, etc.) */
.player-photo-square {
  width: 38px;
  height: 38px;
  min-width: 38px;
  max-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #192434;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  flex-shrink: 0;
}

.player-photo-square img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.match-sport-col .sport-esport-ico,
.sport-esport-ico {
  display: block;
  color: #607d9b;
}

/* 3. eSports & Bundesliga Jersey / Kit */
.kit-jersey {
  width: 38px;
  height: 38px;
  min-width: 38px;
  max-width: 38px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kit-jersey svg.jersey-icon {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

.kit-mini-flag {
  position: absolute;
  bottom: 2px;
  right: 1px;
  width: 14px;
  height: 9px;
  border-radius: 1.5px;
  box-shadow: 0 1px 2.5px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
}

.kit-mini-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 1px;
}

.kit-mini-flag .stripe {
  flex: 1;
  width: 100%;
}

.kit-mini-flag .f-bk { background: #000000; }
.kit-mini-flag .f-rd { background: #dd0000; }
.kit-mini-flag .f-gd { background: #ffce00; }

/* Center VS or Score */
.vs-or-score-container,
.match-center-badge {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  flex-shrink: 0;
}

.vs-text,
.vs-badge {
  font-size: 14.5px;
  font-weight: 800;
  color: #172e4e;
  letter-spacing: 0.5px;
}

.score-main {
  font-size: 15px;
  font-weight: 900;
  color: #10223f;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.score-sub {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 1px;
  white-space: nowrap;
}

/* Market Selection & Odds */
.market-odds-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  margin-bottom: 8px;
}

.market-label {
  font-weight: 700;
  color: #112340;
}

.market-odds {
  font-weight: 800;
  color: #112340;
  font-size: 14px;
}

/* Live Elapsed Time Row */
.match-live-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 8px 0;
  font-size: 12.5px;
  font-weight: 700;
}

.live-label-text {
  color: var(--text-muted);
}

.live-elapsed-time {
  color: #122543;
}

/* Status Row */
.match-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.status-label {
  color: var(--ink-soft);
  font-weight: 400;
}

.match-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
}

.match-status-badge.gain {
  color: var(--status-green);
}

.match-status-badge.accepted {
  color: var(--status-blue);
}

.match-status-badge.lost {
  color: var(--status-red);
}

/* ==========================================================
   TICKET ACTIONS (Cash Out & Duplicate Buttons)
   ========================================================== */
.ticket-actions-container {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-cashout {
  background: var(--primary-blue);
  color: #ffffff;
  border: none;
  padding: 13px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(36, 118, 231, 0.25);
  transition: background 0.15s ease;
}

.btn-cashout:hover {
  background: var(--primary-blue-dark);
}

.btn-duplicate {
  background: var(--primary-blue-light);
  color: var(--primary-blue);
  border: none;
  padding: 13px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-duplicate:hover {
  background: #d5e5fa;
}

/* ==========================================================
   BOTTOM NAVIGATION BAR (1xBet Exact Reproduction)
   ========================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 4px 4px 8px 4px;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}

/* Base commune à tous les boutons */
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #233853;
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  padding: 4px 0;
}

.nav-item span {
  color: #233853;
  font-size: 11px;
  font-weight: 500;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: #237be5;
  color: #237be5;
}

.populaire-item svg,
.populaire-icon,
.favoris-item svg,
.favoris-icon,
.menu-item svg,
.menu-icon,
.steel-icon {
  width: 22px;
  height: 22px;
  fill: var(--icon-steel) !important;
  color: var(--icon-steel) !important;
}

/* Les formes internes ont leur propre couleur dans le HTML : on la remplace ici */
.populaire-icon path,
.menu-icon rect,
.menu-icon circle {
  fill: var(--icon-steel);
}

.favoris-icon polygon {
  fill: var(--icon-steel);
  stroke: var(--icon-steel);       /* le contour arrondit les pointes de l'étoile */
}

/* --- Coupon (3) : grand cercle bleu flottant --- */
.nav-coupon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  margin-top: -24px;          /* le cercle dépasse de la barre */
  padding-bottom: 2px;
  font-size: 11px;
  font-weight: 500;
  color: #233853;
  cursor: pointer;
}

.nav-coupon-btn span {
  color: #233853;
  font-size: 11px;
  font-weight: 500;
  margin-top: 1px;
}

.coupon-circle-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--icon-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  box-shadow: 0 4px 14px rgba(72, 141, 210, 0.38);
  transition: transform 0.15s ease;
}

.coupon-circle-icon:active {
  transform: scale(0.95);
}

.coupon-circle-icon svg {
 width: 36px;
  height: 36px;
  display: block;
}

/* Points de perforation du ticket : même bleu que le cercle */
.coupon-circle-icon svg .perf {
  fill: var(--icon-blue);
}

/* --- Historique (4) : actif --- */
.historique-icon-wrapper {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.historique-icon-wrapper svg {
  width: 100%;
  height: 100%;
}

.historique-icon-wrapper svg circle {
  fill: var(--icon-blue);
}

.nav-item.historique-item.active span {
  color: #112340;
  font-weight: 700;
}

/* ==========================================================
   ADMIN / CRUD MODAL DRAWER
   ========================================================== */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 20, 35, 0.75);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 12px;
}

.admin-modal-overlay.open {
  display: flex;
}

.admin-drawer {
  width: 100%;
  max-width: 620px;
  background: #ffffff;
  border-radius: 14px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: modalFadeIn 0.2s ease-out;
  overflow: hidden;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-drawer-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.admin-drawer-header h3 {
  font-size: 16px;
  color: #122543;
  font-weight: 700;
}

.admin-close-btn {
  background: #e2e8f0;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
}

.admin-close-btn:hover {
  background: #cbd5e1;
}

.admin-drawer-body {
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-section-title {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  font-weight: 800;
  margin-bottom: 4px;
}

.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.admin-form-group label {
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-form-group input,
.admin-form-group select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  color: #0f172a;
  outline: none;
  background: #ffffff;
}

.admin-form-group input:focus,
.admin-form-group select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 480px) {
  .admin-grid-2 {
    grid-template-columns: 1fr;
  }
}

.admin-match-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.admin-match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.admin-match-title {
  color: #122543;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.admin-sport-block {
  background: #eef4fb;
  border: 1.5px solid #c9dcf0;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.admin-sport-label {
  font-weight: 700;
  color: #122543;
}

.team-editor-box {
  background: #ffffff;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.team-editor-title {
  font-weight: 700;
  font-size: 12px;
  color: #1e3a8a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 9px 14px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 12.5px;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.btn-danger:hover {
  background: #dc2626;
}

/* ── Searchable Select Component ── */
.searchable-select {
  position: relative;
  width: 100%;
}

.ss-input-row {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 8px;
  transition: border-color 0.2s;
  gap: 6px;
}

.ss-input-row:focus-within {
  border-color: #237be5;
  box-shadow: 0 0 0 3px rgba(35, 123, 229, 0.12);
}

.ss-search-icon {
  font-size: 13px;
  color: #94a3b8;
  flex-shrink: 0;
}

.ss-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  background: transparent;
  font-size: 12.5px;
  padding: 7px 0;
  color: #1e293b;
  min-width: 0;
  box-shadow: none !important;
}

.ss-clear-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s;
}
.ss-clear-btn:hover { color: #ef4444; }

.ss-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13);
  z-index: 9999;
  max-height: 280px;
  overflow: hidden;
  animation: ssDropIn 0.15s ease;
}

@keyframes ssDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ss-items-container {
  max-height: 278px;
  overflow-y: auto;
  padding: 4px 0;
}

.ss-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 8px 12px 4px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
}

.ss-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 12.5px;
  color: #1e293b;
  transition: background 0.12s;
}

.ss-item:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.ss-item img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ss-no-results {
  padding: 16px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  font-style: italic;
}

/* ==========================================================
   FICHE COUPON & COULEURS STATUT
   ========================================================== */
.summary-val:not(.payout-green) {
  color: var(--ink);
  font-weight: 700;
}

.league-tag-mini {
  background: #3c72eb;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.2px;
}

.status-badge-val.paid {
  color: var(--status-green);
  font-weight: 700;
}

.status-badge-val.accepted {
  color: #4d7fb2;
  font-weight: 700;
}

/* ===== En-tête : copie de l'original ===== */
:root {
  --bg-page: #ebeef3;
  --header-ink: #5a7b93;
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 2px rgba(30, 45, 70, 0.05);
}

.top-header .left-nav {
  display: flex;
  align-items: center;
  min-width: 36px;
}

.top-header .back-btn,
.top-header .icon-btn {
  padding: 4px;
  line-height: 0;
  color: #27436b;
}

/* Titre centré proprement sans chevauchement avec les boutons */
.top-header .header-title {
  position: static;
  transform: none;
  font-size: 19px;
  font-weight: 700;
  color: #27436b;
  letter-spacing: -0.2px;
  text-align: center;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-header .right-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 36px;
}

/* Marges autour des cartes */
.content-scrollable { padding: 10.5px 10.5px 95px 10.5px; }

/* ===== Boutons VENDRE / DUPLIQUER : copie de l'original ===== */
:root { --nav-h: 54px; }   /* hauteur de la barre du bas : ajuste si besoin */

/* Place pour le panneau fixe sous la liste */
.content-scrollable { padding-bottom: 215px; }

/* Panneau blanc fixe au-dessus de la barre du bas */
.ticket-actions-container {
  position: fixed;
  left: 50%;
  bottom: var(--nav-h);
  transform: translateX(-50%);
  width: 100%;
  max-width: 460px;
  margin: 0;
  padding: 14px 14px 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #ffffff;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -2px 8px rgba(30, 45, 70, 0.08);
  z-index: 90;   /* sous la barre du bas (100) pour que le cercle Coupon dépasse */
}

.btn-cashout,
.btn-duplicate {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: 5px;
  font-family: "Roboto", -apple-system, "Segoe UI", Arial, sans-serif;  /* clé du problème */
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-cashout {
  background: #4a88d0;
  color: #ffffff;
  box-shadow: 0 2px 3px rgba(30, 60, 110, 0.28);
}
.btn-cashout:hover { background: #3f7ec6; }

.btn-duplicate {
  background: #d9e6f5;
  color: #4a88c5;
  box-shadow: none;
}
.btn-duplicate:hover { background: #cfdff1; }

/* Coupon Payé : pas de panneau, donc moins de marge en bas */
body.no-actions .content-scrollable { padding-bottom: 95px; }

/* En-tête collant : titre + petit solde (visible seulement après le scroll) */
.hist-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff; text-align: center;
  padding: 18px 14px 10px;
}
.hist-header .hist-title-row { position: relative; }
.hist-header.scrolled { box-shadow: 0 1px 0 #dfe5ec; }
.hist-mini {
  height: 0; opacity: 0; overflow: hidden;
  font-size: 14px; font-weight: 500; color: #5a7b93;
  transition: height .15s ease, opacity .15s ease;
}
.hist-header.scrolled .hist-mini { height: 20px; opacity: 1; margin-top: 2px; }

/* Le bloc du haut n'a plus le titre : on réduit son espace */
.hist-top { padding-top: 4px; }
.hist-account { margin-top: 6px; }

/* Coupon Payé */
.h-row .v.paid { color: #56a46e; font-weight: 500; }
.h-row .v.st { font-weight: 500; }

/* ===== NOUVEAUX SPORTS : Poker TvBet, Morpion, Dés & Extra Info ===== */
.user-avatar-circle {
  width: 38px;
  height: 38px;
  min-width: 38px;
  max-width: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  background: transparent;
}
.user-avatar-circle svg {
  width: 38px;
  height: 38px;
  display: block;
}

.sport-dice-ico {
  color: #5282a0;
  display: block;
}
.sport-dice-ico .dice-dot {
  fill: #ffffff;
}
.sport-dice-ico .dice-front {
  stroke: var(--bg-card, #ffffff);
}
.sport-poker-ico {
  color: #5282a0;
  display: block;
}
.sport-poker-ico .poker-pad {
  stroke: var(--bg-card, #ffffff);
}
.sport-poker-ico .poker-dot {
  fill: var(--bg-card, #ffffff);
}

.tvbet-poker-block {
  text-align: center;
  margin: 4px 0 14px;
}
.tvbet-poker-title {
  font-size: 13px;
  font-weight: 700;
  color: #122543;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.tvbet-poker-lines {
  font-size: 11.5px;
  line-height: 1.45;
  color: #556877;
  font-weight: 400;
}

.score-sub-row {
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #647d8f;
  margin: -8px 0 14px;
}

.morpion-sub-block {
  text-align: center;
  margin: -2px 0 10px;
}
.morpion-score-line {
  font-size: 12px;
  font-weight: 500;
  color: #556877;
  margin-bottom: 4px;
}
.morpion-grids-pre {
  font-family: Consolas, "Courier New", monospace;
  font-size: 11.5px;
  line-height: 1.4;
  color: #556877;
  white-space: pre;
  display: inline-block;
  text-align: left;
  margin: 0;
}

.match-extra-info-box {
  margin-top: 10px;
  padding-top: 2px;
}
.extra-info-title {
  color: #3b82d4;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 3px;
  line-height: 1.25;
}
.extra-info-value {
  color: #122543;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== FIX original : détail du pari plus compact (comme la référence) ===== */
.top-header { height: 48px; padding: 0 14px; }
.top-header .header-title { font-size: 17px; }
.content-scrollable { padding: 10px 10px 200px 10px; }
.coupon-summary-card { padding: 14px 12px 14px 12px; border-top-left-radius: 10px; border-top-right-radius: 10px; }
.coupon-meta-top { margin-bottom: 4px; }
.coupon-date { font-size: 12px; }
.league-tag, .league-tag-mini { font-size: 10px; padding: 2px 6px; }
.coupon-title-row { margin-bottom: 13px; }
.coupon-type-number, .coupon-type-word { font-size: 17px; }
.coupon-number-part { font-size: 13px; }
.coupon-events-count { font-size: 12px; margin-bottom: 10px; padding-top: 8px; }
.events-left-info { font-size: 12px; gap: 6px; }
.events-left-info svg { width: 17px; height: 17px; }
.events-right-info { font-size: 12px; }
.summary-table { gap: 10px; }
.summary-row { font-size: 13px; }
.summary-val { font-size: 13.5px; }
.summary-val.payout-green { font-size: 13.5px; }
.status-badge-val { font-size: 13px; }
.match-card { padding: 10px 8px; }
.match-card:last-child { border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }
.match-header-row { margin-bottom: 10px; }
.match-category-text { font-size: 12px; }
.match-date-line, .match-time-label { font-size: 11.5px; }
.team-name { font-size: 12px; }
.flag-sphere { width: 34px; height: 34px; min-width: 34px; max-width: 34px; }
.club-crest { width: 32px; height: 32px; min-width: 32px; max-width: 32px; }
.club-crest img { max-width: 32px; max-height: 32px; }
.player-photo-square { width: 32px; height: 32px; min-width: 32px; max-width: 32px; }
.kit-jersey { width: 32px; height: 32px; min-width: 32px; max-width: 32px; }
.kit-jersey svg.jersey-icon { width: 29px; height: 29px; }
.user-avatar-circle, .user-avatar-circle svg { width: 32px; height: 32px; min-width: 32px; }
.vs-or-score-container, .match-center-badge { width: 56px; min-width: 56px; max-width: 56px; padding: 0 6px; }
.vs-text, .vs-badge { font-size: 13px; }
.score-main { font-size: 13.5px; }
.teams-confrontation, .teams-container { margin-bottom: 10px; }
.market-odds-row { font-size: 12.5px; margin-bottom: 6px; }
.market-odds { font-size: 13px; }
.match-live-time-row { font-size: 11.5px; margin: 3px 0 6px 0; }
.match-status-row { font-size: 12px; }
.match-status-badge { font-size: 12px; }
.tvbet-poker-title { font-size: 12px; }
.tvbet-poker-lines { font-size: 11px; }
.score-sub-row { font-size: 11px; margin: 2px 0 12px; }
.match-extra-info-box { margin-top: 8px; }
.extra-info-title { font-size: 12px; }
.extra-info-value { font-size: 12.5px; }
.ticket-actions-container { padding: 12px 12px 20px 12px; gap: 10px; }
.btn-cashout, .btn-duplicate { height: 38px; font-size: 12.5px; }