@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

/* ── 변수 ────────────────────────────────────────────── */
:root {
  --bg:        #0c0e14;
  --bg2:       #12151e;
  --bg3:       #181c28;
  --surface:   #1e2333;
  --surface2:  #252b3d;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.13);
  --gold:      #c9a84c;
  --gold2:     #f0d07a;
  --text:      #d8dce8;
  --text2:     #8892a8;
  --text3:     #50596e;
  --accent:    #4a7ef5;
  --danger:    #e85050;
  --success:   #4aad6f;
  --radius:    10px;
  --radius-lg: 16px;
  --ui-scale: 1;
  --town-scale: 1;
  --hunt-scale: 1;
  --monster-image-size: 280px;
  --monster-image-size-mobile: 220px;
  --player-sprite-size: 96px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

/* 배경 별 파티클 효과 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(74,126,245,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(155,111,245,0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── 화면 전환 ───────────────────────────────────────── */
.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  z-index: 1;
}
.screen.active { display: flex; }

/* ── 카드 ────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.card-wide {
  max-width: 820px;
}

/* ── 로고 / 타이틀 ───────────────────────────────────── */
.logo-area {
  text-align: center;
  margin-bottom: 32px;
}

.logo-emblem {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--surface2), var(--surface));
  border: 1px solid var(--border2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.logo-title {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-shadow: 0 0 20px rgba(201,168,76,0.3);
}

.logo-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── 구분선 ──────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text3);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── 폼 ──────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.input-wrap {
  display: flex;
  gap: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,126,245,0.12);
}

input:read-only {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── 버튼 ────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.03em;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: #3a6ee5; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-gold {
  background: linear-gradient(135deg, #b8922e, var(--gold));
  color: #1a1200;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.btn-gold:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
  padding: 10px 14px;
  width: auto;
  flex-shrink: 0;
  font-size: 12px;
}
.btn-ghost:hover:not(:disabled) { background: var(--surface); color: var(--text); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-mt { margin-top: 8px; }

/* ── 링크 텍스트 ─────────────────────────────────────── */
.text-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}
.text-link:hover { color: #7aa8ff; }

.text-center { text-align: center; margin-top: 20px; color: var(--text2); font-size: 13px; }
.form-hint { color: var(--text3); font-size: 10px; }

/* ── 에러 / 성공 메시지 ──────────────────────────────── */
.form-msg {
  min-height: 20px;
  font-size: 12px;
  color: var(--danger);
  margin-top: 12px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.form-msg.visible { opacity: 1; }
.form-msg.success { color: var(--success); }

/* ── 필드 상태 표시 ──────────────────────────────────── */
.field-status {
  font-size: 11px;
  margin-top: 5px;
  height: 16px;
}
.field-status.ok  { color: var(--success); }
.field-status.err { color: var(--danger); }

/* ── 직업 선택 그리드 ────────────────────────────────── */
.create-char-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 820px;
}
.create-char-header {
  text-align: center;
  margin-bottom: 8px;
}
.create-char-title { font-size: 20px; }
.create-char-subtitle {
  font-size: 13px;
  color: var(--text3);
  margin-top: 6px;
}
.char-form {
  width: 100%;
  max-width: 420px;
}

#job-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  margin: 20px 0;
}

@media (max-width: 680px) {
  #job-grid { grid-template-columns: repeat(2, 1fr); }
}

.job-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.job-card:hover {
  border-color: var(--border2);
  background: var(--surface2);
  transform: translateY(-2px);
}

.job-card.selected {
  border-color: var(--gold);
  background: rgba(201,168,76,0.07);
  box-shadow: 0 0 0 1px var(--gold), 0 8px 24px rgba(201,168,76,0.15);
}

.job-icon { font-size: 28px; margin-bottom: 8px; }
.job-name { font-family: 'Cinzel', serif; font-size: 14px; color: var(--gold2); margin-bottom: 5px; font-weight: 600; }
.job-desc { font-size: 10px; color: var(--text3); line-height: 1.5; margin-bottom: 12px; }

.job-stats { display: flex; flex-direction: column; gap: 5px; }
.stat-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text2);
}
.stat-bar-row span { width: 22px; text-align: left; flex-shrink: 0; }
.stat-bars { display: flex; gap: 3px; }
.stat-pip {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.stat-pip.filled { border-color: transparent; }

#selected-job-display {
  font-size: 13px;
  color: var(--gold);
  min-height: 20px;
  text-align: center;
  margin-bottom: 4px;
}

.char-form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  width: 100%;
  max-width: 420px;
  margin-bottom: 14px;
}
.char-form-row .form-group { flex: 1; margin: 0; }
.char-submit-btn {
  flex-shrink: 0;
  width: 120px;
  height: 44px;
  margin-top: 22px;
}

/* ── 버튼 공통 sm ────────────────────────────────────── */
.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  width: auto;
  border-radius: 8px;
}

/* ════════════════════════════════════════════════════════
   마을 화면
════════════════════════════════════════════════════════ */
.town-screen {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background: linear-gradient(180deg, #eef4ff 0%, #d8e7ff 100%);
  min-height: 100vh;
}

/* ── HUD (상단 바) ───────────────────────────────────── */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px * var(--ui-scale)) calc(20px * var(--ui-scale));
  background: rgba(248, 251, 255, 0.9);
  border-bottom: 1px solid rgba(130, 159, 204, 0.25);
  box-shadow: 0 8px 20px rgba(62, 95, 145, 0.08);
  gap: calc(16px * var(--ui-scale));
  z-index: 10;
  flex-shrink: 0;
}

.hud-left  { display: flex; align-items: center; gap: calc(10px * var(--ui-scale)); min-width: calc(180px * var(--ui-scale)); }
.hud-right { display: flex; align-items: center; gap: calc(14px * var(--ui-scale)); min-width: calc(160px * var(--ui-scale)); justify-content: flex-end; }

.hud-avatar {
  width: calc(38px * var(--ui-scale)); height: calc(38px * var(--ui-scale));
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: calc(18px * var(--ui-scale)); flex-shrink: 0;
}

.hud-name { font-family: 'Cinzel', serif; font-size: calc(14px * var(--ui-scale)); color: var(--gold2); font-weight: 600; }
.hud-meta { font-size: calc(11px * var(--ui-scale)); color: var(--text2); margin-top: 2px; }
.hud-sep  { margin: 0 4px; color: var(--text3); }
.hud-job  { color: var(--text2); }

.hud-center {
  flex: 1;
  display: flex;
  gap: calc(16px * var(--ui-scale));
  align-items: center;
  max-width: calc(480px * var(--ui-scale));
  margin: 0 auto;
}

