
.ms-main {
  padding-bottom: 42px;
}

.ms-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ms-back {
  font-weight: 700;
  color: var(--dark);
}

.ms-back:hover {
  color: var(--green);
}

.ms-heading {
  text-align: center;
  padding: 35px 0 26px;
}

.ms-heading .eyebrow {
  margin-bottom: 12px;
}

.ms-heading h1,
.ms-heading h1 em {
  color: #1A4C34 !important;
}

.ms-heading > p:last-child {
  margin: 13px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.ms-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 6vw, 72px);
  padding: 17px 20px;
  margin: 0 auto 15px;
  max-width: 620px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.ms-toolbar > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.ms-label {
  font-size: 9px;
  letter-spacing: 1.3px;
  font-weight: 850;
  color: var(--muted);
}

.ms-toolbar strong {
  font-size: 23px;
  color: var(--dark);
  font-variant-numeric: tabular-nums;
}

.ms-secondary,
.ms-primary {
  font: inherit;
  font-weight: 750;
  border-radius: 7px;
  padding: 10px 14px;
}

.ms-secondary {
  font-size: 12px;
}

.ms-secondary:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.ms-primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.ms-status {
  min-height: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 12px;
}

.ms-status.error {
  color: #bd4545;
}

.ms-status.success {
  color: var(--green);
}

.ms-board-wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  overflow-x: auto;
  padding: 2px 0 8px;
}

.ms-board {
  display: grid;
  grid-template-columns: 112px repeat(3, minmax(125px, 1fr));
  grid-template-rows: 82px repeat(3, minmax(125px, 1fr));
  gap: 7px;
  min-width: 520px;
}

.ms-corner {
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0 4px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.ms-col-head,
.ms-row-head {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 8px;
  background: var(--soft);
  color: var(--dark);
  font-size: 13px;
  font-weight: 800;
  padding: 8px;
  line-height: 1.25;
}

.ms-row-head {
  background: #f6f8f6;
}

.ms-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--dark);
  cursor: pointer;
  transition: .16s;
}

.ms-cell:hover:not(:disabled) {
  border-color: #9ccbab;
  background: #fbfefc;
  transform: translateY(-1px);
}

.ms-cell:disabled {
  cursor: default;
}

.ms-cell .ms-plus {
  font-size: 26px;
  line-height: 1;
  color: #9bad9f;
  font-weight: 400;
}

.ms-cell .ms-cell-hint {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

.ms-cell.found {
  border-color: #b9ddc4;
  background: #f4fbf6;
}

.ms-player-photo {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
  background: #e8eee9;
}

.ms-player-name {
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ms-player-points {
  font-size: 10px;
  font-weight: 800;
  color: var(--green);
}

.ms-bottom {
  max-width: 760px;
  margin: 17px auto 0;
}

.ms-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.ms-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.ms-result {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
  background: #fbfefc;
}

.ms-result h2 {
  margin: 0;
  color: var(--dark);
  font-size: 21px;
}

.ms-result p {
  color: var(--muted);
  font-size: 14px;
}

.ms-stats {
  margin-top: 15px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

.ms-modal[hidden],
.ms-result[hidden] {
  display: none;
}

.ms-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.ms-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 31, 20, .48);
}

.ms-dialog {
  position: relative;
  width: min(100%, 440px);
  padding: 27px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 20px 70px #102d1b2b;
}

.ms-close {
  position: absolute;
  right: 15px;
  top: 12px;
  border: 0;
  font-size: 25px;
  padding: 3px 8px;
  color: var(--muted);
}

.ms-dialog-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ms-dialog h2 {
  margin: 0;
  color: var(--dark);
  font-size: 23px;
}

.ms-dialog-hint {
  margin: 7px 0 16px;
  color: var(--muted);
  font-size: 12px;
}

#ms-search {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
  outline: none;
}

#ms-search:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #27a35a18;
}

.ms-suggestions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 12px;
  max-height: 270px;
  overflow: auto;
}

.ms-suggestion {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f7faf7;
  text-align: left;
  cursor: pointer;
}

.ms-suggestion:hover {
  border-color: #b9ddc4;
  background: #f0f8f2;
}

.ms-suggestion img {
  width: 37px;
  height: 37px;
  object-fit: cover;
  border-radius: 50%;
  background: #e8eee9;
}

