:root {
  color-scheme: dark;
  --airdash-width: 100vw;
  --airdash-height: 100dvh;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100svh;
  height: var(--airdash-height, 100dvh);
  min-height: 0;
  max-height: var(--airdash-height, 100dvh);
  overflow: hidden;
  background: linear-gradient(180deg, #08111c 0%, #03070d 100%);
  font-family: Arial, sans-serif;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body {
  position: fixed;
  inset: 0;
  width: var(--airdash-width, 100vw);
  height: var(--airdash-height, 100dvh);
}

#app-shell,
#game-root {
  position: absolute;
  inset: 0;
  width: var(--airdash-width, 100vw);
  height: 100%;
  height: 100svh;
  height: var(--airdash-height, 100dvh);
  min-height: 0;
  max-height: var(--airdash-height, 100dvh);
  overflow: hidden;
}

#app-shell {
  overflow: hidden;
}

#game-root {
  z-index: 1;
}

#startup-splash {
  position: absolute;
  isolation: isolate;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 18%, rgba(124, 210, 255, 0.14), rgba(124, 210, 255, 0) 32%),
    linear-gradient(180deg, rgba(3, 8, 14, 0.22), rgba(3, 8, 14, 0.56));
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    visibility 0s linear 420ms;
}

#startup-splash::before,
#startup-splash::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#startup-splash::before {
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(5, 10, 16, 0.18), rgba(5, 10, 16, 0.7)),
    url('./assets/images/backgrounds/cave/0.png') center / cover no-repeat,
    url('./assets/images/backgrounds/cave/3.png') center / cover no-repeat,
    url('./assets/images/backgrounds/cave/7.png') center / cover no-repeat;
  opacity: 0.96;
}

#startup-splash::after {
  z-index: 0;
  background:
    radial-gradient(circle at 50% 26%, rgba(121, 214, 255, 0.16), rgba(121, 214, 255, 0) 34%),
    linear-gradient(180deg, rgba(171, 219, 255, 0.06), rgba(0, 0, 0, 0));
  mix-blend-mode: screen;
  opacity: 0.84;
}

body.app-ready #startup-splash {
  opacity: 0;
  transform: scale(1.02);
  visibility: hidden;
}

.startup-card {
  z-index: 1;
  width: min(100%, 540px);
  padding: clamp(24px, 3vw, 34px);
  border-radius: 28px;
  text-align: center;
  position: relative;
  background: rgba(6, 14, 22, 0.78);
  border: 1px solid rgba(140, 228, 255, 0.2);
  box-shadow:
    0 28px 52px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
}

.startup-kicker {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9ddff7;
}

.startup-title {
  margin: 0;
  font-size: clamp(48px, 10vw, 78px);
  line-height: 0.95;
  color: #f4fdff;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.startup-edition {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 210, 92, 0.92);
  background: rgba(20, 49, 77, 0.92);
  color: #ffd25c;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.startup-tagline {
  margin: 20px auto 0;
  max-width: 28rem;
  font-size: clamp(17px, 3.2vw, 20px);
  line-height: 1.45;
  color: #e6f8ff;
}

.startup-hint {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #9fd8e9;
}

.noscript-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: min(90vw, 360px);
  padding: 18px 20px;
  transform: translate(-50%, -50%);
  border-radius: 18px;
  background: rgba(8, 20, 34, 0.92);
  border: 2px solid rgba(140, 228, 255, 0.64);
  color: #f4fdff;
  text-align: center;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: var(--airdash-width, 100vw);
  height: 100%;
  height: 100svh;
  height: var(--airdash-height, 100dvh);
  max-width: 100%;
  max-height: 100%;
  outline: none;
}


@supports (height: 100dvh) {
  #app-shell,
  #game-root,
  canvas {
    height: var(--airdash-height, 100dvh);
  }
}

@media (max-height: 520px) {
  #startup-splash {
    padding: max(12px, var(--safe-area-top)) max(14px, var(--safe-area-right)) max(12px, var(--safe-area-bottom)) max(14px, var(--safe-area-left));
  }

  .startup-card {
    padding: 18px;
    border-radius: 22px;
  }

  .startup-kicker {
    margin-bottom: 8px;
    font-size: 10px;
  }

  .startup-title {
    font-size: clamp(38px, 8vw, 58px);
  }

  .startup-edition {
    margin-top: 10px;
    padding: 8px 14px;
    font-size: 12px;
  }

  .startup-tagline {
    margin-top: 12px;
    font-size: 15px;
  }

  .startup-hint {
    margin-top: 8px;
    font-size: 12px;
  }
}

/* 2026 landing splash polish: a tiny playable promise before Phaser mounts. */
#startup-splash {
  background:
    radial-gradient(circle at 68% 24%, rgba(255, 210, 110, 0.16), rgba(255, 210, 110, 0) 27%),
    radial-gradient(circle at 30% 18%, rgba(124, 225, 255, 0.2), rgba(124, 225, 255, 0) 34%),
    linear-gradient(180deg, rgba(3, 8, 14, 0.08), rgba(3, 8, 14, 0.62));
}

#startup-splash::before {
  background:
    linear-gradient(180deg, rgba(5, 10, 16, 0.12), rgba(5, 10, 16, 0.72)),
    url('./assets/mobile/images/backgrounds/opening/day/clouds.webp') center 18% / cover no-repeat,
    url('./assets/mobile/images/backgrounds/opening/day/mountains.webp') center bottom / cover no-repeat,
    linear-gradient(180deg, #75dfff 0%, #377cc4 100%);
  opacity: 0.98;
}

