:root {
  --green: #0b7a3b;
  --green-dark: #075c2c;
  --green-light: #e8f5ee;
  --ink: #17202a;
  --muted: #6b7280;
  --line: #d8dee6;
  --bg: #f4f7f6;
  --panel: #ffffff;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 34px 40px;
  background: linear-gradient(135deg, var(--green), #15a85a);
  color: white;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
}

h1 { margin: 0; font-size: 42px; }

.subtitle {
  margin: 12px 0 0;
  max-width: 760px;
  font-size: 17px;
  line-height: 1.45;
  opacity: 0.92;
}

.header-actions, .actions, .add-player, .add-category {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.header-actions { justify-content: flex-end; }

.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 22px;
  padding: 28px 40px 40px;
}

.public-layout {
  grid-template-columns: 320px 1fr;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel.wide { grid-column: 1 / -1; }
.public-layout .panel.wide { grid-column: auto; }

h2 { margin: 0 0 18px; font-size: 22px; }
h3 { margin: 0 0 16px; font-size: 19px; }

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.section-title h2, .section-title h3 { margin: 0; }

.badge, .status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--green-light);
  color: var(--green-dark);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status {
  background: rgba(255,255,255,0.16);
  color: white;
}

.form-grid { display: grid; gap: 14px; }

label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: white;
}

textarea { min-height: 42px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(11, 122, 59, 0.16);
  border-color: var(--green);
}

button, .link-button {
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: white;
  padding: 11px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

button:hover, .link-button:hover { background: var(--green-dark); }

button.secondary, .link-button.secondary {
  background: white;
  color: var(--green-dark);
  border: 1px solid rgba(255,255,255,0.55);
}

.panel button.secondary { border-color: var(--line); }

button.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.2);
}

button.danger:hover { background: #ffe4e0; }

button.small {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.add-player { display: grid; grid-template-columns: 130px 1fr auto; }
.add-category { display: grid; grid-template-columns: 1fr 130px auto; }

.categories-list, .players-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  max-height: 320px;
  overflow: auto;
}

.category-row, .player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #fbfcfd;
}

.category-row.active {
  border-color: var(--green);
  background: var(--green-light);
}

.category-row-main {
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.category-name, .player-name { font-weight: 700; }

.category-meta {
  color: var(--muted);
  font-size: 13px;
}

.hint {
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
  margin-bottom: 0;
}

.empty {
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 34px;
  text-align: center;
  color: var(--muted);
  background: #fbfcfd;
}

.hidden { display: none !important; }

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  padding-bottom: 10px;
}

.tab {
  background: white;
  color: var(--green-dark);
  border: 1px solid var(--line);
}

.tab.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.bulk-add {
  display: grid;
  gap: 10px;
  margin: 14px 0 4px;
}

.bulk-add textarea { min-height: 120px; }

.bracket-wrap {
  overflow-x: auto;
  padding-bottom: 12px;
}

.bracket-grid {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  min-width: max-content;
}

.round {
  width: 310px;
  display: grid;
  gap: 18px;
}

.round h3 {
  margin: 0;
  background: var(--green-light);
  color: var(--green-dark);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 16px;
}

.match {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.match-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 11px 12px;
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.player-slot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f4;
}

.player-slot.winner { background: var(--green-light); }
.player-slot .name { font-weight: 700; }

.player-slot .placeholder {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}

.match-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.match-body .two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.match-footer {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

.champion {
  margin-top: 20px;
  border: 2px solid var(--green);
  border-radius: 16px;
  padding: 18px;
  background: var(--green-light);
}

.champion h3 {
  margin: 0 0 6px;
  color: var(--green-dark);
}

.champion p {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.table-actions {
  margin-bottom: 14px;
  max-width: 520px;
}

.matches-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.matches-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1050px;
  background: white;
}

.matches-table th,
.matches-table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px;
  vertical-align: middle;
  font-size: 14px;
}

.matches-table th {
  background: #fbfcfd;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.matches-table tr:last-child td { border-bottom: 0; }

.matches-table input,
.matches-table textarea {
  min-width: 120px;
}

.matches-table .score-cell textarea { min-width: 150px; }

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 8px;
  background: #eef2f7;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.done {
  background: var(--green-light);
  color: var(--green-dark);
}

.public-page input,
.public-page textarea,
.public-page select {
  pointer-events: none;
  background: #f7f8fa;
}

