:root {
  color-scheme: dark;
  --bg: #101318;
  --card: #181d25;
  --muted: #8f9bad;
  --text: #e7edf5;
  --line: #2b3442;
  --accent: #70e0b8;
  --accent2: #8ab4ff;
  --bad: #ff8585;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at top left, #1c2a35, var(--bg) 42%);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
  padding: 32px;
}

.wrap,
.page-wrap {
  max-width: 1050px;
  margin: 0 auto;
}

.card,
.impressum-container {
  background: rgba(24, 29, 37, .94);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .35);
  overflow: hidden;
}

.header {
  padding: 24px 26px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .2px;
}

h2 {
  color: var(--text);
  font-size: 1.5em;
  font-weight: 500;
  margin: 2em 0 .8em;
}

h3 {
  color: var(--text);
  font-size: 1.2em;
  font-weight: 500;
  margin: 1.5em 0 .6em;
}

.sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.legal-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
}

.legal-links a,
.nav-button {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 11px;
  border: 1px solid #344258;
  border-radius: 8px;
  color: var(--text);
  background: #202938;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.legal-links a:hover,
.legal-links a:focus,
.nav-button:hover,
.nav-button:focus {
  border-color: var(--accent2);
}

.legal-links a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent);
}

form {
  padding: 22px 26px;
  display: grid;
  grid-template-columns: 1fr 150px 190px auto;
  gap: 14px;
  align-items: end;
}

label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
}

input,
select {
  width: 100%;
  height: 43px;
  background: #0f1319;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 15px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(138, 180, 255, .14);
}

button,
.primary-button,
.secondary-button,
.back-button {
  height: 43px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #50bdf0);
  color: #071014;
  font-weight: 800;
  padding: 0 22px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.primary-button:hover,
.secondary-button:hover,
.back-button:hover,
button:focus,
.primary-button:focus,
.secondary-button:focus,
.back-button:focus {
  filter: brightness(1.05);
  color: #071014;
}

.secondary-button {
  background: #202938;
  border: 1px solid #344258;
  color: var(--text);
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  padding: 0 16px;
}

.domaincheck-form {
  grid-template-columns: 1fr auto;
}

.output {
  margin: 0 26px 26px;
  background: #07090d;
  border: 1px solid #243041;
  border-radius: 14px;
  overflow: hidden;
}

.outbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  color: var(--muted);
  background: #0d1118;
  border-bottom: 1px solid #243041;
  font-size: 13px;
}

pre {
  margin: 0;
  padding: 18px;
  overflow: auto;
  white-space: pre;
  color: #c7f7d4;
  font: 14px/1.55 Consolas, Menlo, Monaco, "Courier New", monospace;
}

.dns-valid {
  color: #c7f7d4;
}

.dns-invalid {
  color: #ffb3b3;
}

.domain-result {
  padding: 8px 18px 18px;
}

.domain-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.domain-table th,
.domain-table td {
  padding: 12px 0;
  border-top: 1px solid #1d2633;
  vertical-align: top;
}

.domain-table tr:first-child th,
.domain-table tr:first-child td {
  border-top: 0;
}

.domain-table th {
  width: 230px;
  padding-right: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}

.domain-table td {
  color: var(--text);
  overflow-wrap: anywhere;
}

.domain-list {
  margin: 0;
  padding-left: 18px;
}

.domain-list li {
  margin: 2px 0;
}

.domain-muted {
  color: var(--muted);
}

.domain-source {
  color: #c7f7d4;
  font: 13px/1.55 Consolas, Menlo, Monaco, "Courier New", monospace;
}

.headertrace-form {
  grid-template-columns: 1fr auto;
}

.result-section {
  padding: 8px 18px 18px;
}

