.startup {
  position: fixed;
  z-index: 1000;
  inset: 0;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(auto, 1fr) auto;
  align-items: center;
  gap: clamp(18px, 4dvh, 38px);
  overflow: auto;
  overscroll-behavior: contain;
  --startup-gutter: clamp(24px, 6.4vw, 120px);
  padding: max(22px, env(safe-area-inset-top)) max(var(--startup-gutter), env(safe-area-inset-right))
    max(clamp(24px, 6dvh, 60px), env(safe-area-inset-bottom)) max(var(--startup-gutter), env(safe-area-inset-left));
  background: #111d1c;
  color: #f6e8ce;
}

.startup-scenery, .startup-scenery img, .startup::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.startup-scenery { z-index: -2; opacity: 0; transition: opacity 750ms ease-out; }
.startup-scenery.is-visible { opacity: 1; }
.startup-scenery img { object-fit: cover; object-position: 71% 45%; }

.startup::before {
  z-index: -1;
  content: '';
  background:
    linear-gradient(90deg, #0a1617e6, #0a161796 30%, #0a161722 63%, transparent 100%),
    linear-gradient(0deg, #081312b0, transparent 35%, transparent 78%, #0d16194d);
}

.startup::after {
  position: absolute;
  inset: clamp(10px, 1.5vw, 24px);
  border: 1px solid #f2d3a542;
  content: '';
  pointer-events: none;
}

.startup-content {
  width: min(100%, 530px);
}

.startup-crest {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: clamp(13px, 3dvh, 28px);
}

.startup-crest img {
  width: clamp(32px, 3.5vw, 49px);
  height: auto;
  border: 1px solid #bf9b67;
  border-radius: 26%;
  box-shadow: 0 0 0 3px #e6b97120, 0 6px 22px #060c0a70;
}

.startup-crest::after {
  width: clamp(70px, 10vw, 151px);
  height: 1px;
  background: linear-gradient(90deg, #d5ae74a8, #d5ae7400);
  content: '';
}

.startup h1 {
  margin: 0;
  color: #f4e5c8;
  font: 700 clamp(42px, 8vw, 112px)/.88 Cinzel, Georgia, serif;
  letter-spacing: -.047em;
  text-shadow: 0 5px 22px #010807a8;
}

.startup h1 span { display: block; }

.startup h1 span + span {
  margin-top: .16em;
  color: #e8c68e;
  font-size: .58em;
  letter-spacing: .075em;
}

.startup-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, min(31vw, 360px));
  align-items: end;
  gap: clamp(15px, 5vw, 72px);
  padding-top: clamp(11px, 2.2dvh, 20px);
  border-top: 1px solid #eccc9f61;
}

.startup p {
  margin: 0;
  color: #eddfc3;
  font: 600 clamp(12px, 1.1vw, 14px)/1.4 var(--ui);
  text-shadow: 0 2px 6px #05100d;
}

.startup-loading p {
  display: flex;
  align-items: center;
  gap: 8px;
}

.startup-tip {
  display: grid;
  gap: 5px;
}

.startup-tip strong {
  color: #efd099;
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.startup-tip span {
  max-width: 46ch;
  font-weight: 500;
}

.startup-loading p::before {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f6d696;
  box-shadow: 0 0 8px #efcc83a0;
  content: '';
}

.startup-track {
  overflow: hidden;
  height: 3px;
  margin-top: 10px;
  background: #e6c5963c;
}

.startup-track::before {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #ffe0a7 80%, #dba05a);
  content: '';
  animation: startup-progress 1.7s ease-in-out infinite;
}

@keyframes startup-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

.startup button {
  min-height: 44px;
  margin-top: 13px;
  padding: 6px 17px;
  border: 1px solid #d7b77d;
  border-radius: 4px;
  background: #2d2c22;
  color: #fce9bf;
  font: 600 14px/1.3 var(--ui);
}

.startup button:hover { background: #51452e; }
.startup button:focus-visible { outline-offset: 3px; }

.startup-loading:has(button:not([hidden])) p::before { background: #ffb295; }
.startup-loading:has(button:not([hidden])) .startup-track::before {
  width: 100%;
  background: #a66a56;
  animation: none;
}

@media (orientation: portrait) {
  .startup-scenery img { object-position: 68% center; }
  .startup::before {
    background: linear-gradient(0deg, #101a1af5, #101a1a7a 50%, #101a1a24);
  }
  .startup { align-items: end; padding-bottom: max(7dvh, env(safe-area-inset-bottom)); }
  .startup h1 { font-size: clamp(42px, 12vw, 85px); }
  .startup-footer { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .startup-scenery { transition: none; }
  .startup-track::before {
    margin-inline: auto;
    animation: none;
  }
}
