/* ── 모바일 터치 조작(터치가 감지되면 표시) ── */
.touch { display: none; }
.is-touch .touch { display: block; position: absolute; inset: 0; z-index: 25; pointer-events: none; }
.is-touch .touch.hidden { display: none; }

.stick-zone { position: absolute; left: 0; bottom: 0; width: 45%; height: 55%; pointer-events: auto; touch-action: none; }
.stick {
  position: absolute; left: var(--sx, 110px); top: var(--sy, calc(100% - 120px));
  width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06); border: 2px solid rgba(255, 255, 255, 0.16);
  opacity: 0.55; transition: opacity 0.15s ease;
}
.stick.is-active { opacity: 1; }
.stick-knob {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255, 220, 160, 0.9), rgba(200, 130, 40, 0.8));
  transform: translate(var(--jx, 0px), var(--jy, 0px));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.touch-buttons {
  position: absolute; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(18px + var(--safe-b));
  width: 240px; height: 240px; pointer-events: none;
}
.tbtn {
  position: absolute; border-radius: 50%; overflow: hidden; pointer-events: auto; touch-action: none;
  background: radial-gradient(circle at 50% 35%, rgba(60, 54, 44, 0.92), rgba(18, 16, 12, 0.92));
  border: 2px solid rgba(232, 163, 58, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: transform 0.06s ease;
}
.tbtn.is-down { transform: scale(0.92); border-color: var(--accent-2); }
.tbtn-icon { position: absolute; inset: 18%; width: 64%; height: 64%; object-fit: contain; pointer-events: none; }
.tbtn-cd { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); transform-origin: bottom; transform: scaleY(var(--cd, 0)); pointer-events: none; }
.tbtn-label { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000; pointer-events: none; }
.tbtn-attack { right: 0; bottom: 0; width: 96px; height: 96px; border-width: 3px; }
.tbtn-s1 { right: 104px; bottom: 4px; width: 62px; height: 62px; }
.tbtn-s2 { right: 92px; bottom: 76px; width: 62px; height: 62px; }
.tbtn-s3 { right: 30px; bottom: 112px; width: 62px; height: 62px; }
.tbtn-potion { right: 164px; bottom: 120px; width: 50px; height: 50px; border-color: rgba(120, 220, 120, 0.45); }
.tbtn-roll { right: 178px; bottom: 50px; width: 54px; height: 54px; border-color: rgba(160, 120, 255, 0.5); }
.tbtn.is-empty { opacity: 0.4; }

/* 터치 기기에서는 기술 칸 대신 터치 버튼을 쓰므로 아래 막대를 줄인다 */
.is-touch .slots { display: none; }
.is-touch .actionbar { left: 12px; transform: none; bottom: auto; top: calc(12px + var(--safe-t)); flex-direction: column; align-items: flex-start; }
.is-touch .orb { display: none; }
.is-touch .xp { width: 180px; }
.is-touch .hud-party { top: calc(34px + var(--safe-t)); }
.is-touch .hint { bottom: auto; top: calc(64px + var(--safe-t)); }

@media (max-height: 420px) {
  .touch-buttons { transform: scale(0.82); transform-origin: right bottom; }
}