.result-heading {
  margin: 22px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.result-table .result-label-col {
  width: 275px;
}

.result-table .result-value-col {
  width: auto;
}

.result-table th,
.result-table td {
  padding: 12px 0;
  border-top: 1px solid #1d2633;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.result-table tr:first-child th,
.result-table tr:first-child td {
  border-top: 0;
}

.result-table tbody th,
.result-table thead th:first-child {
  padding-right: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-align: right;
}

.result-table td,
.result-table thead th:not(:first-child) {
  color: var(--text);
  text-align: left;
}

.header-table thead th {
  border-top: 0;
  border-bottom: 1px solid #1d2633;
}

.redirect-follow-form {
  display: inline;
  padding: 0;
}

.redirect-follow-button {
  display: inline;
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent2);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.redirect-follow-button:hover,
.redirect-follow-button:focus {
  color: var(--accent);
  filter: none;
  text-decoration: underline;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.status-ok {
  color: #071014;
  background: var(--accent);
}

.status-missing {
  color: #ffd0d0;
  background: rgba(255, 133, 133, .14);
  border: 1px solid rgba(255, 133, 133, .4);
}

.body-snippet {
  margin-top: 22px;
  border: 1px solid #243041;
  border-radius: 12px;
  overflow: hidden;
}

.err {
  margin: 0 26px 26px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 133, 133, .4);
  color: #ffd0d0;
  background: rgba(255, 133, 133, .08);
  border-radius: 12px;
}

.hint {
  padding: 0 26px 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.client-ip {
  white-space: nowrap;
}

.home-content,
.impressum-content {
  padding: 24px 26px 30px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.home-content p,
.impressum-content p {
  color: var(--text);
  margin: 1em 0;
}

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

.schach-start,
.schach-content {
  padding: 24px 26px 0;
}

.schach-start .err,
.schach-content .err {
  margin: 0 0 20px;
}

.schach-guide {
  max-width: 940px;
  margin: 24px 0 24px;
  color: var(--text);
}

.schach-guide h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.3;
}

.schach-guide p {
  max-width: 900px;
  margin: 0 0 14px;
  color: var(--text);
  line-height: 1.65;
}

.schach-guide p:last-child {
  margin-bottom: 0;
}

.schach-guide-steps {
  display: grid;
  gap: 9px;
  margin: 14px 0 16px;
  padding-left: 22px;
  color: var(--text);
}

.schach-guide-steps li {
  padding-left: 4px;
  line-height: 1.55;
}

.schach-guide-steps strong {
  color: #fff;
  font-weight: 800;
}

.schach-start-form {
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 18px;
  align-items: end;
}

.schach-option-group .result-heading {
  margin-top: 0;
}

.schach-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schach-segmented label {
  position: relative;
  margin: 0;
  color: var(--text);
}

.schach-segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.schach-segmented span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid #344258;
  border-radius: 8px;
  background: #111821;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.schach-segmented input:checked + span {
  border-color: var(--accent);
  background: rgba(112, 224, 184, .16);
  color: #dffcf1;
}

.schach-segmented input:focus + span {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(138, 180, 255, .14);
}

.schach-game {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(260px, 1fr);
  gap: 22px;
  align-items: start;
}

.schach-board-wrap {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 26px;
  line-height: 0;
  background: #15191f url("../schach/assets/Brett.png") center / contain no-repeat;
}

.schach-board-image,
.schach-board-previous {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.schach-board-image {
  position: relative;
  z-index: 2;
  opacity: 1;
  transition: opacity .12s ease;
}

.schach-board-image.is-loading {
  opacity: 0;
}

.schach-board-previous {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.schach-grid {
  position: absolute;
  left: 5.34045%;
  top: 4.80641%;
  width: 88.99399%;
  height: 88.99399%;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  z-index: 3;
}

.schach-square {
  display: block;
  min-width: 0;
  min-height: 0;
  border: 1px solid transparent;
  background: transparent;
}

.schach-square.is-clickable {
  cursor: pointer;
}

.schach-square.is-clickable:hover,
.schach-square.is-clickable:focus {
  outline: none;
  background: rgba(138, 180, 255, .18);
  box-shadow: inset 0 0 0 4px rgba(138, 180, 255, .55);
}

.schach-square.is-selected {
  background: rgba(112, 224, 184, .22);
  box-shadow: inset 0 0 0 5px rgba(112, 224, 184, .7);
}

.schach-square.is-last-move-from {
  background: rgba(138, 180, 255, .18);
  box-shadow: inset 0 0 0 5px rgba(138, 180, 255, .58);
}

.schach-square.is-last-move-to {
  background: rgba(25, 62, 132, .24);
  box-shadow: inset 0 0 0 5px rgba(31, 74, 153, .78);
}

.schach-square.is-last-move-capture {
  background: rgba(196, 45, 45, .24);
  box-shadow: inset 0 0 0 5px rgba(236, 72, 72, .82);
}

.schach-side .output {
  margin: 0 0 18px;
}

.schach-status-body,
.schach-history {
  padding: 16px 18px 18px;
}

.schach-status-body p,
.schach-history p {
  margin: 0 0 14px;
}

.schach-meta {
  margin: 0 0 16px;
}

.schach-meta div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid #1d2633;
}

.schach-meta dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.schach-meta dd {
  margin: 0;
  color: var(--text);
  text-align: right;
}

.schach-actions {
  display: grid;
  gap: 8px;
}

.schach-actions .secondary-button {
  width: 100%;
}

.schach-history ol {
  margin: 0;
  padding-left: 22px;
}

.schach-history li {
  margin: 4px 0;
  color: var(--text);
}

.schach-history li span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.impressum-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0;
}

.impressum-content h1 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.2em;
}

.impressum-content u {
  text-decoration: none;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid rgba(138, 180, 255, .42);
  padding-bottom: 1px;
}

.impressum-content ul {
  margin: 1em 0 1em 1.5em;
  padding: 0;
}

.impressum-content li {
  margin: .4em 0;
  color: var(--text);
}

.impressum-content a:not(.back-button):not(.nav-button) {
  color: var(--accent2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.impressum-content a:not(.back-button):not(.nav-button):hover,
.impressum-content a:not(.back-button):not(.nav-button):focus {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.contact-info {
  background: #0f1319;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 1.5em 0;
}

.contact-info p {
  margin: .5em 0;
  text-align: left;
}

.back-button {
  margin: 2em 0 1em;
}

.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(138, 180, 255, .32) 50%, transparent 100%);
  margin: 3em 0;
  border: none;
}

span[id^="tl"],
span[id^="sl"],
span[id^="ml"],
span[id^="nl"],
span[id^="ul"] {
  font-style: italic;
  color: var(--muted);
  transition: all .3s ease;
}

span[id^="tl"]:not(:empty),
span[id^="sl"]:not(:empty),
span[id^="ml"]:not(:empty),
span[id^="nl"]:not(:empty),
span[id^="ul"]:not(:empty) {
  font-style: normal;
  color: var(--text);
}

@media (max-width: 760px) {
  body {
    padding: 14px;
  }

  .header {
    flex-direction: column;
  }

  .legal-links {
    justify-content: flex-start;
  }

  form {
    grid-template-columns: 1fr;
  }

  .domaincheck-form {
    grid-template-columns: 1fr;
  }

  .headertrace-form {
    grid-template-columns: 1fr;
  }

  .domain-table,
  .domain-table tbody,
  .domain-table tr,
  .domain-table th,
  .domain-table td,
  .result-table,
  .result-table tbody,
  .result-table thead,
  .result-table tr,
  .result-table th,
  .result-table td {
    display: block;
    width: 100%;
  }

  .domain-table th,
  .result-table th {
    padding: 12px 0 2px;
    text-align: left;
  }

  .result-table tbody th,
  .result-table thead th:first-child {
    padding-right: 0;
    text-align: left;
  }

  .domain-table td,
  .result-table td {
    padding: 0 0 12px;
  }

  button,
  .primary-button,
  .secondary-button,
  .back-button {
    width: 100%;
  }

  .actions,
  .hint,
  .home-actions {
    flex-direction: column;
  }

  .hint {
    gap: 6px;
  }

  .client-ip {
    white-space: normal;
  }

  .schach-start,
  .schach-content {
    padding: 18px 16px 0;
  }

  .schach-start-form,
  .schach-game {
    grid-template-columns: 1fr;
  }

  .schach-board-wrap {
    margin-bottom: 18px;
  }
}