.startup-card {
  overflow: hidden;
  width: min(100%, 620px);
  min-height: 430px;
  padding-top: clamp(150px, 22vw, 190px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
    rgba(6, 16, 27, 0.78);
  border: 1px solid rgba(165, 239, 255, 0.32);
  box-shadow:
    0 34px 70px rgba(0, 0, 0, 0.36),
    0 0 80px rgba(118, 226, 255, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.startup-card::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

.startup-chase {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: clamp(140px, 22vw, 190px);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 68% 48%, rgba(121, 232, 255, 0.2), rgba(121, 232, 255, 0) 46%),
    linear-gradient(180deg, rgba(10, 35, 58, 0.44), rgba(5, 14, 24, 0.08));
}

.startup-chase::before,
.startup-chase::after {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  height: 1px;
  background: rgba(185, 245, 255, 0.16);
  transform: skewX(-18deg);
}

.startup-chase::before { top: 38%; }
.startup-chase::after { top: 66%; }

.startup-plane,
.startup-enemy,
.startup-speed-line {
  position: absolute;
  display: block;
  pointer-events: none;
}

.startup-plane {
  right: 18%;
  top: 45%;
  width: clamp(104px, 22vw, 148px);
  transform: translateY(-50%) rotate(-4deg);
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.34)) drop-shadow(0 0 20px rgba(130, 235, 255, 0.22));
  animation: startupHeroFloat 2.9s ease-in-out infinite;
}

.startup-enemy {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.32));
  opacity: 0.9;
}

.startup-bat {
  right: 43%;
  top: 57%;
  width: clamp(54px, 11vw, 76px);
  animation: startupBatChase 2.4s ease-in-out infinite;
}

.startup-ghost {
  right: 55%;
  top: 33%;
  width: clamp(62px, 12vw, 88px);
  opacity: 0.58;
  mix-blend-mode: screen;
  animation: startupGhostChase 3.3s ease-in-out infinite;
}

.startup-speed-line {
  height: 2px;
  width: clamp(80px, 17vw, 128px);
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(156, 239, 255, 0), rgba(210, 250, 255, 0.72));
  transform: skewX(-18deg);
  animation: startupSpeedLine 1.4s linear infinite;
}

.startup-speed-line-a { top: 30%; left: 78%; animation-delay: -0.2s; }
.startup-speed-line-b { top: 55%; left: 66%; animation-delay: -0.68s; }
.startup-speed-line-c { top: 75%; left: 74%; animation-delay: -1.05s; background: linear-gradient(90deg, rgba(255, 211, 111, 0), rgba(255, 211, 111, 0.64)); }

.startup-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.12em;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', 'Arial Black', sans-serif;
  font-size: clamp(58px, 11vw, 92px);
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.startup-title span {
  color: #f4fdff;
  font-weight: 400;
}

.startup-title strong {
  color: #ffd36f;
  font-weight: 400;
  transform: translateY(0.08em);
}

.startup-edition {
  background: linear-gradient(180deg, #ffd980, #f3a841);
  color: #10222f;
  border-color: rgba(255, 246, 210, 0.92);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

@keyframes startupHeroFloat {
  0%, 100% { transform: translateY(-50%) rotate(-5deg) translateX(0); }
  50% { transform: translateY(calc(-50% - 7px)) rotate(2deg) translateX(9px); }
}

@keyframes startupBatChase {
  0%, 100% { transform: translateY(-50%) rotate(7deg) translateX(0); }
  50% { transform: translateY(calc(-50% + 8px)) rotate(-8deg) translateX(-7px); }
}

@keyframes startupGhostChase {
  0%, 100% { transform: translateY(-50%) rotate(-3deg) translateX(0); opacity: 0.48; }
  50% { transform: translateY(calc(-50% - 8px)) rotate(4deg) translateX(10px); opacity: 0.68; }
}

@keyframes startupSpeedLine {
  from { transform: translateX(0) skewX(-18deg); opacity: 0; }
  18% { opacity: 0.8; }
  to { transform: translateX(-760px) skewX(-18deg); opacity: 0; }
}

@media (max-height: 520px) {
  .startup-card {
    min-height: 0;
    padding-top: 112px;
  }

  .startup-chase {
    height: 110px;
  }

  .startup-plane {
    width: clamp(84px, 16vw, 116px);
  }

  .startup-title {
    font-size: clamp(40px, 8vw, 62px);
  }
}

@media (max-width: 420px) {
  .startup-card {
    min-height: 410px;
    padding-top: 142px;
  }

  .startup-plane {
    right: 9%;
  }

  .startup-bat {
    right: 41%;
  }

  .startup-ghost {
    right: 56%;
  }

  .startup-title {
    gap: 0.08em;
  }
}


@media (pointer: coarse), (max-width: 820px), (max-height: 520px) {
  body {
    -webkit-overflow-scrolling: auto;
  }

  .startup-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow:
      0 22px 42px rgba(0, 0, 0, 0.34),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  #startup-splash::after {
    mix-blend-mode: normal;
    opacity: 0.52;
  }
}

@media (max-width: 380px), (max-height: 460px) {
  #startup-splash {
    padding: max(10px, var(--safe-area-top)) max(10px, var(--safe-area-right)) max(10px, var(--safe-area-bottom)) max(10px, var(--safe-area-left));
  }

  .startup-card {
    border-radius: 20px;
  }

  .startup-edition {
    letter-spacing: 0.11em;
  }

  .startup-tagline {
    font-size: 14px;
  }
}