.hud-bar-group { display: flex; align-items: center; gap: calc(6px * var(--ui-scale)); flex: 1; }
.hud-bar-label { font-size: calc(10px * var(--ui-scale)); color: var(--text3); width: calc(24px * var(--ui-scale)); flex-shrink: 0; }
.hud-bar {
  flex: 1; height: calc(6px * var(--ui-scale));
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
}
.hud-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.hp-fill  { background: linear-gradient(90deg, #c0392b, #e74c3c); }
.mp-fill  { background: linear-gradient(90deg, #1a5276, #2980b9); }
.exp-fill { background: linear-gradient(90deg, #7d6608, #d4ac0d); }
.hud-bar-text { font-size: calc(10px * var(--ui-scale)); color: var(--text3); width: calc(40px * var(--ui-scale)); text-align: right; flex-shrink: 0; }

.hud-gold {
  display: flex; align-items: center; gap: calc(5px * var(--ui-scale));
  background: var(--surface);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 20px;
  padding: calc(4px * var(--ui-scale)) calc(12px * var(--ui-scale));
  font-size: calc(13px * var(--ui-scale)); color: var(--gold2);
}
.gold-icon { font-size: calc(14px * var(--ui-scale)); }

.character-preview-panel {
  margin-bottom: 12px;
}

.character-paperdoll {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.character-paperdoll-stage {
  position: relative;
  width: min(100%, 220px);
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.55), rgba(255,255,255,0) 42%),
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(124, 150, 185, 0.12));
  border: 1px solid rgba(130, 159, 204, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.character-paperdoll.compact .character-paperdoll-stage {
  width: min(100%, 180px);
}

.character-base-image,
.character-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.character-layer {
  pointer-events: none;
}

.character-paperdoll-meta,
.character-preview-caption {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
}

.equipment-preview-hero {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  padding: 10px 0 4px;
}

/* ── 마을 메인 레이아웃 ──────────────────────────────── */
.town-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: calc(100vh - 60px);
}

/* ── 마을 월드 (배경 + NPC) ──────────────────────────── */
.town-world {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #8fc5ff 0%, #c8e4ff 40%, #f4dfb7 100%);
  font-size: calc(1rem * var(--town-scale));
}

/* 마을 이름 배지 */
.town-title-badge {
  position: absolute;
  top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 5;
  font-family: 'Cinzel', serif;
  font-size: calc(13px * var(--town-scale));
  color: #8f6824;
  display: flex; align-items: center; gap: calc(10px * var(--town-scale));
  background: rgba(255,248,229,0.86);
  border: 1px solid rgba(196,156,75,0.35);
  box-shadow: 0 10px 24px rgba(112, 143, 196, 0.14);
  border-radius: calc(20px * var(--town-scale));
  padding: calc(5px * var(--town-scale)) calc(18px * var(--town-scale));
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.town-title-dot {
  width: 4px; height: 4px;
  background: #c58d2b;
  border-radius: 50%;
  opacity: 0.8;
}

/* 배경 레이어 */
.town-bg { position: absolute; inset: 0; pointer-events: none; }

.sky-layer {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 55%;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 239, 182, 0.65) 0%, rgba(255, 239, 182, 0) 20%),
    linear-gradient(180deg, #74b8ff 0%, #9fd0ff 45%, #d6ebff 100%);
  overflow: hidden;
}

/* 구름 */
.cloud {
  position: absolute;
  background: rgba(255,255,255,0.22);
  border-radius: 50px;
  animation: cloudDrift linear infinite;
  filter: blur(0.2px);
}
.cloud::before {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.c1 { width: 120px; height: 30px; top: 20%; left: -15%; animation-duration: 60s; }
.c1::before { width: 60px; height: 40px; top: -60%; left: 20%; }
.c2 { width: 90px; height: 22px; top: 35%; left: 30%; animation-duration: 80s; animation-delay: -25s; }
.c2::before { width: 45px; height: 32px; top: -70%; left: 15%; }
.c3 { width: 150px; height: 36px; top: 12%; left: 60%; animation-duration: 70s; animation-delay: -40s; }
.c3::before { width: 70px; height: 48px; top: -55%; left: 25%; }

@keyframes cloudDrift { from { transform: translateX(0); } to { transform: translateX(130vw); } }

/* 부드러운 대기층 */
.sky-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.04) 42%, rgba(255,255,255,0) 100%);
}

.mountain-layer {
  position: absolute;
  bottom: 44%; left: 0; right: 0;
  height: 200px;
}
.mountain-layer svg { width: 100%; height: 100%; }

.ground-layer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 45%;
  background: linear-gradient(180deg, #4a8a4a 0%, #356f38 42%, #224b2a 100%);
}
.ground-layer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(141,196,102,0.45) 20%,
    rgba(182,224,132,0.75) 50%,
    rgba(141,196,102,0.45) 80%, transparent 100%);
}

/* ── NPC 배치 영역 ───────────────────────────────────── */
.npc-area {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.npc-slot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
  user-select: none;
  filter: drop-shadow(0 10px 14px rgba(23, 42, 28, 0.2));
}
.npc-slot.hidden-until-found {
  display: none;
}
.npc-slot.hidden-until-found.unlocked {
  display: flex;
}

.npc-slot:hover { transform: translateY(-4px); }
.npc-slot:hover .npc-bubble { opacity: 1; transform: translateY(0); }
.hunt-slot:hover { transform: translateX(-50%) translateY(-4px); }
.zone-modal-speech { font-style: normal; }

#npc-notice {
  transform: translateX(-50%);
  z-index: 6;
}

#npc-notice:hover {
  transform: translateX(-50%) translateY(-4px);
}

/* 건물 */
.npc-building {
  position: relative;
  margin-bottom: 2px;
}

.building-roof {
  width: 0; height: 0;
  border-left: calc(36px * var(--town-scale)) solid transparent;
  border-right: calc(36px * var(--town-scale)) solid transparent;
  border-bottom: calc(24px * var(--town-scale)) solid #8b3a2a;
  margin: 0 auto;
}

