:root { --testnet-green:#54e3a2; }
.chat, #buyStakeBtn,
#walletConnectBtn { display:none !important; }
main { grid-template-columns: 1fr !important; }
.content { min-width:0; }
.v2-notice { position:fixed; z-index:9999; right:18px; bottom:18px; max-width:380px; padding:12px 16px; border-radius:10px; border:1px solid rgba(255,120,35,.65); background:#15191f; color:#f8fafc; box-shadow:0 16px 45px #0009; }
.v2-notice.ok { border-color:rgba(84,227,162,.7); }
.v2-grid-winner { position:relative; border-color:#54e3a2 !important; box-shadow:inset 0 0 0 2px #54e3a2,0 0 24px rgba(84,227,162,.42) !important; }
.v2-grid-winner::after { content:"WINNER"; position:absolute; right:9px; top:8px; padding:2px 6px; border-radius:999px; background:rgba(84,227,162,.14); color:#54e3a2; font:700 9px/1.4 Arial,sans-serif; letter-spacing:.08em; }
#disconnectBtn { display:none; }

/* Stake page — a compact Crucible-style dashboard, with artwork always in view. */
#stakeView.left-wrap {
  display: grid !important;
  grid-template-columns: minmax(0, 1.18fr) minmax(390px, .82fr) !important;
  align-items: stretch !important;
  gap: 14px !important;
  width: min(1460px, calc(100vw - 32px)) !important;
  max-width: 1460px !important;
  height: calc(100vh - 100px) !important;
  min-height: 0 !important;
  max-height: calc(100vh - 100px) !important;
  margin: 8px auto 0 !important;
  overflow: hidden !important;
}

/* Navigation hides inactive pages with an inline display:none. Keep that
   authoritative despite the grid layout above. */
#stakeView.left-wrap[style*="display:none"],
#stakeView.left-wrap[style*="display: none"] {
  display: none !important;
}

#stakeView .mid-col,
#stakeView .right {
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  gap: 10px !important;
}

#stakeView .mid-col {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-areas: "stake-head stake-head" "stake-stats stake-stats" "stake-positions stake-apy" !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  gap: 10px !important;
  order: 1 !important;
  min-height: 0 !important;
}

#stakeView .right {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: 112px auto auto !important;
  align-content: stretch !important;
  order: 2 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

#stakeView .st-header {
  grid-area: stake-head !important;
  min-height: 0;
  padding: 17px 20px 15px;
  border: 1px solid rgba(255, 130, 48, .28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 112, 36, .09), rgba(12, 16, 22, .96) 58%);
  overflow: hidden;
}

#stakeView .st-header-divider {
  opacity: .14;
}

#stakeView .st-title {
  margin: 0 0 4px;
  font-size: clamp(26px, 2.4vw, 40px);
  line-height: 1;
}

#stakeView .st-subtitle {
  margin: 0;
  font-size: 12px;
}

#stakeView .chips {
  grid-area: stake-stats !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#stakeView .chip {
  min-height: 68px;
  padding: 9px 12px;
}

#stakeView #yourStakedUsd { display: none !important; }

#stakeView .chip .c-value {
  font-size: 15px;
}

#stakeView .chip .c-sub {
  font-size: 9px;
}

#stakeView .positions,
#stakeView .apy-card {
  margin-top: 0;
  padding: 14px 16px;
  border-radius: 14px;
  min-height: 0 !important;
  overflow: hidden !important;
}

#stakeView .positions:not(.apy-card) { grid-area: stake-positions !important; }
#stakeView .apy-card { grid-area: stake-apy !important; }

#stakeView .positions-head {
  padding-bottom: 8px;
  margin-bottom: 8px;
}

#stakeView #positionsBody {
  max-height: calc(100% - 42px);
  overflow-y: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 128, 48, .5) transparent;
}

#stakeView #positionsBody .pos-row {
  min-height: 82px;
  padding: 11px 12px;
}

#stakeView .apy-card .positions-compact-body {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: calc(100% - 42px);
  overflow-y: auto;
}

#stakeView .apy-card .pos-row {
  min-height: 72px;
  padding: 10px 8px;
}

#stakeView .apy-card .pos-amount {
  font-size: 18px;
}

#stakeView .st-guardian-card {
  order: 1 !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 112px !important;
  margin: 0 !important;
  padding: 8px 14px !important;
  border: 1px solid rgba(255, 130, 48, .28);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 46%, rgba(46, 190, 125, .15), transparent 48%),
    linear-gradient(180deg, rgba(19, 25, 31, .98), rgba(10, 14, 19, .98));
  overflow: hidden;
}

#stakeView .st-guardian-img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 360px !important;
  max-height: 102px !important;
  margin: auto !important;
  object-fit: contain !important;
}

#stakeView .tier-card {
  order: 2 !important;
  padding: 7px 10px !important;
  border-radius: 14px !important;
}

#stakeView .rewards {
  order: 3 !important;
  padding: 7px 10px !important;
  border-radius: 14px !important;
}

#stakeView .tier-card .tier-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px !important;
  margin-bottom: 5px !important;
}

#stakeView .tier-card .stake-head,
#stakeView .tier-card .bal-line { margin-bottom: 3px !important; }
#stakeView .tier-card .tier-btn { min-height: 39px !important; padding: 4px 3px !important; }
#stakeView .tier-card .big-amount { padding: 5px 9px !important; margin-bottom: 3px !important; }
#stakeView .tier-card .helper { margin-bottom: 3px !important; font-size: 10px !important; line-height: 1.15 !important; }
#stakeView .tier-card .quick { gap: 4px !important; margin-bottom: 5px !important; }
#stakeView .tier-card .quick button { padding: 5px !important; }
#stakeView .tier-card .deploy { padding: 7px !important; }

#stakeView .rewards-head { margin-bottom: 4px !important; }
#stakeView .rewards .r-row { padding: 3px 0 !important; font-size: 11px !important; }
#stakeView .claims { gap: 4px !important; margin-top: 1px !important; }
#stakeView .claims button { padding: 7px 10px !important; font-size: 12px !important; }

#stakeView .claims {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 920px) {
  #stakeView.left-wrap {
    display: flex !important;
    width: min(680px, calc(100vw - 24px)) !important;
    flex-direction: column !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  #stakeView .mid-col {
    order: 1 !important;
    grid-template-columns: 1fr !important;
    grid-template-areas: "stake-head" "stake-stats" "stake-positions" "stake-apy" !important;
  }
  #stakeView .right { order: 2 !important; grid-template-rows: 220px auto auto !important; }
  #stakeView .st-guardian-card { height: 220px !important; }
  #stakeView .st-guardian-img { max-height: 204px !important; }

  #stakeView.left-wrap[style*="display:none"],
  #stakeView.left-wrap[style*="display: none"] {
    display: none !important;
  }
}

@media (max-width: 560px) {
  #stakeView .chips,
  #stakeView .apy-card .positions-compact-body {
    grid-template-columns: 1fr;
  }
  #stakeView #positionsBody {
    grid-template-columns: 1fr;
  }
}
