* { user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; }

html {
  min-height: 100%;
  background-color: #0a2f3c;
}

html, body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  color: white;
  margin: 0;
}

#voodoo-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-color: #0a2f3c;
  background-image: url('/voodoo-token-background.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  pointer-events: none;
}

body {
  background-color: transparent !important;
  position: relative;
  z-index: 1;
}

/*
 * Stack normal page chrome above the background.
 * IMPORTANT: never apply this to RainbowKit portals ([data-rk]) or the RK root —
 * forcing position/z-index on every body child breaks multi-step wallet screens
 * (Frame → Zerion stays stuck on Frame, back/close broken, etc.).
 */
body > *:not(#voodoo-bg):not(#calculatorModal):not(#voodooUiModal):not(#rainbowkit-root):not([data-rk]) {
  position: relative;
  z-index: 1;
}

.pool-wrapper { text-align: center; margin-bottom: 1.5rem; }
.pool-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  margin: 0 auto 0.75rem;
  background: transparent !important;
  background-color: transparent !important;
}
.pool-logo,
img.pool-logo {
  width: 120px;
  height: 120px;
  margin: 0;
  padding: 0;
  border: none;
  background: none !important;
  background-color: transparent !important;
  object-fit: contain;
  image-rendering: auto;
}
img[src*="Logo"] {
  background: transparent !important;
  background-color: transparent !important;
}
.pool-title { font-size: 1.5rem; font-weight: 600; color: white; text-shadow: 0 2px 6px rgba(0,0,0,0.6); margin: 0; }
.pool-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem 5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  min-height: 382px !important;
  height: 382px;
  max-height: 382px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}
.tab-container { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-shrink: 0; }
.tab-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.75rem 0.5rem;
  font-weight: 600;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}
