/* === Form Layout === */
#selectCourtForm {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 560px;
  padding: 24px 16px;
  background: var(--color-surface);
  border: none;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 30;
  overflow: visible;
}

#selectCourtForm .card.combined {
  padding-top: 10px;
  padding-bottom: 10px;
}

.btnLeiste {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 1rem;
}

.booking-data {
  display: grid;
  grid-template-columns: 3fr 90px 4fr;
  gap: 1rem;
  width: 100%;
}

#dialogCourtName {
  color: var(--color-surface);
}

.booking-data>.court-data {
  display: flex;
  flex-direction: column;
}

.booking-data>.court-data:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.dialog-weather-summary {
  flex: 0 0 108px;
  width: 108px;
  min-width: 108px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.25rem;
  text-align: left;
}

.dialog-weather-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-start;
}

.dialog-weather-main {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.dialog-weather-summary img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.dialog-weather-summary span {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.dialog-weather-wind {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  opacity: 0.92;
}

.dialog-weather-wind-arrow {
  display: inline-block;
  transform-origin: 50% 50%;
}

#dialogDateTime {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

#selectCourtForm p {
  font-size: 1rem;
  margin: 0;
  padding: 0;
}

#selectCourtDialog.show {
  display: block;
}

#selectCourtDialog {
  z-index: 700;
}

@media (max-width: 1000px) {
  body.select-court-dialog-open .navbar-collapse,
  body.select-court-dialog-open .nav,
  body.select-court-dialog-open #bap-ticker,
  body.select-court-dialog-open #appBuildBadge {
    display: none !important;
  }

  #selectCourtDialog {
    z-index: 13000;
    height: 100vh;
    height: 100dvh;
  }

  #selectCourtForm {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    width: min(560px, 92vw);
    max-height: calc(100vh - max(10px, env(safe-area-inset-top)) - max(18px, env(safe-area-inset-bottom)) - 12px);
    max-height: calc(100dvh - max(10px, env(safe-area-inset-top)) - max(18px, env(safe-area-inset-bottom)) - 12px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-sizing: border-box;
  }
}

/* === Duration Picker === */
.typeAndDuration {
  width: 48%;
  gap: 1rem;
}

#spielTyp,
#spielDauer {
  padding: 14px 16px;
  gap: 0.45rem;
}

#spielTyp h3,
#spielDauer h3 {
  margin: 0 0 0.15rem 0;
}

#spielTyp fieldset.radio-btns.column {
  padding: 0.35rem 0 0;
  gap: 0.65rem;
}

#spielDauer .duration-picker {
  gap: 0.35rem;
}

#spielDauer.is-disabled .duration-picker {
  opacity: 0.55;
}

#spielDauer.is-disabled .duration-value,
#spielDauer.is-disabled #bookingTime {
  color: var(--color-text-muted);
}

#spielDauer.is-disabled #dialogDurationSlider {
  cursor: not-allowed;
}

.description {
  display: none;
  width: 100%;
}

.description textarea {
  width: 100%;
  height: 80px;
  padding: 8px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid var(--color-text-muted);
  font-size: 1rem;
  resize: vertical;
}

.duration-picker {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.duration-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.duration-value {
  font-weight: 600;
  color: var(--color-primary);
}

#dialogDurationSlider {
  width: 100%;
  accent-color: var(--color-secondary);
}

.duration-scale {
  display: none;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.duration-scale span {
  text-align: center;
  flex: 1;
  font-size: 0.75rem;
}

/* === Partner Grid === */
.partner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 4fr;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

#doublePartner.hidden {
  display: none;
}

.partner-grid input[type="radio"] {
  margin: 0 auto;
  display: block;
}

.partner-grid input[type="text"] {
  width: 90%;
  margin: .5rem 0;
  padding: 8px;
  text-align: left;
  background-color: var(--color-border-strong);
  border-radius: 8px;
  box-sizing: border-box;
}

.bookingOptions .options-wrap {
  width: 100%;
  display: flex;
  gap: 1rem;
  margin-top: 10px;
}

.dialog-options-row {
  width: 100%;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.bookingOptions,
.playPartnerSearch {
  width: 100%;
}

.playPartnerSearch .options-wrap {
  width: 100%;
  display: flex;
  gap: 1rem;
  margin-top: 10px;
}

/* allowAnonymousGuest */
label.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}


