/* Audio and display stay readable without a scrolling settings sheet. */
#matchSettings {
  z-index: 15;
}
#matchSettings .settings-dialog {
  width: min(980px, 100%);
  height: min(680px, calc(100dvh - 40px));
  gap: 0;
}
#matchSettings .settings-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
#matchSettings .settings-heading h2 {
  font-size: 32px;
  margin: 4px 0;
}
#matchSettings .screen-tabs {
  margin-bottom: 20px;
}
#matchSettings [role='tabpanel'] {
  min-height: 0;
  flex: 1;
}
#matchSettings [hidden] {
  display: none !important;
}
#matchSettings:has(#settings-controls:not([hidden])) .preferences-footer {
  display: none;
}
.preferences-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-content: start;
}
.preference-card {
  min-width: 0;
  background: #102f39;
  border: 1px solid #a6c4b530;
  border-radius: 7px;
  padding: 16px 18px;
}
.preference-card label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 17px;
  font-weight: 650;
  color: #e4eddf;
}
.preference-card output {
  color: #f5d998;
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}
.preference-card p {
  font-size: 13px;
  line-height: 1.4;
  margin: 8px 0 0;
  color: #aac5bc;
}
.preference-card input[type='range'] {
  width: 100%;
  height: 32px;
  accent-color: #f0d895;
  margin: 8px 0 0;
  cursor: pointer;
}
.preference-card select {
  width: 100%;
  min-height: 40px;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 4px;
  background: #1e424b;
  color: #e4eddf;
  border: 1px solid #7a9a9280;
  font:
    15px 'Segoe UI',
    sans-serif;
}
.audio-preview {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  color: #b8cfc7;
  font-size: 14px;
}
#testSound {
  flex-shrink: 0;
  min-height: 44px;
}
.preferences-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  border-top: 1px solid #a6c4b530;
  margin-top: 16px;
  padding-top: 14px;
  font-size: 13px;
  color: #b8cfc7;
}
#resetSettings {
  letter-spacing: 0;
  white-space: nowrap;
  font-size: 13px;
  min-height: 40px;
  padding: 8px 12px;
}
#crosshairPreview {
  display: block;
  width: 28px;
  margin: 0 auto;
  height: 25px;
  text-align: center;
  color: #edf1d0;
  font: bold 24px/25px monospace;
  transform-origin: center;
}
#pauseSettings {
  width: 100%;
  margin-bottom: 14px;
}
@media (max-height: 679px) {
  #matchSettings .settings-dialog {
    height: calc(100dvh - 24px);
    padding: 14px 20px;
  }
  #matchSettings .settings-heading {
    margin-bottom: 8px;
  }
  #matchSettings .settings-heading h2 {
    font-size: 24px;
  }
  #matchSettings .screen-tabs {
    margin-bottom: 12px;
  }
  .preferences-grid {
    gap: 8px;
  }
  .preference-card {
    padding: 9px 12px;
  }
  .preference-card label {
    font-size: 15px;
  }
  .preference-card select {
    min-height: 32px;
    margin-top: 5px;
    padding: 5px 8px;
    font-size: 14px;
  }
  .preference-card input[type='range'] {
    height: 24px;
    margin-top: 4px;
  }
  .preference-card p {
    font-size: 12px;
    margin-top: 4px;
  }
  .preferences-footer {
    margin-top: 10px;
    padding-top: 10px;
    font-size: 12px;
  }
  .audio-preview {
    padding: 3px 0;
    font-size: 12px;
  }
  #crosshairPreview {
    height: 18px;
    font-size: 18px;
    line-height: 18px;
  }
}
@media (max-height: 679px) and (min-width: 651px) {
  .preferences-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .audio-preview {
    grid-column: span 2;
  }
}
@media (max-width: 650px) {
  #matchSettings .settings-dialog {
    height: calc(100dvh - 24px);
    padding: 18px 16px;
  }
  #matchSettings .settings-heading h2 {
    font-size: 26px;
  }
  #matchSettings .screen-tabs {
    gap: 3px;
    margin-bottom: 14px;
  }
  #matchSettings .screen-tabs button {
    padding: 8px 12px;
    font-size: 14px;
  }
  .preferences-grid {
    gap: 10px;
  }
  .preference-card {
    padding: 13px 10px;
  }
  .preference-card label {
    font-size: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .preference-card p {
    font-size: 12px;
  }
  .preference-card select {
    font-size: 13px;
    padding: 6px;
    min-height: 38px;
  }
  .preference-card input[type='range'] {
    height: 32px;
  }
  .preferences-footer {
    gap: 12px;
    align-items: flex-start;
    flex-direction: column;
  }
  .audio-preview {
    align-items: flex-start;
    font-size: 12px;
    gap: 12px;
  }
}
