/* 카트라이더풍 아이템 HUD 연출: 먹물 얼룩, 화면 테두리, 경고, 상태 칩 (DOM 은 hud.js buildItemFx 가 생성) */
#ifx-under, #ifx-over { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* 화면 테두리: 물방울 / 악마 / 순간이동 충전 */
.ifx-vignette { position: absolute; inset: 0; opacity: 0; transition: opacity 0.25s; }
.ifx-vignette.on { opacity: 1; }
.ifx-vignette.bubble {
  background: radial-gradient(ellipse at center, rgba(120, 200, 255, 0) 42%, rgba(80, 175, 255, 0.42) 78%, rgba(210, 242, 255, 0.8) 100%);
  animation: ifx-wobble 1.1s ease-in-out infinite;
}
.ifx-vignette.devil {
  background: radial-gradient(ellipse at center, rgba(120, 0, 60, 0) 48%, rgba(150, 0, 70, 0.42) 84%, rgba(60, 0, 40, 0.72) 100%);
  animation: ifx-throb 0.55s ease-in-out infinite alternate;
}
.ifx-vignette.warp {
  background: radial-gradient(circle at center, rgba(160, 255, 255, 0) 30%, rgba(150, 120, 255, 0.35) 75%, rgba(255, 255, 255, 0.65) 100%);
  animation: ifx-throb 0.12s ease-in-out infinite alternate;
}
@keyframes ifx-wobble { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, 0.97); } }
@keyframes ifx-throb { from { opacity: 0.7; } to { opacity: 1; } }

/* 먹물 */
.ifx-ink { position: absolute; inset: 0; opacity: 0; transition: opacity 0.15s linear; }
.ink-splat { position: absolute; animation: ink-slide 4.5s 0.25s linear forwards; }
.ink-splat svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: scale(calc(0.15 * var(--flip, 1)), 0.15);
  animation: ink-in 0.3s cubic-bezier(0.2, 1.5, 0.4, 1) forwards;
  animation-delay: inherit;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}
.ink-splat .drip {
  transform-box: fill-box;
  transform-origin: 50% 0;
  transform: scaleY(0.2);
  animation: ink-drip 3.8s 0.35s ease-in forwards;
}
@keyframes ink-in { to { transform: scale(var(--flip, 1), 1); } }
@keyframes ink-slide { to { transform: translateY(4vmin); } }
@keyframes ink-drip { to { transform: scaleY(1.5); } }

/* 순간이동 섬광 */
.ifx-flash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(circle, #fff 0%, rgba(140, 240, 255, 0.9) 40%, rgba(130, 90, 255, 0.45) 100%); }
.ifx-flash.on { animation: ifx-flash 0.5s ease-out; }
@keyframes ifx-flash { from { opacity: 0.95; } to { opacity: 0; } }

/* 경고 (물방울 / 조향 반전) */
.ifx-warn {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 22px 6px 12px;
  border-radius: 18px;
  font-family: var(--font-kr);
  font-size: clamp(24px, 4.6vmin, 46px);
  color: #fff;
  white-space: nowrap;
  -webkit-text-stroke: 1.2px rgba(0, 0, 0, 0.55);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
}
.ifx-warn svg { width: 1.4em; height: 1.4em; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4)); }
.ifx-warn.on { opacity: 1; animation: ifx-blink 0.45s ease-in-out infinite alternate; }
.ifx-warn.bubble { background: rgba(30, 130, 255, 0.55); }
.ifx-warn.devil { background: rgba(170, 0, 60, 0.62); }
@keyframes ifx-blink { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.06); } }

/* 짧은 알림 (실드 방어 / 저주 / 자석 대상 없음) */
.ifx-pop {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  font-family: var(--font-kr);
  font-size: clamp(22px, 4vmin, 38px);
  color: #fff;
  white-space: nowrap;
  -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.65);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}
.ifx-pop.show { animation: ifx-pop 1.3s ease-out forwards; }
.ifx-pop.good { color: #7ff0ff; }
.ifx-pop.bad { color: #ff8ad0; }
.ifx-pop.warn { color: #ffd34a; }
@keyframes ifx-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  25% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -55%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(1); }
}

/* 상태 칩: 아이템 슬롯·코인 아래 (실드 남은 시간, 자석 대상) */
.ifx-chips { position: absolute; top: calc(196px + var(--sa-t)); left: calc(16px + var(--sa-l)); display: flex; flex-direction: column; gap: 6px; }
.ifx-chip {
  display: none;
  align-items: center;
  gap: 6px;
  min-width: 118px;
  padding: 4px 10px 4px 5px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.45);
  font-family: var(--font-ui);
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
.ifx-chip.on { display: flex; animation: pop 0.3s ease-out; }
.ifx-chip svg { width: 24px; height: 24px; flex: none; }
.ifx-chip b { font-weight: 800; white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.ifx-chip .bar { flex: 1; min-width: 40px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.ifx-chip .bar i { display: block; height: 100%; background: linear-gradient(90deg, #7fe3ff, #2fa8ff); }
.ifx-chip.magnet { background: rgba(140, 20, 20, 0.55); }

@media (max-width: 700px), (pointer: coarse) and (max-height: 500px) {
  .ifx-chips { top: calc(160px + var(--sa-t)); }
}
/* 터치 세로 화면: 미니맵이 코인 아래(왼쪽 위)에 있으므로 칩은 미니맵 아래로 */
@media (pointer: coarse) and (min-height: 501px) {
  .ifx-chips { top: calc(348px + var(--sa-t)); }
}