.building-body {
  width: calc(64px * var(--town-scale)); height: calc(52px * var(--town-scale));
  background: linear-gradient(180deg, #425f7e 0%, #334a63 100%);
  border: 1px solid rgba(28, 43, 59, 0.55);
  border-radius: 4px 4px 0 0;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.building-body::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: calc(20px * var(--town-scale)); height: calc(26px * var(--town-scale));
  background: rgba(38, 27, 18, 0.45);
  border-radius: 10px 10px 0 0;
  border: 1px solid rgba(28, 43, 59, 0.55);
  border-bottom: none;
}
.building-sign { font-size: calc(18px * var(--town-scale)); z-index: 1; }

/* 게시판 타입 */
.board-type .quest-board {
  width: calc(64px * var(--town-scale)); height: calc(72px * var(--town-scale));
  background: linear-gradient(180deg, #7b5430 0%, #604122 100%);
  border: 2px solid #4f3216;
  box-shadow: 0 8px 18px rgba(92, 55, 20, 0.18);
  border-radius: 4px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: calc(4px * var(--town-scale)); padding: calc(8px * var(--town-scale)) calc(6px * var(--town-scale));
}
.board-top { font-size: calc(18px * var(--town-scale)); }
.board-lines { display: flex; flex-direction: column; gap: calc(3px * var(--town-scale)); width: 100%; }
.bl { height: calc(2px * var(--town-scale)); background: rgba(201,168,76,0.3); border-radius: 1px; }

/* NPC 스프라이트 */
.npc-sprite {
  font-size: calc(24px * var(--town-scale));
  margin-bottom: 2px;
  animation: npcFloat 3s ease-in-out infinite;
}
@keyframes npcFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-3px); }
}
.npc-slot:nth-child(2) .npc-sprite { animation-delay: -0.8s; }
.npc-slot:nth-child(3) .npc-sprite { animation-delay: -1.6s; }
.npc-slot:nth-child(4) .npc-sprite { animation-delay: -0.4s; }
.npc-slot:nth-child(5) .npc-sprite { animation-delay: -2s; }
.npc-slot:nth-child(6) .npc-sprite { animation-delay: -1.2s; }

.npc-label {
  font-size: calc(11px * var(--town-scale));
  color: #f8fbff;
  background: rgba(26,41,55,0.72);
  border-radius: calc(4px * var(--town-scale));
  padding: calc(2px * var(--town-scale)) calc(8px * var(--town-scale));
  white-space: nowrap;
}

.npc-bubble {
  margin-top: 4px;
  font-size: calc(10px * var(--town-scale));
  color: #7a561f;
  background: rgba(255,246,221,0.92);
  border: 1px solid rgba(196,156,75,0.28);
  border-radius: calc(10px * var(--town-scale));
  padding: calc(2px * var(--town-scale)) calc(10px * var(--town-scale));
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

/* 사냥터 포탈 */
.hunt-portal {
  position: relative;
  width: 70px; height: 70px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.portal-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(232,80,80,0.5);
  animation: portalPulse 2s ease-in-out infinite;
}
.portal-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(232,80,80,0.3);
  animation: portalPulse 2s ease-in-out infinite reverse;
}
.portal-inner {
  font-size: 28px;
  z-index: 1;
}
@keyframes portalPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%       { transform: scale(1.08); opacity: 1; }
}

/* ── 사이드 패널 ─────────────────────────────────────── */
.side-panel {
  width: calc(220px * var(--ui-scale));
  background: rgba(12,14,22,0.96);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.panel-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 500;
}
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.panel-title-row .panel-title {
  margin-bottom: 0;
}
.mobile-panel-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-family: 'Noto Sans KR', sans-serif;
}

/* 스탯 그리드 */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.stat-item {
  background: var(--surface);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.skey { font-size: 10px; color: var(--text3); }
.sval { font-size: 13px; color: var(--text); font-weight: 500; }

/* 빠른 메뉴 */
.quick-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.qbtn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 4px;
  font-size: 11px;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Noto Sans KR', sans-serif;
  text-align: center;
}
.qbtn:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }

.compact-town-menu .quick-menu {
  grid-template-columns: 1fr;
  gap: 8px;
}

.compact-town-menu .qbtn {
  width: 100%;
  padding: 10px 12px;
  text-align: left;
}

.bank-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.bank-summary-card {
  border: 1px solid rgba(235, 208, 122, 0.22);
  background: rgba(12, 16, 20, 0.72);
  border-radius: 14px;
  padding: 12px;
}

.bank-summary-label {
  font-size: 12px;
  color: rgba(225, 230, 235, 0.72);
  margin-bottom: 6px;
}

.bank-summary-value {
  font-size: 18px;
  font-weight: 700;
  color: #f5df92;
}

.bank-summary-sub {
  margin-top: 6px;
  font-size: 12px;
  color: #9db2bf;
}

.bank-action-row {
  display: flex;
  gap: 10px;
}

.bank-action-row .inventory-action-btn {
  flex: 1;
}

@media (max-width: 760px) {
  .bank-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* 인벤토리 요약 */
.inventory-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.inventory-empty {
  background: var(--surface);
  border: 1px dashed var(--border2);
  border-radius: 8px;
  padding: 12px;
  color: var(--text3);
  font-size: 12px;
  text-align: center;
}
.inventory-empty.large {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inventory-preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.inventory-preview-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}
.inventory-preview-meta {
  font-size: 10px;
  color: var(--text3);
}
.inventory-open-btn {
  width: 100%;
}
.equipment-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.equipment-preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.equipment-preview-label {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.equipment-preview-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}

/* 시스템 로그 */
.log-panel { flex: 1; }
.log-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 260px;
  overflow-y: auto;
}
.log-entry {
  font-size: 11px;
  color: var(--text2);
  padding: 4px 8px;
  background: var(--surface);
  border-radius: 5px;
  border-left: 2px solid var(--border2);
  line-height: 1.4;
  animation: logFade 0.3s ease;
}
.log-entry.gold { border-color: var(--gold); color: var(--gold); }
.log-entry.danger { border-color: var(--danger); color: #ff8080; }
@keyframes logFade { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: translateX(0); } }

@media (max-width: 900px) {
  .hud {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
    padding: 10px 12px;
  }
  .hud-left {
    min-width: 0;
  }
  .hud-center {
    grid-column: 1 / -1;
    max-width: none;
    width: 100%;
    gap: 10px;
  }
  .hud-right {
    min-width: 0;
    gap: 8px;
  }
  .town-main {
    flex-direction: column;
    min-height: auto;
    overflow: auto;
  }
  .town-world {
    min-height: 58vh;
  }
  .side-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
  }
  #stat-panel {
    order: 2;
    grid-column: 1 / -1;
  }
  #inventory-panel {
    order: 3;
  }
  #equipment-panel {
    order: 4;
  }
  .quick-panel {
    order: 1;
    grid-column: 1 / -1;
  }
  .quick-panel .panel-title {
    display: none;
  }
  .log-panel {
    display: none;
  }
  .mobile-panel-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .quick-panel .quick-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 0;
  }
  .compact-town-menu .qbtn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    text-align: center;
    padding: 10px 8px;
  }
  .stat-grid {
    gap: 5px;
  }
  .panel-card {
    padding: 12px;
  }
}

