/* Replay quality dialog + settings panel.
   Dashboard pages supply --kb-*. The replay shell falls back to the HUD colors. */

.vt-rq {
  color: var(--kb-text-primary, var(--text, #e8eaed));
  font-size: 0.92rem;
  line-height: 1.4;
}

.vt-rq-lead,
.vt-rq-hint {
  color: var(--kb-text-muted, var(--text-muted, #9aa0a6));
  font-size: 0.82rem;
  margin: 0 0 0.75rem;
}

.vt-rq-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0 0 0.75rem;
}

.vt-rq-field > span {
  color: var(--kb-text-secondary, var(--text-muted, #c4c7ce));
  font-weight: 500;
  font-size: 0.9rem;
}

/* Closed control matches the site's .form-select. The native popup on
   Windows inherits `color` onto a light menu unless color-scheme and the
   option colors are set on the select itself. */
.vt-rq select {
  appearance: none;
  width: 100%;
  background-color: var(--kb-bg-popover, #22262e);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23c4c7ce' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  color: var(--kb-text-primary, var(--text, #e8eaed));
  border: 1px solid var(--kb-border-default, rgba(255, 255, 255, 0.18));
  border-radius: 8px;
  padding: 0.625rem 2.25rem 0.625rem 0.875rem;
  font: inherit;
  color-scheme: dark;
}

.vt-rq select:focus {
  border-color: var(--kb-primary, #3d8bfd);
  box-shadow: 0 0 0 3px var(--kb-primary-muted, rgba(61, 139, 253, 0.35));
  outline: none;
}

.vt-rq select option {
  background-color: var(--kb-bg-card, #1a1d24);
  color: var(--kb-text-primary, #e8eaed);
}

.vt-rq-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.vt-rq-picker {
  position: relative;
}

.vt-rq-picker-btn {
  appearance: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background-color: var(--kb-bg-popover, #22262e);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23c4c7ce' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  color: var(--kb-text-primary, var(--text, #e8eaed));
  border: 1px solid var(--kb-border-default, rgba(255, 255, 255, 0.18));
  border-radius: 8px;
  padding: 0.625rem 2.25rem 0.625rem 0.875rem;
  font: inherit;
}

.vt-rq-picker-btn:hover,
.vt-rq-picker-btn[aria-expanded="true"] {
  border-color: var(--kb-primary, #3d8bfd);
}

.vt-rq-picker-btn:focus-visible {
  border-color: var(--kb-primary, #3d8bfd);
  box-shadow: 0 0 0 3px var(--kb-primary-muted, rgba(61, 139, 253, 0.35));
  outline: none;
}

.vt-rq-picker-menu {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.35rem;
  background: var(--kb-bg-card, #1a1d24);
  color: var(--kb-text-primary, #e8eaed);
  border: 1px solid var(--kb-border-default, rgba(255, 255, 255, 0.16));
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  max-height: 240px;
  overflow: auto;
}

.vt-rq-picker-menu.is-up {
  top: auto;
  bottom: calc(100% + 4px);
}

.vt-rq-picker-menu[hidden] {
  display: none;
}

.vt-rq-picker-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--kb-text-primary, #e8eaed);
  border: 0;
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

.vt-rq-picker-item:hover,
.vt-rq-picker-item.is-active {
  background: var(--kb-bg-subtle, rgba(255, 255, 255, 0.08));
  color: var(--kb-text-primary, #e8eaed);
}

html[data-mode="light"] .vt-rq-picker-btn {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

html[data-mode="light"] .vt-rq select {
  color-scheme: light;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

html[data-mode="light"] .vt-rq select option {
  background-color: var(--kb-bg-card, #fff);
  color: var(--kb-text-primary, #212529);
}

.vt-rq-packs {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.vt-rq-packs.is-off {
  opacity: 0.45;
}

.vt-rq-pack {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.vt-rq-pack-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  cursor: pointer;
}

.vt-rq-workshop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  color: var(--kb-text-muted, var(--text-muted, #9aa0a6));
  flex: 0 0 auto;
}

.vt-rq-workshop:hover {
  color: var(--kb-text-primary, var(--text, #e8eaed));
}

.vt-rq-steam {
  width: 14px;
  height: 14px;
  display: block;
}

.vt-rq-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  cursor: pointer;
}

.vt-rq input[type="checkbox"],
.vt-rq input[type="radio"] {
  accent-color: var(--kb-primary, #3d8bfd);
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

.vt-rq-size {
  margin: 0 0 0.5rem;
  font-variant-numeric: tabular-nums;
}

.vt-rq-cache-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.vt-rq-ghost {
  background: transparent;
  color: var(--kb-text-primary, var(--text, #e8eaed));
  border: 1px solid var(--kb-border-default, rgba(255, 255, 255, 0.18));
  border-radius: 8px;
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.vt-rq-ghost:hover {
  background: var(--kb-bg-subtle, rgba(255, 255, 255, 0.06));
}

.vt-rq-purge[hidden] {
  display: none;
}

.vt-rq-dialog {
  --kb-bg-card: #1a1d24;
  --kb-bg-popover: #22262e;
  --kb-text-primary: #e8eaed;
  --kb-text-secondary: #c4c7ce;
  --kb-text-muted: #9aa0a6;
  --kb-border-subtle: rgba(255, 255, 255, 0.1);
  --kb-border-default: rgba(255, 255, 255, 0.16);
  --kb-primary: #3d8bfd;
  --kb-primary-fg: #fff;
  --kb-primary-muted: rgba(61, 139, 253, 0.35);
  color-scheme: dark;
  background: var(--kb-bg-card);
  color: var(--kb-text-primary);
  border: 1px solid var(--kb-border-default);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  padding: 0;
  width: min(440px, calc(100vw - 24px));
  max-height: min(92vh, 760px);
  /* Menus are portaled onto the dialog, so the card itself must not clip. */
  overflow: visible;
}
.vt-rq-dialog[open] {
  display: flex;
  flex-direction: column;
}

.vt-rq-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.vt-rq-dialog form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(92vh, 760px);
  margin: 0;
  overflow: hidden;
}

.vt-rq-head,
.vt-rq-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 1.25rem;
}

.vt-rq-head {
  border-bottom: 1px solid var(--kb-border-subtle);
  font-weight: 600;
  font-size: 1.15rem;
}

.vt-rq-foot {
  border-top: 1px solid var(--kb-border-subtle);
  justify-content: flex-end;
}

.vt-rq-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.25rem 1.25rem 0.5rem;
}

#replay-quality-modal .modal-body {
  min-height: 0;
  overflow-y: auto;
}

/* Same muted thumb as the replay roster. A custom scrollbar replaces the
   native Windows frame that otherwise draws a box inside the card. */
.vt-rq-body,
#replay-quality-modal .modal-body {
  scrollbar-width: thin;
  scrollbar-color: var(--kb-border-default, rgba(255, 255, 255, 0.16)) transparent;
}

.vt-rq-body::-webkit-scrollbar,
#replay-quality-modal .modal-body::-webkit-scrollbar {
  width: 6px;
}

.vt-rq-body::-webkit-scrollbar-track,
#replay-quality-modal .modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.vt-rq-body::-webkit-scrollbar-thumb,
#replay-quality-modal .modal-body::-webkit-scrollbar-thumb {
  background: var(--kb-border-default, rgba(255, 255, 255, 0.16));
  border-radius: 99px;
}

.vt-rq-body::-webkit-scrollbar-thumb:hover,
#replay-quality-modal .modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

.vt-rq-close {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}

.vt-rq-primary {
  background: var(--kb-primary, #3d8bfd);
  color: var(--kb-primary-fg, #fff);
  border: 1px solid var(--kb-primary, #3d8bfd);
  border-radius: 8px;
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.vt-rq-primary:hover {
  filter: brightness(1.08);
}

.vt-rq-slow {
  display: block;
  width: 100%;
  margin: 8px 0 0;
  padding: 0.2rem 0 0.2rem 0.55rem;
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 3px solid var(--kb-warning, #e0a100);
  color: var(--kb-warning, #e0a100);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.vt-rq-slow[hidden] {
  display: none;
}
