:root {
  --bg-top: #0b0d1a;
  --bg-bot: #1a1430;
  --accent: #ffcc33;
  --accent-2: #ff5566;
  --panel: rgba(8, 10, 22, 0.85);
  --text: #f4f4f8;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0d1a url("assets/image/jupiter.png") center center / cover no-repeat fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#game-root {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#hud {
  position: absolute;
  top: env(safe-area-inset-top, 0);
  left: 0;
  right: 0;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 10;
}

#hud #lives {
  color: var(--accent-2);
}

#hud #score {
  color: var(--accent);
}

#hud #drawing-hp-display {
  color: var(--text);
}

.hidden-hud {
  display: none !important;
}

/* Touch controls */
#touch-controls {
  position: absolute;
  bottom: env(safe-area-inset-bottom, 0);
  left: 0;
  right: 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  z-index: 20;
  pointer-events: none;
}

#touch-controls.hidden {
  display: none;
}

.touch-btn {
  pointer-events: auto;
  flex: 1;
  height: 78px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 18, 40, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
  transition: transform 0.05s ease, background 0.1s ease;
}

.touch-btn:active {
  transform: scale(0.96);
  background: rgba(60, 50, 110, 0.9);
}

.touch-btn.throw {
  flex: 1.6;
  background: linear-gradient(180deg, #ff7a3a, #ff3a6a);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 22px;
}

/* Overlay (start / end screens) */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.85));
  z-index: 30;
  transition: opacity 0.4s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 22px 18px;
  text-align: center;
  max-width: 92%;
  width: 480px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.panel h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: 4px;
  background: linear-gradient(180deg, #ffe28a, #ff7a3a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.panel .tag {
  margin: 0 0 18px;
  opacity: 0.85;
  font-size: 14px;
  letter-spacing: 1px;
}

.panel .hint {
  margin: 8px 0;
  font-size: 13px;
  opacity: 0.7;
}

button.primary {
  margin-top: 18px;
  padding: 14px 28px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 3px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(180deg, var(--accent), #ff8833);
  color: #1a0e00;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(255, 140, 40, 0.35);
  transition: transform 0.08s ease;
}

button.primary:active {
  transform: translateY(2px);
}

/* Responsive — show right hint per device */
.mobile-hint {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .desktop-hint {
    display: none;
  }

  .mobile-hint {
    display: block;
  }

  /* Reserve space at the bottom for the touch controls so the player
     sprite isn't covered by the buttons. */
  #game-canvas {
    height: calc(100% - 120px - env(safe-area-inset-bottom, 0px));
  }
}