:root {
  --bg: #090d14;
  --card: #111827;
  --card-soft: rgba(17, 24, 39, 0.72);
  --panel: rgba(15, 23, 42, 0.72);
  --text: #eef4ff;
  --muted: #91a1b8;
  --green: #35d07f;
  --red: #ff5c73;
  --yellow: #ffc857;
  --border: rgba(255, 255, 255, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, #1a2a44 0, #090d14 38%, #05070b 100%);
}

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.hero-content {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.lead {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

button,
.support {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 18px;
  border: 0;
  border-radius: 16px;
  appearance: none;
  color: #07110c;
  background: var(--green);
  font: inherit;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.support {
  color: #09111f;
  background: #fff;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.stats article {
  min-height: 118px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card-soft);
}

.stats span {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.stats small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 24px 0;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.15;
}

.panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

#updated {
  flex: 0 0 auto;
  padding-top: 5px;
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}

.nodes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 24px;
}

.node {
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
}

.node.online {
  box-shadow: inset 0 0 0 1px rgba(53, 208, 127, 0.18);
}

.node.offline,
.node.disabled {
  box-shadow: inset 0 0 0 1px rgba(255, 92, 115, 0.16);
}

.node.disabled {
  opacity: 0.72;
}

.node-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.node-info {
  min-width: 0;
}

.node h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.node-label {
  margin: 0 0 8px !important;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.badge.online {
  color: var(--green);
  background: rgba(53, 208, 127, 0.14);
}

.badge.offline,
.badge.disabled {
  color: var(--red);
  background: rgba(255, 92, 115, 0.14);
}

.badge.connecting {
  color: var(--yellow);
  background: rgba(255, 200, 87, 0.14);
}

.notice {
  margin: 18px 24px 0;
  padding: 14px 16px;
  border: 1px solid rgba(255, 200, 87, 0.25);
  border-radius: 16px;
  color: #ffe0a3;
  background: rgba(255, 200, 87, 0.08);
  line-height: 1.55;
}

.empty {
  grid-column: 1 / -1;
  padding: 28px;
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  line-height: 1.6;
  text-align: center;
}

.skeleton::before {
  content: "Загрузка серверов…";
  grid-column: 1 / -1;
  padding: 28px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1060px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 620px) {
  .wrap {
    width: min(100% - 22px, 1180px);
    padding: 16px 0;
  }

  .hero {
    padding: 24px;
    border-radius: 22px;
  }

  .lead {
    font-size: 16px;
  }

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

  .panel-head {
    flex-direction: column;
  }

  #updated {
    text-align: left;
    white-space: normal;
  }

  .nodes {
    padding: 16px;
  }

  .node-top {
    gap: 12px;
  }
}

.section-gap {
  margin-top: 18px;
}

.muted-link {
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
}

.about-head {
  padding-bottom: 0;
}

.version-card {
  flex: 0 0 auto;
  min-width: 190px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  text-align: right;
}

.version-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.version-card strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 24px;
}

.about-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
}

.about-card h3 {
  margin: 0 0 14px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.big-date {
  margin: 0 !important;
  color: var(--green) !important;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.1 !important;
  letter-spacing: -0.04em;
}

.muted-text {
  color: var(--muted) !important;
  line-height: 1.65 !important;
}

.clean-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.clean-list li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.clean-list li::before {
  content: "";
  position: absolute;
  top: 0.75em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  transform: translateY(-50%);
}

.changes-card,
.history-card {
  min-height: 190px;
}

.update-card,
.history-card {
  grid-column: span 1;
}

.update-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.update-form label {
  display: grid;
  gap: 8px;
}

.update-form label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.update-form input[type="file"],
.update-form input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
  outline: none;
}

.update-form input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  color: #07110c;
  background: var(--green);
  font-weight: 900;
  cursor: pointer;
}

.update-result {
  margin: 16px 0 0;
}

.update-result.success {
  border-color: rgba(53, 208, 127, 0.3);
  color: #c8ffe1;
  background: rgba(53, 208, 127, 0.09);
}

.update-result.error {
  border-color: rgba(255, 92, 115, 0.3);
  color: #ffd2da;
  background: rgba(255, 92, 115, 0.08);
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.history-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.history-top strong {
  color: var(--text);
  line-height: 1.35;
}

.history-top span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
}

.small-list {
  gap: 6px;
}

.small-list li {
  font-size: 14px;
}

code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.92em;
}

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .version-card {
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .about-grid {
    padding: 16px;
  }

  .history-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .history-top span {
    white-space: normal;
  }
}

.hero {
  position: relative;
}

.gear-link {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-size: 21px;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.gear-link:hover {
  transform: rotate(18deg) scale(1.04);
  border-color: rgba(53, 208, 127, 0.36);
  background: rgba(53, 208, 127, 0.12);
}

.admin-wrap .hero,
.admin-hero {
  align-items: flex-end;
}

.back-link {
  position: absolute;
  top: 22px;
  right: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.back-link:hover {
  color: var(--green);
}

.login-panel {
  margin-top: 18px;
  padding-bottom: 24px;
}

.login-form {
  display: grid;
  gap: 14px;
  max-width: 460px;
  padding: 24px;
}

.login-form label {
  display: grid;
  gap: 8px;
}

.login-form label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.login-form input[type="password"] {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
  outline: none;
}

.login-form input[type="password"]:focus,
.update-form input[type="password"]:focus {
  border-color: rgba(53, 208, 127, 0.42);
  box-shadow: 0 0 0 4px rgba(53, 208, 127, 0.09);
}

.visible-notice {
  margin-right: 24px;
  margin-bottom: 0;
}

.notice.error {
  border-color: rgba(255, 92, 115, 0.3);
  color: #ffd2da;
  background: rgba(255, 92, 115, 0.08);
}

code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.92em;
}

@media (max-width: 620px) {
  .gear-link {
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .back-link {
    position: static;
    margin-bottom: 20px;
  }

  .admin-hero {
    align-items: flex-start;
  }

  .login-form {
    max-width: none;
    padding: 18px;
  }

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

  .version-card {
    width: 100%;
    text-align: left;
  }
}
