/* WVG connect + pay modals */

#wvg-connect-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.wvg-connect-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 20, 0.55);
  backdrop-filter: blur(4px);
}

.wvg-connect-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.wvg-connect-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.wvg-connect-head h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.wvg-connect-x {
  width: 36px;
  height: 36px;
  border: none;
  background: #f3f4f6;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #374151;
}

.wvg-wallet-list {
  padding: 8px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wvg-wallet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.wvg-wallet-row:hover {
  background: #f9fafb;
  border-color: #9945ff;
}

.wvg-wicon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.wvg-wicon.ph { background: linear-gradient(135deg, #ab9ff2, #6c5ce7); }
.wvg-wicon.sf { background: linear-gradient(135deg, #fc8c04, #f7b731); }
.wvg-wicon.bp { background: #e33e3f; }
.wvg-wicon.okx { background: #000; }
.wvg-wicon.mm { background: #f6851b; }
.wvg-wicon.me { background: #e42575; }

.wvg-arr {
  margin-left: auto;
  color: #9ca3af;
  font-size: 18px;
}

.wvg-detected {
  margin-left: auto;
  margin-right: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #059669;
  background: #d1fae5;
  padding: 3px 8px;
  border-radius: 999px;
}

.wvg-wallet-row:has(.wvg-detected) .wvg-arr {
  margin-left: 0;
}

/* Pay modal */
#wvg-pay-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 15, 20, 0.55);
  backdrop-filter: blur(4px);
}

.wvg-pay-dialog {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.wvg-pay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  font-size: 17px;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

.wvg-pay-head button {
  width: 36px;
  height: 36px;
  border: none;
  background: #f3f4f6;
  border-radius: 10px;
  font-size: 22px;
  cursor: pointer;
  color: #374151;
}

.wvg-pay-body {
  padding: 16px 20px 20px;
  max-height: min(78svh, 560px);
  overflow-y: auto;
}

.wvg-pay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: #6b7280;
}

.wvg-pay-row strong {
  color: #0f0f14;
  font-weight: 600;
  text-align: right;
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wvg-pay-total {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  font-size: 15px;
}

.wvg-pay-total strong {
  font-size: 18px;
  background: linear-gradient(90deg, #9945ff, #52e052, #14f195);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.wvg-pay-label {
  display: block;
  margin: 12px 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.wvg-amount-wrap {
  display: flex;
  gap: 8px;
}

.wvg-amount-wrap input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  min-width: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}

.wvg-amount-wrap input::-webkit-outer-spin-button,
.wvg-amount-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.wvg-amount-wrap input:focus {
  outline: none;
  border-color: #9945ff;
  box-shadow: 0 0 0 3px rgba(153, 69, 255, 0.12);
}

.wvg-amount-wrap button {
  padding: 0 16px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.wvg-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}

.wvg-presets button {
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #374151;
}

.wvg-presets button:hover {
  border-color: #52e052;
  color: #15803d;
}

.wvg-msg {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.wvg-msg-err {
  background: #fef2f2;
  color: #b91c1c;
}

.wvg-msg-ok {
  background: #ecfdf5;
  color: #047857;
}

#wvg-pay-btn {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #9945ff 0%, #6b46c1 45%, #52e052 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(153, 69, 255, 0.25);
}

#wvg-pay-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wvg-pay-foot {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
}

.wvg-toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #0f0f14;
  color: #fff;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.wvg-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.wvg-tick {
  color: #52e052;
  font-weight: 700;
}

@media (min-width: 768px) {
  .wvg-toast {
    bottom: 24px;
  }
}
