:root {
  --bg: #0f1419;
  --bg-card: #1a2332;
  --bg-deep: #0a0f15;
  --accent: #ffd700;
  --text: #e8edf2;
  --text-dim: #8b9bb0;
  --win: #4ade80;
  --neutral: #fbbf24;
  --loss: #f87171;
  --border: #2a3a52;
  --primary: linear-gradient(135deg, #ff6b35, #f72585);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overscroll-behavior: none; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(circle at top left, rgba(255, 107, 53, 0.12), transparent 22rem), var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.container {
  flex: 1;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.page-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 2px 0 4px;
}
.page-title {
  min-width: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-btn {
  min-width: 58px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 11px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
}
.nav-btn:active { transform: scale(0.97); }

.topbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.topcard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.topcard-label { font-size: 10px; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.6px; }
.topcard-value { font-size: 22px; font-weight: 900; line-height: 1; }
.topcard-value.ei { color: var(--accent); }
.topcard-value.power { color: #ff6b35; }
.power-inline-row { display: flex; align-items: baseline; gap: 5px; min-width: 0; overflow: hidden; }
.power-inline-stats { font-size: 9px; font-weight: 700; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.matbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mat-icon { font-size: 22px; }
.mat-info { flex: 1; min-width: 0; }
.mat-name { font-size: 9px; color: var(--text-dim); letter-spacing: 0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mat-count { font-size: 16px; font-weight: 800; color: var(--text); }

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 2px 0;
  margin-top: 4px;
}
.section-title .sub { font-size: 10px; letter-spacing: 0; text-transform: none; opacity: 0.75; font-weight: 700; }

.slot-grid { display: grid; gap: 8px; }
.slot-grid.cols-1 { grid-template-columns: 1fr; }
.slot-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.slot {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.slot-head { display: flex; align-items: center; gap: 10px; }
.slot-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: var(--bg-deep);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.slot-text { flex: 1; min-width: 0; }
.slot-name { font-size: 11px; color: var(--text-dim); letter-spacing: 0.5px; line-height: 1.2; }
.slot-weight { color: #ff6b35; font-weight: 700; margin-left: 4px; font-size: 10px; }
.slot-level {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.05;
  margin-top: 3px;
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}
.slot-status {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 700;
  font-family: ui-monospace, monospace;
  letter-spacing: 0.3px;
  line-height: 1.1;
}
.transcend-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  font-family: ui-monospace, monospace;
  vertical-align: 3px;
}
.transcend-badge.t1 { color: #38bdf8;   background: rgba(56, 189, 248, 0.14); border: 1px solid rgba(56, 189, 248, 0.4); }
.transcend-badge.t2 { color: #a78bfa;   background: rgba(167, 139, 250, 0.14); border: 1px solid rgba(167, 139, 250, 0.4); }
.transcend-badge.t3 { color: #fbbf24;   background: rgba(251, 191, 36, 0.14); border: 1px solid rgba(251, 191, 36, 0.4); }
.transcend-badge.t4 { color: #ff6b35;   background: rgba(255, 107, 53, 0.14); border: 1px solid rgba(255, 107, 53, 0.4); }
.transcend-badge.t5 { color: #f87171;   background: rgba(248, 113, 113, 0.18); border: 1px solid rgba(248, 113, 113, 0.55); box-shadow: 0 0 10px rgba(248, 113, 133, 0.45); }
/* 강화 목표 = 현재 초월 단계 max 한 번에 설정. Enhance 버튼 톤 (oranage/pink) 반투명. */
.target-max-btn {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.2px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(247, 37, 133, 0.35);
  background: rgba(247, 37, 133, 0.12);
  color: #ff6b35;
  cursor: pointer;
  vertical-align: 3px;
  font-family: ui-monospace, monospace;
  margin-left: auto;
  transition: transform 0.08s, background 0.12s;
}
.target-max-btn:active { transform: scale(0.96); background: rgba(247, 37, 133, 0.22); }
.target-max-btn:disabled { opacity: 0.35; cursor: not-allowed; }
/* AUTO (자동 초월) — Limit Break 컨텍스트라 살짝 다른 액센트 (LB success 톤) */
.target-max-btn.auto-tx-btn {
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}
.target-max-btn.auto-tx-btn:active { background: rgba(74, 222, 128, 0.22); }

/* v2.6.2 (2026-05-19) — 슬롯 우상단 버튼 우측 정렬. MAX / AUTO / MAX BURST 가 카드 우측에 모임. */
/* 첫 번째 .target-max-btn 에 auto 마진 부여 → 그 앞 lv/badge 와 분리 + 우측으로 밀림 */
.slot-level .target-max-btn:first-of-type {
  margin-left: auto !important;
}
.slot-level .target-max-btn + .target-max-btn {
  margin-left: 4px !important;
}

/* v2.6.2 (2026-05-19) — MAX BURST (LB5 슬롯 전용). 황금 톤 (마켓 claim 과 색계열 유사하되 강화 카드 차별). */
.target-max-btn.burst-btn {
  border-color: rgba(255, 215, 0, 0.55);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(245, 158, 11, 0.12));
  color: #ffd700;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.35);
  animation: burst-pulse 2.2s ease-in-out infinite;
}
.target-max-btn.burst-btn:active { filter: brightness(0.94); }
@keyframes burst-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
  50% { box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.20); }
}

/* MAX BURST 결과 축하 모달 — 트로피/축제 톤. 폭발/도박 컬러 제거, 우아한 골드 + soft glow. */
.burst-celebrate {
  position: relative;
  padding: 16px 6px 0;
  overflow: visible;
}
.burst-rays {
  position: absolute;
  top: 28px;
  left: 50%;
  width: 160px;
  height: 160px;
  margin-left: -80px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.22) 0%, rgba(255, 215, 0, 0.06) 45%, transparent 70%);
  pointer-events: none;
  animation: burst-rays-rotate 12s linear infinite;
}
@keyframes burst-rays-rotate {
  from { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.08); }
  to   { transform: rotate(360deg) scale(1); }
}
.burst-spark {
  position: absolute;
  font-size: 22px;
  animation: burst-spark 1.6s ease-in-out infinite;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.55));
}
.burst-spark.s1 { top: 28px;  left: 24px;  font-size: 22px; animation-delay: 0s;   }
.burst-spark.s2 { top: 48px;  right: 32px; font-size: 16px; animation-delay: 0.3s; }
.burst-spark.s3 { top: 90px;  right: 18px; font-size: 22px; animation-delay: 0.6s; }
.burst-spark.s4 { top: 100px; left: 22px;  font-size: 16px; animation-delay: 0.9s; }
@keyframes burst-spark {
  0%, 100% { transform: scale(0.7) rotate(-12deg); opacity: 0.35; }
  50%      { transform: scale(1.2) rotate(12deg);  opacity: 1; }
}
.burst-trophy {
  position: relative;
  font-size: 72px;
  line-height: 1;
  margin: 4px 0 10px;
  animation: burst-trophy-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 8px 22px rgba(255, 215, 0, 0.50)) drop-shadow(0 0 10px rgba(255, 215, 0, 0.30));
}
@keyframes burst-trophy-pop {
  0%   { transform: scale(0.3) translateY(12px); opacity: 0; }
  55%  { transform: scale(1.15) translateY(-4px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.burst-delta {
  font-size: 13px;
  color: var(--text-dim, #8a96a6);
  margin: -2px 0 16px;
  line-height: 1.4;
}
.burst-delta b {
  color: #ffd700;
  font-weight: 900;
  font-size: 16px;
  margin-right: 2px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}

/* v2.6.2 (2026-05-19) — burst 결과 모달 줄간격 보정. Success/Stay/Drop grid → summary 텍스트 → 버튼 사이 여백 균형. */
.burst-celebrate .auto-summary {
  margin: 0 0 14px;
}
.burst-celebrate .result-sub {
  margin: 0 0 18px;
  line-height: 1.5;
  font-size: 12px;
  color: var(--text-dim, #8a96a6);
}
.burst-celebrate .close-btn {
  margin-top: 4px;
}

/* burst 결과 모달 — 외부 glow (모달 박스 외부로 빛 퍼짐). Limit Break success 톤. overflow: visible 필수. */
.modal.has-burst-result {
  overflow: visible !important;
  animation: burstModalOuterGlow 1.2s ease-out;
  border-color: rgba(255, 215, 0, 0.45);
}
@keyframes burstModalOuterGlow {
  0%   { box-shadow: 0 0 0 transparent; }
  30%  { box-shadow: 0 0 140px 24px rgba(255, 215, 0, 0.65), 0 0 60px 4px rgba(245, 158, 11, 0.45); }
  100% { box-shadow: 0 0 40px 8px rgba(255, 215, 0, 0.18); }
}

/* level-jump 의 to 숫자 한 번 화려한 펄스 */
.burst-celebrate .level-to {
  animation: burstLevelGlow 1.1s ease-out 0.15s 1;
}
@keyframes burstLevelGlow {
  0%   { transform: scale(0.6); opacity: 0; text-shadow: 0 0 0 transparent; }
  55%  { transform: scale(1.15); opacity: 1; text-shadow: 0 0 24px rgba(255, 215, 0, 0.85); }
  100% { transform: scale(1); opacity: 1; text-shadow: 0 0 24px rgba(255, 215, 0, 0.22); }
}

/* v2.6.2 (2026-05-19) — burst 모달 버튼은 기존 .close-btn 패턴 재사용 (강화 결과 Continue 버튼과 동일 톤). */

/* v2.6.2 (2026-05-19) — MAX BURST confirm 모달. 결과 모달과 일관된 골드 트로피 톤. 빨간/녹색 사용 X. */
.burst-confirm {
  padding: 14px 6px 0;
  text-align: center;
}
.burst-confirm-icon {
  font-size: 56px;
  line-height: 1;
  margin: 0 0 8px;
  filter: drop-shadow(0 4px 14px rgba(255, 215, 0, 0.45));
  animation: burst-confirm-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes burst-confirm-pop {
  0%   { transform: scale(0.5) translateY(8px); opacity: 0; }
  60%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}
.burst-confirm-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.30);
  margin-bottom: 10px;
}
.burst-confirm-sub {
  font-size: 13px;
  color: var(--text-dim, #8a96a6);
  margin-bottom: 14px;
  line-height: 1.5;
}
.burst-confirm-sub b { color: #ffd700; font-weight: 800; }
.burst-confirm-sub .muted { color: var(--text-dim, #8a96a6); font-size: 11px; opacity: 0.85; }

/* v2.6.3 (2026-05-19) — burst LB별 골드 비용 표시 + 잔액 부족 경고 */
.burst-confirm-cost {
  font-size: 13px;
  color: var(--text-dim, #8a96a6);
  margin: 0 0 8px;
  padding: 8px 10px;
  background: rgba(255, 215, 0, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-radius: 8px;
}
.burst-confirm-cost b.gold { color: #ffd700; font-weight: 900; }
.burst-confirm-cost .muted { font-size: 11px; opacity: 0.75; margin-left: 4px; }
.burst-confirm-warn {
  font-size: 12px;
  color: #f87171;
  margin: -4px 0 10px;
  padding: 6px 10px;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.32);
  border-radius: 6px;
}

/* confirm 모달 액션 영역 — Cancel 과 Burst 두 버튼 grid 2-col. 둘 다 .close-btn 패턴. */
.burst-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.burst-confirm-actions .close-btn { width: 100%; margin: 0; }
.burst-confirm-actions .close-btn.ghost {
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--border);
}
.burst-confirm-actions .close-btn.ghost:hover { background: var(--surface); }
/* 자동 초월 중단 — 결과 모달 안 Continue 옆 inline 배치 (wrapper 로 두 버튼 같은 row) */
.auto-tx-btn-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  margin-top: 12px;
}
.auto-tx-btn-row .close-btn { flex: 1 1 auto; margin-top: 0; }
.auto-tx-inline-stop {
  flex: 0 0 auto;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.6);
  background: rgba(248, 113, 113, 0.14);
  color: #f87171;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.6px;
  font-family: ui-monospace, monospace;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}
.auto-tx-inline-stop:active { background: rgba(248, 113, 113, 0.26); transform: scale(0.97); }
.auto-tx-inline-stop:disabled { opacity: 0.55; cursor: not-allowed; }
.slot-power {
  color: #ff6b35;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  margin-left: 5px;
}
.slot-meta {
  font-size: 10px;
  color: var(--text-dim);
  font-family: ui-monospace, monospace;
  line-height: 1.2;
  min-height: 14px;
  margin-top: 1px;
}
.slot-meta .dot { color: var(--border); padding: 0 3px; }

.enhance-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 0;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-deep);
  min-height: 44px;
}
.enhance-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 9px 0 0 9px;
  padding: 7px 8px 8px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: 0;
  transition: transform 0.08s;
  line-height: 1.2;
  min-width: 0;
}
.enhance-btn:active { transform: scale(0.97); }
.enhance-btn:disabled { opacity: 0.4; cursor: not-allowed; background: var(--bg-deep); color: var(--text-dim); box-shadow: none; }

/* v2.6.3 (2026-05-19) — PERFECTED (maxed slot) 황금 트로피 버튼. disabled 지만 시각적으로 화려. */
.enhance-btn.mastered:disabled {
  opacity: 1;
  cursor: default;
  background: linear-gradient(135deg, #ffd700 0%, #f59e0b 45%, #ffd700 100%);
  background-size: 200% 100%;
  color: #0b1015;
  font-size: 13px;
  letter-spacing: 1px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.35), inset 0 0 8px rgba(255, 255, 255, 0.18);
  animation: masteredShine 3.6s linear infinite, masteredGlow 2.4s ease-in-out infinite;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
@keyframes masteredShine {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes masteredGlow {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 215, 0, 0.30), inset 0 0 8px rgba(255, 255, 255, 0.18); }
  50%      { box-shadow: 0 0 28px rgba(255, 215, 0, 0.55), inset 0 0 12px rgba(255, 255, 255, 0.28); }
}
/* sparkle 두 점 (좌/우) — pseudo-element 로 추가 */
.enhance-btn.mastered::before,
.enhance-btn.mastered::after {
  content: "✨";
  position: absolute;
  font-size: 11px;
  top: 50%;
  transform: translateY(-50%);
  animation: masteredSpark 1.8s ease-in-out infinite;
  opacity: 0.85;
}
.enhance-btn.mastered::before { left: 8px; animation-delay: 0s; }
.enhance-btn.mastered::after  { right: 8px; animation-delay: 0.6s; }
@keyframes masteredSpark {
  0%, 100% { transform: translateY(-50%) scale(0.7); opacity: 0.45; }
  50%      { transform: translateY(-50%) scale(1.2); opacity: 1; }
}
.enhance-btn .cost { display: block; font-size: 9px; font-weight: 700; margin-top: 2px; opacity: 0.85; }
.enhance-btn .cost.cant { color: #ffb4b4; opacity: 1; }
.target-stepper {
  min-width: 0;
  background: var(--bg-deep);
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  overflow: hidden;
}
.target-btn {
  height: 100%;
  min-height: 42px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}
.target-btn:active { background: rgba(255, 255, 255, 0.07); }
.target-btn:disabled { color: var(--text-dim); opacity: 0.35; cursor: not-allowed; }
.target-value {
  min-width: 0;
  text-align: center;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 5px 2px 4px;
}
.target-label { display: block; color: var(--text-dim); font-size: 8px; font-weight: 700; letter-spacing: 0.5px; }
.target-number { display: block; color: var(--accent); font-size: 13px; font-weight: 900; line-height: 1.2; margin-top: 1px; }
.prob-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  min-height: 28px;
}
.prob-row.maxed {
  grid-template-columns: 1fr;
}
/* v2.6.3 (2026-05-19) — Max level chip 골드 톤 (PERFECTED 버튼과 톤 통일) */
.prob-row.maxed .prob-chip {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(245, 158, 11, 0.06));
  border: 1px solid rgba(255, 215, 0, 0.42);
  color: #ffd700;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.25);
}
.prob-chip {
  background: var(--bg-deep);
  border: 1px solid rgba(42, 58, 82, 0.72);
  border-radius: 7px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 6px 3px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.prob-chip b {
  font-size: 10px;
  font-weight: 900;
}
.prob-chip.success b { color: var(--win); }
.prob-chip.maintain b { color: var(--neutral); }
.prob-chip.fail b { color: var(--loss); }
.slot.wide .slot-head { padding-bottom: 0; }
.slot.wide .slot-icon { width: 52px; height: 52px; font-size: 30px; }
.slot.wide .slot-level { font-size: 26px; }

.log {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 4px 0;
  max-height: 220px;
  overflow-y: auto;
  font-size: 13px;
  border: 1px solid var(--border);
  flex: 1;
  min-height: 80px;
}
.log-entry { padding: 8px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 8px; }
.log-entry:last-child { border-bottom: none; }
.log-entry.success { color: var(--win); }
.log-entry.maintain { color: var(--neutral); }
.log-entry.fail { color: var(--loss); }
.log-entry.transcend { color: var(--accent); }
.log-entry.placeholder { color: var(--text-dim); justify-content: center; padding: 20px; }
.log-entry .delta { color: var(--text-dim); font-size: 11px; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  animation: fadeIn 0.18s ease;
}
.overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-width: 340px;
  background: var(--bg-card);
  border-radius: 18px;
  padding: 22px 18px;
  text-align: center;
  border: 1px solid var(--border);
}
.anim-icon { font-size: 32px; animation: pulse 0.6s ease infinite alternate; opacity: 0.72; }
@keyframes pulse { from { transform: scale(1); filter: brightness(1); } to { transform: scale(1.15); filter: brightness(1.4); } }
.anim-status { color: var(--text-dim); font-size: 13px; margin-top: 14px; }
.progress-level {
  color: var(--accent);
  font-size: 72px;
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 0 26px rgba(255, 209, 102, 0.22);
  display: inline-block;
}
/* 자동강화 결과별 시각 효과 — 320ms 라운드에 맞춰 거의 풀로 채움 */
.progress-level.fx-success {
  animation: progressLevelSuccess 0.30s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes progressLevelSuccess {
  0%   { transform: scale(0.9);  text-shadow: 0 0 26px rgba(255, 209, 102, 0.22); color: var(--accent); }
  35%  { transform: scale(1.55); text-shadow: 0 0 80px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 235, 110, 1), 0 0 12px #fff; color: #ffffff; }
  100% { transform: scale(1);    text-shadow: 0 0 26px rgba(255, 209, 102, 0.55);  color: var(--accent); }
}
.progress-level.fx-fail {
  animation: progressLevelFail 0.30s ease-in-out both;
}
@keyframes progressLevelFail {
  0%   { transform: translateX(0);    color: var(--accent); text-shadow: 0 0 26px rgba(255, 209, 102, 0.22); }
  10%  { transform: translateX(-18px); color: var(--loss); text-shadow: 0 0 40px rgba(248, 113, 113, 1); }
  25%  { transform: translateX(15px);  color: var(--loss); }
  40%  { transform: translateX(-13px); color: var(--loss); }
  55%  { transform: translateX(11px);  color: var(--loss); }
  70%  { transform: translateX(-7px);  color: var(--loss); }
  85%  { transform: translateX(4px);   color: var(--loss); }
  100% { transform: translateX(0);    color: var(--accent); text-shadow: 0 0 26px rgba(255, 209, 102, 0.22); }
}
.progress-level.fx-stay {
  animation: progressLevelStay 0.26s ease both;
}
@keyframes progressLevelStay {
  0%   { opacity: 1; transform: scale(1); color: var(--accent); }
  50%  { opacity: 0.4; transform: scale(0.88); color: var(--text-dim); }
  100% { opacity: 1; transform: scale(1); color: var(--accent); }
}

/* 모달 배경 글로우 — JS에서 modal에 클래스 부착 */
.modal.flash-success {
  animation: modalFlashSuccess 0.28s ease-out;
}
.modal.flash-fail {
  animation: modalFlashFail 0.28s ease-out;
}
@keyframes modalFlashSuccess {
  0%   { box-shadow: 0 0 0 transparent; }
  40%  { box-shadow: 0 0 60px 10px rgba(255, 215, 0, 0.65); border-color: var(--accent); }
  100% { box-shadow: 0 0 0 transparent; }
}
@keyframes modalFlashFail {
  0%   { box-shadow: 0 0 0 transparent; }
  40%  { box-shadow: 0 0 60px 10px rgba(248, 113, 113, 0.65); border-color: var(--loss); }
  100% { box-shadow: 0 0 0 transparent; }
}
.level-jump { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin: 14px 0; font-weight: 900; flex-wrap: nowrap; white-space: nowrap; }
.level-from { font-size: 38px; color: #9fb3d1; }
.level-arrow { font-size: 18px; color: var(--text-dim); }
.level-to { font-size: 58px; color: var(--accent); line-height: 0.95; text-shadow: 0 0 24px rgba(255, 209, 102, 0.22); white-space: nowrap; }
.level-to .transcend-suffix { font-size: 0.55em; opacity: 0.92; margin-left: 2px; letter-spacing: 0.5px; }
.level-to.fail-color { color: var(--loss); }
.level-to.maintain-color { color: var(--neutral); }
.result-level-jump { margin: 16px 0 12px; }
/* v2.6.3 (2026-05-19) — 에러/결과 모달 텍스트 간격 통일. title 8px → sub 16px → button. */
.result-title { font-size: 19px; font-weight: 900; letter-spacing: 0; margin-bottom: 8px; line-height: 1.3; }
.result-title.success { color: var(--win); }
.result-title.maintain { color: var(--neutral); }
.result-title.fail { color: var(--loss); }
.result-sub { color: var(--text-dim); font-size: 13px; line-height: 1.55; margin-bottom: 18px; }
.result-sub span { color: #ff6b35; font-weight: 700; }
/* title 직후 button (sub 없는 모달) 도 적절 간격 */
.result-title + .close-btn { margin-top: 6px; }
.power-jump { color: var(--text-dim); font-size: 12px; margin-top: -10px; margin-bottom: 10px; }
.power-jump span { color: #ff6b35; font-weight: 700; }
.power-jump b { margin-left: 6px; }
.power-jump b.up { color: var(--win); }
.power-jump b.down { color: var(--loss); }
.rate-grid, .auto-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 14px 0 8px; }
.auto-summary { margin: 14px 0; }
.rate-cell, .auto-cell { background: var(--bg-deep); border-radius: 8px; padding: 8px 4px; }
.rate-cell-label, .auto-cell-label { font-size: 10px; color: var(--text-dim); }
.rate-cell-value, .auto-cell-value { font-size: 15px; font-weight: 700; margin-top: 2px; }
.auto-cell-value { font-size: 16px; font-weight: 800; }
.rate-cell.success .rate-cell-value, .auto-cell.success .auto-cell-value { color: var(--win); }
.rate-cell.maintain .rate-cell-value { color: var(--neutral); }
.rate-cell.fail .rate-cell-value, .auto-cell.fail .auto-cell-value { color: var(--loss); }
.cost-bar {
  background: var(--bg-deep);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-dim);
  margin: 4px 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cost-bar .cost-val { color: var(--accent); font-weight: 700; }
.close-btn {
  width: 100%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s;
}
.close-btn:active { transform: scale(0.98); }
.stop-btn {
  width: 100%;
  margin-top: 18px;
  background: var(--bg-deep);
  color: var(--loss);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}
.stop-btn:active { transform: scale(0.98); }
.stop-btn:disabled {
  color: var(--text-dim);
  opacity: 0.7;
  cursor: not-allowed;
}
.reset-hint { text-align: center; color: var(--text-dim); font-size: 10px; margin-top: 4px; opacity: 0.5; }
