:root {
  color-scheme: dark;
  --bg-a: #17132a;
  --bg-b: #08182f;
  --text: #f6f7ff;
  --accent: #8ef5ff;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 15% 20%, var(--bg-a), var(--bg-b));
  color: var(--text);
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  isolation: isolate;
}

#app::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(166, 95, 255, 0.18), transparent 45%),
    radial-gradient(circle at 75% 60%, rgba(41, 224, 255, 0.2), transparent 50%);
  pointer-events: none;
  z-index: -2;
}

#app::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2), transparent 60%);
  transition: opacity 180ms ease;
  pointer-events: none;
  z-index: -1;
}

#app.pulse::after {
  opacity: 0.8;
}

.hud,
.controls,
.status {
  position: relative;
  z-index: 2;
  text-align: center;
  text-shadow: 0 2px 12px var(--shadow);
}

.title {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
}

.subtitle {
  margin: 0.4rem 0 0;
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  opacity: 0.92;
}

.controls {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  color: #0f1430;
  background: #e6ecff;
  cursor: pointer;
  transition: transform 130ms ease, filter 130ms ease, opacity 130ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: linear-gradient(120deg, #95ffff, #75d4ff, #b9b0ff);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  margin-top: 0.9rem;
  max-width: min(90vw, 44rem);
  font-size: 0.95rem;
  line-height: 1.3;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  touch-action: none;
}

#airplaneSprite {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  pointer-events: none;
  font-size: clamp(2.7rem, 5.2vw, 3.8rem);
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(255, 197, 96, 0.8));
  transform: translate(-50%, -50%);
  will-change: transform;
}

#app.running #gameCanvas {
  cursor: none;
}

#app.running .hud,
#app.running .controls {
  opacity: 0.17;
  transition: opacity 180ms ease;
}

#app.running .status {
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  #app::after {
    transition: none;
  }

  .btn {
    transition: none;
  }
}
