:root {
  --bg: #090a0c;
  --bg-soft: #101216;
  --panel: rgba(19, 21, 26, 0.92);
  --panel-strong: #17191f;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 196, 0, 0.26);
  --text: #f7f7f3;
  --muted: #979ba5;
  --muted-strong: #c7c9cf;
  --yellow: #ffc400;
  --yellow-soft: #ffdc66;
  --orange: #ff8a00;
  --green: #6ee7a7;
  --red: #ff7b7b;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% -10%, rgba(255, 196, 0, 0.10), transparent 28rem),
    radial-gradient(circle at 95% 20%, rgba(255, 138, 0, 0.07), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.13;
}

.ambient-one {
  top: 10rem;
  left: -12rem;
  background: var(--yellow);
}

.ambient-two {
  right: -14rem;
  bottom: -8rem;
  background: var(--orange);
}

.topbar {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  gap: 12px;
  letter-spacing: -0.03em;
}

.brand-mark {
  font-weight: 900;
  font-size: 1.55rem;
}

.brand-mark span {
  color: var(--yellow);
  filter: drop-shadow(0 0 14px rgba(255, 196, 0, 0.45));
}

.brand-sub {
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-pill,
.site-link,
.mode-badge,
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
}

.status-pill {
  gap: 8px;
  min-height: 34px;
  padding: 0 13px;
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(151, 155, 165, 0.10);
}

.status-online .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(110, 231, 167, 0.12), 0 0 14px rgba(110, 231, 167, 0.55);
}

.status-offline .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 123, 123, 0.12);
}

.site-link {
  min-height: 34px;
  padding: 0 13px;
  color: var(--yellow-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

main {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  padding: 58px 0 38px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(410px, 0.9fr);
  gap: 48px;
  align-items: center;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 13px;
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.hero h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(3rem, 5.2vw, 5rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
  font-weight: 850;
}

.hero h1 span {
  color: transparent;
  background: linear-gradient(100deg, var(--yellow-soft), var(--yellow), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-text {
  max-width: 620px;
  margin: 23px 0 29px;
  color: var(--muted-strong);
  font-size: clamp(0.95rem, 1.5vw, 1.08rem);
  line-height: 1.6;
}

.address-form {
  max-width: 790px;
}

.address-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: rgba(13, 14, 17, 0.88);
  box-shadow: 0 0 0 1px rgba(255, 196, 0, 0.025), 0 18px 60px rgba(0, 0, 0, 0.24);
}

.input-row:focus-within {
  border-color: rgba(255, 196, 0, 0.66);
  box-shadow: 0 0 0 4px rgba(255, 196, 0, 0.07);
}

.input-row input {
  min-width: 0;
  height: 54px;
  padding: 0 16px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
}

.input-row input::placeholder {
  color: #5f626a;
}

.primary-button,
.secondary-button,
.icon-button,
.text-button {
  cursor: pointer;
}

.primary-button {
  height: 54px;
  padding: 0 22px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(110deg, var(--yellow), #ffb000);
  color: #16120a;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(255, 174, 0, 0.18);
}

.primary-button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.primary-button span {
  padding-left: 8px;
}

.form-meta {
  min-height: 30px;
  padding: 8px 5px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.75rem;
}

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--yellow-soft);
}

.form-error {
  margin: 8px 4px 0;
  color: var(--red);
  font-size: 0.83rem;
}

.pool-overview,
.connection-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 196, 0, 0.06), transparent 45%),
    rgba(17, 19, 23, 0.92);
  box-shadow: var(--shadow);
}

.pool-overview::after,
.connection-card::after {
  content: "";
  position: absolute;
  width: 9rem;
  height: 9rem;
  top: -5rem;
  right: -3rem;
  border-radius: 50%;
  background: var(--yellow);
  filter: blur(65px);
  opacity: 0.17;
}

.pool-overview {
  padding: 25px;
}

.overview-head {
  margin-bottom: 19px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.overview-head .eyebrow {
  margin-bottom: 7px;
  font-size: 0.62rem;
}

.overview-head h2 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
}

.overview-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.overview-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px rgba(110, 231, 167, 0.5);
}

.pool-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.pool-stat {
  min-width: 0;
  min-height: 126px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
}

.pool-stat-total {
  border-color: var(--line-strong);
  background: linear-gradient(150deg, rgba(255, 196, 0, 0.09), rgba(0, 0, 0, 0.16));
}

.pool-stat-mode {
  margin-bottom: auto;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.pool-stat strong {
  margin: 17px 0 6px;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1.05rem, 1.65vw, 1.4rem);
  line-height: 1;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pool-stat small {
  color: var(--muted);
  font-size: 0.66rem;
}

.pool-stat small b {
  color: var(--yellow-soft);
  font-weight: 850;
}

.connection-card {
  margin: 0 0 48px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: minmax(205px, 0.72fr) minmax(0, 2.28fr);
  align-items: center;
  gap: 17px 30px;
}

.connection-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 26px;
  border-right: 1px solid var(--line);
}

.connection-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--yellow);
  color: #15110a;
  font-size: 1.7rem;
  font-weight: 900;
  box-shadow: 0 0 28px rgba(255, 196, 0, 0.18);
}

.connection-head small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
}

.connection-head strong {
  font-size: 1rem;
}

.connection-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1.55fr 1.15fr 0.45fr 1fr;
  gap: 0;
}

.connection-card dl div {
  min-width: 0;
  padding: 4px 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.055);
}

