/* ==========================================================================
   MatchMaker Scrims – UI Modernisée
   Design moderne avec animations, gradients, et meilleure UX
   ========================================================================== */

/* ========== 1) Base & Layout ========== */
.mm-scrims-wrap{
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #111827;
  line-height: 1.6;
}

.mm-scrims-header{
  display: flex;
  justify-content: flex-end;
  column-gap: 1rem;
  row-gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mm-scrims-header label{
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
  min-width: 220px;
  gap: 0.5rem;
}

.mm-scrims-header label span{
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.mm-scrims-header input[type="date"],
.mm-scrims-header select{
  padding: 0.625rem 0.875rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e293b;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mm-scrims-header input[type="date"]:focus,
.mm-scrims-header select:focus{
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.mm-scrims-header select{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
  padding-right: 40px;
  appearance: none;
}

/* ========== 2) Buttons & Actions ========== */
.mm-actions-row{
  display: flex;
  gap: 0.75rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
}

.mm-btn{
  border: none;
  background: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  border: 2px solid #e2e8f0;
  position: relative;
  overflow: hidden;
}

.mm-btn::before{
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.mm-btn:hover::before{
  width: 300px;
  height: 300px;
}

.mm-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.mm-btn:active{
  transform: translateY(0);
}

.mm-btn.primary{
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.mm-btn.primary:hover{
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.mm-btn.orange{
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #d97706;
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.mm-btn.orange:hover{
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.mm-btn.danger{
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: #dc2626;
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.mm-btn.danger:hover{
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.mm-btn-half{
  flex: 1;
  min-width: 150px;
}

.mm-link{
  background: transparent;
  border: none;
  color: #3b82f6;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
  transition: color 0.2s;
}

.mm-link:hover{
  color: #2563eb;
}

.mm-link.danger{
  color: #ef4444;
}

.mm-link.danger:hover{
  color: #dc2626;
}

/* Icon buttons in table */
.mm-icon-btn{
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.5rem;
  cursor: pointer;
  line-height: 0;
  vertical-align: middle;
  margin-right: 0.5rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mm-icon-btn:hover{
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: scale(1.05);
}

.mm-icon-btn.danger{
  border-color: #fecaca;
  background: #fff;
  color: #ef4444;
}

.mm-icon-btn.danger:hover{
  background: #fef2f2;
  border-color: #fca5a5;
}

.mm-icon{
  width: 18px;
  height: 18px;
  display: inline-block;
}

/* ========== 3) Main table ========== */
.mm-scrims-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  background: transparent;
}

.mm-scrims-table thead th{
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 800;
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #475569;
  border: none;
  border-radius: 12px 12px 0 0;
}

.mm-scrims-table tbody tr{
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mm-scrims-table tbody tr:hover{
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.mm-scrims-table th,
.mm-scrims-table td{
  padding: 1rem 1.25rem;
  border: none;
  text-align: left;
  font-size: 0.9375rem;
  vertical-align: middle;
}

.mm-scrims-table tbody td{
  border-top: 1px solid #f1f5f9;
}

.mm-more-row td{
  background: #fafbfc;
  border-radius: 0 0 12px 12px;
  padding: 0 !important;
}

.mm-more-row[hidden]{
  display: none !important;
}

/* ========== 4) "More" panel ========== */
.mm-more{
  padding: 1.5rem;
  animation: slideDown 0.3s ease-out;
}

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

.mm-more-grid{
  display: grid;
  grid-template-columns: 1fr 240px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.mm-card{
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mm-card:hover{
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.mm-card-title{
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #1e293b;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  font-size: 0.8125rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.mm-center{
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.mm-avg-big{
  font-size: 2.5rem;
  font-weight: 900;
  margin: 0.5rem 0;
  color: #3b82f6;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  min-height: 3rem;
  line-height: 1.2;
}

/* Fallback pour les navigateurs qui ne supportent pas background-clip: text */
@supports not (-webkit-background-clip: text) {
  .mm-avg-big{
    color: #3b82f6;
    background: none;
    -webkit-text-fill-color: #3b82f6;
  }
}

.mm-badge{
  display: inline-block;
  border-radius: 999px;
  padding: 0.375rem 0.875rem;
  border: 2px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 800;
  font-size: 0.875rem;
  color: #475569;
}

.mm-chip{
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}

.mm-chip .mm-author-link{
  text-decoration: none;
  color: #3b82f6;
  font-weight: 700;
  transition: color 0.2s;
}

.mm-chip .mm-author-link:hover{
  color: #2563eb;
  text-decoration: underline;
}

/* Players table inside "More" */
.mm-list-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #fff;
}

.mm-list-table thead th{
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 800;
  font-size: 0.8125rem;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
}

.mm-list-table tbody tr{
  transition: background 0.2s;
}

.mm-list-table tbody tr:hover{
  background: #f8fafc;
}

.mm-list-table td{
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.mm-cell-name{
  width: 60%;
  font-weight: 700;
}

.mm-cell-link{
  width: 15%;
  text-align: center;
}

.mm-cell-mmr{
  width: 25%;
  font-weight: 800;
  color: #3b82f6;
}

.mm-chip-link{
  display: inline-block;
  text-decoration: none;
  transition: transform 0.2s;
}

.mm-chip-link:hover{
  transform: scale(1.2);
}

/* Contact card logo */
.mm-contact-logo{
  text-align: center;
  margin-bottom: 1rem;
}

.mm-contact-logo img{
  max-width: 80px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.mm-contact-btn{
  width: 100%;
  margin-bottom: 0.75rem;
}

.mm-contact-note{
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 0.5rem;
  text-align: center;
}

.mm-match-id{
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

/* ========== 5) Modal & Form (unified) ========== */
.mm-modal{
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2147483000;
}

.mm-modal[aria-hidden="false"]{
  opacity: 1;
  pointer-events: auto;
}

.mm-modal-content{
  background: #fff;
  width: min(900px, 100%);
  max-height: 95vh;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
  position: relative;
}

@keyframes modalSlideIn{
  from{
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to{
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

  .mm-modal-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    flex-shrink: 0;
  }
  
  @media (max-width: 768px){
    .mm-modal-header{
      padding: 1rem 1.5rem;
    }
    
    .mm-modal-header h3{
      font-size: 1.25rem;
    }
  }

.mm-modal-header h3{
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
}

.mm-modal-close{
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  color: #64748b;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all 0.2s;
}

.mm-modal-close:hover{
  background: #f1f5f9;
  color: #1e293b;
}

.mm-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 2rem;
  overflow-y: visible;
  flex: 0 0 auto;
  min-height: 0;
}

#mm-players-wrap{
  padding: 0 2rem 1rem;
  overflow-y: auto;
  max-height: none;
  min-height: 0;
  flex-shrink: 0;
}

.mm-modal-actions{
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1.5rem 2rem;
  border-top: 2px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.mm-note{
  padding: 0 2rem 1.5rem;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.6;
  flex-shrink: 0;
}

body.mm-modal-open{
  overflow: hidden;
}

/* Labels */
.mm-modal-content label span{
  display: block;
  margin-bottom: 0.5rem;
  font: 800 0.8125rem/1.2 system-ui, sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #475569;
}

/* Controls */
.mm-modal-content input,
.mm-modal-content select,
.mm-modal-content textarea{
  appearance: none;
  width: 100%;
  height: 48px;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  transition: all 0.2s ease;
}

.mm-modal-content input::placeholder{
  color: #94a3b8;
  font-weight: 500;
}

/* Focus / states */
.mm-modal-content input:focus,
.mm-modal-content select:focus,
.mm-modal-content textarea:focus{
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.mm-modal-content .is-invalid{
  border-color: #ef4444 !important;
}

.mm-modal-content .is-invalid:focus{
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}

.mm-modal-content [disabled]{
  opacity: 0.6;
  cursor: not-allowed;
}

/* Custom chevron for selects */
.mm-modal-content select{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px 18px;
  padding-right: 48px;
  cursor: pointer;
}

/* Player "cards" same look as list */
.mm-player-row{
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.25rem;
  gap: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 1rem;
  transition: all 0.2s;
}

.mm-player-row:hover{
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mm-player-row label{
  display: flex;
  flex-direction: column;
}

/* Time separator ("H") between HH and MM */
.mm-time-sep{
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed transparent;
  border-radius: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #64748b;
  user-select: none;
}

/* ========== 6) Utilities ========== */
.mm-rank{
  display: block;
  font-weight: 800;
  margin-bottom: 0.25rem;
  color: #1e293b;
}

.mm-rank-mmr{
  display: block;
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 600;
}

/* ========== 7) Responsive ========== */

/* ≤ 900px : "More" grid */
@media (max-width: 900px){
  .mm-more-grid{
    grid-template-columns: 1fr;
  }
}

/* ≤ 768px : filters / modal / table as cards */
@media (max-width: 768px){
  /* Filters: centered & full-width */
  .mm-scrims-header{
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 1rem;
    justify-items: stretch;
    align-items: end;
    width: 100%;
    justify-content: stretch !important;
    padding: 1rem !important;
    box-sizing: border-box;
  }

  .mm-scrims-header label{
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 0 !important;
  }

  #mm-scrims-date,
  #mm-filter-mode,
  #mm-filter-rank{
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin: 0 !important;
  }
  
  /* S'assurer que le label de date est bien aligné à gauche */
  .mm-scrims-header label:first-child{
    justify-self: stretch;
    align-self: stretch;
  }
  
  /* Correction spécifique pour l'input date sur iOS */
  #mm-scrims-date{
    -webkit-appearance: none;
    appearance: none;
    text-align: left;
    direction: ltr;
  }

  /* Scrollable modal */
  .mm-modal{
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
  }

  .mm-modal-content{
    max-height: calc(100vh - 1rem);
    margin: 0.5rem 0;
    border-radius: 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  .mm-grid{
    grid-template-columns: 1fr;
    padding: 1.5rem;
    max-height: none;
    overflow-y: visible;
  }
  
  #mm-players-wrap{
    max-height: none;
    padding: 0 1.5rem 1rem;
    overflow-y: visible;
    min-height: 0;
  }
  
  .mm-modal-actions{
    position: relative;
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    z-index: 10;
    flex-shrink: 0;
  }
  
  #mm-scrims-form{
    overflow-y: auto !important;
    max-height: none !important;
    min-height: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  
  .mm-note{
    flex-shrink: 0;
  }

  /* Table → card rows */
  .mm-scrims-wrap{
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
  }
  
  /* S'assurer que le header ne déborde pas */
  .mm-scrims-header{
    overflow: hidden;
    position: relative;
  }

  /* hide table head */
  .mm-scrims-table thead{
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  .mm-scrims-table tbody tr{
    display: grid !important;
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
      "team rank rank"
      "datetime mode bo"
      "actions actions actions";
    row-gap: 0.5rem;
    align-items: center;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  .mm-scrims-table td{
    border: 0 !important;
    padding: 0.25rem 0 !important;
  }

  .mm-scrims-table td::before{
    display: none !important;
  }

  /* column mapping */
  .mm-scrims-table td:nth-child(5){
    grid-area: team;
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: 0.02em;
  }

  .mm-scrims-table td:nth-child(6){
    grid-area: rank;
    text-align: right;
  }

  /* Espacement pour éviter que le ruban touche le rank sur mobile */
  .mm-opponent-found-row td:nth-child(6){
    padding-top: 2.5rem !important;
  }

  .mm-scrims-table td:nth-child(6) .mm-rank-mmr{
    display: none;
  }

  .mm-scrims-table td:nth-child(6) .mm-rank{
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 2px solid #c7d2fe;
    font-weight: 800;
    font-size: 0.8125rem;
  }

  .mm-scrims-table td:nth-child(1){
    grid-area: datetime;
    color: #64748b;
    white-space: nowrap;
  }

  .mm-scrims-table td:nth-child(1)::after{
    content: " · " attr(data-time);
    margin-left: 0.5rem;
    font-weight: 700;
  }

  .mm-scrims-table td:nth-child(2){
    display: none !important;
  }

  .mm-scrims-table td:nth-child(3),
  .mm-scrims-table td:nth-child(4){
    justify-self: end;
    padding: 0.5rem 0.875rem !important;
    font-size: 0.8125rem;
    font-weight: 800;
    line-height: 1.3;
    border-radius: 999px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 2px solid #cbd5e1;
  }

  .mm-scrims-table td:nth-child(3){
    grid-area: mode;
  }

  .mm-scrims-table td:nth-child(4){
    grid-area: bo;
  }

  .mm-scrims-table td:nth-child(4)::before{
    content: "/ ";
    margin-right: 0.25rem;
  }

  .mm-scrims-table td:nth-child(7){
    grid-area: actions;
    padding-top: 0.75rem !important;
  }

  .mm-scrims-table td:nth-child(7) .mm-icon-btn{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-weight: 800;
    margin-top: 0.125rem;
    background: #fff;
    border: 2px solid #e2e8f0;
  }

  .mm-scrims-table td:nth-child(7) .mm-icon-btn:first-child{
    margin-top: 0;
  }

  .mm-scrims-table td:nth-child(7) .mm-icon-btn .mm-icon{
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
  }

  .mm-scrims-table td:nth-child(7) .mm-icon-btn::after{
    content: attr(aria-label);
  }

  .mm-scrims-table td:nth-child(7) .mm-icon-btn.danger{
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #dc2626;
    color: #fff;
  }
}

/* ≤ 720px : "Players" table inside More as cards */
@media (max-width: 720px){
  /* hide head */
  .mm-more .mm-list-table thead{
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  .mm-more .mm-list-table{
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    table-layout: auto !important;
  }

  .mm-more .mm-list-table tbody tr{
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
    width: 100% !important;
    margin: 0.75rem 0 !important;
    padding: 1rem !important;
    background: #fff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
  }

  .mm-more .mm-list-table td{
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: left !important;
    width: auto !important;
  }

  .mm-more .mm-list-table .mm-cell-name{
    flex: 1 1 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-weight: 800 !important;
    min-width: 0 !important;
  }

  .mm-more .mm-list-table .mm-cell-name strong{
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mm-more .mm-list-table .mm-cell-link{
    order: 1 !important;
    margin-left: 0.5rem !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  .mm-chip-link img{
    width: 18px;
    height: 18px;
    vertical-align: middle;
  }

  .mm-more .mm-list-table .mm-cell-mmr{
    flex: 0 0 auto !important;
    font-weight: 900 !important;
    padding: 0.5rem 0.875rem !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
    border: 2px solid #c7d2fe !important;
    white-space: nowrap !important;
  }

  .mm-more .mm-list-table .mm-cell-link:empty{
    display: none !important;
  }
}

/* ≥ 1024px : desktop airy version + centered headers/results */
@media (min-width: 1024px){
  .mm-scrims-header label:first-child{
    margin-right: auto;
  }

  .mm-more-grid{
    align-items: stretch !important;
  }

  .mm-more-grid .mm-card{
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .mm-scrims-table thead th,
  .mm-scrims-table tbody td{
    text-align: center;
  }

  .mm-scrims-table tbody td{
    border: 0 !important;
    padding: 1.25rem 1.5rem;
    vertical-align: middle;
  }

  /* widths (PC order: Date, Heure, Mode, Équipe, Niveau, BO, Actions) */
  .mm-scrims-table td:nth-child(1){
    width: 150px;
  }

  .mm-scrims-table td:nth-child(2){
    width: 150px;
  }

  .mm-scrims-table td:nth-child(3){
    width: 150px;
  }

  .mm-scrims-table td:nth-child(4){
    min-width: 150px;
  }

  .mm-scrims-table td:nth-child(5){
    min-width: 150px;
  }

  .mm-scrims-table td:nth-child(6){
    width: 150px;
  }

  .mm-scrims-table td:nth-child(7){
    width: 150px;
    white-space: nowrap;
    text-align: right;
  }

  .mm-scrims-table td:nth-child(5) .mm-rank{
    display: block;
    font-weight: 800;
    margin-bottom: 0.25rem;
  }

  .mm-scrims-table td:nth-child(5) .mm-rank-mmr{
    display: block;
    font-size: 0.8125rem;
    color: #64748b;
  }

  .mm-scrims-table td:nth-child(7) .mm-icon-btn{
    margin-left: 0.125rem;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
  }

  .mm-scrims-table td:nth-child(7) .mm-icon-btn:first-child{
    margin-left: 0;
  }

  .mm-scrims-table tbody tr:hover{
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  }
}

/* ========== 8) States (expired rows) ========== */
.mm-expired-row{
  opacity: 0.6;
  filter: grayscale(0.2);
  position: relative;
}

.mm-expired-row::after{
  content: "EXPIRÉ";
  position: absolute;
  top: 12px;
  left: 16px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  font-weight: 900;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  line-height: 1;
  z-index: 1;
}

/* ========== 8.5) States (opponent found rows) ========== */
.mm-opponent-found-row{
  opacity: 0.7;
  filter: grayscale(0.1);
  position: relative;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #93c5fd !important;
}

.mm-opponent-found-row::after{
  content: "ADVERSAIRE TROUVÉ";
  position: absolute;
  top: 12px;
  left: 16px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  font-weight: 900;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  line-height: 1;
  z-index: 1;
}

.mm-opponent-found-row:hover{
  border-color: #60a5fa !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.mm-opponent-found-active{
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  border-color: #2563eb !important;
  color: #fff !important;
}

.mm-opponent-found-active:hover{
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border-color: #1d4ed8 !important;
}

.mm-contact-disabled{
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

@media (min-width: 1024px){
  .mm-scrims-table tbody tr{
    position: relative;
  }
}

/* ========== 9) Final overrides (keep LAST) ========== */

/* Mobile : put date (DD MMM YYYY) and time (HH H MM) on ONE line for sure */
@media (max-width: 600px){
  .mm-date-wrap{
    display: grid !important;
    grid-template-columns: 1fr 1.2fr 1fr !important;
    column-gap: 0.75rem !important;
    align-items: center !important;
  }

  .mm-date-wrap > *{
    width: 100% !important;
    min-width: 0 !important;
  }

  .mm-time-wrap{
    display: grid !important;
    grid-template-columns: 1fr 32px 1fr !important;
    column-gap: 0.75rem !important;
    align-items: center !important;
  }

  .mm-time-wrap > select{
    width: 100% !important;
    min-width: 0 !important;
  }

  .mm-time-sep{
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    user-select: none;
    font-weight: 900;
    opacity: 0.75;
  }

  /* Player cards: 1 input per line */
  .mm-player-row{
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    margin-bottom: 1.5rem !important;
  }
  
  /* Ensure all form elements are visible on mobile */
  .mm-modal-content input,
  .mm-modal-content select,
  .mm-modal-content textarea{
    width: 100% !important;
    box-sizing: border-box;
  }
  
  #mm-players-wrap h4{
    font-size: 1rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  /* Better spacing for form fields on mobile */
  .mm-grid label{
    margin-bottom: 0.5rem;
  }
}

/* Ultra narrow phones */
@media (max-width: 360px){
  .mm-time-wrap{
    grid-template-columns: 1fr 24px 1fr !important;
  }
  
  .mm-modal-content{
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
  
  /* Correction supplémentaire pour iPhone */
  .mm-scrims-header{
    padding: 0.75rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .mm-scrims-header label,
  #mm-scrims-date{
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .mm-grid{
    padding: 1rem;
  }
  
  #mm-players-wrap{
    padding: 0 1rem 1rem;
  }
  
  .mm-modal-actions{
    padding: 1rem;
    flex-wrap: wrap;
  }
  
  .mm-modal-actions .mm-btn{
    flex: 1 1 100%;
    margin-bottom: 0.5rem;
  }
  
  .mm-modal-actions .mm-btn:last-child{
    margin-bottom: 0;
  }
  
  .mm-modal-header{
    padding: 1rem;
  }
  
  .mm-note{
    padding: 0 1rem 1rem;
    font-size: 0.8125rem;
  }
}

/* ========== 10) Popup de suppression ========== */
.mm-deletion-popup{
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 2147483100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mm-deletion-popup.mm-deletion-popup-show{
  opacity: 1;
}

.mm-deletion-popup-content{
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.mm-deletion-popup.mm-deletion-popup-show .mm-deletion-popup-content{
  transform: scale(1);
}

.mm-deletion-popup-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 2px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.mm-deletion-popup-header h3{
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
}

.mm-deletion-popup-close{
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  color: #64748b;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all 0.2s;
}

.mm-deletion-popup-close:hover{
  background: #f1f5f9;
  color: #1e293b;
}

.mm-deletion-popup-body{
  padding: 2rem;
}

.mm-deletion-message{
  margin: 0;
  font-size: 1.125rem;
  color: #1e293b;
  line-height: 1.6;
  text-align: center;
}

.mm-deletion-popup-footer{
  padding: 1.5rem 2rem;
  border-top: 2px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  justify-content: center;
}

.mm-deletion-popup-footer .mm-btn{
  min-width: 120px;
}
