:root {
  color-scheme: dark;
  --bg: #101211;
  --panel: #171b19;
  --panel-2: #20231f;
  --line: #383d35;
  --text: #f1efe7;
  --muted: #b7b3a6;
  --gold: #d0aa58;
  --green: #39d98a;
  --red: #e66a63;
  --blue: #6aa9d8;
  --wine: #7b3149;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(57, 217, 138, 0.10), transparent 22rem), var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: #141715;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(208, 170, 88, 0.65);
  border-radius: 8px;
  background: #252118;
  color: var(--gold);
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 0.85rem;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-button {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.nav-button:hover,
.nav-button:focus-visible {
  outline: none;
  border-color: var(--line);
  background: #1d211e;
  color: var(--text);
}

.nav-button.is-active {
  border-color: rgba(208, 170, 88, 0.55);
  background: #242117;
  color: var(--gold);
}

.sidebar-status {
  margin-top: auto;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #777;
}

.status-dot.is-online {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(57, 217, 138, 0.12);
}

.status-dot.is-offline {
  background: var(--red);
}

.status-dot.is-unknown {
  background: var(--gold);
}

.main-panel {
  min-width: 0;
  padding: 28px;
}

.top-band {
  position: relative;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #151817;
}

.top-band-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-band-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 18, 17, 0.95) 0%, rgba(16, 18, 17, 0.70) 43%, rgba(16, 18, 17, 0.30) 100%);
}

.top-band-content {
  position: relative;
  z-index: 1;
  width: min(800px, 100%);
  min-height: 320px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.system-line,
.hero-grid,
.grid,
.account-grid,
.status-list,
.form-grid,
.port-table,
.players-list {
  display: grid;
  gap: 12px;
}

.system-line {
  grid-template-columns: repeat(3, max-content);
}

.pill {
  padding: 6px 9px;
  border: 1px solid rgba(208, 170, 88, 0.55);
  border-radius: 999px;
  background: rgba(208, 170, 88, 0.12);
  color: var(--gold);
  font-size: 0.84rem;
}

.pill-muted {
  border-color: rgba(183, 179, 166, 0.32);
  background: rgba(183, 179, 166, 0.10);
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 740px;
  font-size: 2.7rem;
  line-height: 1.04;
}

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

.metric-block,
.info-card,
.panel-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 27, 25, 0.94);
}

.metric-block {
  min-height: 86px;
  padding: 14px;
}

.metric-block span,
.card-label,
.section-heading span {
  color: var(--muted);
  font-size: 0.88rem;
}

.metric-block strong {
  display: block;
  margin-top: 10px;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

.view {
  display: none;
  margin-top: 26px;
}

.view.is-visible {
  display: block;
}

.is-hidden {
  display: none !important;
}

.section-heading {
  min-height: 44px;
  margin-bottom: 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

h2 {
  font-size: 1.45rem;
}

h3 {
  font-size: 1.02rem;
}

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

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

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

.info-card {
  min-height: 150px;
  padding: 18px;
}

.info-card.compact {
  min-height: 118px;
}

.info-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.35rem;
}

.info-card p,
.panel-block p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.58;
}

.split-layout {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
}

.panel-block {
  padding: 18px;
}

.status-list {
  margin-top: 14px;
}

.status-row,
.account-pill,
.player-row,
.port-table div {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-row span,
.account-pill span,
.player-row span,
.port-table span {
  color: var(--muted);
}

.status-tag {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(183, 179, 166, 0.24);
  color: var(--muted);
  font-size: 0.82rem;
}

.status-tag.working {
  border-color: rgba(57, 217, 138, 0.42);
  color: var(--green);
}

.status-tag.partial {
  border-color: rgba(208, 170, 88, 0.48);
  color: var(--gold);
}

.status-tag.blocked {
  border-color: rgba(106, 169, 216, 0.46);
  color: var(--blue);
}

.status-tag.missing {
  border-color: rgba(230, 106, 99, 0.40);
  color: var(--red);
}

.account-grid {
  margin-top: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-pill {
  min-height: 50px;
  align-items: start;
  flex-direction: column;
}

.form-grid {
  margin-top: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) max-content;
  align-items: end;
}

.register-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) max-content;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101211;
  color: var(--text);
  padding: 0 11px;
}

input:disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.primary-button {
  height: 42px;
  border: 1px solid rgba(208, 170, 88, 0.55);
  border-radius: 8px;
  background: #2a2416;
  color: var(--gold);
  padding: 0 16px;
  cursor: pointer;
}

.primary-button:hover:not(:disabled),
.primary-button:focus-visible:not(:disabled) {
  outline: none;
  background: #362c18;
}

.form-message {
  min-height: 24px;
  margin-top: 12px;
  color: var(--muted);
}

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

.form-message.error {
  color: var(--red);
}

.form-message.pending {
  color: var(--gold);
}

.empty-table {
  margin-top: 16px;
  min-height: 130px;
  border: 1px dashed rgba(183, 179, 166, 0.34);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 16px;
}

.port-table {
  margin-top: 16px;
}

.command-line {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101211;
  color: var(--gold);
  font-family: "Cascadia Mono", Consolas, monospace;
  overflow-wrap: anywhere;
}

.admin-private-details {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.players-list {
  margin-top: 14px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(90px, 1fr));
  }

  .sidebar-status {
    margin-top: 0;
  }

  .main-panel {
    padding: 16px;
  }

  .hero-grid,
  .grid.three,
  .grid.four,
  .split-layout,
  .register-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-line,
  .hero-grid,
  .grid.two,
  .account-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .top-band {
    min-height: 0;
  }

  .top-band-content {
    min-height: 420px;
    padding: 20px;
  }

  h1 {
    font-size: 2rem;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }
}
