/* Prestake card. Own panel, not nested in a card. Matches primitives-v3/participation-v3
   token usage and layout-v3 wallet-picker card language (18px radius, 999px pill). */

.prestake {
  position: relative;
  min-width: 0;
  max-width: 100%;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line, var(--hairline));
  border-radius: 18px;
  padding: var(--space-24, 24px);
}

.prestake__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16, 16px);
  margin-bottom: var(--space-16, 16px);
}

.prestake__head h3 {
  margin: 0;
  color: var(--ink);
  min-width: 0;
}

.prestake__state {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--fs-label, 11px);
  letter-spacing: var(--track-label, 0.09em);
  text-transform: uppercase;
  color: var(--mute);
  background: var(--card);
  border: 1px solid var(--line, var(--hairline));
  border-radius: 999px;
  padding: var(--space-8, 8px) var(--space-16, 16px);
  white-space: nowrap;
}

/* Bar */
.prestake__bar {
  height: 8px;
  width: 100%;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line, var(--hairline));
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: var(--space-24, 24px);
}

.prestake__fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--mute);
  transition: width 400ms var(--ease-soft, ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .prestake__fill {
    transition: none;
  }
}

/* Stats */
.prestake__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-16, 16px) var(--space-24, 24px);
  margin: 0 0 var(--space-24, 24px);
  min-width: 0;
}

.prestake__stats > div {
  min-width: 0;
}

.prestake__stats dt {
  margin: 0 0 var(--space-4, 4px);
  color: var(--mute);
  font-size: var(--fs-label, 11px);
  letter-spacing: var(--track-label, 0.09em);
  text-transform: uppercase;
}

.prestake__stats dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Action row */
.prestake__action {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8, 8px);
  min-width: 0;
  margin-bottom: var(--space-16, 16px);
}

.prestake__amount {
  flex: 1 1 8rem;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: var(--space-12, 12px) var(--space-16, 16px);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line, var(--hairline));
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.prestake__amount::placeholder {
  color: var(--mute);
}

.prestake__action .btn {
  flex: none;
  min-height: 44px;
}

.prestake__status {
  margin: 0;
  min-height: 1.4em;
  color: var(--mute);
}

/* Focus states */
.prestake__amount:focus-visible,
.prestake__action .btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* States */
.prestake[data-state="pre_token"] {
  opacity: 0.7;
}

.prestake[data-state="pre_token"] .prestake__fill {
  background: var(--mute);
}

.prestake[data-state="pre_token"] .prestake__amount,
.prestake[data-state="pre_token"] .prestake__action .btn {
  pointer-events: none;
  opacity: 0.6;
}

.prestake[data-state="prestake"] {
  opacity: 1;
}

.prestake[data-state="prestake"] .prestake__fill {
  background: var(--pg-accent, #B2EB76);
}

.prestake[data-state="pool_live"],
.prestake[hidden],
#prestakeFill[hidden] {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .prestake {
    padding: var(--space-16, 16px);
  }
}

@media (max-width: 480px) {
  .prestake__action {
    flex-direction: column;
    align-items: stretch;
  }

  .prestake__action .btn {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .prestake__stats {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-12, 12px);
  }
}

@media (max-width: 360px) {
  .prestake {
    padding: var(--space-12, 12px);
  }

  .prestake__amount {
    flex: 1 1 100%;
  }
}
