.mode-picker {
  display: flex;
  gap: 8px;
  width: 100%;
  margin: 0 0 8px;
}

.mode-picker button {
  flex: 1;
}

.queue-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
}

.queue-summary strong {
  color: #0d2e57;
  font-size: 36px;
}

.queue-summary span {
  font-weight: 800;
}

.queue-summary small {
  margin-left: auto;
  color: #667085;
}

.queue-progress {
  width: 100%;
  display: grid;
  gap: 7px;
  margin-top: 6px;
}

.queue-progress[hidden] {
  display: none;
}

.queue-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce8f7;
}

.queue-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1769e0, #27b47e);
  transition: width .35s ease;
}

.queue-progress small {
  width: 100%;
  margin: 0;
  color: #47617f;
}

.requeue-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border-color: #88c6a7;
  background: linear-gradient(135deg, #ffffff, #edfff7);
}

.requeue-prompt[hidden] {
  display: none;
}

.requeue-prompt h2,
.requeue-prompt p {
  margin: 4px 0;
}

.request-progress {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
  color: #17365b;
  font-size: 14px;
  font-weight: 700;
  background: rgba(238, 244, 252, .76);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  pointer-events: auto;
}

.request-progress[hidden] {
  display: none;
}

.request-progress-bar {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 38%;
  height: 4px;
  background: linear-gradient(90deg, #1769e0, #27b47e);
  animation: request-progress-slide 1.05s ease-in-out infinite;
}

.request-progress strong {
  background: rgba(255, 255, 255, .96);
  border: 1px solid #dce8f7;
  border-radius: 999px;
  padding: 9px 16px;
  box-shadow: 0 8px 26px rgba(23, 54, 91, .16);
}

.request-spinner {
  width: 44px;
  height: 44px;
  border: 5px solid rgba(23, 105, 224, .18);
  border-top-color: #1769e0;
  border-radius: 50%;
  animation: request-spinner-rotate .7s linear infinite;
  filter: drop-shadow(0 6px 12px rgba(23, 54, 91, .15));
}

@keyframes request-progress-slide {
  from { transform: translateX(-110%); }
  to { transform: translateX(350%); }
}

@keyframes request-spinner-rotate {
  to { transform: rotate(360deg); }
}

.queue-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1769e0;
  color: white;
  font-weight: 800;
}

.match-create-controls {
  display: flex;
  align-items: end;
  gap: 10px;
}

.match-create-controls label {
  margin: 0;
  min-width: 105px;
}

.session-rule {
  padding: 9px 12px;
  border-radius: 999px;
  color: #0d2e57;
  background: #deecff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.queue-mode-chooser {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.queue-mode-chooser button {
  background: white;
  color: #1769e0;
  border: 1px solid #bdd5f8;
}

.queue-mode-chooser button.active {
  background: #1769e0;
  color: white;
}

.queue-mode-chooser button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.pass-required {
  padding: 14px;
  border: 1px solid #f0c36b;
  border-radius: 12px;
  background: #fff9e8;
  color: #704d00;
}

.pass-required p {
  margin: 5px 0 0;
}

.selection-bar {
  position: sticky;
  top: 82px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 15px;
  border-radius: 12px;
  background: #0d2e57;
  color: white;
  box-shadow: 0 8px 20px #0d2e5730;
}

.selection-bar[hidden] {
  display: none !important;
}

.selectable-player.selected {
  outline: 2px solid #1769e0;
  background: #eef5ff;
}

.selectable-player.disabled {
  opacity: .58;
}

.match-create-controls select {
  margin-top: 5px;
}

.courts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.court-card {
  position: relative;
  min-height: 170px;
}

.empty-match-card {
  color: #667085;
  text-align: center;
}

.court-card.available {
  background: linear-gradient(135deg, #fff, #edfff7);
}

.court-card.occupied {
  border-color: #9fc4fa;
}

.court-card.pending {
  border-style: dashed;
  background: #fffaf0;
}

.court-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.match-live-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.match-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef5ff;
  color: #0d2e57;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.match-timer b {
  min-width: 38px;
  letter-spacing: .04em;
}

.court-label {
  color: #0d2e57;
  font-size: 24px;
  font-weight: 900;
}

.action.pending {
  color: #8b5a00;
  background: #fff0c7;
}

.court-state {
  display: inline-block;
  color: #087848;
  background: #dff7eb;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.quick-score-card {
  overflow: hidden;
}

.quick-score-board {
  display: grid;
  gap: 10px;
  margin: 16px 0 12px;
}

.quick-score-team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid #d8e4f3;
  border-radius: 18px;
  background: #f8fbff;
}

.quick-score-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.quick-score-player div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.quick-score-player strong {
  overflow-wrap: anywhere;
}

.quick-score-player small {
  color: #718096;
}

.quick-score-side {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #1769e0;
  background: #deecff;
  font-weight: 900;
}

.quick-score-controls {
  display: grid;
  grid-template-columns: 46px 58px 46px;
  align-items: center;
  gap: 7px;
}

.score-step {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  background: #e7eef8;
  color: #17355b;
  font-size: 25px;
  line-height: 1;
}

.score-step.plus {
  background: #1769e0;
  color: white;
}

.quick-score-input {
  width: 58px;
  height: 52px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 32px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

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

.quick-score-vs {
  margin: -4px 0;
  color: #8a98ab;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
}

.score-validity {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: #8b5a00;
  background: #fff6da;
  font-size: 13px;
  font-weight: 700;
}

.score-validity.valid {
  color: #087848;
  background: #dff7eb;
}

.score-submit {
  width: 100%;
  min-height: 48px;
}

.first-server {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  margin: 8px 0;
  padding: 8px 11px;
  border-radius: 12px;
  color: #7b4b00;
  background: #fff2c7;
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .courts-grid {
    grid-template-columns: 1fr;
  }

  .queue-summary {
    flex-wrap: wrap;
  }

  .queue-summary small {
    width: 100%;
    margin-left: 0;
  }

  .match-create-controls {
    width: 100%;
  }

  .queue-mode-chooser {
    grid-template-columns: 1fr;
  }

  .requeue-prompt {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-score-team {
    grid-template-columns: 1fr;
  }

  .quick-score-controls {
    grid-template-columns: 54px minmax(64px, 1fr) 54px;
  }

  .score-step {
    width: 54px;
    height: 52px;
  }

  .quick-score-input {
    width: 100%;
  }
}