.public-page #matchSearch {
  pointer-events: auto;
  background: white;
}

.public-page .admin-only,
.public-page .match-footer {
  display: none !important;
}

footer {
  color: var(--muted);
  text-align: center;
  padding: 0 20px 30px;
  font-size: 14px;
}

@media (max-width: 900px) {
  .app-header, .layout {
    padding-left: 18px;
    padding-right: 18px;
  }

  .app-header { flex-direction: column; }
  h1 { font-size: 34px; }
  .layout, .public-layout { grid-template-columns: 1fr; }
  .panel.wide, .public-layout .panel.wide { grid-column: auto; }
  .round { width: 285px; }
  .add-category { grid-template-columns: 1fr; }
}


.seeded-player-row {
  display: grid;
  grid-template-columns: 115px 1fr auto;
}

.seed-field {
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.seed-input {
  min-width: 70px;
  padding: 8px 9px;
}

.bracket-info {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
}

.readonly-value {
  display: inline-block;
  min-width: 80px;
  font-weight: 700;
}

.readonly-match-details {
  display: grid;
  gap: 8px;
}

.readonly-match-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #eef1f4;
  padding-bottom: 7px;
}

.readonly-match-details div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.readonly-match-details strong {
  color: var(--muted);
  font-size: 13px;
}

.public-page .matches-table th:first-child,
.public-page .matches-table td:first-child,
.public-page .matches-table th:nth-child(2),
.public-page .matches-table td:nth-child(2) {
  background: #fbfcfd;
}

.public-page .matches-table td:first-child,
.public-page .matches-table td:nth-child(2) {
  font-weight: 800;
}

@media (max-width: 900px) {
  .add-player {
    grid-template-columns: 1fr;
  }

  .seeded-player-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  .public-page .matches-table,
  .public-page .matches-table thead,
  .public-page .matches-table tbody,
  .public-page .matches-table th,
  .public-page .matches-table td,
  .public-page .matches-table tr {
    display: block;
  }

  .public-page .matches-table {
    min-width: 0;
  }

  .public-page .matches-table thead {
    display: none;
  }

  .public-page .matches-table tr {
    margin: 0 0 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: white;
  }

  .public-page .matches-table td {
    border-bottom: 1px solid #eef1f4;
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }

  .public-page .matches-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
  }
}


/* V6.4 — Vue publique de progression type tableau de tournoi */
.public-page .app-header {
  padding: 24px 40px;
}

.public-page .layout.public-layout {
  grid-template-columns: 280px minmax(0, 1fr);
}

.public-page .tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel);
}

.public-bracket-intro {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  margin-bottom: 14px;
  color: var(--muted);
}

.public-bracket-intro strong {
  color: var(--ink);
  font-size: 18px;
}

.bracket-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.bracket-summary span {
  border: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
}

.progression-bracket-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
  padding: 16px;
}

.progression-bracket-grid {
  gap: 46px;
  padding: 8px 8px 18px;
  align-items: flex-start;
}

.progression-round {
  display: flex;
  flex-direction: column;
  gap: var(--round-gap);
  padding-top: var(--round-top);
  min-width: 285px;
  position: relative;
}

.progression-round h3 {
  position: sticky;
  top: 58px;
  z-index: 4;
  margin-bottom: 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.public-bracket-match {
  position: relative;
  border-radius: 12px;
  box-shadow: none;
  border: 1px solid #cfd7df;
  min-height: 150px;
}

.public-bracket-match::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -47px;
  width: 47px;
  border-top: 2px solid #cfd7df;
}

.progression-round:last-child .public-bracket-match::after {
  display: none;
}

.public-bracket-match.match-complete {
  border-color: rgba(11, 122, 59, 0.45);
}

.public-bracket-match .match-header {
  background: #f7faf8;
  color: var(--green-dark);
  font-size: 12px;
}

.public-bracket-match .match-body {
  padding: 10px 12px;
}

