/* ---------- shell ---------- */

.dodge-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.dodge-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dodge-topbar .auth-slot {
  margin-left: auto;
}

.dodge-back {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.dodge-back:hover { color: var(--accent-deep); }

.dodge-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
}

/* ---------- HP bar ---------- */

.dodge-hp {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.dodge-hp-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.dodge-hp-bar {
  flex: 1;
  height: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.dodge-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #fb923c 0%, #fbbf24 50%, #84cc16 100%);
  transition: width 0.18s linear, background 0.4s ease;
  border-radius: 999px;
}

.dodge-hp-fill[data-low="true"] {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
  animation: hpPulse 0.7s ease-in-out infinite alternate;
}

@keyframes hpPulse {
  from { opacity: 1; }
  to   { opacity: 0.55; }
}

/* ---------- HUD ---------- */

.dodge-hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.hud-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hud-label {
  font-size: 0.7rem;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.hud-value {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- stage ---------- */

.dodge-stage {
  position: relative;
  margin-top: 14px;
  height: min(72vh, 600px);
  border-radius: 24px;
  overflow: hidden;
  border: 3px solid #f8c98a;
  background: linear-gradient(180deg, #fff8ec 0%, #fceacd 100%);
  box-shadow: 0 10px 30px rgba(217, 122, 60, 0.15);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* lane 가이드 제거됨 — 연속 좌우 이동으로 변경 */

.dodge-objects {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---------- cat ---------- */

.dodge-cat {
  position: absolute;
  bottom: 14px;
  width: 48px;
  height: 48px;
  background-image: url("./cat-dodge.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center bottom;
  will-change: left;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(120, 70, 30, 0.18));
}

.dodge-cat[data-hit="true"] {
  animation: catHit 0.6s ease both;
}

@keyframes catHit {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(-15deg) scale(1.08); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  100% { transform: rotate(0deg); opacity: 0.55; }
}

/* ---------- falling objects (생선=이모지, 생선뼈=img) ---------- */

.dodge-obj {
  position: absolute;
  top: 0;
  left: 0;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  pointer-events: none;
  font-size: 32px;
  line-height: 38px;
  text-align: center;
  will-change: transform;
}

.dodge-obj img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(120, 70, 30, 0.18));
}

.dodge-obj.caught {
  animation: caughtPop 0.32s ease forwards;
}

@keyframes caughtPop {
  0%   { transform: scale(1); opacity: 1; }
  60%  { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.6); opacity: 0; }
}

/* ---------- tap zones (mobile) ---------- */

.dodge-tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dodge-tap-left { left: 0; }
.dodge-tap-right { right: 0; }

.dodge-tap-zone:active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 60%, rgba(255,255,255,0.6) 0%, transparent 60%);
  pointer-events: none;
}

/* ---------- overlays ---------- */

.dodge-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px;
  background: rgba(255, 248, 236, 0.92);
  backdrop-filter: blur(2px);
  text-align: center;
  z-index: 5;
}

/* HTML hidden 속성이 CSS display:flex보다 우선순위가 낮아 무시됨 → 명시적 override. */
.dodge-overlay[hidden] {
  display: none;
}

.overlay-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--ink);
}

.overlay-sub {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.overlay-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin: 4px 0;
}

.overlay-stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.overlay-stat-label {
  font-size: 0.7rem;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.overlay-stat-value {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.dodge-btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  padding: 12px 28px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(217, 122, 60, 0.28);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.dodge-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(217, 122, 60, 0.35); }
.dodge-btn:active { transform: translateY(0); }

/* ---------- best + leaderboard ---------- */

.dodge-best {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-align: center;
  font-weight: 700;
}

.dodge-leaderboard-section {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.dodge-leaderboard-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--ink);
}

/* ---------- mobile tweaks ---------- */

@media (max-width: 420px) {
  .dodge-stage { height: min(70vh, 540px); }
  .dodge-cat { width: 44px; height: 44px; }
  .dodge-obj { width: 34px; height: 34px; margin: -17px 0 0 -17px; font-size: 28px; line-height: 34px; }
  .overlay-title { font-size: 1.1rem; }
  .overlay-stats { max-width: 280px; }
}