@media (max-width: 640px) {
  .equipment-grid {
    grid-template-columns: 1fr 1fr;
  }
  .inventory-card-actions {
    flex-direction: column;
  }
  .town-world {
    min-height: 50vh;
  }
  .side-panel {
    grid-template-columns: 1fr;
  }
  #stat-panel {
    order: 2;
  }
  #inventory-panel {
    order: 3;
  }
  #equipment-panel {
    order: 4;
  }
  .quick-panel {
    order: 1;
  }
  .quick-panel .quick-menu {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .compact-town-menu .qbtn {
    min-height: 44px;
    font-size: 12px;
  }
  .hud-center {
    flex-direction: column;
    align-items: stretch;
  }
  .hud-bar-group {
    width: 100%;
  }
  .town-title-badge {
    top: 10px;
    font-size: 11px;
    padding: 4px 12px;
  }
  .npc-slot {
    transform: scale(0.8);
    transform-origin: bottom center;
  }
  .npc-slot:hover {
    transform: scale(0.8) translateY(-3px);
  }
  #npc-weapon {
    left: calc(68% - 45px) !important;
    bottom: 5% !important;
    z-index: 2;
  }
  #npc-potion {
    left: calc(32% - 25px) !important;
    bottom: 5% !important;
    z-index: 2;
  }
  #npc-quest {
    left: 15% !important;
    bottom: calc(32% + 30px) !important;
    z-index: 5;
  }
  #npc-notice {
    left: calc(86% - 40px) !important;
    bottom: calc(55% + 28px) !important;
    z-index: 6;
    transform: scale(0.8);
    transform-origin: bottom center;
  }
  #npc-notice:hover {
    transform: scale(0.8) translateY(-3px);
  }
  #npc-job {
    left: calc(80% - 55px) !important;
    bottom: calc(32% + 30px) !important;
    z-index: 3;
  }
  #npc-bank {
    left: calc(14% - 25px) !important;
    bottom: 5% !important;
    z-index: 2;
  }
  #npc-market {
    left: calc(86% - 45px) !important;
    bottom: 5% !important;
    z-index: 2;
  }
  .hunt-road-area {
    bottom: 8%;
    width: 190px;
  }
  .hunt-entrance {
    transform: scale(0.72);
    transform-origin: bottom center;
  }
  .hunt-entrance:hover {
    transform: scale(0.72) translateY(-3px);
  }
  .tree-deco.t2,
  .tree-deco.t3,
  .tree-deco.t4,
  .tree-deco.t5 {
    display: none;
  }
  .tree-deco.t1 {
    left: 6%;
    bottom: 8px;
    font-size: 34px;
  }
  .tree-deco.t6 {
    right: 6%;
    bottom: 10px;
    font-size: 34px;
  }
  .stone-road {
    width: 44px;
    height: 96px;
  }
}

/* ── NPC 모달 ────────────────────────────────────────── */
.npc-modal-wrap {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.npc-modal-wrap.open {
  opacity: 1;
  pointer-events: all;
}

.npc-modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 340px;
  max-width: 90vw;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  transform: translateY(12px);
  transition: transform 0.2s;
}
.npc-modal-wrap.open .npc-modal { transform: translateY(0); }

.modal-npc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-npc-icon { font-size: 28px; }
.modal-npc-name { font-family: 'Cinzel', serif; font-size: 15px; color: var(--gold2); font-weight: 600; }
.modal-npc-sub  { font-size: 11px; color: var(--text3); margin-top: 2px; }
.modal-close {
  margin-left: auto;
  background: none; border: none;
  color: var(--text3); font-size: 16px;
  cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: background 0.15s;
}
.modal-close:hover { background: var(--surface); color: var(--text); }

.modal-npc-speech {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  padding: 14px 18px;
  background: var(--surface);
  margin: 0 16px 14px;
  border-radius: 8px;
  border-left: 3px solid var(--gold);
  font-style: italic;
}

.modal-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 16px 16px;
}
.modal-menu-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 16px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s;
}
.modal-menu-btn:hover { background: var(--surface2); border-color: var(--border2); }
.modal-menu-btn .mbtn-icon { font-size: 16px; width: 22px; text-align: center; }
.modal-menu-btn .mbtn-label { flex: 1; }
.modal-menu-btn .mbtn-badge {
  font-size: 10px;
  background: rgba(201,168,76,0.15);
  color: var(--gold);
  border-radius: 10px;
  padding: 2px 8px;
}

.modal-coming-soon {
  text-align: center;
  padding: 20px;
  color: var(--text3);
}
.coming-text { font-size: 20px; margin-bottom: 6px; }
.coming-sub  { font-size: 12px; }

.inventory-modal {
  width: 720px;
  max-width: 92vw;
}
.inventory-modal-body {
  padding: 16px;
}
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}
.inventory-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inventory-card.equipped {
  border-color: rgba(201,168,76,0.5);
  box-shadow: inset 0 0 0 1px rgba(201,168,76,0.25);
}
.inventory-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.inventory-card-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.inventory-card-type {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.inventory-card-qty {
  font-size: 11px;
  color: var(--text2);
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}
.inventory-card-desc {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.5;
  min-height: 32px;
}
.inventory-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.inventory-stat-chip {
  font-size: 10px;
  color: var(--text2);
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  padding: 3px 7px;
}
.inventory-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text3);
}
.inventory-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.inventory-action-btn {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
}
.inventory-action-btn:hover {
  border-color: var(--gold);
}
.inventory-action-btn.alt {
  color: var(--text2);
}
.inventory-equipped-badge {
  color: var(--gold);
}
.equipment-modal {
  width: 820px;
  max-width: 94vw;
}
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}
.equipment-slot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 170px;
}
.equipment-slot-card.filled {
  border-color: rgba(201,168,76,0.45);
  box-shadow: inset 0 0 0 1px rgba(201,168,76,0.22);
}
.equipment-slot-label {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.equipment-slot-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.equipment-slot-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: 12px;
  border: 1px dashed var(--border2);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
}
.equipment-slot-desc {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.5;
  min-height: 34px;
}

@media (max-width: 760px) {
  .character-paperdoll-stage {
    width: min(100%, 180px);
  }
}
.blacksmith-modal {
  width: 820px;
  max-width: 94vw;
}
.blacksmith-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text2);
}
.blacksmith-gold {
  color: var(--gold2);
  font-weight: 600;
}
.blacksmith-limit {
  color: var(--text3);
}
.blacksmith-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.blacksmith-tab {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.15s;
}
.blacksmith-tab:hover {
  border-color: var(--border2);
  color: var(--text);
}
.blacksmith-tab.active {
  background: rgba(201,168,76,0.12);
  border-color: rgba(201,168,76,0.45);
  color: var(--gold2);
}
.shop-card {
  min-height: 220px;
}
.shop-card.soldout {
  opacity: 0.72;
}
.shop-card .inventory-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.shop-price {
  color: var(--gold2);
  font-weight: 600;
}
.shop-card .inventory-action-btn.alt:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.quest-modal {
  width: 820px;
  max-width: 94vw;
}
.quest-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.quest-summary-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}
.quest-summary-label {
  font-size: 10px;
  color: var(--text3);
  margin-bottom: 4px;
}
.quest-summary-value {
  font-size: 14px;
  color: var(--gold2);
  font-weight: 600;
}
.quest-card.completed {
  border-color: rgba(74, 173, 111, 0.45);
}
.quest-card.claimed {
  opacity: 0.75;
}
.quest-progress {
  font-size: 11px;
  color: var(--success);
  font-weight: 600;
}
.quest-reward {
  font-size: 11px;
  color: var(--text2);
}

