/* ── Modal overlay ───────────────────────────────────────────────── */
.dw-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dw-modal {
  background: var(--df-panel);
  border: 1px solid var(--df-border);
  border-radius: 8px;
  min-width: 280px;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.dw-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--df-border);
  background: var(--df-bg);
  border-radius: 8px 8px 0 0;
}

.dw-modal-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--df-text);
}

.dw-modal-close {
  background: none;
  border: none;
  color: var(--df-border-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
}
.dw-modal-close:hover { color: var(--df-text); }

.dw-modal-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  scrollbar-color: var(--df-border) var(--df-bg);
  scrollbar-width: thin;
}

.dw-modal-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.dw-modal-body::-webkit-scrollbar-track {
  background: var(--df-bg);
  border-left: 1px solid var(--df-btn-secondary);
}

.dw-modal-body::-webkit-scrollbar-thumb {
  background: var(--df-border);
  border: 2px solid var(--df-bg);
  border-radius: 999px;
}

.dw-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--df-border-muted);
}

/* ── Layout containers ──────────────────────────────────────────── */
.dw-layout-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dw-layout-horizontal {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.dw-layout-grid {
  display: grid;
  gap: 8px;
  max-width: 100%;
  overflow: visible;
}

.dw-player-row-grid {
  justify-content: start;
}

.dw-player-row-grid-multicolumn {
  grid-template-columns: repeat(3, 156px) !important;
}

/* ── Display elements ───────────────────────────────────────────── */
.dw-heading {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--df-text);
}

.dw-paragraph {
  margin: 0;
  font-size: 12px;
  color: var(--df-muted);
  line-height: 1.5;
}

.dw-text {
  font-size: 12px;
  color: var(--df-text);
}

.dw-divider {
  border: none;
  border-top: 1px solid var(--df-btn-secondary);
  margin: 4px 0;
}

.dw-progress {
  position: relative;
  height: 16px;
  background: linear-gradient(180deg, var(--df-bg), var(--df-panel));
  border: 1px solid var(--df-border);
  border-radius: 999px;
  overflow: hidden;
}

.dw-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2388ff, #6fb6ff);
  transition: width 0.3s ease;
}

.dw-progress-label {
  position: absolute;
  top: 0;
  left: 8px;
  right: 8px;
  font-size: 10px;
  line-height: 16px;
  color: var(--df-text-strong);
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.65);
}

.dw-ansi-text {
  margin: 0;
  color: var(--df-text);
  font-family: var(--df-font-mono);
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: normal;
}

/* ── Form fields ────────────────────────────────────────────────── */
.dw-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dw-label {
  font-size: 11px;
  color: var(--df-muted);
  font-weight: 600;
}

.dw-input, .dw-select {
  background: var(--df-bg);
  border: 1px solid var(--df-border);
  color: var(--df-text);
  padding: 5px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

.dw-input:focus, .dw-select:focus {
  border-color: var(--df-accent-blue);
}

.dw-checkbox-field {
  flex-direction: row;
  align-items: center;
}

.dw-checkbox-label {
  font-size: 12px;
  color: var(--df-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.dw-button {
  background: var(--df-btn-secondary);
  color: var(--df-text);
  border: 1px solid var(--df-border);
  padding: 5px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}
.dw-button:hover { background: var(--df-border); }

.dw-button-primary {
  background: var(--df-btn-bg);
  border-color: var(--df-btn-hover);
  color: #fff;
}
.dw-button-primary:hover { background: var(--df-btn-hover); }

.dw-button-secondary {
  background: var(--df-btn-secondary);
  border-color: var(--df-border);
}

/* ── Image display ─────────────────────────────────────────────── */
.dw-image {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: var(--df-bg);
  min-height: 80px;
}

.dw-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dw-image.dw-image-loaded img {
  opacity: 1;
}

.dw-image-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--df-muted);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  white-space: pre-line;
  line-height: 1.5;
}

.dw-image.dw-image-loaded .dw-image-loading {
  display: none;
}

.dw-image.dw-image-error img {
  display: none;
}

.dw-image.dw-image-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.dw-image.dw-image-error .dw-image-loading {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

/* ── NPC dialogue overlay ────────────────────────────────────────── */
.dw-npc-dialogue-overlay {
  position: fixed;
  z-index: 20020;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
  padding: 18px 18px 14px;
}

.dw-npc-dialogue-frame {
  position: relative;
  pointer-events: auto;
  display: block;
  width: min(920px, 84%);
  min-height: min(360px, 100%);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.dw-npc-dialogue-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(223, 188, 111, 0.25);
  border-radius: 999px;
  background: rgba(15, 17, 20, 0.85);
  color: #d9c999;
  cursor: pointer;
  line-height: 1;
}

.dw-npc-dialogue-close:hover,
.dw-npc-dialogue-close:focus-visible {
  color: #fff4c8;
  border-color: rgba(223, 188, 111, 0.65);
  outline: none;
}

.dw-npc-dialogue-body {
  width: 100%;
}

.dw-npc-dialogue {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 420px);
  align-items: end;
  gap: 16px;
  min-height: 100%;
}

.dw-npc-dialogue-many-choices {
  grid-template-columns: 1fr;
}

.dw-npc-dialogue-portrait {
  position: relative;
  align-self: end;
  justify-self: center;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  background: transparent;
}

.dw-npc-dialogue-portrait img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: contain;
  object-position: center bottom;
}