.player-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.seed-badge {
  width: 24px;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2f7;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.muted-seed {
  opacity: 0.45;
}

.winner-mark {
  font-weight: 900;
  color: var(--green-dark);
}

.public-page .player-slot {
  padding: 11px 12px;
}

.public-page .player-slot.winner {
  background: var(--green-light);
  border-left: 4px solid var(--green);
}

.public-page .player-slot .name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-details {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.compact-details span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.compact-details strong {
  color: var(--ink);
}

.public-page .champion {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .public-page .app-header {
    padding: 22px 18px;
  }

  .public-page .layout.public-layout {
    grid-template-columns: 1fr;
  }

  .progression-bracket-wrap {
    padding: 12px;
  }

  .progression-bracket-grid {
    gap: 34px;
  }

  .progression-round {
    min-width: 260px;
  }

  .public-bracket-match::after {
    right: -35px;
    width: 35px;
  }
}


/* V6.5 — Tableau classique de tournoi, style bracket 32/16/8 */
.classic-bracket-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
}

.classic-scroll-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}

.classic-summary {
  margin-bottom: 10px;
}

.classic-bracket-shell {
  display: grid;
  grid-template-columns: max-content 280px max-content;
  gap: 52px;
  align-items: stretch;
  min-width: max-content;
  padding: 12px;
}

.classic-side {
  display: flex;
  align-items: stretch;
  gap: 38px;
}

.classic-left {
  justify-content: flex-end;
}

.classic-right {
  justify-content: flex-start;
}

.classic-round {
  width: 255px;
  display: flex;
  flex-direction: column;
}

.classic-round h3 {
  margin: 0 0 14px;
  background: var(--green-light);
  color: var(--green-dark);
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
}

.classic-match-list {
  display: flex;
  flex-direction: column;
  gap: var(--group-gap);
}

.classic-pair {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--pair-gap);
}

.classic-left .classic-pair:not(.single-pair)::after {
  content: "";
  position: absolute;
  top: 49px;
  bottom: 49px;
  right: -18px;
  border-right: 2px solid #cfd7df;
}

.classic-left .classic-pair:not(.single-pair)::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -38px;
  width: 20px;
  border-top: 2px solid #cfd7df;
}

.classic-right .classic-pair:not(.single-pair)::after {
  content: "";
  position: absolute;
  top: 49px;
  bottom: 49px;
  left: -18px;
  border-left: 2px solid #cfd7df;
}

.classic-right .classic-pair:not(.single-pair)::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -38px;
  width: 20px;
  border-top: 2px solid #cfd7df;
}

.classic-match {
  position: relative;
  width: 255px;
  min-height: 108px;
  border: 1px solid #cfd7df;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.classic-left .classic-match::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -18px;
  width: 18px;
  border-top: 2px solid #cfd7df;
}

.classic-right .classic-match::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -18px;
  width: 18px;
  border-top: 2px solid #cfd7df;
}

.classic-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  position: relative;
}

.classic-center::before,
.classic-center::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 34px;
  border-top: 2px solid #cfd7df;
}

.classic-center::before {
  left: -42px;
}

.classic-center::after {
  right: -42px;
}

.classic-final-title {
  text-align: center;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 13px;
}

.classic-final-match {
  border: 2px solid var(--green);
  box-shadow: 0 8px 20px rgba(11, 122, 59, 0.12);
}

.classic-match.complete {
  border-color: rgba(11, 122, 59, 0.55);
}

.classic-match-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: #f7faf8;
  border-bottom: 1px solid #e6ebef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.classic-score {
  color: var(--green-dark);
  white-space: nowrap;
}

.classic-player {
  min-height: 33px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  gap: 7px;
  align-items: center;
  padding: 7px 10px;
  border-bottom: 1px solid #eef1f4;
  font-weight: 700;
}

.classic-player.winner {
  background: var(--green-light);
  border-left: 4px solid var(--green);
  padding-left: 6px;
}

.classic-player.empty-player {
  color: var(--muted);
  font-weight: 500;
  font-style: italic;
}

.classic-seed {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475467;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  font-style: normal;
}

.classic-player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classic-check {
  color: var(--green-dark);
  font-weight: 900;
}

.classic-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
}

.classic-champion {
  margin-top: 12px;
  border: 2px solid var(--green);
  border-radius: 12px;
  background: var(--green-light);
  padding: 12px;
  text-align: center;
}

