body {
  margin: 0;
  padding: 0;
  background-color: #333;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
#gameCanvas {
  display: block;
  margin: 0 auto;
  box-shadow: none;
}
#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.hidden {
  display: none !important;
}
.card {
  background: rgba(255, 255, 255, 0.95);
  box-sizing: border-box;
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  animation: 3s ease-in-out infinite float;
  max-width: 80%;
  border: 4px solid #0c0c0c;
}
h1 {
  color: #2563eb;
  font-size: 2.5rem;
  margin: 0 0 10px;
  text-shadow: 2px 2px 0 #0c0c0c;
  font-weight: 900;
  text-transform: uppercase;
}
p {
  color: #0c0c0c;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}
button {
  background: #2563eb;
  color: #ffffff;
  border: 3px solid #0c0c0c;
  padding: 12px 24px;
  font-size: 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.1s;
  box-shadow: 4px 4px 0 #0c0c0c;
  text-transform: uppercase;
}
button:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
.floating-text {
  position: absolute;
  font-family: Impact, sans-serif;
  font-weight: 900;
  pointer-events: none;
  animation: 1.5s forwards fadeUp;
  -webkit-text-stroke: 0.0075em #ffffff;
  color: #2563eb;
  font-size: 32px;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5) rotate(-10deg);
  }
  20% {
    opacity: 1;
    transform: translateY(-20px) scale(1.2) rotate(5deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) scale(1) rotate(0);
  }
}
#sales-display {
  position: absolute;
  top: 30px;
  width: 100%;
  text-align: center;
  font-family: Impact, sans-serif;
  font-size: 50px;
  color: #2563eb;
  -webkit-text-stroke: 2px #0c0c0c;
  pointer-events: none;
}

/* 3DIMLI launch glide enhancement */
#ui-layer {
  padding: 24px;
}

#startScreen,
#gameOverScreen {
  width: min(540px, calc(100vw - 32px));
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(9, 16, 34, 0.9), rgba(5, 10, 22, 0.96));
  box-shadow:
    0 28px 80px rgba(2, 6, 23, 0.64),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#startScreen p,
#gameOverScreen p {
  color: #cbd5e1;
}

#startScreen h1,
#gameOverScreen h1 {
  color: #eff6ff;
  text-shadow:
    0 0 24px rgba(59, 130, 246, 0.34),
    0 4px 0 rgba(15, 23, 42, 0.92);
}

.launch-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.48rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  background: rgba(37, 99, 235, 0.14);
  color: #dbeafe;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.launch-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 1rem 0 1.25rem;
}

.launch-badges span {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.62);
  color: #dbeafe;
  font-size: 0.82rem;
  font-weight: 700;
}

.launch-instructions {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  color: #93c5fd;
}

#sales-display {
  top: 20px;
  left: 50%;
  width: auto;
  min-width: 220px;
  padding: 0.9rem 1.3rem;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(8, 15, 32, 0.74);
  box-shadow:
    0 18px 40px rgba(2, 6, 23, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-size: clamp(2rem, 4vw, 3rem);
}

#gameOverScreen .go-score-line {
  margin-bottom: 15px;
  font-size: 1.5rem;
  font-weight: bold;
  color: #e5e7eb !important;
}
#gameOverScreen .go-score-line #finalScore {
  color: #60a5fa !important;
  -webkit-text-stroke: 0 !important;
  text-shadow: none !important;
}
#gameOverScreen .go-best-line {
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: #9ca3af !important;
}
#gameOverScreen .go-best-line #bestScore {
  color: #cbd5e1 !important;
}

@media (max-width: 600px), (pointer: coarse) {
  #ui-layer {
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .card {
    width: min(100%, 400px);
    max-width: none;
    padding: 1.35rem 1rem;
    border-radius: 20px;
    animation: none;
    max-height: calc(100svh - 32px);
    overflow-y: auto;
  }

  .floating-text {
    font-size: 22px;
    letter-spacing: 0.5px;
  }

  h1 {
    font-size: clamp(2.1rem, 10vw, 3rem);
    line-height: 0.95;
    margin-bottom: 0.6rem;
  }

  p {
    font-size: 0.98rem;
    margin-bottom: 1rem;
  }

  .launch-chip {
    margin-bottom: 0.75rem;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .launch-badges {
    gap: 0.45rem;
    margin: 0.85rem 0 1rem;
  }

  .launch-badges span {
    padding: 0.45rem 0.65rem;
    font-size: 0.72rem;
  }

  .launch-instructions {
    font-size: 0.88rem;
  }

  button {
    width: min(100%, 290px);
    padding: 0.85rem 1rem;
    font-size: 1rem;
  }

  #sales-display {
    top: max(12px, env(safe-area-inset-top));
    width: min(calc(100vw - 32px), 310px);
    min-width: 0;
    padding: 0.75rem 1rem;
    font-size: clamp(1.5rem, 8vw, 2.2rem);
  }

  #gameOverScreen .go-score-line {
    font-size: 1.2rem;
    margin-bottom: 12px;
  }

  #gameOverScreen .go-best-line {
    margin-bottom: 16px;
  }
}
