:root {
  --bg: #090b14;
  --bg-soft: #111522;
  --bg-card: rgba(20, 25, 40, 0.82);
  --bg-card-strong: rgba(18, 23, 36, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --border-blue: rgba(109, 125, 255, 0.26);
  --text: #f5f7fb;
  --muted: #a7aec2;
  --blue: #6d7dff;
  --blue-strong: #4d63ff;
  --green: #19c37d;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 10%, rgba(109, 125, 255, 0.18), transparent 24%),
    radial-gradient(circle at 92% 18%, rgba(123, 60, 255, 0.18), transparent 26%),
    linear-gradient(180deg, #070912 0%, #090b14 100%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 38%, transparent 92%);
  -webkit-mask-image: radial-gradient(circle at center, black 38%, transparent 92%);
  pointer-events: none;
}

.bg-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.2;
  pointer-events: none;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: #304ffe;
  top: -130px;
  left: -100px;
}

.orb-2 {
  width: 360px;
  height: 360px;
  background: #7b3cff;
  right: -80px;
  top: 90px;
}

.container {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 24px 72px;
}

/* HERO */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 400px);
  align-items: center;
  gap: 42px;
  margin-bottom: 34px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-logo {
  width: 104px;
  height: 104px;
  object-fit: contain;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.eyebrow {
  color: var(--blue);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero h1 {
  margin: 0;
  font-size: 58px;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-subtitle {
  margin-top: 14px;
  max-width: 760px;
  font-size: 17px;
  line-height: 1.58;
  color: var(--muted);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(109, 125, 255, 0.12);
  color: #d7ddff;
  border: 1px solid rgba(109, 125, 255, 0.28);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
}

/* TOP CARDS */

.epoch-card,
.stake-card,
.delegate-card {
  background: linear-gradient(180deg, rgba(109, 125, 255, 0.14), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-blue);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.epoch-card {
  padding: 24px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.epoch-label,
.stake-label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.epoch-value {
  font-size: 50px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.epoch-subvalue {
  margin-top: 12px;
  color: #d7ddff;
  font-size: 17px;
  font-weight: 600;
}

.epoch-progress {
  width: 100%;
  height: 12px;
  margin-top: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.epoch-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6d7dff 0%, #7b3cff 55%, #a855f7 100%);
  box-shadow: 0 0 18px rgba(109, 125, 255, 0.35);
  transition: width 0.6s ease;
}

/* HERO STATS */

.hero-stats {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 420px);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 34px;
}

/* STAKE CARD */

.stake-card {
  padding: 22px 26px;
  width: 100%;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.stake-inline {
  display: grid;
  grid-template-columns: minmax(250px, 1.2fr) repeat(3, max-content);
  align-items: center;
  column-gap: 42px;
  row-gap: 18px;
  width: 100%;
}

.stake-main {
  min-width: 0;
}

.stake-value {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.stake-subvalue {
  margin-top: 8px;
  color: #d7ddff;
  font-size: 15px;
  line-height: 1.45;
}

.stake-metrics {
  display: contents;
}

.stake-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.stake-stat-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.stake-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.stake-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #19c37d;
  box-shadow: 0 0 12px rgba(25, 195, 125, 0.7);
  animation: pulseGreen 1.4s infinite ease-in-out;
}

.status-dot.down {
  background: #ff5d5d;
  box-shadow: 0 0 12px rgba(255, 93, 93, 0.7);
  animation: pulseRed 1.4s infinite ease-in-out;
}

@keyframes pulseGreen {
  0% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0.45; transform: scale(0.9); }
}

@keyframes pulseRed {
  0% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0.45; transform: scale(0.9); }
}

/* DELEGATE CARD */

.delegate-card {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.delegate-card-header {
  margin-bottom: 16px;
}

.delegate-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.delegate-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.delegate-connect-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.delegate-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.connected-wallet-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.connected-wallet-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.connected-wallet-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.wallet-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wallet-balance-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.wallet-balance-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  text-align: right;
}

.stake-btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  color: #161616;
  background: linear-gradient(180deg, #ffd85a 0%, #f5b700 100%);
  box-shadow: 0 10px 24px rgba(245, 183, 0, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.stake-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(245, 183, 0, 0.34);
}

.stake-btn:active {
  transform: translateY(0);
}

/* delegate input/button row */

.delegate-controls .delegate-action {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 18px;
  align-items: center;
  width: 100%;
}

.delegate-controls .stake-input-wrap {
  position: relative;
  width: 100%;
}

.delegate-controls .stake-input {
  width: 100%;
  height: 52px;
  padding: 0 86px 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 14, 24, 0.9);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.delegate-controls .stake-input:focus {
  border-color: rgba(109, 125, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(109, 125, 255, 0.08);
}

.delegate-controls .stake-input::placeholder {
  color: #8e96ad;
  opacity: 1;
}

.delegate-controls .max-stake-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.delegate-controls .max-stake-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.delegate-controls #stakeBtn {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-align: center;
  background: linear-gradient(180deg, #ffd85a 0%, #f5b700 100%);
  color: #161616;
}

/* SECTION */

.section {
  margin-top: 12px;
}

.section-title {
  margin: 0 0 16px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  margin: -2px 0 24px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

/* MODE CARDS */

.mode-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 10px;
  margin-bottom: 34px;
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mode-card:hover {
  transform: translateY(-2px);
  border-color: rgba(109, 125, 255, 0.38);
}

.mode-card.active {
  border-color: rgba(109, 125, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(109, 125, 255, 0.24), var(--shadow);
}

.mode-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.mode-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(109, 125, 255, 0.15);
  color: #eef2ff;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.mode-tag {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

.mode-tag.recommended {
  color: #dff9ed;
  border-color: rgba(25, 195, 125, 0.28);
  background: rgba(25, 195, 125, 0.12);
}

.mode-card h3 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.mode-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.mode-card ul {
  margin: 0;
  padding-left: 18px;
  color: #edf1ff;
}

.mode-card li {
  margin-bottom: 8px;
  line-height: 1.55;
}

.mode-card li:last-child {
  margin-bottom: 0;
}

/* OPTIONAL PANELS / COMMANDS */

.command-panel,
.output-panel,
.code-card {
  background: rgba(10, 14, 24, 0.92);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.command-panel,
.output-panel {
  padding: 24px;
  margin-top: 24px;
}

.panel-title {
  margin: 0 0 14px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.panel-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.code-card {
  position: relative;
  padding: 18px 20px;
  overflow-x: auto;
}

.code-card pre,
.code-card code,
.command-output,
#commandOutput {
  margin: 0;
  color: #eef2ff;
  font-size: 14px;
  line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.copy-btn,
.primary-btn,
button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--blue), var(--blue-strong));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(77, 99, 255, 0.22);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.copy-btn:hover,
.primary-btn:hover,
button:hover {
  transform: translateY(-1px);
}

.copy-btn:active,
.primary-btn:active,
button:active {
  transform: translateY(0);
}

/* FORM */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 26px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group.full {
  grid-column: 1 / -1;
}

label {
  font-size: 14px;
  font-weight: 700;
  color: #e8edff;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 18px;
  padding: 16px 18px;
  font-size: 15px;
  outline: none;
  min-height: 58px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(109, 125, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(109, 125, 255, 0.08);
}

input::placeholder,
textarea::placeholder {
  color: #7f889f;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

.helper-text,
.form-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* GENERATOR */

.generator-shell {
  background: rgba(12, 16, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  margin-top: 18px;
}

.generator-header {
  margin-bottom: 24px;
}

.generator-eyebrow {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.generator-title {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.generator-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 760px;
}

.generator-form-card {
  background: rgba(18, 23, 36, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-top: 22px;
}

.generator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.generator-actions button,
.generator-actions .copy-btn,
.generator-actions .primary-btn {
  min-width: 210px;
}

.generator-output-card {
  background: rgba(18, 23, 36, 0.9);
  border: 1px solid rgba(109, 125, 255, 0.18);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-top: 24px;
}

.generator-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.generator-output-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.generator-output-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.command-output-wrap {
  background: rgba(8, 12, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 18px 20px;
  overflow-x: auto;
}

.generator-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.generator-mini-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 16px;
}

.generator-mini-card-title {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.generator-mini-card-value {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

/* FOOTER */

.footer {
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* HELPERS */

.hidden {
  display: none !important;
}

.center {
  text-align: center;
}

.muted {
  color: var(--muted);
}

.success {
  color: var(--green);
}

/* RESPONSIVE */

@media (max-width: 1180px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 28px;
  }

  .mode-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .generator-mini-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .generator-shell,
  .generator-form-card,
  .generator-output-card {
    padding: 20px;
  }
}

@media (max-width: 820px) {
  .container {
    padding: 36px 18px 56px;
  }

  .brand-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .brand-logo {
    width: 84px;
    height: 84px;
    border-radius: 18px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .epoch-value {
    font-size: 42px;
  }

  .stake-value {
    font-size: 28px;
  }

  .stake-inline {
    grid-template-columns: 1fr;
    row-gap: 20px;
  }

  .stake-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 40px;
  }
}

@media (max-width: 700px) {
  .delegate-controls .delegate-action {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .delegate-controls #stakeBtn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 28px 14px 44px;
  }

  .hero {
    gap: 22px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero-badges {
    gap: 8px;
  }

  .badge {
    font-size: 12px;
    padding: 8px 12px;
  }

  .epoch-card,
  .stake-card,
  .delegate-card,
  .mode-card,
  .command-panel,
  .output-panel,
  .code-card,
  .generator-shell,
  .generator-form-card,
  .generator-output-card {
    border-radius: 18px;
    padding: 18px;
  }

  .epoch-value {
    font-size: 35px;
  }

  .epoch-subvalue,
  .stake-subvalue {
    font-size: 14px;
  }

  .mode-card h3 {
    font-size: 24px;
  }

  .copy-btn,
  .primary-btn,
  button,
  .generator-actions button,
  .generator-actions .copy-btn,
  .generator-actions .primary-btn {
    width: 100%;
    min-width: 0;
  }

  .copy-row {
    justify-content: stretch;
  }

  .generator-actions {
    flex-direction: column;
  }

  .generator-title {
    font-size: 24px;
  }
}