.classic-champion span {
  display: block;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.classic-champion strong {
  font-size: 18px;
}

@media (max-width: 900px) {
  .classic-bracket-wrap {
    padding: 12px;
  }

  .classic-bracket-shell {
    gap: 42px;
    padding: 8px;
  }

  .classic-side {
    gap: 30px;
  }

  .classic-round,
  .classic-match {
    width: 235px;
  }

  .classic-bracket-shell {
    grid-template-columns: max-content 250px max-content;
  }
}


/* V6.8 — outils d'administration, validations et sauvegardes */
.backup-import-label input {
  display: none;
}

.note-cell textarea {
  min-width: 180px;
}

.classic-title-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.classic-status {
  color: #475467;
  background: #eef2f7;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 11px;
}

.classic-note {
  padding: 6px 10px 8px;
  font-size: 12px;
  color: var(--muted);
  background: #fffdf5;
  border-top: 1px solid #f3e7b5;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.court-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.court-card h3 {
  margin: 0;
  padding: 12px 14px;
  background: var(--green-light);
  color: var(--green-dark);
}

.court-match-list {
  display: grid;
}

.court-match-row {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.court-match-row strong {
  color: var(--green-dark);
}

.court-match-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.checks-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.check-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}

.check-card strong {
  display: block;
  font-size: 24px;
  margin-bottom: 4px;
}

.check-card.good {
  border-color: rgba(11, 122, 59, 0.35);
  background: var(--green-light);
}

.check-card.warn {
  border-color: #f0c36d;
  background: #fff8e6;
}

.check-card.bad {
  border-color: rgba(180, 35, 24, 0.35);
  background: var(--danger-bg);
}

.issues-list {
  display: grid;
  gap: 10px;
}

.issue {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.issue.error {
  border-left-color: var(--danger);
}

.issue.warning {
  border-left-color: #d68b00;
}

.issue p {
  margin: 6px 0 0;
  color: var(--muted);
}

.success-empty {
  border-color: rgba(11, 122, 59, 0.35);
  color: var(--green-dark);
  background: var(--green-light);
}

@media (max-width: 760px) {
  .public-page .tabs {
    justify-content: stretch;
  }

  .public-page .tab {
    flex: 1;
    justify-content: center;
  }

  .classic-bracket-wrap {
    max-height: none;
  }
}


/* V6.9 — Vue publique simplifiée pour mobile */
.public-simple-intro {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  margin-bottom: 14px;
  color: var(--muted);
}

.public-simple-intro strong {
  color: var(--ink);
  font-size: 18px;
}

.simple-match-groups {
  display: grid;
  gap: 22px;
}

.simple-group h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--green-dark);
}

.simple-card-list {
  display: grid;
  gap: 12px;
}

.simple-match-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.simple-match-card.done {
  border-color: rgba(11, 122, 59, 0.32);
}

.simple-match-card.alert {
  border-color: rgba(180, 35, 24, 0.32);
}

.simple-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--green-light);
  color: var(--green-dark);
  font-weight: 900;
}

.simple-time {
  font-size: 18px;
}

.simple-court {
  text-align: right;
}

.simple-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid #eef1f4;
}

.simple-players {
  display: grid;
}

.simple-players div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid #eef1f4;
}

.simple-players div.winner {
  background: var(--green-light);
  border-left: 4px solid var(--green);
  padding-left: 10px;
}

.simple-players span {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475467;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
}

.simple-players strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-score,
.simple-winner,
.simple-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 14px;
  border-bottom: 1px solid #eef1f4;
}

.simple-winner {
  color: var(--green-dark);
}

.simple-note {
  display: block;
  background: #fff8e6;
  color: #7a5b00;
  border-bottom: 0;
}

.small-empty {
  padding: 18px;
}

/* Sur téléphone, la vue simplifiée est volontairement plus utile que le grand tableau.
   Le tableau classique reste disponible dans son onglet, mais il défile horizontalement. */
@media (max-width: 700px) {
  .public-page .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .public-page .tab {
    white-space: nowrap;
  }

  .simple-card-top {
    align-items: flex-start;
  }

  .simple-time {
    font-size: 17px;
  }
}


/* V6.10 — édition des noms après génération */
.editable-player-row {
  grid-template-columns: 105px minmax(220px, 1fr) auto;
  display: grid;
  align-items: end;
}