.notice-board-feature {
  border: 1px solid rgba(227, 190, 97, 0.22);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(27, 33, 38, 0.96), rgba(17, 21, 26, 0.98));
  padding: 18px;
  margin-bottom: 12px;
}

.notice-board-feature.pinned {
  border-color: rgba(227, 190, 97, 0.42);
  box-shadow: 0 12px 28px rgba(227, 190, 97, 0.08);
}

.notice-board-feature-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.notice-board-feature-content {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text1);
}

.notice-board-list {
  display: grid;
  gap: 6px;
}

.notice-board-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 10px 12px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.notice-board-row:hover {
  border-color: rgba(227, 190, 97, 0.24);
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
}

.notice-board-row.active {
  border-color: rgba(227, 190, 97, 0.45);
  background: rgba(227, 190, 97, 0.08);
}

.notice-board-row-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text1);
}

.notice-board-row-meta {
  font-size: 11px;
  color: var(--gold2);
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════
   사냥터 입구 · 돌길
════════════════════════════════════════════════════════ */
.hunt-road-area {
  position: absolute;
  left: 50%;
  bottom: 30%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 260px;
  z-index: 4;
}

/* 돌길 */
.stone-road {
  width: 60px;
  height: 120px;
  background: repeating-linear-gradient(
    180deg,
    #2a2520 0px, #2a2520 10px,
    #221e1a 10px, #221e1a 22px
  );
  border-left: 3px solid #1a1610;
  border-right: 3px solid #1a1610;
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
}

/* 나무 장식 */
.tree-deco {
  position: absolute;
  font-size: 32px;
  filter: brightness(0.55) saturate(0.7);
  animation: treeSway 4s ease-in-out infinite;
  transform-origin: bottom center;
}
.t1 { left: 2%;  bottom: 30px; font-size: 44px; animation-delay: 0s; }
.t2 { left: 12%; bottom: 10px; font-size: 36px; animation-delay: -1s; }
.t3 { left: 22%; bottom: 20px; font-size: 40px; animation-delay: -2s; }
.t4 { right: 2%;  bottom: 30px; font-size: 44px; animation-delay: -0.5s; }
.t5 { right: 12%; bottom: 10px; font-size: 36px; animation-delay: -1.5s; }
.t6 { right: 22%; bottom: 20px; font-size: 40px; animation-delay: -2.5s; }

@keyframes treeSway {
  0%,100% { transform: rotate(-1deg); }
  50%      { transform: rotate(1deg);  }
}

/* 아치 입구 */
.hunt-entrance {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
  z-index: 5;
}
.hunt-entrance:hover { transform: translateY(-4px); }
.hunt-entrance:hover .hunt-enter-hint { opacity: 1; }

.entrance-arch {
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin-bottom: -2px;
}
.arch-post {
  width: 14px;
  height: 56px;
  background: linear-gradient(180deg, #3a2e1e, #2a2010);
  border: 1px solid #5a4a28;
  border-radius: 2px;
}
.arch-top {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #2a2010, #1e1808);
  border: 1px solid #5a4a28;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--gold);
  white-space: nowrap;
}
.arch-skull { font-size: 14px; }
.arch-text  { font-family: 'Cinzel', serif; letter-spacing: 0.06em; }

/* 새 포탈 */
.hunt-portal-new {
  width: 90px;
  height: 90px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.portal-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(80,200,80,0.12) 0%, transparent 70%);
  animation: glowPulse 2.5s ease-in-out infinite;
}
@keyframes glowPulse {
  0%,100% { opacity: 0.5; transform: scale(0.95); }
  50%      { opacity: 1;   transform: scale(1.05); }
}
.portal-ring {
  position: absolute;
  border-radius: 50%;
  border-style: solid;
  border-color: rgba(60,180,60,0.4);
}
.portal-ring.r1 {
  inset: 4px;
  border-width: 2px;
  animation: portalSpin 6s linear infinite;
}
.portal-ring.r2 {
  inset: 12px;
  border-width: 1.5px;
  border-color: rgba(100,220,80,0.3);
  animation: portalSpin 4s linear infinite reverse;
}
@keyframes portalSpin { to { transform: rotate(360deg); } }

.portal-core {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, #0d2010 40%, #081408 100%);
  border: 2px solid rgba(60,160,60,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.portal-forest { font-size: 26px; filter: brightness(0.7); }

.hunt-enter-hint {
  margin-top: 8px;
  font-size: 11px;
  color: #4aad6f;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(74,173,111,0.25);
  border-radius: 10px;
  padding: 3px 12px;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
}

/* ── 구역 선택 모달 ──────────────────────────────────── */
.zone-modal { max-width: 480px; }

.zone-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px 16px;
}
.zone-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
}
.zone-card:hover:not(.locked) {
  border-color: var(--border2);
  background: var(--surface2);
  transform: translateY(-2px);
}
.zone-card.locked { opacity: 0.45; cursor: not-allowed; }
.zone-card-icon  { font-size: 22px; margin-bottom: 6px; }
.zone-card-name  { font-family: 'Cinzel', serif; font-size: 13px; color: var(--gold2); font-weight: 600; margin-bottom: 3px; }
.zone-card-level { font-size: 11px; color: var(--text3); margin-bottom: 8px; }
.zone-card-desc  { font-size: 11px; color: var(--text2); line-height: 1.5; }
.zone-lock-badge {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 10px;
  background: rgba(232,80,80,0.15);
  color: var(--danger);
  border-radius: 6px;
  padding: 2px 6px;
}
.zone-rec-badge {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 10px;
  background: rgba(74,173,111,0.15);
  color: var(--success);
  border-radius: 6px;
  padding: 2px 6px;
}

/* ── 화면 전환 오버레이 ──────────────────────────────── */
.transition-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 0.5s;
}
.transition-overlay.fade-in  { opacity: 1; pointer-events: all; }
.transition-overlay.fade-out { opacity: 0; pointer-events: none; }

