/* The splash element also acts as a backdrop in character selection.
   Apply this artwork and layout only to its entrance state. */
#splash:not(.menu, .sp-updating) {
  --ink: #243e36;
  --paper: #fff8e9;
  --pine: #214e45;
  --copper: #974a29;
  --rule: #cfc3a7;
  background: #264c49;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 412px);
  grid-template-rows: minmax(min-content, 1fr) auto;
  align-content: start;
  gap: 24px clamp(32px, 6vw, 100px);
  padding: max(84px, env(safe-area-inset-top)) max(5vw, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(5vw, env(safe-area-inset-left));
  overflow: hidden auto;
  touch-action: pan-y;
  scrollbar-width: thin;
}
#splash:not(.menu, .sp-updating) .sp-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: #436b67 url("assets/skyport/skyport-dawn.v1.webp") center 45% / cover no-repeat;
}
#splash:not(.menu) #ro-bg-canvas { display: none; }
#splash:not(.menu, .sp-updating) .sp-veil {
  position: fixed;
  background: linear-gradient(0deg, #0e251fee, transparent 42%),
              linear-gradient(90deg, #1e30252b, transparent 60%);
}
.skyport-wildlife { display: none; }
#splash:not(.hidden, .menu, .leaving, .sp-updating, .sp-checking) .skyport-wildlife {
  display: block;
  position: absolute;
  left: 8%;
  bottom: calc(100% + 5px);
  width: 180px;
  height: 76px;
  pointer-events: none;
}
/* Both creatures share a single two-cell atlas. Their feet are aligned
   within the cells so the landing squash has a stable point of contact. */
