.start-screen {
  position: fixed;
  z-index: 1300;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  padding: 22px clamp(10px, 5vw, 36px);
  background: #bfe0e5;
}
.start-screen[hidden] { display: none; }

html:has(.welcome-shell), .welcome-shell { background: transparent; }

.welcome-shell .start-screen {
  inset: 34px 20px 26px 35px;
  overflow: visible;
  background: transparent;
}

.welcome-shell .welcome-slides {
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 8px 18px #1019214d;
}

.welcome-slides,
.welcome-slides > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.welcome-slides {
  z-index: -1;
  background: center / cover no-repeat url("../../assets/welcome/map-1.png");
}

.welcome-slides > img {
  object-fit: cover;
  animation: welcome-slide 21s linear infinite both;
}

.welcome-slides > img:nth-child(1) { animation-delay: -.7s; }
.welcome-slides > img:nth-child(2) { animation-delay: 6.3s; }
.welcome-slides > img:nth-child(3) { animation-delay: 13.3s; }

@keyframes welcome-slide {
  0%, 36.6667%, 100% { opacity: 0; }
  3.3333%, 33.3333% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-slides > img { animation-name: welcome-slide-discrete; animation-timing-function: step-end; }
}

@keyframes welcome-slide-discrete {
  0% { opacity: 1; }
  33.3333%, 100% { opacity: 0; }
}

.welcome-mark {
  position: absolute;
  inset: 0 0 auto;
  height: 54px;
  -webkit-app-region: drag;
}

.welcome-emblem {
  position: absolute;
  left: -45px;
  top: -48px;
  width: 216px;
  pointer-events: none;
  filter: drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff)
    drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff) drop-shadow(5px 11px 9px #101b24b5);
}

.welcome-shell .welcome-emblem { left: -33px; top: -30px; }

.welcome-wordmark {
  position: absolute;
  top: 13px;
  left: 184px;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #edf6f5b8;
  border-radius: 7px;
  background: #172c35ee;
  color: #fff;
  box-shadow: 0 3px 10px #172c354d;
  font: 500 14px/1.15 'Segoe UI', sans-serif;
  white-space: nowrap;
}

.welcome-wordmark strong { font-size: 18px; letter-spacing: .12em; }
.welcome-wordmark small { font-size: 11px; color: #c7dce4; }

@media (max-width: 440px) {
  .welcome-wordmark { left: 105px; gap: 5px; }
  .welcome-emblem { max-width: 130px; }
}

.start-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(5px, 2vw, 12px);
  width: min(100%, 470px);
  margin-bottom: clamp(24px, 12vh, 68px);
}

.start-choices button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 82px;
  padding: 8px 4px;
  border: 1px solid #e8f4f2;
  border-radius: 9px;
  background: #20353bf5;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 3px 12px #14263060;
}

.start-choices button:hover { background: #31535a; border-color: #fff; }
.start-choices button:focus-visible, .welcome-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.start-choices svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  -webkit-app-region: no-drag;
}

.welcome-close svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 2px #0004);
  transition: transform .16s ease;
}

.welcome-close svg path:first-child { stroke: #fff; stroke-width: 7; }
.welcome-close svg path:last-child { stroke: #151515; stroke-width: 3.5; }
.welcome-close:hover { background: #ffffff4d; }
.welcome-close:hover svg { transform: scale(1.1); }

.welcome-progress {
  display: none;
  position: absolute;
  bottom: 15px;
  left: 19px;
  margin: 0;
  color: #121212;
  font-size: 13px;
  font-weight: 650;
  paint-order: stroke fill;
  -webkit-text-stroke: 3px #fff;
}

.start-screen[data-loading] .welcome-progress { display: block; }
.start-screen[data-loading] .start-choices,
.start-screen[data-loading] .welcome-close { visibility: hidden; }

.welcome-error {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 12px;
  margin: 0;
  padding: 8px 12px;
  color: #fff;
  background: #1d3039;
  border-radius: 7px;
  overflow-wrap: anywhere;
}

.welcome-shell :is(#newMapSettings, #planetSettings) {
  width: min(600px, calc(100vw - 40px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid #52686d;
  border-radius: 14px;
  background: #1c2a32;
  color: #e8f0f2;
  box-shadow: 0 14px 40px #0b141a99;
  overflow: hidden;
}
.welcome-shell :is(#newMapSettings, #planetSettings)::backdrop { background: #101b217a; }
.welcome-shell :is(#newMapSettings, #planetSettings) .dialog-heading {
  position: static;
  padding: 12px 16px;
  margin: 0;
  background: #1c2a32;
  border-bottom: 1px solid #40545d;
}
.welcome-shell :is(#newMapSettings, #planetSettings) h2 { margin: 0; font-size: 18px; }
.welcome-shell :is(#newMapSettings, #planetSettings) form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 92px);
}
.welcome-shell :is(#newMapSettings, #planetSettings) .form-scroll {
  padding: 8px 16px;
  overflow-y: auto;
}
.welcome-shell :is(#newMapSettings, #planetSettings) .form-scroll label:not(.inline) {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) minmax(130px, 1.25fr);
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  font-size: 13px;
}
.welcome-shell :is(#newMapSettings, #planetSettings) :is(input, select) {
  min-width: 0;
  margin: 0;
  border: 1px solid #50646b;
  background: #152127;
  color: #e8f0f2;
}
.welcome-shell :is(#newMapSettings, #planetSettings) details { margin: 10px 0; }
.welcome-shell :is(#newMapSettings, #planetSettings) summary { cursor: pointer; }
.welcome-shell :is(#newMapSettings, #planetSettings) .dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px 16px;
  margin: 0;
  border-top: 1px solid #40545d;
}
.welcome-shell :is(#newMapSettings, #planetSettings) .dialog-actions button {
  width: auto;
  margin: 0;
  padding: 7px 10px;
  white-space: nowrap;
}
.welcome-shell :is(#newMapSettings, #planetSettings) .cancel-settings { color: #e8f0f2; }

.welcome-shell :is(#newMapSettings, #planetSettings) .form-scroll label { color: #bbced3; }
.welcome-shell :is(#newMapSettings, #planetSettings) .dialog-close {
  color: #c8dce0;
  background: #263b43;
  border-color: #52686d;
}