.connection-card dl div:first-child {
  border-left: 0;
}

.connection-card dt {
  color: var(--muted);
  font-size: 0.76rem;
}

.connection-card dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  text-align: left;
}

.connection-note {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-strong);
  font-size: 0.72rem;
}

.connection-note span {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 16px rgba(255, 196, 0, 0.55);
}

.dashboard {
  padding: 56px 0 80px;
}

.dashboard-header {
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: flex-end;
}

.dashboard-header h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.045em;
}

.address-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.address-line code {
  max-width: min(600px, 70vw);
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted-strong);
  font-size: 0.79rem;
}

.icon-button {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--yellow-soft);
  font-size: 0.69rem;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.last-update {
  margin-right: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.secondary-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 750;
}

.secondary-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.loading-card,
.error-card {
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--muted-strong);
}

.loading-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.error-card {
  border-color: rgba(255, 123, 123, 0.24);
  color: #ffadad;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 196, 0, 0.2);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  min-height: 142px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.metric-card.accent {
  border-color: var(--line-strong);
  background:
    linear-gradient(150deg, rgba(255, 196, 0, 0.105), transparent 70%),
    var(--panel);
}

.metric-label {
  margin-bottom: auto;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.metric-card strong {
  margin: 18px 0 4px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-card small {
  color: var(--muted);
  font-size: 0.67rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 45px rgba(0, 0, 0, 0.13);
}

.chart-panel,
.group-panel,
.workers-panel,
.members-panel {
  padding: 22px;
}

.panel-head {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.panel-head h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.panel-kicker {
  display: block;
  margin-bottom: 7px;
  font-size: 0.61rem;
}

.panel-value {
  color: var(--yellow-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.mode-badge,
.count-badge {
  min-height: 31px;
  padding: 0 11px;
  color: var(--yellow-soft);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.chart-wrap {
  position: relative;
  height: 292px;
}

#hashrateChart {
  width: 100%;
  height: 100%;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.group-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 22px;
}

.group-stats div {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.13);
}

.group-stats span,
.distribution-title small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.62rem;
}

.group-stats strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.91rem;
}

.distribution-title {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
}

.distribution-title span {
  font-size: 0.82rem;
  font-weight: 800;
}

.distribution-title small {
  margin: 0;
  text-align: right;
}

.distribution-list {
  display: grid;
  gap: 11px;
}

.distribution-row {
  display: grid;
  gap: 6px;
}

.distribution-meta {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: var(--muted-strong);
  font-size: 0.7rem;
}

.distribution-meta strong {
  color: var(--text);
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.progress-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--orange));
  box-shadow: 0 0 12px rgba(255, 196, 0, 0.2);
}

.workers-panel,
.members-panel {
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

td {
  color: var(--muted-strong);
  font-size: 0.75rem;
}

td:first-child {
  color: var(--text);
  font-weight: 750;
}

.worker-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.worker-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(110, 231, 167, 0.35);
}

.empty-state {
  padding: 34px 10px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.member-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.12);
}

.member-card.self {
  border-color: var(--line-strong);
  background: linear-gradient(145deg, rgba(255, 196, 0, 0.07), rgba(0, 0, 0, 0.12));
}

.member-head {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.member-address {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.66rem;
}

.member-role {
  flex: 0 0 auto;
  color: var(--yellow-soft);
  font-size: 0.58rem;
  font-weight: 850;
  text-transform: uppercase;
}

.member-card dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.member-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.member-card dt {
  color: var(--muted);
  font-size: 0.62rem;
}

.member-card dd {
  margin: 0;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 750;
}

footer {
  width: min(1240px, calc(100% - 40px));
  min-height: 90px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
}

@media (max-width: 1120px) {
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .members-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .hero {
    padding-top: 48px;
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .connection-card {
    grid-template-columns: 1fr;
  }

  .connection-head {
    padding: 0 0 17px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .connection-card dl {
    grid-template-columns: repeat(2, 1fr);
  }

  .connection-card dl div,
  .connection-card dl div:first-child {
    padding: 10px 14px;
    border-left: 0;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-actions {
    justify-content: flex-start;
  }

}

@media (max-width: 660px) {
  .topbar,
  main,
  footer {
    width: min(100% - 24px, 1240px);
  }

  .topbar {
    min-height: 72px;
  }

  .brand-sub,
  .site-link,
  .status-pill {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 42px 0 34px;
  }

  .hero h1 {
    font-size: clamp(2.65rem, 13vw, 4rem);
  }

  .pool-overview {
    padding: 18px;
  }

  .pool-stats-grid {
    grid-template-columns: 1fr;
  }

  .pool-stat {
    min-height: 105px;
  }

  .connection-card {
    margin-bottom: 34px;
    padding: 18px;
  }

  .connection-card dl {
    grid-template-columns: 1fr;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .primary-button {
    width: 100%;
  }

  .form-meta {
    flex-direction: column;
    gap: 4px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-card {
    min-height: 128px;
  }

  .group-stats {
    grid-template-columns: 1fr;
  }

  .chart-wrap {
    height: 230px;
  }

  .members-grid {
    grid-template-columns: 1fr 1fr;
  }

  .chart-panel,
  .group-panel,
  .workers-panel,
  .members-panel {
    padding: 17px;
  }

  footer {
    padding: 25px 0;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .summary-grid,
  .members-grid {
    grid-template-columns: 1fr;
  }

  .address-line code {
    max-width: 78vw;
  }
}
