:root {
  --safe-x: max(5vw, env(safe-area-inset-left), env(safe-area-inset-right));
  --safe-y: max(5vh, env(safe-area-inset-top), env(safe-area-inset-bottom));
  color-scheme: dark;
  font-family: Inter, ui-rounded, "Trebuchet MS", system-ui, sans-serif;
  color: #fffce8;
  background: #06130d;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100svh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(78, 255, 126, 0.18), transparent 45%),
    #06130d;
}

button,
select {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.launcher,
.panel {
  min-height: 100svh;
}

.panel {
  position: relative;
  display: grid;
  place-items: center;
  padding: var(--safe-y) var(--safe-x);
}

.panel[hidden],
.loading[hidden] {
  display: none;
}

.splash-panel {
  overflow: hidden;
}

.hero-art {
  position: absolute;
  inset: 0;
  background: #102c18 url("./assets/launcher/lightning-legends-launch-1920x1080.png") center / cover
    no-repeat;
  transform: scale(1.01);
}

.shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 46%, rgba(2, 12, 7, 0.22) 64%, rgba(2, 12, 7, 0.86));
}

.splash-content {
  position: relative;
  align-self: end;
  display: flex;
  justify-content: center;
  width: 100%;
  padding-bottom: clamp(10px, 4vh, 52px);
}

.button {
  min-height: 56px;
  padding: 14px 28px;
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  color: #10210c;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 0 #153b20, 0 14px 28px rgba(0, 0, 0, 0.34);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #153b20, 0 7px 16px rgba(0, 0, 0, 0.32);
}

.button:focus-visible,
.back-button:focus-visible,
select:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 4px;
}

.button-primary {
  background: linear-gradient(180deg, #e9ff4c, #82e536);
}

.button-secondary {
  width: 100%;
  background: linear-gradient(180deg, #75efff, #3bbdff);
}

.button-hero {
  min-width: min(300px, 80vw);
  min-height: 68px;
  font-size: clamp(1.5rem, 4vw, 2.15rem);
  text-transform: uppercase;
}

.build-panel {
  background:
    linear-gradient(rgba(3, 17, 9, 0.68), rgba(3, 17, 9, 0.92)),
    url("./assets/launcher/lightning-legends-launch-1920x1080.png") center / cover fixed;
}

.build-card {
  width: min(720px, 100%);
  padding: clamp(24px, 5vw, 46px);
  border: 2px solid rgba(207, 255, 86, 0.55);
  border-radius: 28px;
  background: rgba(8, 33, 20, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0 0 8px;
  color: #dfff62;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1;
}

.intro {
  margin: 14px 0 24px;
  color: #d2e3d5;
}

.newest-card {
  padding: 22px;
  border: 2px solid #caff42;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(55, 108, 34, 0.7), rgba(12, 47, 28, 0.9));
}

.badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  color: #18310d;
  background: #dfff62;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.newest-card h3 {
  margin: 13px 0 5px;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
}

.newest-card p {
  margin: 0 0 18px;
  color: #c9ddce;
}

.archive {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.archive label {
  font-weight: 800;
}

.archive-link {
  display: block;
  min-height: 48px;
  margin: 18px auto 0;
  padding: 8px 12px;
  border: 0;
  color: #bcd1c1;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.archive-link:hover {
  color: #fff;
}

.archive-link:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 3px;
}

.archive-date {
  min-height: 1.3em;
  margin: -3px 0 0;
  color: #bcd1c1;
  font-size: 0.9rem;
}

select {
  width: 100%;
  min-height: 54px;
  padding: 10px 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  color: #fff;
  background: #0b2718;
  cursor: pointer;
}

.back-button {
  min-height: 48px;
  margin-top: 18px;
  padding: 8px 4px;
  border: 0;
  color: #d9eadc;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.loading {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--safe-y) var(--safe-x);
  background: rgba(2, 12, 7, 0.94);
}

.loading-card {
  width: min(460px, 100%);
  text-align: center;
}

.bolt {
  color: #dfff62;
  font-size: 5rem;
  line-height: 1;
  text-shadow: 0 0 28px rgba(206, 255, 71, 0.7);
  animation: pulse 800ms ease-in-out infinite alternate;
}

.loading p {
  font-size: 1.25rem;
  font-weight: 900;
}

.progress {
  height: 16px;
  overflow: hidden;
  border: 2px solid #dfff62;
  border-radius: 999px;
  background: #102519;
}

.progress span {
  display: block;
  width: 46%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #67e4ff, #dfff62);
  animation: load 1.2s ease-in-out infinite;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@keyframes load {
  from { transform: translateX(-105%); }
  to { transform: translateX(220%); }
}

@keyframes pulse {
  to { transform: scale(1.1); filter: brightness(1.3); }
}

@media (max-height: 650px) and (orientation: landscape) {
  .build-panel {
    align-items: start;
  }

  .build-card {
    padding: 12px 24px;
  }

  h2 {
    font-size: 1.8rem;
  }

  .eyebrow {
    margin-bottom: 3px;
    font-size: 0.72rem;
  }

  .intro {
    margin: 4px 0 8px;
    font-size: 0.9rem;
  }

  .newest-card {
    padding: 10px 14px;
  }

  .newest-card h3 {
    margin: 5px 0 2px;
    font-size: 1.1rem;
  }

  .newest-card p {
    margin-bottom: 8px;
    font-size: 0.85rem;
  }

  .button {
    min-height: 48px;
    padding-block: 8px;
  }

  .archive-link {
    min-height: 44px;
    margin-top: 4px;
  }

  .back-button {
    min-height: 44px;
    margin-top: -6px;
  }

  .archive {
    gap: 6px;
    margin-top: 8px;
  }

  select {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