.ms-suggestion strong {
  display: block;
  color: var(--dark);
  font-size: 13px;
}

.ms-suggestion small {
  color: var(--muted);
  font-size: 10px;
}

.ms-search-message {
  min-height: 16px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

/* Message de mauvaise réponse */
#ms-search-message.error {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 8px 13px;
  background: #fff0f0;
  color: #d93030 !important;
  border: 1px solid #ffd1d1;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  animation: ms-error-appear 0.2s ease;
}

@keyframes ms-error-appear {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Drapeaux des nationalités */
.ms-country-flag {
  width: 65px;
  height: 43px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Logos des clubs */
.ms-club-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

/* En-têtes de la grille */
.ms-col-head,
.ms-row-head {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive */
@media (max-width: 640px) {
  .ms-topline {
    margin-top: 18px;
  }

  .ms-heading {
    padding: 30px 0 20px;
  }

  .ms-heading > p:last-child {
    font-size: 13px;
    max-width: 300px;
  }

  .ms-toolbar {
    gap: 20px;
    padding: 13px 8px;
  }

  .ms-toolbar strong {
    font-size: 20px;
  }

  .ms-secondary {
    padding: 8px 9px;
    font-size: 11px;
  }

  .ms-board {
    grid-template-columns: 86px repeat(3, minmax(112px, 1fr));
    grid-template-rows: 70px repeat(3, 120px);
    gap: 5px;
    min-width: 430px;
  }

  .ms-col-head,
  .ms-row-head {
    font-size: 11px;
    padding: 5px;
  }

  .ms-cell {
    padding: 6px;
    gap: 5px;
  }

  .ms-player-photo {
    width: 42px;
    height: 42px;
  }

  .ms-player-name {
    font-size: 10px;
  }

  .ms-player-points {
    font-size: 9px;
  }

  .ms-dialog {
    padding: 23px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ms-cell {
    transition: none;
  }
}

/* Confirmation d'abandon */
.ms-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ms-confirm-modal[hidden] {
  display: none;
}

.ms-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 24, 0.65);
  backdrop-filter: blur(5px);
}

.ms-confirm-dialog {
  position: relative;
  width: 100%;
  max-width: 500px;
  padding: 32px 28px;
  background: white;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: ms-confirm-appear 0.2s ease;
}

.ms-confirm-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e2f9e9;
  color: #1a4c34;
  font-size: 36px;
  font-weight: 800;
}

.ms-confirm-dialog h2 {
  margin: 0 0 14px;
  color: #202923;
  font-size: 25px;
  font-weight: 750;
}

.ms-confirm-dialog p {
  margin: 0 auto 26px;
  max-width: 420px;
  color: #78827b;
  font-size: 16px;
  line-height: 1.5;
}

.ms-confirm-dialog button {
  width: 100%;
  min-height: 56px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
}

.ms-confirm-continue {
  margin-bottom: 12px;
  background: white;
  color: #202923;
  border: 1px solid #d9dedb;
}

.ms-confirm-continue:hover {
  background: #f7faf8;
}

.ms-confirm-giveup {
  background: #df2424;
  color: white;
  border: 1px solid #df2424;
}

.ms-confirm-giveup:hover {
  background: #c91e1e;
}

.ms-confirm-dialog button:disabled {
  opacity: 0.6;
  cursor: wait;
}

@keyframes ms-confirm-appear {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 600px) {
  
/* Confirmation d'abandon - format compact */
/* Fenêtre d'abandon compacte */
.ms-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.ms-confirm-modal[hidden] {
  display: none;
}

.ms-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 18, 0.65);
  backdrop-filter: blur(4px);
}

.ms-confirm-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 350px;
  padding: 20px;
  background: white;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.ms-confirm-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  font-size: 24px;
  font-weight: 900;
}

.ms-confirm-dialog h2 {
  color: #17251c;
  font-size: 19px;
  margin: 0 0 9px;
}

.ms-confirm-dialog p {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 17px;
}

