* { box-sizing: border-box; }

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Arial, sans-serif;
  background: #111827;
  touch-action: none;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
}

.hud {
  position: fixed;
  top: 14px;
  left: 14px;
  max-width: min(430px, calc(100vw - 28px));
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.45);
  color: white;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.hud h1 {
  margin: 0 0 4px;
  font-size: 18px;
}

.hud p {
  margin: 2px 0 0;
  font-size: 13px;
  opacity: 0.9;
}

#hint {
  color: #ffe066;
  font-weight: bold;
}

.mobile-controls {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 170px;
  height: 170px;
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 56px);
  gap: 0;
  user-select: none;
}

.control-btn,
.action-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.78);
  font-weight: bold;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  touch-action: none;
}

.control-btn {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 24px;
}

.action-btn {
  position: fixed;
  left: 24px;
  bottom: 28px;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  font-size: 32px;
}

.control-btn:active,
.control-btn.pressed,
.action-btn:active {
  transform: scale(0.94);
  background: white;
}

.up { grid-column: 2; grid-row: 1; }
.left { grid-column: 1; grid-row: 2; }
.down { grid-column: 2; grid-row: 3; }
.right { grid-column: 3; grid-row: 2; }


.start-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-direction: column;
  padding: 22px;
  background: #000;
  color: white;
  overflow: hidden;
  touch-action: manipulation;
}

.start-screen.hidden {
  display: none;
}

.start-artwork {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.start-btn {
  position: relative;
  z-index: 2;
  margin-bottom: 12px;
  padding: 16px 30px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.62);
  color: white;
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 900;
  letter-spacing: 1px;
  box-shadow: 0 0 22px rgba(255, 90, 190, 0.9);
  backdrop-filter: blur(6px);
  touch-action: manipulation;
}

.start-btn:active {
  transform: scale(0.96);
}

.start-help {
  position: relative;
  z-index: 2;
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
  font-size: 13px;
  font-weight: bold;
  text-shadow: 0 2px 4px black;
}

@media (max-width: 700px) {
  .start-screen {
    padding-bottom: 34px;
  }

  .start-artwork {
    object-position: center center;
  }

  .start-btn {
    width: min(88vw, 420px);
  }
}

@media (min-width: 900px) {
  .mobile-controls,
  .action-btn {
    opacity: 0.5;
  }
}
