html,
body.legacy-site {
  min-height: 100%;
  background-color: #071127 !important;
}

body.legacy-site {
  min-height: 100vh;
  background-image: url('/public/cCRD/ee3df0e4-e9de-4906-8bba-bca3f1bb5377.png') !important;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Character model canvases in the rankings iframe should show through to the page. */
body.legacy-site:has(canvas) {
  background-color: transparent !important;
  background-image: none !important;
  background-attachment: initial;
}

html:has(body.legacy-site canvas) {
  background-color: transparent !important;
  background-image: none !important;
}

body.legacy-site.legacy-character-model {
  background-color: transparent !important;
  background-image: none !important;
  background-attachment: initial;
}

/* Admin pages use a softer version of the site art so shared tables and forms
   remain readable across the whole management area. */
body.legacy-admin {
  background-image:
    linear-gradient(180deg, rgba(6, 20, 42, .62), rgba(9, 31, 58, .7)),
    url('/public/cCRD/2b1739ed-7dd3-4aad-a9d8-dd6768bc6b9e.png') !important;
  background-position: center, center top;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}

body.legacy-admin .content {
  min-width: 0;
  color: #173550;
  background: rgba(239, 247, 253, .94);
  border-left: 1px solid rgba(186, 211, 232, .76);
}

/* Homepage landing layout inspired by modern online game portals. */
body.legacy-site .legacy-home {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100vh;
  padding-top: clamp(7.5rem, 14vh, 10rem);
  padding-bottom: 1rem;
}

body.legacy-site .legacy-home-shell {
  width: 100%;
}

body.legacy-site .legacy-home-hero {
  min-height: clamp(390px, 58vh, 560px);
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  padding-left: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.legacy-site .legacy-home-hero::before {
  display: none;
}

body.legacy-site .legacy-home-art {
  display: none !important;
}

body.legacy-site .legacy-home-copy {
  justify-self: start;
  margin-left: 0;
  transform: none;
  max-width: 650px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid rgba(205, 233, 255, .48);
  border-radius: 1.35rem;
  background: linear-gradient(110deg, rgba(3, 18, 45, .72), rgba(5, 33, 76, .48) 68%, rgba(8, 55, 107, .2));
  box-shadow: 0 22px 60px rgba(0, 12, 38, .28), inset 0 1px 0 rgba(255,255,255,.22);
  backdrop-filter: blur(3px);
}

body.legacy-site .legacy-home-copy h1 {
  font-size: clamp(2.8rem, 5.2vw, 5rem);
}

body.legacy-site .legacy-home-actions {
  margin-top: 1.65rem;
}

body.legacy-site .legacy-home-actions a {
  text-decoration: none;
}

body.legacy-site .legacy-home-primary span,
body.legacy-site .legacy-home-secondary span {
  font-size: 1.1em;
}

body.legacy-site .legacy-home-links {
  position: relative;
  z-index: 45;
  right: auto;
  bottom: auto;
  left: auto;
  width: min(100%, 940px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 1rem auto 0;
  padding: 0 1rem;
}

body.legacy-site .legacy-home-link-card {
  display: flex;
  min-height: 84px;
  align-items: center;
  gap: .9rem;
  padding: .8rem 1rem;
  border: 1px solid rgba(183, 222, 255, .48);
  border-radius: 1rem;
  color: #f3faff;
  background: linear-gradient(115deg, rgba(4, 21, 49, .86), rgba(13, 61, 105, .68));
  box-shadow: 0 14px 40px rgba(0, 12, 38, .3), inset 0 1px 0 rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

body.legacy-site .legacy-home-link-card:hover {
  transform: translateY(-3px);
  border-color: rgba(170, 231, 255, .9);
  background: linear-gradient(115deg, rgba(7, 36, 77, .94), rgba(17, 91, 151, .8));
}

body.legacy-site .legacy-home-link-card > span:nth-child(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .25rem;
}

body.legacy-site .legacy-home-link-card small {
  color: #9bdcff;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .16em;
}

body.legacy-site .legacy-home-link-card strong {
  font-size: 1rem;
}

body.legacy-site .legacy-home-link-icon {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(159, 221, 255, .62);
  border-radius: .8rem;
  color: #cbf0ff;
  background: rgba(62, 156, 222, .22);
  font-size: 1.25rem;
}

body.legacy-site .legacy-home-link-card > b {
  color: #a9e6ff;
  font-size: 1.1rem;
}

/* Keep the home server title clear of the fixed navigation and visible on
   shorter laptop screens. */
body.legacy-site .legacy-home {
  padding-top: clamp(5.8rem, 10vh, 7.4rem);
}

@media (max-height: 760px) and (min-width: 641px) {
  body.legacy-site .legacy-home {
    padding-top: 5.8rem;
  }

  body.legacy-site .legacy-home-hero {
    min-height: min(440px, calc(100vh - 7rem));
  }
}

@media (max-width: 600px) {
  body.legacy-site .legacy-home-links {
    position: static;
    grid-template-columns: 1fr;
    padding: 0;
    margin: 0 auto;
    transform: none;
  }

  body.legacy-site .legacy-home-hero {
    justify-items: stretch;
  }

  body.legacy-site {
    background-position: center, 50% 50%;
    background-size: cover, auto 100vh;
  }

  body.legacy-site .legacy-home {
    padding: 6.6rem .75rem 1.5rem;
  }

  body.legacy-site .legacy-home-hero {
    min-height: 0;
  }

  body.legacy-site .legacy-home-links {
    grid-template-columns: 1fr;
    gap: .65rem;
  }

  body.legacy-site .legacy-home-link-card {
    min-height: 78px;
  }
}
