/* Aphelion — portrait frame. The page is a starfield; the game is a centered
   390x844 portrait card that scales to fit whatever screen it is on. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(1px 1px at 12% 22%, rgba(220, 235, 255, 0.8), transparent 60%),
    radial-gradient(1px 1px at 78% 12%, rgba(220, 235, 255, 0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 32% 72%, rgba(190, 220, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 88% 58%, rgba(220, 235, 255, 0.7), transparent 60%),
    radial-gradient(1px 1px at 55% 38%, rgba(220, 235, 255, 0.45), transparent 60%),
    linear-gradient(180deg, #05070f 0%, #0a0f1f 55%, #070a14 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#frame {
  position: relative;
  /* keep 390:844 aspect, fit inside the viewport */
  height: min(100dvh, calc(100dvw * 844 / 390));
  aspect-ratio: 390 / 844;
}

@media (min-width: 500px) {
  /* desktop: a framed portrait card with breathing room */
  #frame {
    height: min(96dvh, calc(96dvw * 844 / 390));
    border-radius: 14px;
    box-shadow:
      0 0 0 1px rgba(140, 180, 220, 0.22),
      0 24px 80px rgba(0, 0, 0, 0.65),
      0 0 60px rgba(90, 140, 200, 0.12);
    overflow: hidden;
  }
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  background: #070a14;
}

/* ---- touch controls ------------------------------------------------------ */

#touch {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cluster {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  gap: 12px;
  pointer-events: none;
}

#move-cluster {
  left: 12px;
}

#act-cluster {
  right: 12px;
}

.tbtn {
  pointer-events: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1.5px solid rgba(150, 195, 230, 0.4);
  background: rgba(12, 20, 36, 0.42);
  color: rgba(205, 230, 250, 0.85);
  font-size: 22px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(2px);
}

.tbtn:active,
.tbtn.held {
  background: rgba(70, 120, 170, 0.5);
  border-color: rgba(190, 230, 255, 0.8);
}

#t-jump {
  width: 74px;
  height: 74px;
}

/* mouse-and-keyboard machines don't need the thumbs */
@media (hover: hover) and (pointer: fine) {
  #touch {
    display: none;
  }
}
