/* ── Page header ──────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
}
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-toggle-finished {
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}
.btn-toggle-finished:hover { background: #f1f5f9; }
.btn-toggle-finished.active { background: #f0fdf4; border-color: #86efac; color: #166534; }
.page-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
}
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .03em;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}

/* ── Tabs ─────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 20px;
  background: #e2e8f0;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.tab-btn.active {
  background: #2563eb;
  color: #fff;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Filtre groupes ───────────────────────────────── */
.group-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  width: fit-content;
}
.filter-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.filter-btn:hover {
  color: #1e293b;
  background: #e2e8f0;
}
.filter-btn.active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ── Day header ───────────────────────────────────── */
.day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin: 24px 0 4px;
  letter-spacing: .02em;
}
.day-header::before,
.day-header::after {
  content: '';
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  border-radius: 1px;
}

/* ── Section titre ────────────────────────────────── */
.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin: 14px 0 6px;
}

/* ── Match card ───────────────────────────────────── */
.match-list { display: flex; flex-direction: column; gap: 8px; }

.match-card {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto minmax(0, 1fr);
  align-items: center;
  gap: 6px 10px;
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: box-shadow .15s, border-color .15s;
  overflow: hidden;
}
.match-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); border-color: #d0daea; }
.match-card[data-status="finished"] { background: #fafbfd; }
.match-card.sortable-ghost { opacity: .4; }
.match-card.sortable-chosen { box-shadow: 0 4px 16px rgba(37,99,235,.2); }
.match-card.touch-arming {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(37,99,235,.16);
  background: #f8fbff;
}

.match-card.sets-mode {
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 8px 10px;
}

.score-zone.score-zone-hidden {
  display: none !important;
}

.sets-card-head {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sets-card-head .match-time,
.sets-card-head .match-meta,
.sets-card-head .match-venue {
  grid-column: auto;
  grid-row: auto;
  margin: 0;
}

.sets-grid {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sets-grid-header,
.sets-grid-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) repeat(var(--sets-count, 5), minmax(40px, 48px));
  gap: 6px;
  align-items: center;
}

.sets-grid-header {
  margin-bottom: -2px;
}

.sets-grid-spacer {
  display: block;
}

.set-col-head {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sets-grid-team .team-cell,
.sets-grid-team .team-cell.right {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}

.sets-grid-team .team-name {
  white-space: nowrap;
}

.set-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.set-cell-display {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.set-input-grid {
  width: 100%;
  height: 38px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.set-input-grid:focus {
  box-shadow: none;
}

.save-btn-grid {
  grid-column: 2;
  justify-self: end;
  position: static;
  transform: none;
  margin-top: 2px;
}

/* Drag handle */
.drag-handle {
  color: #cbd5e1;
  cursor: grab;
  font-size: 18px;
  line-height: 1;
  user-select: none;
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.no-drag { width: 20px; }

/* Team cell */
.team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.team-cell.right {
  flex-direction: row-reverse;
  text-align: right;
}
.team-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #e2e8f0;
}
.team-initials {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.team-name {
  font-weight: 600;
  font-size: 14px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-cell.team-loser {
  opacity: .42;
}
.team-placeholder {
  font-size: 13px;
  color: #94a3b8;
  font-style: italic;
}

/* Score zone */
.score-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-column: 3;
  flex-shrink: 0;
  min-width: 132px;
  margin-left: 34px;
}
.score-tools {
  grid-column: 4;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: -18px;
}

.score-controls {
  display: flex;
  align-items: center;
}
.finish-type-select {
  height: 22px;
  padding: 0 2px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  width: 42px;
  min-width: 42px;
  text-align: center;
  text-align-last: center;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  cursor: pointer;
}
.finish-type-select:focus {
  outline: none;
  color: #0f172a;
  box-shadow: none;
}
.score-input {
  width: 52px;
  height: 36px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  border: 1.5px solid #dde3ed;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  transition: border-color .2s, box-shadow .2s;
}
.score-zone .score-input + .score-sep,
.score-zone .score-display + .score-sep {
  margin: 0 4px;
}
.score-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
  background: #fff;
}
.score-input:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.score-sep {
  font-weight: 800;
  color: #64748b;
  font-size: 15px;
}
.score-display {
  min-width: 28px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.01em;
}

.match-shootout-summary {
  grid-column: 1 / -1;
  grid-row: 2;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: .02em;
}

.match-shootout-editor {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  justify-content: center;
  gap: 4px;
  align-items: center;
}

.shootout-total-input {
  width: 34px;
  height: 24px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  padding: 0 4px;
}

.shootout-total-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

.shootout-total-sep {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

/* Save button */
.save-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #22c55e;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .15s;
  flex-shrink: 0;
}
.save-btn.visible {
  opacity: 1;
  pointer-events: auto;
}
.save-btn:hover { transform: scale(1.1); }
.save-btn.saving { background: #94a3b8; }
.save-btn.saved  { background: #2563eb; }

.save-btn-mobile {
  display: none;
}

/* Heure du match — centrée sous le score */
.match-time {
  grid-column: 1 / -1;
  grid-row: 4;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: .02em;
}

/* Match meta (journée / groupe) — centré sous le score */
.match-meta {
  grid-column: 1 / -1;
  grid-row: 5;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
}

.match-set-summary {
  grid-column: 1 / -1;
  grid-row: 3;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  letter-spacing: .01em;
}

.match-sets-editor {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.match-set-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
}

.match-set-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: .03em;
}

.set-input {
  width: 38px;
  height: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
}

.set-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* Venue tag sur la carte match — centré sous le meta */
.match-venue {
  grid-column: 1 / -1;
  grid-row: 6;
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Filtre venue global */
.venue-filter-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.venue-filter-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  flex-shrink: 0;
}

/* ── Mobile (≤ 600px) ─────────────────────────────── */
@media (max-width: 600px) {
  .match-list,
  .match-card,
  .team-cell,
  .team-name,
  .match-meta,
  .match-time,
  .match-venue {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
  .match-card {
    -webkit-tap-highlight-color: transparent;
  }
  .score-input {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
  }
  .shootout-total-input,
  .finish-type-select {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
  }
  .set-input {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
    width: 34px;
    height: 26px;
    font-size: 12px;
  }
  .group-filter {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 10px;
    padding: 4px;
  }
  .group-filter::-webkit-scrollbar { display: none; }
  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 18px;
    font-size: 14px;
  }

  /* Card mobile : 3 colonnes (handle masqué) */
  .match-card {
    grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr);
    gap: 4px 4px;
    padding: 10px 8px;
  }

  .match-card.sets-mode {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sets-card-head,
  .sets-grid,
  .save-btn-grid {
    grid-column: 1;
  }

  .sets-grid-header,
  .sets-grid-row {
    grid-template-columns: minmax(110px, 1fr) repeat(var(--sets-count, 5), minmax(28px, 34px));
    gap: 4px;
  }

  .sets-grid-team .team-cell,
  .sets-grid-team .team-cell.right {
    justify-content: flex-start;
    text-align: left;
  }

  .sets-grid-team .team-logo,
  .sets-grid-team .team-initials {
    width: 24px;
    height: 24px;
    margin: 0;
  }

  .sets-grid-team .team-name {
    font-size: 11px;
    text-align: left;
    display: block;
    line-height: 1.2;
  }

  .set-cell {
    min-height: 32px;
    border-radius: 8px;
  }

  .set-cell-display,
  .set-input-grid {
    font-size: 13px;
  }

  .set-input-grid {
    height: 30px;
  }

  .save-btn-grid {
    width: 28px;
    height: 28px;
    justify-self: end;
  }

  .drag-handle, .no-drag { display: none; }

  /* Équipes : logo + nom empilés verticalement */
  .team-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
  }
  .team-cell.right {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
  }

  .match-card:not(.sets-mode) > .team-cell {
    grid-row: 1;
  }

  .match-card:not(.sets-mode) > .score-zone {
    grid-column: 2;
    grid-row: 1;
  }

  .match-card:not(.sets-mode) > .score-tools {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }

  .match-card:not(.sets-mode) > .team-cell.right {
    grid-column: 4;
    grid-row: 1;
  }

  /* Score au centre : save-btn absolu */
  .score-zone {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    margin-left: 18px;
  }

  .match-sets-editor {
    gap: 6px;
  }

  .match-set-row {
    padding: 3px 5px;
  }

  .match-shootout-editor {
    gap: 3px;
  }

  .shootout-total-input {
    width: 30px;
    height: 22px;
    font-size: 11px;
    border-radius: 7px;
  }

  .finish-type-select {
    width: 38px;
    min-width: 38px;
    height: 22px;
    font-size: 10px;
    padding: 0 1px;
  }

  .shootout-total-sep {
    font-size: 10px;
  }

  /* Save btn à droite des inputs, hors flux */
  .save-btn {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
  .save-btn:hover {
    transform: scale(1.1);
  }

  .team-logo,
  .team-initials {
    width: 36px;
    height: 36px;
    align-self: center;
    margin: 0 auto;
  }

  .team-name {
    font-size: 11px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
    line-height: 1.2;
    text-align: center;
    width: 100%;
    min-width: 0;
  }

  .score-input {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }
  .score-display {
    min-width: 20px;
    height: 26px;
    font-size: 15px;
  }

  .score-sep { font-size: 11px; }
}

/* ── Empty state ──────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 15px;
}

/* ── Live widget ─────────────────────────────────── */
.live-widget {
  background: #1e293b;
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 20px;
  color: #fff;
  display: none;
}
.live-widget.visible { display: block; }

.live-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.live-widget-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: livepulse 1.5s ease-in-out infinite;
}
.live-dot.paused { background: #f59e0b; animation: none; }
@keyframes livepulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}
.live-timer {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  letter-spacing: .04em;
}
.live-timer.expired { color: #f87171; }

.live-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.live-team {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.live-team.right {
  flex-direction: row-reverse;
  text-align: right;
}
.live-team-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: #334155;
  flex-shrink: 0;
}
.live-team-name {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}
.live-score {
  font-size: 52px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.live-score-sep {
  font-size: 32px;
  color: #475569;
  font-weight: 400;
}

/* ── Live in-card ────────────────────────────────── */
.match-card.is-live {
  border: 2px solid #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.12);
}

.card-live-bar {
  grid-column: 1 / -1;
  grid-row: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #16a34a;
  border-top: 1px solid #dcfce7;
  background: #f0fdf4;
  border-radius: 0 0 8px 8px;
  margin: 0 -12px -10px;
}

.card-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: livepulse 1.5s ease-in-out infinite;
}
.card-live-dot.paused {
  background: #f59e0b;
  animation: none;
}
@keyframes livepulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

.card-live-label { color: #16a34a; }
.card-live-dot.paused ~ .card-live-label { color: #b45309; }

.card-live-phase {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.card-live-timer {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1e293b;
}
.card-live-timer.expired { color: #dc2626; }

/* Livescore 3 overrides */
.page-header h2 {
  font-size: 24px;
}

.match-card {
  grid-template-columns: 20px minmax(150px, 1fr) auto 26px minmax(150px, 1fr);
  row-gap: 4px;
  overflow: visible;
}

.match-card:not(.sets-mode) > .team-cell {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  max-width: 100%;
}

.match-card:not(.sets-mode) > .team-cell.right {
  grid-column: 5;
  grid-row: 2;
  min-width: 0;
  max-width: 100%;
}

.match-status-line {
  grid-column: 1 / -1;
  grid-row: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 8px;
  justify-self: center;
  min-height: 28px;
}

.match-status-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 12px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.match-status-main::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  transform: translateY(1px);
}

.match-status-line[data-state="REG"] {
  color: #dc2626;
}

.match-status-line[data-state="REG"] .match-status-main {
  background: #fef2f2;
  border-color: #fecaca;
}

.match-status-line[data-state="OT"] {
  color: #d97706;
}

.match-status-line[data-state="OT"] .match-status-main {
  background: #fff7ed;
  border-color: #fed7aa;
}

.match-status-line[data-state="SO"] {
  color: #2563eb;
}

.match-status-line[data-state="SO"] .match-status-main {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.match-status-line[data-state="PAUSED"] {
  color: #b45309;
}

.match-status-line[data-state="PAUSED"] .match-status-main {
  background: #fffbeb;
  border-color: #fde68a;
}

.match-status-line[data-state="FIN"] {
  color: #64748b;
}

.match-status-line[data-state="FIN"] .match-status-main {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.match-status-line[data-state="PLANNED"] {
  color: #64748b;
}

.match-status-line[data-state="PLANNED"] .match-status-main {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.match-status-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: 2px;
}

.match-status-spacer {
  width: 20px;
  min-width: 20px;
  visibility: hidden;
  flex: 0 0 auto;
}

.match-status-actions .score-tools {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  margin: 0;
  grid-column: auto;
  grid-row: auto;
  justify-self: auto;
  align-self: center;
}

.match-status-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.match-status-line .match-subline-trigger,
.match-status-line .match-subline-static,
.match-status-line .match-status-text {
  color: currentColor;
}

.match-status-line .match-subline-trigger {
  min-height: 0;
  padding: 0;
  gap: 5px;
  border-radius: 0;
}

.match-status-label {
  color: currentColor;
}

.match-status-dot {
  color: currentColor;
  line-height: 1;
}

.match-status-meta {
  color: #0f172a;
  opacity: 1;
}

.score-zone {
  grid-column: 3;
  grid-row: 2;
  margin-left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-zone {
  gap: 10px;
  min-height: 44px;
  padding: 2px 0;
}

.score-tools {
  display: flex;
  justify-self: auto;
  align-self: auto;
  margin-top: 0;
  min-width: 18px;
  overflow: visible;
  z-index: 3;
}

.score-input,
.score-display {
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  border-radius: 10px;
  color: #0f172a;
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  width: 52px;
  min-width: 52px;
  height: 44px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  position: relative;
}

.score-input:focus {
  border-color: #cbd5e1;
  box-shadow: 0 0 0 2px rgba(203,213,225,.18);
  outline: none;
}

.score-zone .score-input {
  appearance: textfield;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.score-zone .score-input::-webkit-outer-spin-button,
.score-zone .score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.score-input::placeholder {
  color: transparent;
  opacity: 1;
}

.score-input {
  border-color: #e2e8f0;
  background: rgba(255,255,255,.72);
}

.score-input:disabled,
.score-input[disabled] {
  color: #0f172a;
  -webkit-text-fill-color: #0f172a;
  opacity: 1;
}

.match-subline-row {
  grid-column: 1 / -1;
  grid-row: 3;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 24px;
}

.match-subline-trigger,
.match-subline-static {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.match-subline-trigger {
  cursor: pointer;
  position: relative;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  padding: 4px 8px;
  border-radius: 10px;
}

.match-subline-trigger .score-controls {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255,255,255,.98);
  border: 1px solid #dbe3ee;
  box-shadow: 0 10px 24px rgba(15,23,42,.12);
  z-index: 120;
  min-width: 122px;
  gap: 6px;
  pointer-events: auto;
  touch-action: manipulation;
}

.save-btn-status {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

.match-subline-trigger.open .score-controls {
  display: flex;
}

.match-subline-trigger .finish-type-option {
  padding: 0;
  border: none;
  background: transparent;
  color: #0f172a;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  opacity: .55;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.match-subline-trigger .finish-type-option.active {
  opacity: 1;
  color: #111827;
}

.match-subline-trigger .finish-type-option:hover {
  opacity: .85;
}

.match-shootout-summary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37,99,235,.08);
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.match-timer-summary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.match-shootout-sep {
  color: #94a3b8;
}

.match-shootout-editor {
  display: none;
  align-items: center;
  gap: 6px;
}

.match-card.shootout-editing .match-shootout-editor {
  display: inline-flex;
}

.match-card.shootout-editing .match-shootout-summary {
  display: none !important;
}

.match-time {
  grid-row: 4;
}

.match-meta {
  grid-row: 5;
}

.match-venue {
  grid-row: 6;
}

.card-live-bar {
  display: none !important;
}

@media (max-width: 600px) {
  .match-card {
    grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr);
  }

  .match-card:not(.sets-mode) > .team-cell {
    grid-column: 1;
    grid-row: 2;
  }

  .match-card:not(.sets-mode) > .score-zone {
    grid-column: 2 / 4;
    grid-row: 2;
    margin-left: 8px;
    margin-right: 8px;
    justify-self: center;
    position: relative;
    z-index: 2;
    pointer-events: auto;
  }

  .match-card:not(.sets-mode) > .team-cell.right {
    grid-column: 4;
    grid-row: 2;
  }

  .match-card:not(.sets-mode) > .score-tools {
    display: none;
  }

  .match-status-line {
    grid-row: 1;
    font-size: 12px;
  }

  .match-status-actions {
    margin-left: 2px;
  }

  .match-status-spacer {
    width: 18px;
    min-width: 18px;
  }

  .save-btn-status {
    display: none !important;
  }

  .score-zone,
  .score-zone .score-input,
  .score-zone .score-display {
    pointer-events: auto;
    touch-action: manipulation;
  }

  .score-zone .score-input {
    position: relative;
    z-index: 4;
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
  }

  .match-subline-row {
    grid-row: 3;
    font-size: 11px;
    width: auto;
    max-width: 100%;
    flex-wrap: nowrap;
    justify-content: center;
    min-height: 0;
    padding: 2px 10px 0;
  }

  .match-subline-trigger {
    width: auto;
    max-width: 100%;
    flex-wrap: nowrap;
    gap: 6px;
    min-height: 32px;
  }

  .match-shootout-editor {
    gap: 8px;
    padding: 2px 8px 0;
  }

  .shootout-total-input {
    width: 42px;
    height: 30px;
    font-size: 14px;
    position: relative;
    z-index: 5;
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
  }

  .shootout-total-sep {
    font-size: 12px;
  }

  .match-subline-trigger.open {
    width: auto;
    flex-wrap: nowrap;
  }

  .match-subline-trigger .score-controls {
    position: absolute;
    top: auto;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: min(220px, calc(100vw - 32px));
    margin-top: 0;
    border-radius: 12px;
    justify-content: center;
    padding: 10px 12px;
    z-index: 140;
  }

  .match-subline-trigger .finish-type-option {
    min-width: 44px;
    min-height: 32px;
    padding: 4px 6px;
  }

  .match-status-line {
    font-size: 12px;
    margin-bottom: 8px;
    white-space: nowrap;
  }

  .score-input,
  .score-display {
    font-size: 33px;
    width: 36px;
    min-width: 36px;
    height: 40px;
  }

  .score-zone {
    gap: 8px;
  }

  .save-btn-mobile {
    grid-column: 1 / -1;
    grid-row: 6;
    justify-self: stretch;
    display: none;
    width: calc(100% - 4px);
    height: 44px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    margin-top: 8px;
    position: relative;
    z-index: 8;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .save-btn-mobile.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    pointer-events: auto;
  }

  .match-card.sets-mode .save-btn-grid {
    display: none !important;
  }

}

.match-card.darts-mode .score-zone {
  gap: 6px;
}

.match-card.darts-mode .score-input,
.match-card.darts-mode .score-display {
  width: 118px;
  min-width: 118px;
  font-size: 32px;
}

.match-card.darts-mode .score-sep {
  margin: 0 -2px;
}

@media (max-width: 600px) {
  .match-card.darts-mode .score-zone {
    gap: 4px;
  }

  .match-card.darts-mode .score-input,
  .match-card.darts-mode .score-display {
    width: 72px;
    min-width: 72px;
    font-size: 25px;
  }
}