.tab-active { background: #2563eb; color: white; }
.tab-inactive { background: #1f2937; color: white; }
/* Fixed button row — busy labels must NEVER resize the card */
.btn-row {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
  align-items: stretch;
  width: 100%;
}
.action-btn {
  flex: 1 1 0;
  min-width: 0;
  width: 0; /* equal columns; label cannot grow the button */
  height: 2.75rem;
  min-height: 2.75rem;
  max-height: 2.75rem;
  padding: 0 0.4rem;
  border: none;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  cursor: pointer;
}
.action-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.approve-btn { background: #1e40af; }
.approve-btn:hover:not(:disabled) { background: #1e3a8a; }
.stake-btn { background: #2563eb; }
.stake-btn:hover:not(:disabled) { background: #1d4ed8; }
/*
 * Stake / Reward panels share .content
 * IMPORTANT: never set display:flex on .content without guarding .hidden —
 * that overrode Tailwind .hidden and left the Reward unstake <select>
 * always visible (“random dropdown”) on the Stake tab.
 */
.pool-wrapper .content {
  width: 224px !important;
  max-width: 224px !important;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

/* Only show the active panel */
.pool-wrapper .content:not(.hidden) {
  display: flex;
}

.pool-wrapper .content.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.pool-wrapper .content > .btn-row {
  margin-top: auto;
}

/* Reward tab: unstake select + button must fit fixed card height */
.pool-wrapper .content[id^="rewardContent"] {
  justify-content: flex-start;
  gap: 0.5rem;
}

.pool-wrapper .content[id^="rewardContent"] .timer-text {
  display: block;
  color: #111827;
  font-size: 1.125rem;
  margin: 0.25rem 0 0.75rem;
}

.pool-wrapper select[id^="unstakeSelect"] {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 2.75rem;
  min-height: 2.75rem;
  max-height: 2.75rem;
  margin: 0 0 0.75rem;
  padding: 0 0.75rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #111827;
  font-size: 0.8125rem;
  line-height: 1.2;
  box-sizing: border-box;
  appearance: auto;
  -webkit-appearance: menulist;
  cursor: pointer;
}

.pool-wrapper button[id^="unstake"] {
  display: block;
  width: 100%;
  height: 2.75rem;
  min-height: 2.75rem;
  max-height: 2.75rem;
  margin: 0;
  padding: 0 0.75rem;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  box-sizing: border-box;
  flex-shrink: 0;
}

.pool-wrapper button[id^="unstake"]:hover:not(:disabled) {
  background: #1d4ed8;
}

.pool-wrapper button[id^="unstake"]:disabled {
  opacity: 0.55;
  cursor: default;
}

.pool-wrapper .content[id^="rewardContent"] > p {
  margin: 0.5rem 0 0;
  font-size: 0.7rem;
  line-height: 1.3;
  color: #4b5563;
  flex-shrink: 1;
  overflow: hidden;
}

/* ROI line: fixed one-line height so rates never jump layout */
.pool-wrapper [id^="roi"] {
  display: inline-block;
  min-width: 5.5rem;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Calculator pool dropdown — styled, no layout spill */
#calculatorModal select#poolSelect {
  display: block;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #4b5563;
  background: #374151;
  color: #fff;
  font-size: 0.875rem;
  box-sizing: border-box;
  appearance: auto;
  -webkit-appearance: menulist;
}

#calculatorModal input#voodooAmount {
  box-sizing: border-box;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  color: #fff;
}

/* Allow text selection only in inputs/selects (global * disables it) */
input,
select,
textarea,
option {
  user-select: text;
  -webkit-user-select: text;
}

/* Soft highlight when Stake clicked without amount (no chrome alert) */
.pool-wrapper input.amount-needs-value,
.pool-wrapper input#amount1.amount-needs-value,
input.amount-needs-value {
  outline: 2px solid #2563eb !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  animation: amount-pulse 0.45s ease 2;
}

@keyframes amount-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
footer p { font-size: 20px !important; }
footer a { font-size: 30px !important; }
#connectBtn,
#voodooWalletBtn { cursor: pointer; }
#openCalculator { cursor: pointer; }

.wallet-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Fixed button size so labels never resize the layout */
.wallet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 10.5rem;
  min-width: 10.5rem;
  max-width: 10.5rem;
  height: 2.5rem;
  min-height: 2.5rem;
  max-height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.375rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  border: none;
  color: #fff;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-btn:disabled {
  opacity: 0.9;
  cursor: default;
}

/* Voodoo Wallet — brand navy only text: "Voodoo Wallet" | "Connected" */
.wallet-btn-voodoo {
  background: #073749;
}
.wallet-btn-voodoo:hover:not(:disabled) {
  background: #0a4a61;
}

/* "Other" — RainbowKit browser wallets only */
.wallet-btn-injected,
.wallet-btn-other {
  background: #1e40af;
}
.wallet-btn-injected:hover:not(:disabled),
.wallet-btn-other:hover:not(:disabled) {
  background: #1d4ed8;
}

/* Standalone WalletConnect QR (does not use RainbowKit modal) */
.wallet-btn-wc {
  background: #3b99fc;
}
.wallet-btn-wc:hover:not(:disabled) {
  background: #2b7fd4;
}
.wallet-btn-wc.is-connected {
  background: #2563eb;
}

/* AppKit / RainbowKit mount */
#appkit-root,
#rainbowkit-root {
  position: fixed;
  width: 0;
  height: 0;
  overflow: visible;
  z-index: 2147483000;
  pointer-events: none;
}

/* Reown AppKit / w3m overlays above dapp */
w3m-modal,
wcm-modal,
[data-rk],
body > [data-rk] {
  z-index: 2147483000 !important;
  color: #1a1b1f !important;
  pointer-events: auto !important;
}

body > [data-rk] button,
w3m-modal button {
  user-select: text !important;
  pointer-events: auto !important;
  cursor: pointer;
  font: inherit;
}

.wallet-btn.is-connected {
  /* no size change — only subtle opacity cue is forbidden; keep same chrome */
  opacity: 1;
}

@media (max-width: 640px) {
  .wallet-actions {
    max-width: 100%;
  }
  .wallet-btn {
    width: 9.25rem;
    min-width: 9.25rem;
    max-width: 9.25rem;
    height: 2.35rem;
    min-height: 2.35rem;
    max-height: 2.35rem;
    font-size: 0.8rem;
  }
}
#calculatorModal {
  position: fixed !important;
  inset: 0;
  z-index: 9999 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
#calculatorModal.hidden { display: none !important; }

/* ── Modern in-dapp dialogs (replace chrome alert/confirm) ── */
body.voodoo-ui-open {
  overflow: hidden;
}

#voodooUiModal.voodoo-ui-modal,
.voodoo-ui-modal {
  position: fixed !important;
  inset: 0;
  z-index: 100000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  pointer-events: auto;
}

#voodooUiModal.hidden,
.voodoo-ui-modal.hidden {
  display: none !important;
}

.voodoo-ui-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 18, 24, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.voodoo-ui-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 1.35rem;
  border-radius: 1rem;
  /* Clean white modal — not green/teal panel */
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(15, 23, 42, 0.04);
  text-align: center;
  color: #0f172a;
  animation: voodoo-ui-in 0.22s ease-out;
}

@keyframes voodoo-ui-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.voodoo-ui-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.85rem;
  border-radius: 9999px;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #2563eb;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  user-select: none;
}

.voodoo-ui-icon[data-type="error"] {
  background: #dc2626;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.35);
}

.voodoo-ui-icon[data-type="success"] {
  background: #16a34a;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.35);
}

.voodoo-ui-icon[data-type="warning"] {
  background: #d97706;
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.35);
}

.voodoo-ui-icon[data-type="info"] {
  background: #0e7490;
  box-shadow: 0 8px 20px rgba(14, 116, 144, 0.35);
}

.voodoo-ui-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #0f172a;
}

.voodoo-ui-message {
  margin: 0 0 1.35rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #475569;
  white-space: pre-wrap;
  word-break: break-word;
}

.voodoo-ui-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  align-items: center;
}

.voodoo-ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  min-height: 2.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 0.55rem;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

.voodoo-ui-btn:active {
  transform: scale(0.98);
}

.voodoo-ui-btn-primary {
  background: #2563eb;
  color: #fff;
}

.voodoo-ui-btn-primary:hover {
  background: #1d4ed8;
}

.voodoo-ui-btn-secondary {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.voodoo-ui-btn-secondary:hover {
  background: #e2e8f0;
}

.voodoo-ui-btn-ghost {
  background: transparent;
  color: #475569;
  border: 1px solid rgba(15, 23, 42, 0.14);
}

.voodoo-ui-btn-ghost:hover {
  background: #f8fafc;
  color: #0f172a;
}

@media (max-width: 480px) {
  .voodoo-ui-panel {
    padding: 1.4rem 1.15rem 1.15rem;
  }
  .voodoo-ui-actions {
    flex-direction: column-reverse;
    width: 100%;
  }
  .voodoo-ui-btn {
    width: 100%;
  }
}