.name-field {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

.name-input {
  min-width: 220px;
}

@media (max-width: 700px) {
  .editable-player-row {
    grid-template-columns: 1fr;
  }

  .name-input {
    min-width: 0;
  }
}


/* V6.12 — Date de match et stabilité de la catégorie publique */
.simple-card-top {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr;
  align-items: center;
}

.simple-date {
  font-weight: 900;
}

.classic-meta-stacked {
  display: grid;
  gap: 4px;
}

@media (max-width: 700px) {
  .simple-card-top {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .simple-court {
    text-align: left;
  }
}


/* V6.13 — Administration verrouillée */
#adminLoginPanel {
  border: 2px solid rgba(11, 122, 59, 0.18);
}

#adminPassword:disabled {
  background: #f3f6f4;
  color: #475467;
}

.admin-page .admin-protected.hidden {
  display: none !important;
}


/* V6.14 — Fiabilité mobile */
button,
.link-button,
.category-select-button,
.tab,
select {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(11, 122, 59, 0.18);
}

button,
.link-button,
.tab,
.mobile-category-select {
  min-height: 44px;
}

.category-select-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.category-select-button:hover {
  background: transparent;
  color: inherit;
}

.mobile-category-select {
  display: none;
  margin: 10px 0 14px;
  font-weight: 800;
  border: 2px solid rgba(11, 122, 59, 0.28);
  background: #ffffff;
}

@media (max-width: 700px) {
  .app-header {
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .public-page .layout.public-layout {
    gap: 14px;
  }

  .public-page .mobile-category-select,
  .admin-page .mobile-category-select {
    display: block;
  }

  .public-page .categories-list {
    display: grid;
    max-height: none;
    overflow: visible;
    margin-top: 10px;
  }

  .public-page .tabs {
    position: static !important;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow: visible;
    flex-wrap: initial;
    z-index: auto;
    padding-bottom: 12px;
  }

  .public-page .tab {
    width: 100%;
    justify-content: center;
    font-size: 16px;
    padding: 13px 14px;
  }

  .public-page .panel {
    padding: 18px;
    border-radius: 16px;
  }

  .public-page .section-title {
    align-items: flex-start;
  }

  .public-page #categoryWorkspace {
    min-height: 360px;
  }
}


/* V6.17 — Catégories plus fiables sur mobile */
.mobile-category-hint {
  display: none;
}

@media (max-width: 700px) {
  .mobile-category-hint {
    display: block;
    margin: 8px 0 10px;
  }

  .public-page .category-row,
  .admin-page .category-row {
    padding: 0;
    overflow: hidden;
  }

  .public-page .category-select-button,
  .admin-page .category-select-button {
    min-height: 58px;
    padding: 13px 14px;
    border-radius: 10px;
  }

  .public-page .category-row.active .category-select-button,
  .admin-page .category-row.active .category-select-button {
    background: var(--green-light);
  }

  .public-page .category-name,
  .admin-page .category-name {
    font-size: 16px;
  }

  .public-page .category-meta,
  .admin-page .category-meta {
    font-size: 13px;
  }

  .public-page .mobile-category-select,
  .admin-page .mobile-category-select {
    margin-bottom: 8px;
  }
}


/* V6.18 — Sélecteur public mobile indépendant */
.public-mobile-category-switcher {
  display: none;
}

.mobile-switcher-title {
  font-weight: 900;
  color: var(--green-dark);
  margin-bottom: 10px;
}

.mobile-switcher-buttons {
  display: grid;
  gap: 10px;
}

.mobile-category-button {
  width: 100%;
  border: 2px solid var(--line);
  background: #ffffff;
  border-radius: 14px;
  padding: 14px;
  text-align: left;
  display: grid;
  gap: 4px;
  min-height: 58px;
}

.mobile-category-button span {
  font-weight: 900;
  color: var(--ink);
}

.mobile-category-button small {
  color: var(--muted);
  font-weight: 800;
}

.mobile-category-button.active {
  border-color: var(--green);
  background: var(--green-light);
}

@media (max-width: 700px) {
  .public-mobile-category-switcher {
    display: block;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfcfd;
  }

  .public-page .layout > section.panel:first-child {
    display: none;
  }

  .public-page .mobile-switcher-buttons {
    grid-template-columns: 1fr;
  }
}


/* V6.19 — Multi-tournois et tableau classique optimisé */
.tournament-manager-panel .tournament-create-row {
  margin-top: 12px;
}

.public-tournament-select {
  width: 100%;
  margin-bottom: 12px;
  font-weight: 800;
}