/* === Responsive === */
@media (max-width: 1000px) {
  .dialog-options-row {
    grid-template-columns: 1fr;
  }

  #selectCourtForm {
    width: 90%;
    gap: 0.65rem;
    padding: 10px 8px max(18px, env(safe-area-inset-bottom));
  }

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

  .booking-data {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
  }

  #dialogDateTime {
    text-align: left;
  }

  .partner-grid {
    grid-template-columns: 1fr 1fr;
  }

  .partner-grid input[type="text"] {
    grid-column: 1 / -1;
    width: 100%;
  }

  #selectCourtForm .card.combined {
    padding: 10px 12px;
  }

  #selectCourtForm h3 {
    margin: 0 0 0.35rem;
  }

  #spielTyp,
  #spielDauer {
    padding: 10px 12px;
  }

  #spielTyp fieldset.radio-btns.column {
    padding: 0.2rem 0 0;
    gap: 0.45rem;
  }

  #selectCourtForm .partner-grid {
    gap: 0.55rem;
  }

  #selectCourtForm .partner-grid input[type="text"] {
    margin: 0.25rem 0;
    padding: 7px 8px;
    font-size: 16px;
  }

  #selectCourtForm input,
  #selectCourtForm select,
  #selectCourtForm textarea {
    font-size: 16px;
  }

  #selectCourtForm #fussnote {
    margin-top: 0.35rem;
  }

  #selectCourtForm .bookingOptions .options-wrap {
    gap: 0.55rem;
    margin-top: 0.45rem;
  }

  #selectCourtForm .switch-row {
    padding: 0.55rem 0.85rem;
  }

  #selectCourtForm .btnLeiste {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--color-surface);
    margin-top: 0;
    padding-top: 0.35rem;
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 1000px) and (max-height: 740px) {
  #selectCourtForm {
    gap: 0.5rem;
    padding-top: 8px;
  }

  #selectCourtForm .card.combined {
    padding: 8px 10px;
  }

  #selectCourtForm .booking-data {
    gap: 0.5rem;
  }

  #selectCourtForm h2 {
    margin-top: 0.15rem;
  }

  #selectCourtForm h3 {
    margin-bottom: 0.25rem;
  }

  #selectCourtForm .radio-btns label {
    padding-block: 0.35rem;
  }

  #selectCourtForm .bookingOptions .options-wrap {
    flex-wrap: nowrap;
  }

  #selectCourtForm .switch-row {
    padding: 0.45rem 0.65rem;
  }
}

@media (max-width: 1000px) {
  .box {
    display: none;
  }

  .booking-header {
    display: none;
  }
}

.open-match-details-dialog {
  position: fixed;
  inset: 0;
  z-index: 13000;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.open-match-details-dialog.show {
  display: flex !important;
}

.open-match-details-dialog .dialog-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.open-match-details-panel {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--color-surface);
  border: none;
  border-radius: 16px;
  padding: 24px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  gap: 1rem;
  align-items: stretch;
}

.open-match-details-panel>.open-match-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.open-match-details-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.open-match-hero {
  align-items: flex-start;
  width: 100%;
  max-width: none;
  padding: 16px 18px;
  gap: 0.45rem;
}

.open-match-hero h2 {
  margin: 0;
  color: var(--color-surface) !important;
  text-align: left;
}

.open-match-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  color: var(--color-accent);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.open-match-content-card {
  align-items: stretch;
  width: 100%;
  max-width: none;
  padding: 14px 16px;
  background: var(--color-surface);
}

.open-match-summary {
  margin: 0 0 1rem;
  font-weight: 600;
}

.open-match-applicants h3 {
  margin: 0 0 0.75rem;
}

.open-match-applicant-checks {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.open-match-applicant-checks h3 {
  margin: 0;
}

.open-match-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border-default);
}

.open-match-notice {
  padding: 0.8rem 1rem;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  background: var(--color-surface-muted);
  color: var(--color-text-default);
}

.open-match-empty {
  padding: 0.9rem 1rem;
  border: 1px dashed var(--color-border-default);
  border-radius: 8px;
  color: var(--color-text-muted);
}

.open-match-applicant-list {
  display: grid;
  gap: 0.75rem;
}

.open-match-applicant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  background: var(--color-surface);
}

.open-match-applicant-main {
  display: grid;
  gap: 0.2rem;
}

.open-match-applicant-main span {
  font-size: 0.92rem;
}

.open-match-applicant-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .open-match-details-panel {
    width: min(560px, 92vw);
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
  }

  .open-match-check-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .open-match-applicant-row {
    align-items: stretch;
    flex-direction: column;
  }

  .open-match-applicant-actions {
    justify-content: flex-start;
  }
}