.ms-confirm-dialog button {
  width: 100%;
  min-height: 40px;
  padding: 9px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.ms-confirm-continue {
  margin-bottom: 8px;
  background: white;
  color: #17251c;
  border: 1px solid #d1d5db;
}

.ms-confirm-giveup {
  background: #dc2626;
  color: white;
  border: none;
}

.ms-confirm-continue:hover {
  background: #f8faf9;
}

.ms-confirm-giveup:hover {
  background: #b91c1c;
}

.ms-confirm-dialog button:disabled {
  opacity: 0.6;
  cursor: wait;
}
}
#ms-confirm-modal .ms-confirm-dialog {
  width: 400px !important;
  max-width: calc(100vw - 40px) !important;
  min-width: 0 !important;
  padding: 23px !important;
  box-sizing: border-box !important;
}
/* Réduction des deux titres verts */
.ms-heading .eyebrow {
  font-size: 16px !important;
  letter-spacing: 3px !important;
  margin-bottom: 18px !important;
}

.ms-heading h1 {
  font-size: clamp(42px, 4.5vw, 62px) !important;
  line-height: 1.05;
}

.ms-heading h1 em {
  font-size: inherit !important;
}

@media (max-width: 600px) {
  .ms-heading h1 {
    font-size: 40px !important;
  }
}

/* =====================================
   STATISTIQUES QUOTIDIENNES
===================================== */

.ms-stats {
    margin: 35px auto;
    padding: 28px;
    max-width: 680px;
    background: #f3f8f4;
    border: 1px solid #dceade;
    border-radius: 16px;
    text-align: center;
}

.ms-stats h2 {
    margin: 0 0 22px;
    color: #174b32;
    font-size: 21px;
}

.ms-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.ms-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 20px;
    background: white;
    border: 1px solid #e2ebe3;
    border-radius: 12px;
}

.ms-stat-card span {
    color: #647568;
    font-size: 14px;
}

.ms-stat-card strong {
    color: #174b32;
    font-size: 32px;
    font-weight: 750;
}

.ms-stat-card small {
    color: #849287;
    font-size: 12px;
}

.ms-stats-count {
    margin: 18px 0 0;
    color: #829087;
    font-size: 13px;
}

/* =====================================
   RÉSULTAT ET PERCENTILE
===================================== */

.ms-final-score {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 20px 0;
}

.ms-final-score span {
    color: #647568;
    font-size: 14px;
}

.ms-final-score strong {
    color: #174b32;
    font-size: 36px;
}

.ms-percentile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    padding: 22px;
    background: #f0f7f1;
    border: 1px solid #dceade;
    border-radius: 12px;
}

.ms-percentile strong {
    color: #21834b;
    font-size: 30px;
}

.ms-percentile span {
    color: #52665a;
    font-size: 14px;
}

.ms-result-message {
    color: #647568;
    font-size: 14px;
}

@media (max-width: 500px) {
    .ms-stats {
        padding: 18px;
    }

    .ms-stats-grid {
        gap: 10px;
    }

    .ms-stat-card {
        padding: 14px 8px;
    }

    .ms-stat-card strong {
        font-size: 26px;
    }
}

.ms-cell.missed {
    background: #fff0f0 !important;
    border-color: #e5a5a5 !important;
    cursor: default;
}

.ms-cell.missed .ms-player-name {
    color: #a52c2c !important;
}

.ms-cell.missed .ms-player-points {
    color: #d04444 !important;
}
/* =========================================
   FOOTER — KICKDLE
========================================= */

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 66px;
    margin-top: 40px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    color: #9aa39d;
    font-size: 12px;
}

.site-footer .copyright {
    flex: 0 0 auto;
    margin-right: auto;
    white-space: nowrap;
}

.site-footer .copyright b {
    color: #78827b;
    font-weight: 750;
}

.site-footer nav.footer-links {
    position: static;
    left: auto;
    transform: none;
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    width: auto;
    gap: 30px;
    margin: 0 0 0 auto;
    padding: 0;
}

.site-footer .footer-links a {
    display: inline-block;
    flex: 0 0 auto;
    color: #9aa39d;
    font-size: 13px;
    font-weight: 450;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer .footer-links a:hover {
    color: var(--dark);
}

/* MOBILE */

@media (max-width: 640px) {
    .site-footer {
        flex-wrap: wrap;
        gap: 16px;
    }

    .site-footer nav.footer-links {
        position: static;
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 13px 20px;
        margin-left: 0;
    }
}

@media (max-width: 420px) {
    .site-footer nav.footer-links {
        justify-content: flex-start;
        column-gap: 16px;
    }
}