:root {
  color-scheme: light;
  --ink: #111;
  --paper: #fff;
  --ground: #f2f2f0;
  --muted: #606060;
  --shadow: #8a8a8a;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f5;
  --paper: #0d0d0d;
  --ground: #050505;
  --muted: #b5b5b5;
  --shadow: #666;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #f5f5f5;
    --paper: #0d0d0d;
    --ground: #050505;
    --muted: #b5b5b5;
    --shadow: #666;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.45 Arial, Helvetica, sans-serif;
}

.hidden {
  display: none !important;
}

header {
  min-height: 64px;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  padding: 0 max(24px, calc((100vw - 1080px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
  text-decoration: none;
}

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

.header-actions a {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

main {
  width: min(680px, calc(100% - 32px));
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  padding: 48px 0 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

h1,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.panel {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 22px;
  box-shadow: 6px 6px 0 var(--ink);
}

.panel-title {
  margin: -35px 0 22px;
  width: max-content;
  max-width: 100%;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.checker {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 12px;
}

input,
select {
  width: 100%;
  min-width: 0;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 11px 12px;
  font: inherit;
}

input:focus,
select:focus {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

button {
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--shadow);
  white-space: nowrap;
}

button:hover {
  background: var(--paper);
  color: var(--ink);
}

button:active {
  box-shadow: 1px 1px 0 var(--shadow);
  transform: translate(2px, 2px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px dashed var(--ink);
  outline-offset: 3px;
}

button.secondary {
  background: var(--paper);
  color: var(--ink);
}

button.compact {
  padding: 5px 9px;
  font-size: 12px;
}

button:disabled {
  cursor: wait;
  opacity: .55;
}

.result {
  display: grid;
  gap: 16px;
}

.server-head {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.server-icon {
  width: 80px;
  height: 80px;
  border: 2px solid var(--ink);
  background: var(--ground);
  padding: 8px;
  image-rendering: pixelated;
  object-fit: contain;
}

.motd {
  min-width: 0;
  min-height: 80px;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 13px;
  text-align: center;
  white-space: pre-wrap;
  font-size: 17px;
}

.motd .bold {
  font-weight: 900;
}

.motd .italic {
  font-style: italic;
}

.motd .underlined {
  text-decoration: underline;
}

.motd .strikethrough {
  text-decoration: line-through;
}

.motd .obfuscated {
  filter: blur(2px);
}

.info-row {
  min-height: 48px;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.info-row span:last-child {
  text-align: right;
}

.records {
  border: 2px solid var(--ink);
  background: var(--paper);
  overflow: hidden;
}

.record {
  display: grid;
  grid-template-columns: 82px 190px minmax(0, 1fr);
  min-height: 48px;
}

.record + .record {
  border-top: 2px solid var(--ink);
}

.record span {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 9px 11px;
  overflow-wrap: anywhere;
}

.record span + span {
  border-left: 2px solid var(--ink);
}

.rate-info {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.error-state {
  padding: 16px;
  text-align: center;
}

.error-state h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.error-state p {
  margin: 0;
  color: var(--muted);
}

main.docs {
  width: min(860px, calc(100% - 32px));
  min-height: 0;
  justify-content: flex-start;
  gap: 42px;
  padding-top: 64px;
}

.docs pre {
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  color: var(--ink);
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 720px) {
  header {
    padding: 14px 16px;
  }

  main {
    min-height: calc(100vh - 70px);
    padding: 36px 0 64px;
  }

  .panel {
    padding: 16px;
  }

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

  .server-head {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .server-icon {
    width: 64px;
    height: 64px;
  }

  .motd {
    min-height: 64px;
    font-size: 14px;
  }

  .record {
    grid-template-columns: 72px 1fr;
  }

  .record span:last-child {
    grid-column: 1 / -1;
    border-top: 2px solid var(--ink);
    border-left: 0;
  }
}
