/*
 * cauldron.css — 픽셀아트 연금솥 색과 움직임 (cauldronSprite.js 짝꿍)
 *   크기: .cauldron-sprite { --scale: 4 }  → 픽셀 1칸 = 4px
 *   솥 안 물 색은 JS가 --liquid / --liquid-lo / --liquid-hi 로 넣어 줘요.
 */

.cauldron-sprite {
  --scale: 4;
  --liquid: #4b8f84;
  --liquid-lo: #2f5852;
  --liquid-hi: #a6d0c8;
  display: inline-block;
  line-height: 0;
}
.cauldron-sprite svg {
  display: block;
  width: calc(64px * var(--scale));
  height: calc(68px * var(--scale));
  overflow: visible;
}

/* ── 색 ── */
.cs-ol { fill: #2b1d16; }
.cs-i1 { fill: #2f2829; }
.cs-i2 { fill: #463d3e; }
.cs-i3 { fill: #5f5555; }
.cs-i4 { fill: #7c716d; }
.cs-i5 { fill: #9c8f86; }
.cs-i6 { fill: #d2c7b4; }
.cs-br1 { fill: #6b4220; }
.cs-br2 { fill: #a0692e; }
.cs-br3 { fill: #cf9a47; }
.cs-br4 { fill: #f0cf85; }
.cs-wall { fill: #221a1b; }
.cs-liq-lo { fill: var(--liquid-lo); transition: fill 0.4s; }
.cs-liq { fill: var(--liquid); transition: fill 0.4s; }
.cs-liq-hi { fill: var(--liquid-hi); transition: fill 0.4s; }
.cs-shine { fill: #ffffff; }
.cs-f1 { fill: #b3341e; }
.cs-f2 { fill: #e8702a; }
.cs-f3 { fill: #f9be3c; }
.cs-f4 { fill: #fff0aa; }
.cs-w1 { fill: #5c381e; }
.cs-w2 { fill: #82522c; }
.cs-w3 { fill: #a06c3c; }
.cs-w4 { fill: #aa7846; }
.cs-w5 { fill: #d6aa6e; }
.cs-steam { fill: #f4efe4; }
.cs-steam-edge { fill: #c9c0b0; }
.cs-smoke { fill: #6d645a; }
.cs-smoke-edge { fill: #463f38; }
.cs-spark { fill: #f2c33d; }
.cs-spark-core { fill: #fffbe8; }

/* ── 불: 두 장을 번갈아 ── */
.cs-fire-a { animation: cs-flick 0.5s steps(1) infinite; }
.cs-fire-b { animation: cs-flick 0.5s steps(1) infinite; animation-delay: -0.25s; }
.cs-ripple-a { animation: cs-flick 1.4s steps(1) infinite; }
.cs-ripple-b { animation: cs-flick 1.4s steps(1) infinite; animation-delay: -0.7s; }
@keyframes cs-flick {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ── 거품: 물 위로 떠올라 터짐 ── */
.cs-bubbles .cs-fx { opacity: 0; animation: cs-rise 2.6s steps(8) infinite; }
.cs-bubbles .cs-fx-1 { animation-delay: 0s; }
.cs-bubbles .cs-fx-2 { animation-delay: -0.9s; animation-duration: 3.1s; }
.cs-bubbles .cs-fx-3 { animation-delay: -1.7s; animation-duration: 2.3s; }
.cs-bubbles .cs-fx-4 { animation-delay: -0.4s; animation-duration: 3.4s; }
.cs-bubbles .cs-fx-5 { animation-delay: -2.2s; animation-duration: 2.8s; }
@keyframes cs-rise {
  0% { opacity: 0; transform: translateY(0); }
  12% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-16px); }
}

/* ── 조합 중: 솥이 덜컹이고 김이 오름 ── */
.cauldron-sprite.is-brewing .cs-body,
.cauldron-sprite.is-brewing .cs-bubbles { animation: cs-shake 0.16s steps(2) infinite; }
.cauldron-sprite.is-brewing .cs-bubbles .cs-fx { animation-duration: 0.9s; }
.cauldron-sprite.is-brewing .cs-fire-a,
.cauldron-sprite.is-brewing .cs-fire-b { animation-duration: 0.24s; }
.cauldron-sprite.is-brewing .cs-fire-b { animation-delay: -0.12s; }
@keyframes cs-shake {
  0% { transform: translateX(-1px); }
  100% { transform: translateX(1px); }
}

.cs-steam .cs-fx,
.cs-smoke .cs-fx,
.cs-sparks .cs-fx { opacity: 0; }
.cauldron-sprite.is-brewing .cs-steam .cs-fx { animation: cs-puff 0.9s steps(6) infinite; }
.cauldron-sprite.is-brewing .cs-steam .cs-fx-2 { animation-delay: -0.3s; }
.cauldron-sprite.is-brewing .cs-steam .cs-fx-3 { animation-delay: -0.6s; }
@keyframes cs-puff {
  0% { opacity: 0; transform: translateY(4px); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-12px); }
}

/* ── 성공: 반짝임 / 실패: 검은 연기 ── */
.cauldron-sprite.is-success .cs-sparks .cs-fx { animation: cs-spark 1.2s steps(6) 1 both; transform-box: fill-box; transform-origin: center; }
.cauldron-sprite.is-success .cs-sparks .cs-fx-2 { animation-delay: 0.12s; }
.cauldron-sprite.is-success .cs-sparks .cs-fx-3 { animation-delay: 0.05s; }
.cauldron-sprite.is-success .cs-sparks .cs-fx-4 { animation-delay: 0.25s; }
.cauldron-sprite.is-success .cs-sparks .cs-fx-5 { animation-delay: 0.18s; }
.cauldron-sprite.is-success .cs-sparks .cs-fx-6 { animation-delay: 0.32s; }
@keyframes cs-spark {
  0% { opacity: 0; transform: scale(0.2); }
  30% { opacity: 1; transform: scale(1.2); }
  60% { opacity: 1; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(0.2); }
}
.cauldron-sprite.is-fail .cs-smoke .cs-fx { animation: cs-smoke 1.5s steps(8) 1 both; }
.cauldron-sprite.is-fail .cs-smoke .cs-fx-2 { animation-delay: 0.15s; }
.cauldron-sprite.is-fail .cs-smoke .cs-fx-3 { animation-delay: 0.3s; }
@keyframes cs-smoke {
  0% { opacity: 0; transform: translateY(4px); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-18px); }
}

/* '움직임 줄이기' 설정을 켠 경우: 솥 흔들림만 멈춤 (불꽃·거품 같은 작은 움직임은 게임 정보라 그대로) */
@media (prefers-reduced-motion: reduce) {
  .cauldron-sprite.is-brewing .cs-body,
  .cauldron-sprite.is-brewing .cs-bubbles { animation: none; }
}

/* ── 픽셀 이펙트 (effects.js 가 넣고 다 틀면 지움) ── */
.fx {
  position: absolute;
  z-index: 4;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  pointer-events: none;
}

/* 6단계: 대성공 · 품질 */
.result-sub { font-size: 12px; color: #7a6a58; margin-top: 2px; }
.cauldron-result .result-card.is-great { box-shadow: 0 0 0 2px #e0a92e, 0 0 10px rgba(255, 200, 60, 0.6); }
.cauldron-result .result-card.is-great .result-label { color: #b8860b; }
.cauldron-pop.is-great .pop-label { color: #ffd75e; text-shadow: 0 0 6px rgba(255, 190, 40, 0.9), 0 2px 0 #3a2718; }

/* 원소 미리보기 · 심연 경고 */
.cauldron-traits { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 20px; margin: 2px 0 6px; }
.cauldron-abyss { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px 0 3px; background: #12302a; color: #8fe0c8; font-size: 12px; line-height: 18px; box-shadow: 0 0 0 1.5px #2e6b5e; }
