/* ===== Mobil dokunmatik kontroller ===== */

.pk-touch {
  position: absolute;
  inset: 0;
  z-index: 28;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.pk-touch[hidden] {
  display: none !important;
}

.pk-touch-move {
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(46vw, 220px);
  height: min(42vh, 240px);
  pointer-events: auto;
  touch-action: none;
}

.pk-touch-base {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(28px, env(safe-area-inset-bottom));
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: rgba(26, 29, 34, 0.45);
  border: 2px solid rgba(227, 6, 19, 0.55);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.pk-touch-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(227, 6, 19, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 14px rgba(227, 6, 19, 0.35);
  transform: translate(0, 0);
  will-change: transform;
}

.pk-touch-actions {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: auto;
  z-index: 2;
}

.pk-touch-btn {
  width: 68px;
  height: 68px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pk-touch-btn strong {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.pk-touch-btn-run.is-active {
  background: #e30613;
  color: #fff;
}

.pk-touch-btn-sit {
  opacity: 0.35;
  pointer-events: none;
}

.pk-touch-btn-sit.is-near {
  opacity: 1;
  pointer-events: auto;
}

/* Dokunmatikte alt WASD ipucunu gizle */
body.pk-touch-on .pk-tps-hint {
  display: none !important;
}

body.pk-touch-on .pk-sit-hint {
  bottom: max(118px, calc(env(safe-area-inset-bottom) + 108px));
}

.pk-tps-hint-touch {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .pk-tps-hint-desk {
    display: none;
  }
  .pk-tps-hint-touch {
    display: inline;
  }
}

@media (max-width: 480px) {
  .pk-touch-move {
    width: min(52vw, 200px);
    height: min(38vh, 210px);
  }

  .pk-touch-base {
    width: 108px;
    height: 108px;
    left: max(12px, env(safe-area-inset-left));
    bottom: max(20px, env(safe-area-inset-bottom));
  }

  .pk-touch-knob {
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
  }

  .pk-touch-btn {
    width: 62px;
    height: 62px;
  }

  .pk-touch-actions {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    gap: 10px;
  }
}

@media (orientation: landscape) and (max-height: 480px) {
  .pk-touch-base {
    width: 96px;
    height: 96px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .pk-touch-btn {
    width: 54px;
    height: 54px;
  }

  .pk-touch-btn strong {
    font-size: 11px;
  }
}