.skyport-wildlife::before, .skyport-wildlife::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: var(--cell);
  height: var(--cell);
  background: url("assets/skyport/poring-lunatic.v1.png") left bottom / 200% 100% no-repeat;
  image-rendering: pixelated;
  transform-origin: 50% 94%;
}
.skyport-wildlife::before { --cell: 84px; left: 15%; }
.skyport-wildlife::after { --cell: 67px; right: 0; bottom: 9px; background-position: right bottom; }
@media (min-width: 1180px) {
  #splash:not(.hidden, .menu, .leaving, .sp-updating, .sp-checking) .skyport-wildlife {
    left: calc(100% + 12px);
    bottom: 12px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .skyport-wildlife::before { animation: skyport-poring 3.4s ease-in-out infinite; }
  .skyport-wildlife::after { animation: skyport-lunatic 4.6s -1.7s ease-in-out infinite; }
}
@keyframes skyport-poring {
  0%, 18%, 100% { transform: translate(0, 0); }
  24%, 83% { transform: translate(0, 2px) scale(1.12, .82); }
  34%, 72% { transform: translate(-12px, -23px) scale(.90, 1.12); }
  44%, 62% { transform: translate(-25px, 2px) scale(1.14, .83); }
  51%, 57% { transform: translate(-25px, 0); }
}
@keyframes skyport-lunatic {
  0%, 26%, 78%, 100% { transform: translate(0, 0); }
  33%, 69% { transform: translate(-9px, -10px) rotate(-5deg); }
  40%, 61% { transform: translate(-19px, 1px) scale(1.05, .94); }
  51% { transform: translate(-19px, 0) rotate(4deg); }
}
#splash[data-skyport-paused] .skyport-wildlife::before,
#splash[data-skyport-paused] .skyport-wildlife::after { animation-play-state: paused; }
@media (max-width: 760px) {
  #splash:not(.hidden, .menu, .leaving, .sp-updating, .sp-checking) .skyport-wildlife {
    left: auto;
    right: 0;
    top: 8px;
    bottom: auto;
    width: 64px;
    height: 64px;
  }
  .skyport-wildlife::before { --cell: 64px; left: 0; }
  .skyport-wildlife::after { content: none; }
}
#splash:not(.menu, .sp-updating) .sp-logo {
  grid-area: 1 / 1;
  align-self: end;
  justify-self: start;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  max-width: min(100%, 450px);
  zoom: 1;
}
#splash:not(.menu, .sp-updating) .sp-logo-name { animation: none; }
#splash:not(.menu, .sp-updating) .sp-logo-img {
  width: clamp(238px, 24vw, 375px);
  filter: drop-shadow(0 3px 8px #152b28aa);
}
#splash:not(.menu, .sp-updating) .sp-logo small {
  color: #ffefd1;
  background: #203e35eb;
  border: 1px solid #f5e4b07a;
  border-radius: 2px;
  font: 700 13px/1.4 Georgia, "Microsoft JhengHei", serif;
  letter-spacing: .12em;
  padding: 4px 12px;
  box-shadow: none;
}
#splash:not(.menu, .sp-updating) .hz-news {
  margin-top: 6px;
  max-width: 100%;
  width: fit-content;
  border: 0;
  border-left: 3px solid #ebb477;
  border-radius: 0 5px 5px 0;
  background: #193a32eb;
  padding: 10px 16px;
  color: #fff5dd;
  font-size: 13px;
  overflow-wrap: anywhere;
}
#splash:not(.menu, .sp-updating) .hz-news-h span {
  background: none;
  color: #fbd3a1;
  padding: 0;
}
#splash:not(.menu, .sp-updating) .hz-news-more {
  border: 0;
  border-bottom: 1px solid #d7bc92;
  border-radius: 0;
  background: none;
  padding: 2px 0;
  color: #fff6df;
}
#splash:not(.menu, .sp-updating) .sp-card {
  grid-area: 1 / 2;
  align-self: center;
  justify-self: end;
  max-height: none;
  border-radius: 7px;
  border: 1px solid #edddbb;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 12px 44px #142e2b59, 0 2px 5px #17332a40;
  backdrop-filter: none;
}
#splash:not(.menu, .sp-updating) .sp-card .ro-title {
  position: relative;
  padding: 25px 24px 23px;
  background: repeating-linear-gradient(132deg, #ffffff03 0 1px, transparent 1px 7px), var(--pine);
  border: 0;
  border-bottom: 3px double #d8b887;
  color: #fff4d8;
  font: 700 clamp(21px, 1.9vw, 28px)/1.3 Georgia, "PMingLiU", serif;
  letter-spacing: .08em;
  text-shadow: none;
}
#splash:not(.menu, .sp-updating) .sp-card .ro-title::before {
  content: "✧";
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  transform: none;
  color: #ecc594;
  margin-right: .45em;
}
#splash:not(.menu, .sp-updating) .sp-card .ro-body {
  padding: 16px clamp(16px, 1.6vw, 24px) 22px;
  gap: 16px;
  scrollbar-gutter: auto;
}
#splash:not(.menu, .sp-updating) .sp-tabs {
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 0;
  background: none;
}
#splash:not(.menu, .sp-updating) .sp-tabs button {
  min-height: 44px;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  color: #52635a;
  background: none;
  box-shadow: none;
}
#splash:not(.menu, .sp-updating) .sp-tabs button.active {
  border-color: var(--copper);
  color: #743b23;
}
#splash:not(.menu, .sp-updating) .sp-tabs button:hover { background: #efe8d7; }
#splash:not(.menu, .sp-updating) .sp-feat {
  padding: 7px 0;
  border: 0;
  border-bottom: 1px dashed var(--rule);
  border-radius: 0;
  background: none;
  color: var(--ink);
  line-height: 1.5;
}
#splash:not(.menu, .sp-updating) :is(.sp-field, .sp-reg-tip, .sp-note) { color: var(--ink); }
#splash:not(.menu, .sp-updating) .sp-field input {
  min-height: 44px;
  box-sizing: border-box;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid #a79e87;
  border-radius: 4px;
  font-size: 16px;
}
#splash:not(.menu, .sp-updating) :is(button, input, a):focus-visible {
  outline: 3px solid #b55923;
  outline-offset: 2px;
}
#splash:not(.menu, .sp-updating) .sp-submit {
  align-self: stretch;
  min-height: 48px;
  background: var(--pine) !important;
  color: #fff7e4 !important;
  border: 1px solid #19372e !important;
  border-radius: 4px;
  box-shadow: inset 0 -3px 0 #152f27 !important;
  text-shadow: none !important;
  letter-spacing: .12em;
}
#splash:not(.menu, .sp-updating) .sp-submit:disabled { opacity: .68; }
#splash:not(.menu, .sp-updating) .sp-leave {
  background: #f4eddd;
  color: var(--ink);
  border: 1px solid var(--rule);
}
#splash:not(.menu, .sp-updating) .sp-reg-progress {
  background: #edeedc;
  border-color: #c1c7af;
}
#splash:not(.menu, .sp-updating) .sp-reg-bar { background: #cdcdb7; }
#splash:not(.menu, .sp-updating) .sp-error {
  background: #f8e4d7;
  color: #832f1e;
  border-color: #c59583;
}
#splash:not(.menu, .sp-updating) :is(#hans-login-note, #hans-reg-note) {
  background: #f4ecda !important;
  border: 1px solid #d9c9aa !important;
  color: #4b4f42 !important;
}
#splash:not(.menu, .sp-updating) :is(#hans-login-note, #hans-reg-note) b { color: #774127 !important; }
#splash:not(.menu, .sp-updating) .sp-foot {
  grid-area: 2 / 1 / 3 / -1;
  position: static;
  padding: 10px 0 0;
  border-top: 1px solid #ffefcc60;
  flex-direction: row;
  justify-content: space-between;
  gap: 20px;
  text-align: start;
}
#splash:not(.menu, .sp-updating) :is(.sp-legal, .sp-meta) {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  backdrop-filter: none;
  color: #fff3db;
  text-shadow: 0 1px 4px #142e26;
}
#splash:not(.menu, .sp-updating) .sp-meta a { color: #fff0cc; }
#splash:not(.menu, .sp-updating) .sp-s2-banner {
  transform-origin: top left;
  scale: 1.5;
  background: #203d33f2;
  border: 1px solid #e2c89a;
  border-radius: 5px;
}
#splash:not(.menu, .sp-updating) .sp-s2-label {
  border: 0;
  background: none;
  color: #ffe4b9;
  padding: 0;
}
body.sp-on:has(#splash:not(.menu, .hidden, .sp-updating)) .sp-top :is(.sp-news-btn, .sp-lang-btn) {
  background: #203d33f2;
  border: 1px solid #e2c89a;
  border-radius: 5px;
  color: #fff4de;
}
@media (max-width: 760px) {
  #splash:not(.menu, .sp-updating) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: max-content max-content max-content;
    gap: 14px;
    padding: max(84px, calc(env(safe-area-inset-top) + 75px)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    /* Reserve a little sky above the masthead on tall phones. */
    align-content: safe center;
  }
  #splash:not(.menu, .sp-updating) .sp-bg {
    background-image: url("assets/skyport/skyport-dawn-mobile.v1.webp");
    background-position: center top;
  }
  #splash:not(.menu, .sp-updating) .sp-logo {
    grid-area: 1 / 1;
    width: min(100%, 440px);
    justify-self: center;
    gap: 5px;
  }
  #splash:not(.menu, .sp-updating) .sp-logo-img { width: clamp(183px, 54vw, 245px); }
  #splash:not(.menu, .sp-updating) .hz-news { margin: 0; padding: 5px 10px; }
  #splash:not(.menu, .sp-updating) .sp-card { grid-area: 2 / 1; justify-self: center; }
  #splash:not(.menu, .sp-updating) .sp-card .ro-title { padding: 15px 18px; }
  #splash:not(.menu, .sp-updating) .sp-foot { grid-area: 3 / 1; justify-self: center; max-width: 440px; flex-direction: column; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  #splash:not(.menu, .sp-updating) :is(.sp-logo, .sp-card, .sp-s2-banner) { animation: none; }
  #splash:not(.menu, .sp-updating) .sp-veil::after { animation: none; }
  #splash:not(.menu, .sp-updating) #ro-bg-canvas { visibility: hidden; }
}
@media (max-width: 359px) {
  #splash:not(.menu, .sp-updating) .sp-s2-banner img { width: 27px; height: 27px; }
  body.sp-on:has(#splash:not(.menu, .hidden, .sp-updating)) .sp-top :is(.sp-news-btn, .sp-lang-btn) { padding-inline: 6px; }
}
