* {
  box-sizing: border-box;
}

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #050505;
  --line: #d8d8d8;
  --soft: #f5f5f5;
  --overlay: rgba(0, 0, 0, 0.52);
  --danger: #d10000;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050505;
    --fg: #f5f5f5;
    --line: #303030;
    --soft: #101010;
    --overlay: rgba(0, 0, 0, 0.72);
    --danger: #ff4d4d;
  }
}

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

body {
  background: var(--bg);
  color: var(--fg);
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

button {
  color: inherit;
  font: inherit;
}

.text-img {
  display: block;
  max-width: 100%;
  height: auto;
}

.danger-img,
.no-invert {
  display: block;
  max-width: 100%;
  height: auto;
}

@media (prefers-color-scheme: dark) {
  .text-img {
    filter: invert(1);
  }

  .join-button-dark .no-invert,
  .copy-row button .no-invert,
  .redirect-button .no-invert {
    filter: invert(1);
  }
}

.page {
  width: min(100% - 32px, 1080px);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 24px;
  padding: 20px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
}

.top-img {
  max-height: 20px;
}

.hero {
  display: grid;
  align-content: center;
  gap: 28px;
  padding: 8vh 0 12vh;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 1.5vw, 16px);
}

.status-name {
  width: min(42vw, 260px);
}

.status-tail {
  width: min(34vw, 170px);
}

.digit-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 45px;
}

.digit-img {
  width: auto;
  height: clamp(28px, 4vw, 45px);
}

.hero h1,
.lead {
  margin: 0;
}

.hero-title-img {
  width: min(100%, 980px);
}

.lead-img {
  width: min(100%, 620px);
}

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

.join-button,
.modal button {
  border-radius: 8px;
}

.join-button {
  display: grid;
  place-items: center;
  min-width: 150px;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid var(--fg);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}

.join-button-dark {
  background: var(--fg);
  color: var(--bg);
}

.button-img {
  max-height: 24px;
}

.join-button:hover,
.join-button:focus-visible,
.copy-row button:hover,
.copy-row button:focus-visible,
.redirect-button:hover,
.redirect-button:focus-visible,
.modal-close:hover,
.modal-close:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: var(--overlay);
  cursor: pointer;
}

.modal {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 28px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
}

.close-img {
  width: 14px;
}

.modal-title-img {
  max-height: 44px;
}

.modal-copy-img {
  max-width: calc(100% - 42px);
  max-height: 28px;
  margin-top: 10px;
  opacity: 0.68;
}

.modal-body {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.body-line {
  max-height: 30px;
}

.copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.row-label {
  grid-column: 1 / -1;
  max-height: 22px;
  opacity: 0.68;
}

.row-value {
  min-width: 0;
  max-height: 36px;
}

.copy-row button,
.redirect-button {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
}

.web-warning {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 2px solid var(--danger);
  border-radius: 8px;
}

.danger-img {
  max-height: 28px;
}

.redirect-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  opacity: 0.68;
}

.redirect-label {
  max-height: 26px;
}

.redirect-button {
  width: 100%;
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, 1080px);
    gap: 16px;
    padding-top: 12px;
  }

  .topbar {
    display: grid;
    justify-content: start;
  }

  .hero {
    padding: 6vh 0 8vh;
  }

  .actions,
  .join-button {
    width: 100%;
  }

  .hero-title-img {
    width: 100%;
  }

  .modal {
    padding: 22px;
  }

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

  .copy-row button {
    width: 100%;
  }
}