.dw-npc-dialogue-bubble {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 34px;
  padding: 18px 20px 18px;
  border: 1px solid rgba(223, 188, 111, 0.35);
  border-radius: 10px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 244, 200, 0.08), transparent 38%),
    linear-gradient(140deg, rgba(67, 56, 37, 0.95), rgba(31, 29, 25, 0.97));
  color: #f4ead0;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.58);
}

.dw-npc-dialogue-many-choices .dw-npc-dialogue-portrait {
  display: none;
}

.dw-npc-dialogue-many-choices .dw-npc-dialogue-bubble {
  margin-bottom: 0;
}

.dw-npc-dialogue-bubble::before {
  content: "";
  position: absolute;
  right: -15px;
  bottom: 44px;
  width: 28px;
  height: 28px;
  transform: rotate(45deg);
  border-right: 1px solid rgba(223, 188, 111, 0.35);
  border-top: 1px solid rgba(223, 188, 111, 0.35);
  background: rgba(48, 42, 32, 0.98);
}

.dw-npc-dialogue-name {
  margin: 0 34px 8px 0;
  color: #ffe3a0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.dw-npc-dialogue-text {
  color: #f5efe2;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.dw-npc-dialogue-choices {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.dw-npc-dialogue-choices-multicolumn {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.dw-npc-dialogue-many-choices .dw-npc-dialogue-bubble::before {
  display: none;
}

.dw-npc-dialogue-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 48px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 226, 146, 0.58);
  border-radius: 6px;
  background: rgba(49, 43, 31, 0.86);
  color: #fff3c4;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.dw-npc-dialogue-choice:hover,
.dw-npc-dialogue-choice:focus-visible {
  background: rgba(83, 67, 42, 0.92);
  border-color: rgba(255, 226, 146, 0.92);
  outline: none;
}

.dw-npc-dialogue-choice-label {
  font-size: 14px;
  font-weight: 800;
}

.dw-npc-dialogue-choice-description {
  color: rgba(245, 239, 226, 0.78);
  font-size: 12px;
  line-height: 1.25;
}

@media (max-width: 760px) {
  .dw-npc-dialogue-overlay {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }

  .dw-npc-dialogue-frame {
    width: min(96vw, 420px);
    min-height: 0;
  }

  .dw-npc-dialogue {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .dw-npc-dialogue-portrait {
    display: none;
    grid-column: 1;
    grid-row: 1;
  }

  .dw-npc-dialogue-bubble {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
  }

  .dw-npc-dialogue-bubble::before {
    display: none;
  }

  .dw-npc-dialogue-choices-multicolumn {
    grid-template-columns: 1fr;
  }
}

/* ── Shared video display ───────────────────────────────────────── */
.dw-youtube-embed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-height: 260px;
  padding: 10px;
  border: 1px solid var(--df-border);
  border-radius: 6px;
  background: var(--df-bg);
}

.dw-youtube-embed iframe {
  width: 100%;
  min-height: 220px;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 4px;
  background: #000;
}

/* ── Rich player rows ────────────────────────────────────────────── */
.dw-finger-profile {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
  padding: 2px;
}

.dw-finger-avatar-button {
  flex: 0 0 auto;
  width: 156px;
  height: 156px;
  padding: 0;
  border: 1px solid var(--df-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--df-bg);
  cursor: zoom-in;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.dw-finger-avatar-button:hover,
.dw-finger-avatar-button:focus-visible {
  border-color: #f2cc60;
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}

.dw-finger-avatar-button:focus-visible {
  outline: 2px solid var(--df-accent-blue);
  outline-offset: 2px;
}

.dw-finger-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dw-finger-details {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--df-text);
  font-size: 14px;
  line-height: 1.35;
}

