:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #10151c;
  --panel-2: #0c1117;
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef8f5;
  --muted: #8fa09e;
  --teal: #62f2db;
  --green: #7ee27d;
  --amber: #f3bd55;
  --red: #f06d86;
  --blue: #72a8ff;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 54px 54px;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

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

.shell {
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 17, 23, 0.92);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: end;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-icon {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(98, 242, 219, 0.46);
  border-radius: var(--radius);
  background: #0e2423;
  color: var(--teal);
  font-weight: 900;
}

.brand strong {
  display: block;
  overflow: hidden;
  color: var(--teal);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #090d12;
}

nav a {
  padding: 10px 12px;
  border-radius: 6px;
  color: #d8e3e1;
}

.staff-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(98, 242, 219, 0.32);
  border-radius: var(--radius);
  background: rgba(98, 242, 219, 0.11);
  color: var(--teal);
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
}

.staff-action[hidden],
#adminNav[hidden] {
  display: none;
}

.staff-action[aria-disabled="true"] {
  border-color: rgba(143, 160, 158, 0.22);
  background: rgba(143, 160, 158, 0.08);
  color: var(--muted);
  cursor: default;
}

nav a:hover,
nav a:focus-visible {
  background: rgba(98, 242, 219, 0.12);
  color: var(--teal);
  outline: none;
}

.status,
.chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(126, 226, 125, 0.28);
  border-radius: 999px;
  background: rgba(126, 226, 125, 0.09);
  color: #d8ffd7;
  font-size: 0.84rem;
  white-space: nowrap;
}

.status i {
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.status.pending {
  border-color: rgba(243, 189, 85, 0.32);
  background: rgba(243, 189, 85, 0.1);
  color: #ffe8bd;
}

.status.pending i {
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
}

.status.offline {
  border-color: rgba(240, 109, 134, 0.32);
  background: rgba(240, 109, 134, 0.1);
  color: #ffd9e0;
}

.status.offline i {
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
}

main {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.grid {
  display: grid;
  gap: 18px;
}

.overview {
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, 0.82fr);
  align-items: start;
}

.lower {
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 21, 28, 0.88);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

.panel-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--teal);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.1;
}

button {
  min-height: 40px;
  border: 1px solid rgba(98, 242, 219, 0.32);
  border-radius: var(--radius);
  background: rgba(98, 242, 219, 0.12);
  color: var(--teal);
  cursor: pointer;
  font-weight: 900;
}

button:hover,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.map-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1518 / 1311;
  border-radius: 0 0 var(--radius) var(--radius);
  background: #020407;
}

.map-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.94;
  filter: saturate(1.12) contrast(1.08) brightness(0.92);
}

.map-wrap::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, rgba(7, 9, 13, 0.04), rgba(7, 9, 13, 0.22));
}

.pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 8px rgba(98, 242, 219, 0.14), 0 0 22px rgba(98, 242, 219, 0.72);
  transform: translate(-50%, -50%);
}

.pin.green {
  background: var(--green);
}

.pin.amber {
  background: var(--amber);
}

.map-card {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  width: min(430px, calc(100% - 36px));
  padding: 14px 16px;
  border: 1px solid rgba(98, 242, 219, 0.34);
  border-radius: var(--radius);
  background: rgba(7, 9, 13, 0.82);
  backdrop-filter: blur(10px);
}

.map-card strong,
.map-card span {
  display: block;
}

.map-card strong {
  color: var(--teal);
  font-size: 1.18rem;
}

.map-card span {
  margin-top: 4px;
  color: #c8d8d5;
  line-height: 1.45;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.stats div,
.admin-card,
.details div {
  min-height: 78px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.stats span,
.admin-card span,
.details dt,
.search span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stats strong,
.admin-card strong,
.details dd {
  display: block;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.15;
}

.notice {
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid rgba(243, 189, 85, 0.24);
  border-radius: var(--radius);
  background: rgba(243, 189, 85, 0.08);
  color: #ffe8bd;
}

.notice.ok {
  border-color: rgba(126, 226, 125, 0.24);
  background: rgba(126, 226, 125, 0.08);
  color: #d8ffd7;
}

.notice.error {
  border-color: rgba(240, 109, 134, 0.24);
  background: rgba(240, 109, 134, 0.08);
  color: #ffd9e0;
}

.search {
  display: grid;
  gap: 8px;
  padding: 18px 18px 0;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #090d12;
  color: var(--text);
  padding: 0 12px;
}

.player-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.player-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.19);
}

.player-row:hover {
  border-color: rgba(98, 242, 219, 0.3);
  background: rgba(98, 242, 219, 0.06);
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: #15232a;
  color: var(--teal);
  font-weight: 900;
}

.player-row strong,
.player-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-row small {
  margin-top: 4px;
  color: var(--muted);
}

.player-tag {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(126, 226, 125, 0.1);
  color: #d8ffd7;
  font-size: 0.78rem;
  font-weight: 900;
}

.empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.details {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 18px 0;
}

.settings-grid,
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 18px 0;
}

.setting-card,
.feature-card {
  min-height: 78px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.setting-card span,
.feature-card span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.setting-card strong,
.feature-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 1.08rem;
}

.setting-card strong.on {
  color: var(--green);
}

.setting-card strong.off {
  color: var(--red);
}

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

.server-copy {
  display: grid;
  gap: 6px;
  margin: 18px;
  padding: 16px;
  border: 1px solid rgba(98, 242, 219, 0.22);
  border-radius: var(--radius);
  background: rgba(98, 242, 219, 0.07);
}

.server-copy strong {
  color: var(--teal);
  font-size: 1.1rem;
}

.server-copy span {
  color: #c8d8d5;
  line-height: 1.45;
}

.admin-panel[hidden] {
  display: none;
}

@media (max-width: 1040px) {
  .topbar,
  .overview,
  .lower {
    grid-template-columns: 1fr;
  }

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

  .header-actions {
    justify-content: start;
  }

  nav {
    justify-content: start;
  }
}

@media (max-width: 600px) {
  .shell {
    width: min(100% - 20px, 1420px);
    padding-top: 10px;
  }

  .topbar {
    padding: 14px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand strong {
    white-space: normal;
  }

  nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
    width: 100%;
  }

  nav a {
    text-align: center;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .settings-grid,
  .admin-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .player-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .player-tag {
    grid-column: 2;
    justify-self: start;
  }
}