/* ════════════════════════════════════════════════════════
   사냥터 화면
════════════════════════════════════════════════════════ */
.hunt-screen-wrap {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background: #060a0a;
}
.hunt-battle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(280px * var(--ui-scale));
  flex: 1;
  min-height: 0;
}

.hunt-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: calc(100vh - 60px);
}

/* 사냥터 배경 */
.hunt-world {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.hunt-bg { position: absolute; inset: 0; pointer-events: none; }

.hunt-sky {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, #020408 0%, #060e10 50%, #0a1410 100%);
}

/* 안개 */
.hunt-fog {
  position: absolute;
  height: 60px;
  left: -20%;
  right: -20%;
  background: rgba(20,40,20,0.3);
  filter: blur(20px);
  animation: fogDrift linear infinite;
  border-radius: 50%;
}
.f1 { bottom: 35%; animation-duration: 25s; }
.f2 { bottom: 25%; animation-duration: 35s; animation-delay: -12s; opacity: 0.6; }
@keyframes fogDrift {
  0%   { transform: translateX(-5%); }
  50%  { transform: translateX(5%); }
  100% { transform: translateX(-5%); }
}

.hunt-trees {
  position: absolute;
  bottom: 40%;
  left: 0; right: 0;
  display: flex;
  justify-content: space-around;
  padding: 0 20px;
}
.ht {
  font-size: calc(48px * var(--hunt-scale));
  filter: brightness(0.25) saturate(0.5);
  animation: treeSway 5s ease-in-out infinite;
}
.ht:nth-child(2n) { animation-delay: -2s; font-size: calc(56px * var(--hunt-scale)); }
.ht:nth-child(3n) { animation-delay: -1s; font-size: calc(40px * var(--hunt-scale)); }

.hunt-ground {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 42%;
  background: linear-gradient(180deg, #060e06 0%, #040a04 100%);
}
.hunt-ground::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(40,80,40,0.3);
}

/* 구역 배지 */
.zone-badge {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: calc(8px * var(--hunt-scale));
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(74,173,111,0.2);
  border-radius: calc(20px * var(--hunt-scale));
  padding: calc(5px * var(--hunt-scale)) calc(16px * var(--hunt-scale));
  font-family: 'Cinzel', serif;
  font-size: calc(13px * var(--hunt-scale));
  color: #4aad6f;
  white-space: nowrap;
  z-index: 5;
}
.zone-badge-icon  { font-size: calc(15px * var(--hunt-scale)); }
.zone-badge-level {
  font-size: calc(10px * var(--hunt-scale));
  color: var(--text3);
  background: var(--surface);
  border-radius: 8px;
  padding: 1px 7px;
  font-family: 'Noto Sans KR', sans-serif;
}

/* 몬스터 스테이지 */
.monster-stage {
  position: absolute;
  bottom: 38%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 6;
}
.monster-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.monster-icon {
  font-size: 72px;
  animation: monsterBob 2s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(200,80,80,0.3));
  transition: all 0.3s;
  cursor: default;
}
@keyframes monsterBob {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.monster-icon.shake {
  animation: monsterShake 0.4s ease;
}
@keyframes monsterShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-5px); }
  80%     { transform: translateX(5px); }
}

.monster-name-badge {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--text);
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 3px 14px;
}
.monster-hp-bar-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 200px;
}
.monster-hp-label { font-size: 10px; color: var(--danger); width: 18px; }
.monster-hp-bar {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(232,80,80,0.2);
}
.monster-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b1a1a, #e74c3c);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.monster-hp-text { font-size: 10px; color: var(--text3); width: 50px; text-align: right; }

/* 전투 로그 */
.hunt-log-box {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 6;
  pointer-events: none;
}
.hunt-log-list {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  max-height: 120px;
  overflow: hidden;
}
.hunt-log-entry {
  font-size: 12px;
  color: var(--text2);
  background: rgba(0,0,0,0.6);
  border-radius: 5px;
  padding: 4px 10px;
  border-left: 2px solid var(--border2);
  animation: logFade 0.3s ease;
  backdrop-filter: blur(4px);
}
.hunt-log-entry.atk  { border-color: #e74c3c; color: #ff9090; }
.hunt-log-entry.def  { border-color: #3498db; color: #90b8ff; }
.hunt-log-entry.win  { border-color: var(--gold); color: var(--gold2); }
.hunt-log-entry.info { border-color: #4aad6f; color: #80d890; }

/* ── 사냥터 사이드 패널 ──────────────────────────────── */
.hunt-side {
  width: 200px;
  background: rgba(6,10,10,0.97);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

/* 전투 버튼 */
.hunt-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hbtn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
  transition: all 0.15s;
  width: 100%;
}
.hbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.hbtn:not(:disabled):hover { background: var(--surface2); border-color: var(--border2); }
.hbtn-icon { font-size: 15px; width: 20px; text-align: center; }
.hbtn-label { flex: 1; text-align: left; }
.hbtn-sub { font-size: 10px; color: var(--text3); }

.hbtn-attack:not(:disabled) { border-color: rgba(232,80,80,0.3); }
.hbtn-attack:not(:disabled):hover { background: rgba(232,80,80,0.08); }
.hbtn-skill:not(:disabled)  { border-color: rgba(155,111,245,0.3); }
.hbtn-skill:not(:disabled):hover  { background: rgba(155,111,245,0.08); }
.hbtn-find  { border-color: rgba(74,173,111,0.3); }
.hbtn-find:not(:disabled):hover  { background: rgba(74,173,111,0.08); }

.hunt-stat-list { display: flex; flex-direction: column; gap: 6px; }
.hstat {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text2);
  padding: 5px 8px;
  background: var(--surface);
  border-radius: 6px;
}
.c-exp  { color: #d4ac0d; }
.c-gold { color: var(--gold); }

.battle-skill-modal-wrap {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
}
.battle-skill-modal-wrap.open {
  display: flex;
}
.battle-skill-modal {
  width: min(560px, 92vw);
  max-height: 76vh;
  overflow: hidden;
  background: rgba(12, 16, 22, 0.98);
  border: 1px solid var(--border2);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
  padding: 16px;
}
.battle-skill-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.battle-skill-title {
  font-size: 16px;
  color: var(--gold2);
  font-weight: 700;
}
.battle-skill-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
}
.battle-skill-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(76vh - 88px);
  overflow-y: auto;
}
.battle-skill-item {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
  font-family: 'Noto Sans KR', sans-serif;
}
.battle-skill-item:hover:not(:disabled) {
  border-color: rgba(155,111,245,0.45);
  background: rgba(155,111,245,0.08);
  transform: translateY(-1px);
}
.battle-skill-item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.battle-skill-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.battle-skill-item-meta {
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 4px;
}
.battle-skill-item-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.45;
}
.battle-potion-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.battle-potion-item-meta {
  font-size: 11px;
  color: #72d893;
  margin-bottom: 4px;
}