.dw-finger-tagline {
  margin-bottom: 8px;
  color: var(--df-text-strong);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.dw-finger-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(139, 148, 158, 0.18);
}

.dw-finger-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid rgba(88, 166, 255, 0.34);
  border-radius: 999px;
  background: rgba(88, 166, 255, 0.1);
  color: #79c0ff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dw-finger-badge-legend {
  border-color: rgba(242, 204, 96, 0.42);
  background: rgba(242, 204, 96, 0.12);
  color: #f2cc60;
}

.dw-finger-line {
  display: grid;
  grid-template-columns: minmax(92px, max-content) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  min-height: 23px;
  padding: 2px 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.dw-finger-label {
  color: var(--df-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dw-finger-value {
  min-width: 0;
  color: #dbe3ec;
  font-weight: 500;
}

.dw-finger-value-full {
  grid-column: 1 / -1;
  color: #9fb3c8;
  font-size: 13px;
}

.dw-finger-line-status .dw-finger-value-full {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid rgba(242, 204, 96, 0.3);
  border-radius: 999px;
  background: rgba(242, 204, 96, 0.08);
  color: #f2cc60;
  font-size: 12px;
  font-weight: 700;
}

.dw-finger-line-spacer {
  display: block;
  min-height: 12px;
  padding: 0;
}

@media (max-width: 560px) {
  .dw-finger-profile {
    flex-direction: column;
  }

  .dw-finger-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.dw-player-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  width: 156px;
  min-height: 156px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  overflow: visible;
}

.dw-player-row:hover {
  z-index: 20;
}

.dw-player-row-avatar-button {
  position: relative;
  flex: 0 0 auto;
  width: 156px;
  height: 156px;
  padding: 0;
  border: 1px solid var(--df-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--df-bg);
  cursor: zoom-in;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.dw-player-row-avatar-button:hover,
.dw-player-row-avatar-button:focus-visible {
  border-color: var(--df-accent-blue);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}

.dw-player-row-avatar-button:focus-visible {
  outline: 2px solid var(--df-accent-blue);
  outline-offset: 2px;
}

.dw-player-row-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dw-player-row-avatar-overlay {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-height: 52px;
  padding: 8px 8px 20px 28px;
  color: var(--df-text-strong);
  text-align: right;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.74) 0%,
    rgba(0, 0, 0, 0.42) 58%,
    rgba(0, 0, 0, 0) 100%
  );
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.dw-player-row-avatar-name {
  max-width: 100%;
  overflow: hidden;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dw-player-row-avatar-level {
  max-width: 100%;
  overflow: hidden;
  color: #d8dee9;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.dw-player-row-body {
  display: none;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 5px;
}

.dw-player-row-tooltip {
  position: absolute;
  left: var(--dw-player-tooltip-left, 0px);
  top: calc(100% + 10px);
  z-index: 40;
  width: min(260px, 88vw);
  padding: 10px 12px;
  border: 1px solid var(--df-border);
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.46);
  color: var(--df-text);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.dw-player-row:hover .dw-player-row-tooltip,
.dw-player-row-avatar-button:focus-visible + .dw-player-row-body + .dw-player-row-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.dw-player-tooltip-name {
  color: var(--df-text-strong);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 7px;
  overflow-wrap: anywhere;
}

.dw-player-tooltip-detail {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.35;
}

.dw-player-tooltip-label {
  color: var(--df-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
}

.dw-player-tooltip-value {
  color: var(--df-text);
  overflow-wrap: anywhere;
}

.dw-player-tooltip-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

@media (max-width: 780px) {
  .dw-layout-grid {
    grid-template-columns: repeat(auto-fit, minmax(156px, 156px)) !important;
  }
}

.dw-player-row-line {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.dw-player-row-line1 {
  color: var(--df-text-strong);
}

.dw-player-row-line2 {
  color: #9fb3c8;
  font-size: 12px;
}

.dw-player-row-level {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 2px 6px;
  border: 1px solid var(--df-accent-blue);
  border-radius: 999px;
  color: var(--df-text-strong);
  background: rgba(88, 166, 255, 0.12);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.dw-player-row-name {
  min-width: 0;
  color: var(--df-text-strong);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.dw-player-row-achievement {
  min-width: 0;
  color: #f2cc60;
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.dw-player-row-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dw-player-row-designation {
  color: #79c0ff;
  font-weight: 600;
}

.dw-player-row-designation::before {
  content: "•";
  margin-right: 7px;
  color: var(--df-border-muted);
  font-weight: 400;
}

.dw-player-row-flags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dw-player-row-flag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 6px;
  border: 1px solid var(--df-border);
  border-radius: 999px;
  background: rgba(48, 54, 61, 0.55);
  color: var(--df-text);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
}

.dw-avatar-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
}

.dw-avatar-lightbox-frame {
  position: relative;
  max-width: 80vw;
  max-height: 80vh;
  border: 1px solid var(--df-border);
  border-radius: 8px;
  background: var(--df-bg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.62);
}

.dw-avatar-lightbox-image {
  display: block;
  max-width: 80vw;
  max-height: 80vh;
  border-radius: 8px;
  object-fit: contain;
}

.dw-avatar-lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(201, 209, 217, 0.28);
  border-radius: 999px;
  background: rgba(13, 17, 23, 0.86);
  color: var(--df-text);
  cursor: pointer;
  line-height: 1;
}

.dw-avatar-lightbox-close:hover,
.dw-avatar-lightbox-close:focus-visible {
  border-color: var(--df-accent-blue);
  color: var(--df-text-strong);
}

/* ── Login modal (game-launcher style) ─────────────────────────── */
.dw-login-overlay {
  background: rgba(0, 0, 0, 0.8);
}

.dw-login-modal {
  flex-direction: row;
  width: 680px;
  max-width: 95vw;
  height: 480px;
  max-height: 90vh;
  overflow: hidden;
}

.dw-login-art {
  width: 260px;
  min-width: 260px;
  overflow: hidden;
  position: relative;
  border-radius: 8px 0 0 8px;
}

.dw-login-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

.dw-login-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px 28px 24px;
  justify-content: center;
  overflow-y: auto;
}

.dw-login-brand {
  font-size: 28px;
  font-weight: 700;
  color: var(--df-text);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 2px;
}

.dw-login-tagline {
  font-size: 13px;
  color: var(--df-accent-blue);
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.dw-login-body {
  padding: 0;
}

/* Hide the server-sent heading/error in login since we have our own brand header */
.dw-login-body .dw-heading {
  display: none;
}

/* Style the login error message */
.dw-login-body .dw-paragraph[data-dw-id="error"]:empty {
  display: none;
}

/* Larger inputs for login */
.dw-login-body .dw-input {
  padding: 8px 12px;
  font-size: 13px;
}

/* Larger login buttons */
.dw-login-body .dw-button {
  padding: 8px 20px;
  font-size: 13px;
}

.dw-login-body .dw-button-primary {
  background: var(--df-btn-bg);
  border-color: var(--df-btn-hover);
  box-shadow: 0 0 12px rgba(35, 134, 54, 0.3);
  transition: background 0.15s, box-shadow 0.15s;
}

.dw-login-body .dw-button-primary:hover {
  background: var(--df-btn-hover);
  box-shadow: 0 0 18px rgba(46, 160, 67, 0.4);
}

/* ── Snoop modal ───────────────────────────────────────────────── */
.dw-snoop-overlay {
  background: rgba(0, 0, 0, 0.76);
  padding: 24px;
}

.dw-snoop-modal {
  width: min(980px, 96vw);
  height: min(860px, 88vh);
  background: #1b1d23;
  overflow: hidden;
}

.dw-snoop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 18px;
  background: #2b1d1d;
  border-bottom: 1px solid #3a2a2a;
  border-radius: 8px 8px 0 0;
}

.dw-snoop-heading {
  min-width: 0;
}

.dw-snoop-title {
  color: #f0f0f0;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 700;
}

.dw-snoop-subtitle {
  margin-top: 4px;
  color: #aeb4bd;
  font-size: 14px;
  line-height: 1.3;
}

.dw-snoop-icon-button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b8bec7;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.dw-snoop-icon-button:hover,
.dw-snoop-icon-button:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.dw-snoop-stream {
  flex: 1;
  margin: 14px 16px 10px;
  padding: 12px;
  overflow: auto;
  background: #0d0f12;
  border: 1px solid #23272f;
  border-radius: 6px;
  color: #d6d9de;
  font-family: var(--df-font-mono);
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  scrollbar-color: var(--df-border) var(--df-bg);
  scrollbar-width: thin;
}

.dw-snoop-stream::-webkit-scrollbar {
  width: 10px;
}

.dw-snoop-stream::-webkit-scrollbar-track {
  background: #0d0f12;
}

.dw-snoop-stream::-webkit-scrollbar-thumb {
  background: var(--df-border);
  border: 2px solid #0d0f12;
  border-radius: 999px;
}

.dw-snoop-line {
  min-height: 1.4em;
}

.dw-snoop-line-status {
  color: var(--df-muted);
  border-bottom: 1px solid rgba(139, 148, 158, 0.12);
  margin-bottom: 6px;
  padding-bottom: 6px;
}

.dw-snoop-line-input {
  color: var(--df-text);
}

.dw-snoop-line-command {
  color: var(--df-warn);
}

.dw-snoop-prefix {
  color: #6ea8fe;
  font-weight: 700;
}

.dw-snoop-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 24px 24px;
}

.dw-snoop-command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 10px;
}

.dw-snoop-command-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--df-border);
  border-radius: 7px;
  background: #16181e;
  color: var(--df-text-strong);
  padding: 10px 12px;
  font-family: var(--df-font-mono);
  font-size: 14px;
  line-height: 1.3;
}

.dw-snoop-command-input:focus {
  outline: none;
  border-color: #6f7dff;
  box-shadow: 0 0 0 2px rgba(111, 125, 255, 0.25);
}

.dw-snoop-command-button,
.dw-snoop-stop {
  border: 0;
  border-radius: 7px;
  background: #6973d6;
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  padding: 10px 16px;
}

.dw-snoop-command-button:hover,
.dw-snoop-command-button:focus-visible {
  background: #7a84e8;
  outline: none;
}

.dw-snoop-footer {
  display: flex;
  justify-content: flex-end;
  padding: 20px 30px;
  background: #1f2128;
  border-top: 1px solid #30333b;
}

.dw-snoop-stop {
  background: #ef7774;
  min-width: 172px;
}

.dw-snoop-stop:hover,
.dw-snoop-stop:focus-visible {
  background: #ff8582;
  outline: none;
}

/* ── Login modal responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
  .dw-login-modal {
    flex-direction: column;
    width: 95vw;
    height: auto;
    max-height: 90vh;
  }

  .dw-login-art {
    width: 100%;
    min-width: unset;
    height: 160px;
    border-radius: 8px 8px 0 0;
  }

  .dw-login-form {
    padding: 20px 20px 16px;
  }

  .dw-snoop-overlay {
    padding: 8px;
  }

  .dw-snoop-modal {
    width: 100%;
    height: 94vh;
    max-width: none;
  }

  .dw-snoop-header {
    padding: 16px;
  }

  .dw-snoop-title {
    font-size: 18px;
  }

  .dw-snoop-stream {
    margin: 10px;
    font-size: 13px;
  }

  .dw-snoop-controls {
    padding: 0 10px 12px;
  }

  .dw-snoop-command-row {
    grid-template-columns: 1fr;
  }

  .dw-snoop-footer {
    padding: 12px 10px;
  }

  .dw-snoop-stop {
    width: 100%;
  }
}

/* ── Connection strip (auth modals) + reconnect overlay ─────────── */

.dw-conn-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  font-size: 12px;
  background: var(--df-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--df-border);
  color: var(--df-muted, #9da7b3);
}

.dw-conn-strip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7280;
  flex: none;
}

