/* ── 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: #161b22;
  border: 1px solid #30363d;
  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 #30363d;
  background: #0d1117;
  border-radius: 8px 8px 0 0;
}

.dw-modal-title {
  font-size: 13px;
  font-weight: 600;
  color: #c9d1d9;
}

.dw-modal-close {
  background: none;
  border: none;
  color: #484f58;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
}
.dw-modal-close:hover { color: #c9d1d9; }

.dw-modal-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  scrollbar-color: #30363d #0d1117;
  scrollbar-width: thin;
}

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

.dw-modal-body::-webkit-scrollbar-track {
  background: #0d1117;
  border-left: 1px solid #21262d;
}

.dw-modal-body::-webkit-scrollbar-thumb {
  background: #30363d;
  border: 2px solid #0d1117;
  border-radius: 999px;
}

.dw-modal-body::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

/* ── 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;
}

/* ── Display elements ───────────────────────────────────────────── */
.dw-heading {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #c9d1d9;
}

.dw-paragraph {
  margin: 0;
  font-size: 12px;
  color: #8b949e;
  line-height: 1.5;
}

.dw-text {
  font-size: 12px;
  color: #c9d1d9;
}

.dw-divider {
  border: none;
  border-top: 1px solid #21262d;
  margin: 4px 0;
}

.dw-progress {
  position: relative;
  height: 16px;
  background: linear-gradient(180deg, #0d1117, #161b22);
  border: 1px solid #30363d;
  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: #f0f6fc;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.65);
}

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

.dw-label {
  font-size: 11px;
  color: #8b949e;
  font-weight: 600;
}

.dw-input, .dw-select {
  background: #0d1117;
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 5px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

.dw-input:focus, .dw-select:focus {
  border-color: #58a6ff;
}

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

.dw-checkbox-label {
  font-size: 12px;
  color: #c9d1d9;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.dw-button {
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
  padding: 5px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}
.dw-button:hover { background: #30363d; }

.dw-button-primary {
  background: #238636;
  border-color: #2ea043;
  color: #fff;
}
.dw-button-primary:hover { background: #2ea043; }

.dw-button-secondary {
  background: #21262d;
  border-color: #30363d;
}

/* ── Image display ─────────────────────────────────────────────── */
.dw-image {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #0d1117;
  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: #8b949e;
  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;
}

/* ── 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 #30363d;
  border-radius: 8px;
  overflow: hidden;
  background: #0d1117;
  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 #58a6ff;
  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: #c9d1d9;
  font-size: 14px;
  line-height: 1.35;
}

.dw-finger-tagline {
  margin-bottom: 8px;
  color: #f0f6fc;
  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: #8b949e;
  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 #30363d;
  border-radius: 8px;
  overflow: hidden;
  background: #0d1117;
  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: #58a6ff;
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}

.dw-player-row-avatar-button:focus-visible {
  outline: 2px solid #58a6ff;
  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: #f0f6fc;
  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 #30363d;
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.46);
  color: #c9d1d9;
  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: #f0f6fc;
  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: #8b949e;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
}

.dw-player-tooltip-value {
  color: #c9d1d9;
  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: #f0f6fc;
}

.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 #58a6ff;
  border-radius: 999px;
  color: #e6edf3;
  background: rgba(88, 166, 255, 0.12);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.dw-player-row-name {
  min-width: 0;
  color: #f0f6fc;
  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: #484f58;
  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 #30363d;
  border-radius: 999px;
  background: rgba(48, 54, 61, 0.55);
  color: #c9d1d9;
  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 #30363d;
  border-radius: 8px;
  background: #0d1117;
  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: #c9d1d9;
  cursor: pointer;
  line-height: 1;
}

.dw-avatar-lightbox-close:hover,
.dw-avatar-lightbox-close:focus-visible {
  border-color: #58a6ff;
  color: #f0f6fc;
}

/* ── 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: #c9d1d9;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 2px;
}

.dw-login-tagline {
  font-size: 13px;
  color: #58a6ff;
  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: #238636;
  border-color: #2ea043;
  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: #2ea043;
  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: #30363d #0d1117;
  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: #30363d;
  border: 2px solid #0d0f12;
  border-radius: 999px;
}

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

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

.dw-snoop-line-input {
  color: #c9d1d9;
}

.dw-snoop-line-command {
  color: #d29922;
}

.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 #30363d;
  border-radius: 7px;
  background: #16181e;
  color: #f0f6fc;
  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%;
  }
}