/* ── 몬스터 애니메이션 ───────────────────────────────── */
#monster-icon {
  font-size: calc(var(--player-sprite-size) * 1.05);
  display: inline-block;
  transition: font-size 0.3s;
  filter: drop-shadow(0 0 16px rgba(200,80,80,0.25));
}
.monster-image {
  width: var(--monster-image-size);
  height: var(--monster-image-size);
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,0.35));
}
@keyframes monsterBob {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(1deg); }
}
#monster-icon { animation: monsterBob 2.5s ease-in-out infinite; }

@keyframes animHit {
  0%   { transform: translateX(0) scale(1); filter: brightness(1) drop-shadow(0 0 16px rgba(200,80,80,0.25)); }
  20%  { transform: translateX(-12px) scale(0.95); filter: brightness(3) drop-shadow(0 0 30px rgba(255,80,80,0.8)); }
  40%  { transform: translateX(10px) scale(1.05); filter: brightness(2) drop-shadow(0 0 20px rgba(255,80,80,0.6)); }
  60%  { transform: translateX(-6px) scale(0.98); filter: brightness(1.5); }
  80%  { transform: translateX(4px); filter: brightness(1.2); }
  100% { transform: translateX(0) scale(1); filter: brightness(1) drop-shadow(0 0 16px rgba(200,80,80,0.25)); }
}
#monster-icon.anim-hit {
  animation: animHit 0.5s ease forwards !important;
}

