/* RUNS bet stake — loads last on homepage (main.css hides bare input) */

#esRoot .es-stake-input {
  position: static;
  z-index: auto;
  display: block;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font-family: 'Roboto Mono', monospace;
  font-size: var(--es-panel-font, 12px);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  -webkit-appearance: none;
  appearance: none;
}

#esRoot .es-stake-input:focus {
  outline: none;
}

#esRoot .es-stake-input:disabled {
  opacity: 1;
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.45);
}

#esRoot .es-runs-stake-stepper__usd {
  position: static;
  z-index: auto;
  display: block;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  width: auto;
  min-width: 2.75rem;
  max-width: 4.25rem;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-family: 'Roboto Mono', monospace;
  font-size: calc(var(--es-panel-font, 12px) * 1.215);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: left;
  line-height: 1.15;
  -webkit-appearance: none;
  appearance: none;
}

#esRoot .es-runs-stake-stepper__usd:focus {
  outline: none;
}

#esRoot .es-runs-stake-stepper__usd:disabled {
  opacity: 1;
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.38);
}

/* ── Pick rules ── */
.es-runs-rules {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 3px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: var(--es-radius, 8px);
  border: 1px solid rgba(251, 226, 75, 0.14);
  background: rgba(251, 226, 75, 0.04);
}

.es-runs-rule-line {
  margin: 0;
  font-size: var(--es-panel-font, 12px);
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.72);
}

.es-runs-rule-tag {
  display: inline-block;
  min-width: 2.6rem;
  margin-right: 0.35rem;
  color: var(--es-accent, #ffe233);
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* ── Stacked separate boxes ── */
.es-stake-stack {
  --es-stake-frame: rgba(251, 226, 75, 0.28);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.es-stake-amount,
.es-stake-actions {
  flex-shrink: 0;
}

.es-stake-amount {
  display: flex;
  align-items: stretch;
  min-height: 52px;
  border: 1px solid var(--es-stake-frame);
  border-radius: var(--es-radius, 8px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  box-sizing: border-box;
}

.es-stake-amount__label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: rgba(251, 226, 75, 0.14);
  color: var(--es-accent, #ffe233);
  font-family: 'Roboto Mono', monospace;
  font-size: var(--es-panel-font, 12px);
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-right: 1px solid var(--es-stake-frame);
}

.es-stake-amount__body {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 2px 8px;
  min-width: 0;
  padding: 8px 10px 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.es-stake-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.es-stake-field--sol {
  grid-column: 1;
  grid-row: 1;
}

.es-stake-field--usd {
  grid-column: 1;
  grid-row: 2;
}

.es-stake-tag {
  display: none;
}

.es-stake-input-wrap {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 4px;
}

.es-stake-input-wrap .es-stake-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.es-stake-input-prefix {
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1;
}

.es-stake-field--sol .es-stake-input {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  cursor: text;
}

.es-stake-field--sol .es-stake-input:focus {
  color: #fff;
}

.es-stake-field--usd .es-stake-input {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.es-stake-sol-icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.es-stake-amount-lock {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--es-accent, #ffe233);
  line-height: 0;
}

.es-stake-amount-lock[hidden] {
  display: none;
}

.es-stake-stack--locked .es-stake-sol-icon {
  display: none;
}

.es-stake-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(251, 226, 75, 0.22);
  border-radius: var(--es-radius, 8px);
  background: rgba(255, 255, 255, 0.02);
  box-sizing: border-box;
}

.es-stake-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 2px;
  border: 1px solid rgba(251, 226, 75, 0.22);
  border-radius: var(--es-radius, 8px);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.82);
  font-family: 'Roboto Mono', monospace;
  font-size: var(--es-panel-font, 12px);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.es-stake-btn:hover:not(:disabled) {
  border-color: var(--es-accent, #ffe233);
  background: rgba(251, 226, 75, 0.1);
  color: var(--es-accent, #ffe233);
}

.es-stake-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.es-stake-stack .es-buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: 100%;
  min-height: 72px;
  margin: 0;
  padding: 16px 12px;
  border: none;
  border-radius: var(--es-radius, 8px);
  background: var(--es-accent, #ffe233);
  color: var(--es-text-on-accent, #0d0c07);
  font-family: "Public Pixel", ui-monospace, monospace;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.1;
  cursor: pointer;
  box-sizing: border-box;
}

.es-stake-stack .es-buy-btn:hover:not(:disabled) {
  background: var(--es-accent-soft, #fbe24b);
}

.es-stake-stack .es-buy-btn:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.28);
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .es-stake-stack .es-buy-btn {
    flex: 0 0 auto;
    min-height: calc(72px * 0.8);
    padding-top: calc(16px * 0.8);
    padding-bottom: calc(16px * 0.8);
  }
}

/* Used briefly while JS measures row height (avoids resize blow-up). */
.es-main-block.es-main-block--measuring .es-stake-stack .es-buy-btn {
  flex: 0 0 auto;
}

.es-stake-stack--locked .es-stake-amount {
  border-color: var(--es-accent, #ffe233);
  box-shadow: inset 0 0 0 1px rgba(251, 226, 75, 0.35);
}

.es-stake-stack--locked .es-stake-actions {
  opacity: 0.55;
  pointer-events: none;
}

.es-stake-stack--locked .es-stake-input {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 1;
}

.es-stake-stack--locked .es-stake-field--sol .es-stake-input {
  color: rgba(255, 255, 255, 0.55);
}

.es-stake-stack--locked .es-stake-field--usd .es-stake-input {
  color: #fff;
}
