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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Telefonda kaydırma, yakınlaştırma ve metin seçimi olmasın */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

canvas {
  display: block;
}

/* ---- Dokunmatik kontroller ---- */

#controls,
#btn-pause {
  display: none;
}

body.touch.playing #controls,
body.touch.playing #btn-pause {
  display: flex;
}

#controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 max(18px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  pointer-events: none;
}

.pad {
  display: flex;
  gap: 10px;
}

.ctrl,
#btn-pause {
  /* Uzun basışta metin seçimi, büyüteç ve tarayıcının basma efekti olmasın */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  transform: none;
  transition: none;
  outline: none;
}

.ctrl {
  pointer-events: auto;
  width: 66px;
  height: 66px;
  border: 3px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  background: rgba(20, 24, 40, 0.3);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  touch-action: none;
}

.ctrl-jump {
  width: 92px;
  font-size: 16px;
  letter-spacing: 1px;
}

.ctrl.active {
  background: rgba(47, 123, 255, 0.65);
  border-color: #fff;
}

#btn-pause {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  background: rgba(20, 24, 40, 0.4);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

/* ---- Telefon dik tutulduğunda uyarı ---- */

#rotate-hint {
  display: none;
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  font-size: 14px;
  white-space: nowrap;
  pointer-events: none;
}

@media (orientation: portrait) and (pointer: coarse) {
  #rotate-hint {
    display: block;
  }
}