@keyframes animDie {
  0%   { transform: scale(1) rotate(0deg); opacity: 1; filter: brightness(1); }
  30%  { transform: scale(1.2) rotate(-10deg); filter: brightness(3) drop-shadow(0 0 40px #ff4400); }
  60%  { transform: scale(0.8) rotate(15deg); opacity: 0.6; filter: brightness(0.5); }
  100% { transform: scale(0) rotate(30deg); opacity: 0; }
}
#monster-icon.anim-die {
  animation: animDie 0.8s ease forwards !important;
}

@keyframes animAppear {
  0%   { transform: scale(0.3) translateY(30px); opacity: 0; }
  60%  { transform: scale(1.1) translateY(-5px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
#monster-icon.anim-appear {
  animation: animAppear 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards !important;
}

@keyframes playerHit {
  0%,100% { background: var(--surface2); }
  30%     { background: rgba(232,80,80,0.5); box-shadow: 0 0 0 3px rgba(232,80,80,0.4); }
}
.anim-player-hit {
  animation: playerHit 0.4s ease !important;
}

/* ── 데미지 팝업 ─────────────────────────────────────── */
.dmg-popup {
  position: absolute;
  font-size: 22px;
  font-weight: 700;
  pointer-events: none;
  z-index: 20;
  animation: dmgFloat 0.9s ease forwards;
  font-family: 'Cinzel', serif;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
.dmg-red  { color: #ff4444; }
.dmg-blue { color: #4488ff; }

@keyframes dmgFloat {
  0%   { transform: translateY(0) scale(0.8); opacity: 1; }
  30%  { transform: translateY(-20px) scale(1.2); opacity: 1; }
  100% { transform: translateY(-60px) scale(0.9); opacity: 0; }
}

/* ── 토스트 알림 ─────────────────────────────────────── */
.battle-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.05em;
}
.battle-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-levelup { background: linear-gradient(135deg,#b8922e,#f0d07a); color: #1a1200; box-shadow: 0 4px 20px rgba(201,168,76,0.4); }
.toast-danger  { background: rgba(232,80,80,0.9); color: #fff; box-shadow: 0 4px 20px rgba(232,80,80,0.4); }
.toast-info    { background: rgba(30,35,51,0.95); color: var(--text); border: 1px solid var(--border2); }

/* ════════════════════════════════════════════════════════
   포켓몬 스타일 전투 UI
════════════════════════════════════════════════════════ */

/* 상단 바 */
.hunt-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(8px * var(--ui-scale)) calc(16px * var(--ui-scale));
  background: rgba(6,10,10,0.97);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}
.hunt-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 전투 필드 */
.poke-field {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

/* 적 정보 카드 - 우측 상단 */
.poke-enemy-card {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(10,14,20,0.88);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 200px;
  z-index: 10;
  backdrop-filter: blur(4px);
}

/* 적 이모지 - 우측 중앙 */
.poke-enemy-sprite {
  position: absolute;
  right: 21%;
  top: 24%;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 내 캐릭터 정보 카드 - 좌측 하단 */
.poke-player-card {
  position: absolute;
  bottom: 16px;
  left: 20px;
  background: rgba(10,14,20,0.88);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 220px;
  z-index: 10;
  backdrop-filter: blur(4px);
}

/* 내 캐릭터 이모지 - 좌측 중앙 */
.poke-player-sprite {
  position: absolute;
  left: 21%;
  bottom: 22%;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-icon {
  font-size: var(--player-sprite-size);
  display: inline-block;
  filter: drop-shadow(0 0 12px rgba(74,126,245,0.3));
  animation: playerBob 3s ease-in-out infinite;
  transform: scaleX(-1);
}
@keyframes playerBob {
  0%,100% { transform: scaleX(-1) translateY(0); }
  50%      { transform: scaleX(-1) translateY(-6px); }
}
.anim-player-hit .player-icon,
.anim-player-hit {
  animation: playerHitAnim 0.4s ease !important;
}
@keyframes playerHitAnim {
  0%,100% { transform: scaleX(-1) translateX(0); filter: brightness(1); }
  25%     { transform: scaleX(-1) translateX(8px); filter: brightness(3) drop-shadow(0 0 20px rgba(232,80,80,0.8)); }
  75%     { transform: scaleX(-1) translateX(-4px); filter: brightness(1.5); }
}

/* 공통 카드 요소 */
.poke-player-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.poke-player-avatar {
  font-size: 22px;
  width: 36px; height: 36px;
  background: var(--surface2);
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.poke-player-info { flex: 1; }
.poke-card-name {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--gold2);
  font-weight: 600;
  margin-bottom: 2px;
}
.poke-card-level {
  font-size: 11px;
  color: var(--text2);
}

/* 스탯 바 */
.poke-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}
.poke-bar-label {
  font-size: 10px;
  color: var(--text3);
  width: 22px;
  flex-shrink: 0;
  font-weight: 500;
}
.poke-bar {
  flex: 1;
  height: 7px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.poke-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.poke-hp-fill  { background: linear-gradient(90deg, #c0392b, #e74c3c); }
.poke-mp-fill  { background: linear-gradient(90deg, #1a5276, #2980b9); }
.poke-exp-fill { background: linear-gradient(90deg, #7d6608, #d4ac0d); }
.poke-bar-val {
  font-size: 10px;
  color: var(--text3);
  min-width: 48px;
  text-align: right;
  flex-shrink: 0;
}

/* 하단 패널 */
.poke-bottom {
  display: flex;
  height: 136px;
  flex-shrink: 0;
  background: rgba(6,10,10,0.98);
  border-top: 2px solid rgba(255,255,255,0.1);
}

/* 전투 로그 */
.poke-log-box {
  flex: 1;
  padding: 12px 16px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  border-right: 1px solid var(--border);
}
.poke-log-box .hunt-log-list {
  width: 100%;
  max-height: 116px;
  overflow: hidden;
}

/* 액션 버튼 그리드 */
.poke-actions {
  width: calc(320px * var(--ui-scale));
  flex-shrink: 0;
  padding: calc(10px * var(--ui-scale)) calc(12px * var(--ui-scale));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: 1fr auto;
  gap: calc(6px * var(--ui-scale));
  align-items: center;
}
.battle-side-panel {
  background: linear-gradient(180deg, rgba(8,11,16,0.98) 0%, rgba(6,10,10,0.98) 100%);
  border-left: 1px solid var(--border);
  padding: calc(16px * var(--ui-scale)) calc(14px * var(--ui-scale));
  display: flex;
  flex-direction: column;
  gap: calc(12px * var(--ui-scale));
  overflow-y: auto;
}
.battle-side-card {
  background: rgba(15,19,28,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.battle-side-title {
  font-size: 11px;
  color: var(--gold2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 600;
}
.battle-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
  color: var(--text2);
}
.battle-item-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.battle-item-row strong {
  color: var(--text);
  font-weight: 700;
}
.battle-passive-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.battle-passive-item {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
}
.battle-passive-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.battle-passive-top strong {
  color: var(--text);
  font-size: 12px;
}
.battle-passive-level {
  color: var(--gold2);
  font-size: 11px;
  font-weight: 600;
}
.battle-passive-meta,
.battle-passive-desc {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.45;
}
.battle-passive-desc {
  margin-top: 4px;
  color: var(--text2);
}
.battle-passive-empty {
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text3);
}

.poke-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(3px * var(--ui-scale));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(8px * var(--ui-scale));
  padding: calc(8px * var(--ui-scale)) calc(4px * var(--ui-scale));
  cursor: pointer;
  color: var(--text);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: calc(11px * var(--ui-scale));
  transition: all 0.15s;
  height: calc(64px * var(--ui-scale));
}
.poke-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.poke-btn:not(:disabled):hover { background: var(--surface2); border-color: var(--border2); transform: translateY(-2px); }
.poke-btn-icon { font-size: calc(20px * var(--ui-scale)); }

.poke-btn-attack:not(:disabled) { border-color: rgba(232,80,80,0.4); }
.poke-btn-attack:not(:disabled):hover { background: rgba(232,80,80,0.1); }
.poke-btn-skill:not(:disabled)  { border-color: rgba(155,111,245,0.4); }
.poke-btn-skill:not(:disabled):hover  { background: rgba(155,111,245,0.1); }
.poke-btn-find  { border-color: rgba(74,173,111,0.4); }
.poke-btn-find:not(:disabled):hover  { background: rgba(74,173,111,0.1); }
.poke-btn-flee:not(:disabled)  { border-color: rgba(136,135,128,0.4); }

/* 세션 스탯 (하단 한 줄) */
.poke-session-stats {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-around;
  font-size: calc(11px * var(--ui-scale));
  color: var(--text3);
  padding-top: 2px;
}
.ps-item { display: flex; gap: 4px; }
.ps-item.c-exp  { color: #d4ac0d; }
.ps-item.c-gold { color: var(--gold); }

@media (max-width: 1100px) {
  .hunt-battle-layout {
    grid-template-columns: 1fr;
  }
  .battle-side-panel {
    border-left: none;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .poke-enemy-sprite {
    right: 16%;
  }
  .poke-player-sprite {
    left: 16%;
  }
}

@media (max-width: 760px) {
  .hunt-topbar {
    gap: 8px;
    padding: 8px 10px;
  }
  .hunt-topbar-right {
    gap: 8px;
    flex: 1;
  }
  .zone-badge {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    margin-left: auto;
    max-width: 46%;
    padding: 5px 10px;
    font-size: 12px;
    gap: 6px;
    overflow: hidden;
  }
  #zone-badge-name {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .zone-badge-level {
    padding: 1px 6px;
  }
  .hunt-battle-layout {
    display: block;
  }
  .battle-side-panel {
    display: none;
  }
  .poke-field {
    min-height: 540px;
  }
  .poke-enemy-card {
    top: 42%;
    right: 6%;
    min-width: 150px;
    width: 150px;
    padding: 9px 10px;
  }
  .poke-enemy-sprite {
    right: 7%;
    top: 9%;
  }
  .poke-player-card {
    left: 6%;
    bottom: 28%;
    min-width: 150px;
    width: 150px;
    padding: 9px 10px;
  }
  .poke-player-sprite {
    left: 7%;
    bottom: 4%;
  }
  .monster-image {
    width: var(--monster-image-size-mobile);
    height: var(--monster-image-size-mobile);
  }
  .player-icon {
    font-size: calc(var(--player-sprite-size) * 0.92);
  }
  .poke-player-card .poke-player-top {
    display: none;
  }
  .poke-enemy-card .poke-card-name,
  .poke-enemy-card .poke-card-level {
    display: none;
  }
  .poke-enemy-card .poke-bar-row:first-of-type,
  .poke-player-card .poke-bar-row:first-of-type {
    margin-top: 0;
  }
  .poke-enemy-card .poke-bar-row,
  .poke-player-card .poke-bar-row {
    gap: 5px;
  }
  .poke-enemy-card .poke-bar-label,
  .poke-player-card .poke-bar-label {
    width: 20px;
    font-size: 9px;
  }
  .poke-enemy-card .poke-bar-val,
  .poke-player-card .poke-bar-val {
    min-width: 40px;
    font-size: 9px;
  }
  .poke-bottom {
    height: auto;
    display: flex;
    flex-direction: column;
  }
  .poke-log-box {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
  }
  .poke-log-box .hunt-log-list {
    max-height: 72px;
  }
  .poke-actions {
    width: 100%;
    padding: 10px 12px 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: 1fr;
  }
  .poke-session-stats {
    display: none;
  }
  .poke-btn {
    height: 58px;
    font-size: 10px;
    padding: 7px 2px;
  }
  .poke-btn-icon {
    font-size: 18px;
  }
}