.dw-conn-strip .dw-spinner-small { display: none; }

.dw-conn-strip.is-connected .dw-conn-strip-dot { background: #3fb950; }
.dw-conn-strip.is-reconnecting .dw-conn-strip-dot { display: none; }
.dw-conn-strip.is-reconnecting .dw-spinner-small { display: inline-block; }
.dw-conn-strip.is-reconnecting { color: #d29922; border-color: #d2992255; }
.dw-conn-strip.is-disconnected .dw-conn-strip-dot { background: #f85149; }
.dw-conn-strip.is-disconnected { color: #f85149; border-color: #f8514955; }

.dw-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--df-accent, #58a6ff);
  border-radius: 50%;
  animation: dw-spin 0.8s linear infinite;
  flex: none;
}

.dw-spinner-small {
  width: 12px;
  height: 12px;
  border-width: 2px;
  border-top-color: currentColor;
  animation: dw-spin 0.8s linear infinite;
}

@keyframes dw-spin {
  to { transform: rotate(360deg); }
}

.dw-conn-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 10500;
}

.dw-conn-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 90vw;
  padding: 28px 32px;
  border-radius: 10px;
  background: var(--df-bg, #0d1117);
  border: 1px solid var(--df-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.dw-conn-status {
  font-size: 16px;
  font-weight: 600;
  color: var(--df-btn-fg, #e6edf3);
}

.dw-conn-detail {
  font-size: 12px;
  color: var(--df-muted, #9da7b3);
  min-height: 1.2em;
}

.dw-conn-buttons {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