.public-tournament-buttons {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.public-tournament-button {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 12px;
  padding: 11px 12px;
  text-align: left;
  display: grid;
  gap: 3px;
  min-height: 48px;
}

.public-tournament-button span {
  font-weight: 900;
  color: var(--ink);
}

.public-tournament-button small {
  color: var(--muted);
  font-weight: 700;
}

.public-tournament-button.active {
  border-color: var(--green);
  background: var(--green-light);
}

.category-section-title {
  margin-top: 16px;
}

.public-tournament-switcher-main {
  display: none;
}

/* Tableau classique : alignement plus stable entre les rondes. */
.classic-bracket-shell {
  gap: 64px;
  align-items: start;
  padding: 18px 18px 28px;
}

.classic-side {
  align-items: flex-start;
  gap: 46px;
}

.classic-round {
  width: 272px;
}

.classic-match-list-aligned {
  gap: var(--match-gap) !important;
  padding-top: var(--round-offset);
}

.classic-pair,
.classic-left .classic-pair:not(.single-pair)::after,
.classic-left .classic-pair:not(.single-pair)::before,
.classic-right .classic-pair:not(.single-pair)::after,
.classic-right .classic-pair:not(.single-pair)::before {
  display: contents;
  content: none;
}

.classic-match {
  width: 272px;
  height: var(--match-height, 154px);
  min-height: var(--match-height, 154px);
  display: flex;
  flex-direction: column;
}

.classic-match-title {
  min-height: 38px;
}

.classic-meta {
  margin-top: auto;
}

.classic-note {
  max-height: 28px;
  overflow: hidden;
}

.classic-left .classic-match::after {
  right: -24px;
  width: 24px;
}

.classic-right .classic-match::before {
  left: -24px;
  width: 24px;
}

.classic-center {
  min-width: 292px;
  padding-top: 44px;
}

@media (max-width: 900px) {
  .classic-side {
    gap: 34px;
  }

  .classic-round,
  .classic-match {
    width: 250px;
  }

  .classic-bracket-shell {
    gap: 46px;
    grid-template-columns: max-content 260px max-content;
  }
}

@media (max-width: 700px) {
  .public-tournament-switcher-main {
    display: block;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfcfd;
  }

  .public-page .layout > section.panel:first-child .public-tournament-switcher,
  .public-page .layout > section.panel:first-child .public-tournament-select,
  .public-page .layout > section.panel:first-child .category-section-title {
    display: none;
  }
}


/* V6.20 — Terrain plus visible dans le tableau classique */
.classic-meta-schedule {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 7px 10px 4px;
  color: var(--muted);
  font-size: 12px;
  margin-top: auto;
}

.classic-date,
.classic-time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classic-time {
  text-align: right;
  font-weight: 800;
  color: var(--ink);
}

.classic-court {
  margin: 4px 10px 9px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--green-light);
  border: 1px solid rgba(11, 122, 59, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.classic-court span {
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.classic-court strong {
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 950;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classic-court-missing {
  background: #fff8e6;
  border-color: rgba(185, 128, 0, 0.35);
}

.classic-court-missing span,
.classic-court-missing strong {
  color: #7a5b00;
}

/* La V6.19 forçait la hauteur des cartes à 154px. On l'augmente ici pour éviter que le terrain soit comprimé. */
.classic-match {
  height: var(--match-height, 178px);
  min-height: var(--match-height, 178px);
}

.classic-note {
  margin: 0 10px 9px;
  border-radius: 8px;
}

@media (max-width: 900px) {
  .classic-court strong {
    font-size: 13px;
  }
}

@media (max-width: 700px) {
  .classic-meta-schedule {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .classic-time {
    text-align: left;
  }

  .classic-court {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .classic-court strong {
    text-align: left;
    white-space: normal;
  }
}


/* V6.21 — Vue simplifiée admin et catégories publiques épurées */
.admin-simple-intro {
  margin-bottom: 14px;
}

.simple-admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid #eef1f4;
  background: #fbfcfd;
}

.simple-admin-actions button {
  flex: 1 1 130px;
}

.public-page .category-row .category-meta {
  opacity: 0.85;
}

.public-page .bracket-summary.classic-summary {
  justify-content: flex-start;
}

.public-page .bracket-summary.classic-summary span {
  background: #ffffff;
}


/* V6.21.3 — Terrain mobile compact dans le tableau classique */
.classic-title-left {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.classic-mobile-court-pill {
  display: none;
}

@media (max-width: 700px) {
  .classic-match-title {
    align-items: start;
    gap: 8px;
  }

  .classic-title-left > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .classic-mobile-court-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--green-light);
    border: 1px solid rgba(11, 122, 59, 0.32);
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 950;
    line-height: 1.15;
    white-space: nowrap;
  }

  .classic-mobile-court-pill-missing {
    background: #fff8e6;
    border-color: rgba(185, 128, 0, 0.35);
    color: #7a5b00;
  }

  /* Sur mobile, on masque l'ancien encadré du bas pour ne pas répéter le terrain. */
  .classic-match .classic-court {
    display: none;
  }

  .classic-match {
    min-height: var(--match-height, 178px);
  }
}


/* V6.21.5 — Classement facile à déplacer */
.rank-tools {
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid rgba(11, 122, 59, 0.22);
  border-radius: 14px;
  background: #fbfcfd;
  display: grid;
  gap: 12px;
}

.rank-tools-text {
  display: grid;
  gap: 3px;
}

.rank-tools-text strong {
  color: var(--green-dark);
}

.rank-tools-text span {
  color: var(--muted);
  font-size: 13px;
}

.rank-tools-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rank-editable-row {
  grid-template-columns: 100px 105px minmax(220px, 1fr) auto auto;
  gap: 10px;
}

.selected-rank-row {
  border-color: rgba(11, 122, 59, 0.45);
  background: var(--green-light);
}

.rank-position-button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  display: grid;
  place-items: center;
  gap: 1px;
  cursor: pointer;
  font-weight: 900;
}

.rank-position-button span {
  font-size: 18px;
  line-height: 1;
}

.rank-position-button small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
}

.rank-position-button.active {
  border-color: var(--green);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(11, 122, 59, 0.12);
}

.rank-position-button.active span,
.rank-position-button.active small {
  color: var(--green-dark);
}

.rank-row-actions {
  display: flex;
  gap: 6px;
  align-items: end;
}

.rank-row-actions button {
  min-width: 42px;
}

@media (max-width: 700px) {
  .rank-tools-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .rank-tools-actions button {
    width: 100%;
  }

  .rank-editable-row {
    grid-template-columns: 1fr;
  }

  .rank-row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .rank-row-actions button {
    width: 100%;
    min-height: 44px;
  }

  .rank-position-button {
    min-height: 58px;
  }
}


/* V6.21.6 — Alignement des exemptions dans le tableau classique */
.classic-bye-spacer {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.classic-bye-spacer::before,
.classic-bye-spacer::after {
  display: none !important;
  content: none !important;
}

.classic-bye-spacer * {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


/* V6.21.8 — Annuler le gagnant d'un match */
.clear-winner-btn {
  white-space: nowrap;
}

.match-action-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.simple-admin-actions .clear-winner-btn {
  flex-basis: 100%;
}

@media (max-width: 700px) {
  .simple-admin-actions .clear-winner-btn,
  .match-footer .clear-winner-btn {
    width: 100%;
  }

  .match-action-cell {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .match-action-cell .clear-winner-btn {
    grid-column: 1 / -1;
  }
}


/* V6.21.13 — Vue par terrain ordonnée */
.court-order-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.court-dashboard-grid {
  align-items: start;
}

.ordered-court-card {
  overflow: hidden;
}

.court-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: -18px -18px 14px;
  padding: 14px 18px;
  background: var(--green-light);
  border-bottom: 1px solid rgba(11, 122, 59, 0.18);
}

.court-card-header h3 {
  margin: 0;
  color: var(--green-dark);
}

.court-card-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.ordered-court-match-row strong {
  color: var(--ink);
}

.ordered-court-match-row span:last-child {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 700px) {
  .court-card-header {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* V6.21.14 — Vue par terrain améliorée */
.court-order-note-enhanced {
  display: grid;
  gap: 4px;
  border-left: 5px solid var(--green);
}

.court-order-note-enhanced strong {
  color: var(--green-dark);
}

.court-order-note-enhanced span {
  color: var(--muted);
  font-weight: 700;
}

.court-dashboard-list {
  display: grid;
  gap: 18px;
}

.court-schedule-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}

.court-schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--green-light);
  border-bottom: 1px solid rgba(11, 122, 59, 0.18);
}

.court-schedule-header h3 {
  margin: 0;
  color: var(--green-dark);
  font-size: 20px;
}

.court-schedule-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.court-schedule-header > span {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.court-schedule-list {
  display: grid;
}

.court-schedule-match {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr) 115px;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.court-schedule-match:last-child {
  border-bottom: 0;
}

.court-schedule-time {
  display: grid;
  gap: 3px;
}

.court-schedule-time strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.1;
}

.court-schedule-time span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.court-schedule-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.court-schedule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.court-schedule-meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f2f4f7;
}

.court-schedule-meta .court-match-number {
  background: var(--green-light);
  color: var(--green-dark);
}

.court-schedule-players {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.court-schedule-players em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.court-schedule-players .winner {
  color: var(--green-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.court-schedule-score {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.court-schedule-status {
  justify-self: end;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f2f4f7;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.court-schedule-status.is-completed {
  background: #eef7f0;
  color: var(--green-dark);
}

.court-completed-divider {
  padding: 10px 18px;
  background: #fbfcfd;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.court-schedule-match-completed {
  background: #fbfcfd;
}

.court-schedule-match-completed .court-schedule-time,
.court-schedule-match-completed .court-schedule-meta,
.court-schedule-match-completed .court-schedule-players {
  opacity: 0.78;
}

@media (max-width: 850px) {
  .court-schedule-match {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .court-schedule-status {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 600px) {
  .court-schedule-header {
    flex-direction: column;
  }

  .court-schedule-match {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 14px;
  }

  .court-schedule-time {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
  }

  .court-schedule-time strong {
    font-size: 19px;
  }

  .court-schedule-status {
    justify-self: stretch;
  }

  .court-completed-divider {
    padding: 9px 14px;
  }
}


/* V6.21.15 — Vue admin par date avec suivi des balles */
.date-schedule-note {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 12px;
  background: #fbfcfd;
  display: grid;
  gap: 4px;
}

.date-schedule-note strong {
  color: var(--green-dark);
}

.date-schedule-note span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.date-schedule-list {
  display: grid;
  gap: 20px;
}

.date-schedule-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}

.date-schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 17px 19px;
  background: var(--green-light);
  border-bottom: 1px solid rgba(11, 122, 59, 0.18);
}

.date-schedule-header h3 {
  margin: 0;
  color: var(--green-dark);
  font-size: 22px;
}

.date-schedule-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.date-schedule-header > span {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.date-court-list {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.date-court-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #ffffff;
  overflow: hidden;
}

.date-court-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
}

.date-court-header h4 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.date-court-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.date-court-header > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.date-match-list {
  display: grid;
}

.date-match-row {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr) 155px;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.date-match-row:last-child {
  border-bottom: 0;
}

.date-match-time {
  display: grid;
  gap: 4px;
}

.date-match-time strong {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.1;
}

.date-match-time span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f2f4f7;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.date-match-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.date-match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.date-match-meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f2f4f7;
}

.date-match-meta .date-match-number {
  background: var(--green-light);
  color: var(--green-dark);
}

.date-match-players {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.date-match-players em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.date-match-players .winner {
  color: var(--green-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.date-match-score {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.balls-given-check {
  justify-self: end;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.balls-given-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.date-match-balls-given .balls-given-check {
  border-color: rgba(11, 122, 59, 0.35);
  background: var(--green-light);
  color: var(--green-dark);
}

.date-completed-divider {
  padding: 9px 14px;
  background: #fbfcfd;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.date-match-row-completed {
  background: #fbfcfd;
}

.date-match-row-completed .date-match-time,
.date-match-row-completed .date-match-meta,
.date-match-row-completed .date-match-players {
  opacity: 0.76;
}

@media (max-width: 850px) {
  .date-match-row {
    grid-template-columns: 95px minmax(0, 1fr);
  }

  .balls-given-check {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 600px) {
  .date-schedule-header,
  .date-court-header {
    flex-direction: column;
  }

  .date-court-list {
    padding: 11px;
  }

  .date-match-row {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 13px;
  }

  .date-match-time {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
  }

  .date-match-time strong {
    font-size: 20px;
  }

  .balls-given-check {
    justify-self: stretch;
    justify-content: center;
  }

  .date-completed-divider {
    padding: 9px 13px;
  }
}
