@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;400&display=swap');

body {
  background: linear-gradient(135deg, #7b2ff2 0%, #f357a8 100%);
  font-family: 'Montserrat', sans-serif;
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.section {
  width: 420px;
  max-width: 96vw;
  padding: 36px 28px;
  border-radius: 32px;
  box-shadow: 0 8px 48px 0 rgba(31, 38, 135, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(13px);
  border: 1.5px solid rgba(255,255,255,0.15);
  margin-top: 48px;
}
.logo {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  margin-bottom: 18px;
  background: white;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 16px 0 rgba(127, 46, 217, 0.15);
}
h1, h2 {
  margin: 16px 0 20px 0;
  font-size: 2.1rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(127,46,217,0.18);
}
input[type="number"], input[type="text"], input[type="password"], input[type="email"] {
  width: 100%;
  padding: 13px;
  border-radius: 15px;
  border: none;
  font-size: 1.1rem;
  margin-bottom: 17px;
  outline: none;
  background: rgba(255,255,255,0.33);
  color: #3b2457;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(127,46,217,0.13);
  transition: background 0.17s;
}
input[type="number"]:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus {
  background: rgba(255,255,255,0.55);
}
.glass-btn {
  width: 100%;
  padding: 13px;
  border-radius: 15px;
  border: none;
  font-size: 1.07rem;
  font-weight: 700;
  background: linear-gradient(90deg,#f8e178 0%,#f8b84e 100%);
  color: #8b3fd9;
  box-shadow: 0 4px 16px 0 rgba(246, 211, 101, 0.16);
  margin-top: 6px;
  cursor: pointer;
  transition: 0.18s;
}
.glass-btn:hover {
  background: linear-gradient(90deg, #f8b84e 0%, #f8e178 100%);
}
.logout-btn {
  background: rgba(255,255,255,0.12);
  color: #a04eea;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  padding: 12px 0;
  margin-top: 30px;
  width: 100%;
  cursor: pointer;
  font-size: 1em;
}
.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-size: 1.04em;
  justify-content: flex-end;
}
#user-label {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.auth-hint {
  width: 100%;
  text-align: center;
  margin: 8px 0 0 0;
  font-size: 1em;
  color: #ffe683;
}
.auth-hint a { color: #ffe683; text-decoration: underline; }
.auth-message { color: #27e570; margin-top: 8px; min-height: 16px; }
.auth-error { color: #ff9191; min-height: 16px; margin: 7px 0 2px 0; }
.hidden { display: none !important; }
.dash-message { color: #ff9191; min-height: 16px; margin: 9px 0; }
.stake-actions, .unstake-actions { width: 100%; display: flex; gap: 10px; }
.stake-actions input, .unstake-actions input { flex: 2; margin: 0; }
.stake-actions button, .unstake-actions button { flex: 1; }
.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 18px 0 20px 0;
}
.stat-block {
  flex: 1;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 12px 7px;
  text-align: center;
  color: #421b7a;
  min-width: 70px;  
}
.stat-label {
  font-size: 1em;
  color: #421b7a;
  opacity: 0.88;
}
.stat-val {
  font-size: 1.18em;
  color: #24144f;
  font-weight: bold;
  margin-top: 5px;
}
.spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #8b3fd9;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  animation: spin 0.93s linear infinite;
  margin: 16px auto 8px auto;
}
.highlight-msg {
  color: #fffed6;
  background: rgba(255,255,255,0.09);
  padding: 11px 18px;
  margin-bottom: 12px;
  border-radius: 12px;
  font-size: 1.13em;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 2px 8px 0 rgba(127,46,217,0.07);
}
.highlight-msg b {
  color: #ffe45c;
}
/* Already staked row for Go to Dashboard */
.already-staked-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 12px;
}
.already-staked-label {
  color: #fff;
  font-size: 1.04em;
  font-weight: 500;
  margin-right: 2px;
}
.small-btn,
.copy-btn,
#withdraw-btn,
#unstake-btn {
  padding: 13px 18px;
  min-width: 100px;
  border-radius: 15px;
  font-size: 1.07rem;
  font-weight: 700;
  background: linear-gradient(90deg,#f8e178 0%,#f8b84e 100%);
  color: #8b3fd9;
  box-shadow: 0 4px 16px 0 rgba(246, 211, 101, 0.16);
  margin-top: 6px;
  cursor: pointer;
  transition: 0.18s;
}
.copy-btn {
  margin-left: 10px;
  margin-top: 0;
  width: auto;
  height: 45px; 
  display: inline-block;
  vertical-align: middle;
}
#withdraw-btn,
#unstake-btn {
  width: auto;
  display: inline-block;
  height: 45px;
}
.withdraw-modal {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 99;
  padding: 24px 18px;
  background: rgba(255,255,255,0.98);
  border-radius: 22px;
  box-shadow: 0 4px 28px 0 rgba(127,46,217,0.19);
  min-width: 310px;
  max-width: 93vw;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.withdraw-modal input {
  margin-bottom: 13px;
}
.withdraw-modal button {
  margin-bottom: 6px;
}

/* ---- Referral link wrap and layout fix ---- */
.referral-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px; /* space between link/button */
  word-break: break-all;
  font-size: 1.03em;
  color: #24144f;
  margin-top: 9px;
  margin-bottom: 0;
  background: rgba(255,255,255,0.11);
  border-radius: 15px;
  padding: 16px 10px;
}
.referral-section ul {
  margin: 5px 0 0 10px;
  font-size: 0.97em;
  color: #43147e;
}
#my-ref-link {
  display: inline-block;
  max-width: 60%;
  min-width: 120px;
  word-break: break-all;
  vertical-align: middle;
  font-size: 0.97em;
  color: #3b2457;
  margin-right: 8px;
}

/* Responsive fix for referral link on small screens */
@media (max-width: 540px) {
  .section { padding: 12vw 4vw; }
  .logo { width: 54px; height: 54px; }
  .stat-row { flex-direction: column; gap: 12px; }
  .copy-btn, #withdraw-btn, #unstake-btn {
    min-width: 80px;
    font-size: 1em;
    height: 40px;
  }
  .referral-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  #my-ref-link {
    max-width: 98vw;
    min-width: 80px;
    font-size: 0.93em;
    margin-right: 0;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg);}
}
