@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;600;700&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,400&display=swap');

:root {
  --gold: #c8a84b;
  --gold-light: #f0d080;
  --gold-dim: #7a6228;
  --red: #8b1a1a;
  --red-bright: #cc2222;
  --bg-dark: #0a0805;
  --bg-mid: #12100c;
  --bg-panel: #1a1610;
  --bg-card: #201c14;
  --border: #3a3020;
  --border-gold: #5a4a20;
  --text-main: #d4c090;
  --text-dim: #8a7a50;
  --text-bright: #f0e0a0;
  --blue-rare: #4a90d9;
  --green-uncommon: #1eff00;
  --white-common: #ffffff;
  --purple-epic: #a335ee;
  --orange-legendary: #ff8000;
}

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

body {
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Parchment texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(200, 150, 50, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139, 26, 26, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── HEADER ── */
.site-header {
  position: relative;
  text-align: center;
  padding: 56px 20px 36px;
  border-bottom: 1px solid var(--border-gold);
  background: linear-gradient(180deg, #050402 0%, #0c0906 50%, var(--bg-dark) 100%);
  overflow: hidden;
}

/* Subtle rune tile texture */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c8a84b' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* Atmospheric lighting — gold overhead, blue-left (Alliance), red-right (Horde) */
.header-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(200,140,40,0.18) 0%, transparent 65%),
    radial-gradient(ellipse 35% 70% at 5% 50%, rgba(68,136,204,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 35% 70% at 95% 50%, rgba(180,50,50,0.07) 0%, transparent 70%);
}

/* Floating rune/spark particles */
.header-runes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.rune {
  position: absolute;
  color: var(--gold);
  opacity: 0;
  animation: floatRune var(--dur, 7s) var(--del, 0s) ease-in-out infinite;
  font-size: var(--sz, 0.85rem);
}
.r1 { left: 7%;  top: 20%; --dur: 8s;  --del: 0s;   --sz: 0.9rem; }
.r2 { left: 16%; top: 65%; --dur: 6s;  --del: 1.3s; --sz: 0.6rem; }
.r3 { left: 28%; top: 35%; --dur: 9s;  --del: 2.5s; --sz: 0.75rem; }
.r4 { left: 44%; top: 72%; --dur: 7s;  --del: 0.8s; --sz: 0.5rem; }
.r5 { left: 60%; top: 22%; --dur: 8s;  --del: 3.2s; --sz: 0.8rem; }
.r6 { left: 74%; top: 58%; --dur: 6s;  --del: 1.9s; --sz: 0.65rem; }
.r7 { left: 85%; top: 32%; --dur: 7s;  --del: 4.1s; --sz: 0.55rem; }
.r8 { left: 92%; top: 68%; --dur: 9s;  --del: 2.2s; --sz: 0.85rem; }

@keyframes floatRune {
  0%   { opacity: 0; transform: translateY(8px) scale(0.7); }
  20%  { opacity: 0; }
  35%  { opacity: 0.45; }
  50%  { opacity: 0.65; transform: translateY(-16px) scale(1); }
  65%  { opacity: 0.35; }
  80%  { opacity: 0; }
  100% { opacity: 0; transform: translateY(-28px) scale(0.7); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; text-shadow: none; }
  50% { opacity: 0.9; text-shadow: 0 0 20px var(--gold); }
}

/* Header content stack */
.header-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Logo with breathing halo */
.header-logo-container {
  position: relative;
  display: inline-block;
  margin-bottom: 18px;
}
.header-logo-halo {
  position: absolute;
  inset: -35%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(200,140,40,0.2) 0%, rgba(200,140,40,0.06) 45%, transparent 70%);
  animation: haloBreath 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes haloBreath {
  0%, 100% { opacity: 0.7; transform: scale(0.94); }
  50%       { opacity: 1;   transform: scale(1.06); }
}
.header-logo {
  display: block;
  width: min(280px, 55vw);
  height: auto;
  position: relative;
  filter:
    drop-shadow(0 0 50px rgba(200,140,40,0.3))
    drop-shadow(0 12px 32px rgba(0,0,0,0.9));
  transition: transform 0.4s ease, filter 0.4s ease;
}
.header-logo:hover {
  transform: scale(1.04) translateY(-3px);
  filter:
    drop-shadow(0 0 72px rgba(200,140,40,0.55))
    drop-shadow(0 0 28px rgba(200,140,40,0.2))
    drop-shadow(0 18px 40px rgba(0,0,0,0.9));
}

.site-subtitle {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.62rem, 1.8vw, 0.82rem);
  color: var(--gold-dim);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  position: relative;
}

/* Alliance ← ◆ → Horde divider */
.header-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}
.header-divider-line {
  flex: 1;
  height: 1px;
  max-width: 280px;
}
.header-divider-alliance {
  background: linear-gradient(90deg, transparent 0%, rgba(68,136,204,0.3) 30%, rgba(68,136,204,0.75) 100%);
}
.header-divider-horde {
  background: linear-gradient(90deg, rgba(180,50,50,0.75) 0%, rgba(180,50,50,0.3) 70%, transparent 100%);
}
.header-divider-center {
  padding: 0 20px;
  display: flex;
  align-items: center;
}
.divider-diamond {
  color: var(--gold);
  font-size: 0.8rem;
  animation: pulse-glow 3s ease-in-out infinite;
  display: block;
  line-height: 1;
}

/* ── CONTROLS ── */
.controls {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,8,5,0.97);
  border-bottom: 1px solid var(--border-gold);
  backdrop-filter: blur(8px);
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-dim);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 3px;
  color: var(--text-bright);
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(200,168,75,0.2);
}
.search-input::placeholder { color: var(--text-dim); }

.filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.filter-btn {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-btn:hover, .filter-btn.active {
  background: linear-gradient(135deg, #2a2010, #1a1508);
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 8px rgba(200,168,75,0.15);
}
.controls-right {
  display: flex;
  gap: 8px;
  align-items: center;
}
.view-btn {
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}
.view-btn.active, .view-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.quest-count {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.quest-count span { color: var(--gold); font-weight: 600; }

/* ── DUNGEON TABS ── */
.dungeon-tabs {
  display: flex;
  overflow-x: auto;
  background: var(--bg-mid);
  border-bottom: 1px solid var(--border-gold);
  padding: 0 20px;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
  justify-content: safe center;
}
.dungeon-tab {
  padding: 10px 16px;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
  position: relative;
}
.dungeon-tab:hover { color: var(--text-main); }
.dungeon-tab.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}
.tab-level {
  font-size: 0.6rem;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
  letter-spacing: 0.05em;
}
.dungeon-tab.active .tab-level { color: var(--gold-dim); }
.dungeon-tab.dungeon-complete { color: var(--gold-light); }
.dungeon-tab.dungeon-complete::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  font-size: 0.58rem;
  line-height: 13px;
  text-align: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1a1208;
  box-shadow: 0 0 6px rgba(240,208,128,0.8);
}

/* ── MAIN LAYOUT ── */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ── DUNGEON HEADER ── */
.dungeon-header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.dungeon-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.dungeon-header.all-complete {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(240,208,128,0.25), 0 0 28px rgba(200,168,75,0.25);
  animation: dungeon-complete-glow 3s ease-in-out infinite;
}
.dungeon-header.all-complete::before {
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
}
@keyframes dungeon-complete-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(240,208,128,0.25), 0 0 28px rgba(200,168,75,0.22); }
  50%      { box-shadow: 0 0 0 1px rgba(240,208,128,0.4), 0 0 42px rgba(200,168,75,0.4); }
}
.dungeon-complete-ribbon {
  display: none;
  position: absolute;
  top: 14px;
  right: -2px;
  align-items: center;
  gap: 8px;
  padding: 6px 18px 6px 14px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1a1208;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 3px 0 0 3px;
  box-shadow: 0 2px 14px rgba(240,208,128,0.5), -2px 2px 8px rgba(0,0,0,0.35);
  z-index: 1;
}
.dungeon-header.all-complete .dungeon-complete-ribbon {
  display: flex;
  animation: ribbon-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ribbon-icon { font-size: 0.95rem; }
@keyframes ribbon-pop {
  0%   { transform: scale(0.4) translateX(20px); opacity: 0; }
  100% { transform: scale(1) translateX(0); opacity: 1; }
}
@media (max-width: 560px) {
  .dungeon-complete-ribbon {
    position: static;
    width: 100%;
    justify-content: center;
    border-radius: 3px;
    margin-bottom: 4px;
  }
}
.dungeon-icon {
  font-size: 2.5rem;
  opacity: 0.8;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.dungeon-loading-screen {
  height: 130px;
  width: auto;
  border-radius: 3px;
  border: 1px solid var(--border-gold);
  object-fit: cover;
  display: block;
  opacity: 0.9;
  cursor: pointer;
  transition: opacity 0.2s, filter 0.2s;
}
.dungeon-loading-screen:hover {
  opacity: 1;
  filter: brightness(1.12) drop-shadow(0 0 10px rgba(200,168,75,0.35));
}
.dungeon-info { flex: 1; }
.dungeon-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(200,168,75,0.3);
  margin-bottom: 4px;
}
.dungeon-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.dungeon-meta-item {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dungeon-meta-item strong { color: var(--gold); margin-left: 4px; }
.dungeon-progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 140px;
}
.progress-label {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}
.progress-bar-wrap {
  width: 140px;
  height: 8px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

@media (max-width: 560px) {
  .dungeon-progress {
    width: 100%;
    align-items: flex-start;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }
  .progress-bar-wrap {
    width: 100%;
  }
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 2px;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}
.progress-bar-fill.complete {
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}
.progress-bar-fill.complete::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  animation: progress-shine 2.2s ease-in-out infinite;
}
@keyframes progress-shine {
  0%   { left: -60%; }
  100% { left: 120%; }
}
.progress-fraction {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  color: var(--gold);
}
.progress-fraction.complete {
  color: var(--gold-light);
  text-shadow: 0 0 8px rgba(240,208,128,0.6);
}

/* ── QUEST GRID / LIST ── */
#quest-container.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
#quest-container.list-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── QUEST CARD ── */
.quest-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.25s;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}
.quest-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(200,168,75,0.03) 0%, transparent 60%);
  pointer-events: none;
}
.quest-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.5), 0 0 12px rgba(200,168,75,0.08);
}
.quest-card.completed {
  opacity: 0.55;
}
.quest-card.completed .quest-name {
  text-decoration: line-through;
  text-decoration-color: var(--gold-dim);
}

.quest-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
}
.quest-checkbox {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-gold);
  border-radius: 2px;
  background: var(--bg-dark);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--gold);
  transition: all 0.2s;
}
.quest-card.completed .quest-checkbox {
  background: var(--gold-dim);
  border-color: var(--gold);
}
.quest-name {
  font-family: 'Cinzel', serif;
  font-size: 0.88rem;
  color: var(--gold-light);
  letter-spacing: 0.02em;
  flex: 1;
  line-height: 1.3;
}
.quest-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  flex: none;
}
.quest-level-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  color: var(--text-dim);
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.quest-card-body {
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.quest-row {
  display: flex;
  gap: 8px;
  font-size: 0.83rem;
  line-height: 1.4;
}
.quest-label {
  color: var(--text-dim);
  font-size: 0.72rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.06em;
  min-width: 52px;
  flex-shrink: 0;
  text-transform: uppercase;
  padding-top: 1px;
}
.quest-value { color: var(--text-main); flex: 1; }
.quest-value.location { color: #8ab4d4; font-style: italic; }
.quest-value.xp { color: #84d4a0; font-weight: 600; }
.quest-value.reward { color: var(--green-uncommon); font-weight: 600; }
.quest-value.items { color: #c8a0d4; }
.quest-value.note { color: var(--text-dim); font-style: italic; font-size: 0.8rem; }

.quest-card-footer {
  padding: 6px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.footer-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.xp-pill {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  color: #84d4a0;
  background: rgba(132,212,160,0.08);
  border: 1px solid rgba(132,212,160,0.2);
  border-radius: 2px;
  padding: 2px 8px;
  letter-spacing: 0.05em;
}
.money-pill {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  background: rgba(255,209,0,0.07);
  border: 1px solid rgba(255,209,0,0.22);
  border-radius: 2px;
  padding: 2px 8px;
  letter-spacing: 0.04em;
}
.money-gold   { color: #ffd100; }
.money-silver { color: #c0c0c0; }
.money-copper { color: #cd7f32; }
.coin-icon {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}
.coin-icon.coin-gold {
  background: radial-gradient(circle at 35% 30%, #fff5a0 0%, #ffd100 45%, #a87800 100%);
  box-shadow: 0 0 3px 1px rgba(255,209,0,0.25), inset 0 1px 0 rgba(255,255,200,0.4);
}
.coin-icon.coin-silver {
  background: radial-gradient(circle at 35% 30%, #f4f4f4 0%, #c0c0c0 45%, #707070 100%);
  box-shadow: 0 0 3px 1px rgba(192,192,192,0.2), inset 0 1px 0 rgba(255,255,255,0.4);
}
.coin-icon.coin-copper {
  background: radial-gradient(circle at 35% 30%, #f5c890 0%, #cd7f32 45%, #7a3b10 100%);
  box-shadow: 0 0 3px 1px rgba(205,127,50,0.2), inset 0 1px 0 rgba(255,220,160,0.4);
}
.reward-pill {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  color: var(--green-uncommon);
  background: rgba(30,255,0,0.06);
  border: 1px solid rgba(30,255,0,0.2);
  border-radius: 2px;
  padding: 2px 8px;
}
.complete-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-gold);
  border-radius: 2px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
}
.complete-btn:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  background: rgba(200,168,75,0.08);
}
.quest-card.completed .complete-btn {
  border-color: var(--gold-dim);
  color: var(--gold-dim);
}

/* ── QUEST NAME AS WOWHEAD LINK ── */
.quest-name-link {
  color: inherit;
  text-decoration: none;
}
.quest-name-link:hover {
  color: var(--gold-light);
  text-decoration: underline;
  text-decoration-color: var(--gold-dim);
}

/* ── NPC NAME AS WOWHEAD LINK ── */
.npc-link {
  color: inherit;
  text-decoration: none;
}
.npc-link:hover {
  color: var(--gold-light);
  text-decoration: underline;
  text-decoration-color: var(--gold-dim);
}

/* ── OBJECT LINKS ── */
.object-link {
  color: var(--gold-light);
  text-decoration: none;
}
.object-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--gold-dim);
}

/* ── ITEM QUALITY LINKS ── */
.item-link {
  text-decoration: none;
  transition: opacity 0.15s;
  font-weight: 600;
}
.item-link:hover { opacity: 0.8; text-decoration: underline; }
.item-link.q0 { color: #9d9d9d; }
.item-link.q1 { color: var(--white-common); }
.item-link.q2 { color: var(--green-uncommon); }
.item-link.q3 { color: var(--blue-rare); }
.item-link.q4 { color: var(--purple-epic); }
.item-link.q5 { color: var(--orange-legendary); }

/* ── CHAIN BADGE ── */
.chain-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: var(--gold-dim);
  background: rgba(200,168,75,0.08);
  border: 1px solid var(--border-gold);
  border-radius: 2px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── FACTION FILTER BUTTONS ── */
.faction-group {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.faction-btn {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  color: var(--text-dim);
}
.faction-btn:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}
.faction-btn.active {
  background: linear-gradient(135deg, #2a2010, #1a1508);
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 8px rgba(200,168,75,0.15);
}

.faction-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 2px;
}

/* Alliance */
.faction-btn-alliance {
  color: #5a8aaa;
  border-color: rgba(68, 136, 204, 0.3);
  background: rgba(68, 136, 204, 0.05);
}
.faction-btn-alliance:hover {
  color: #7ab4e0;
  border-color: #4488cc;
  background: rgba(68, 136, 204, 0.12);
  box-shadow: 0 0 8px rgba(68, 136, 204, 0.2);
}
.faction-btn-alliance.active {
  color: #a8d0f0;
  border-color: #4488cc;
  background: linear-gradient(135deg, rgba(68,136,204,0.22), rgba(40,80,140,0.14));
  box-shadow: 0 0 12px rgba(68,136,204,0.3), inset 0 0 12px rgba(68,136,204,0.06);
}

/* Horde */
.faction-btn-horde {
  color: #aa5a5a;
  border-color: rgba(204, 68, 68, 0.3);
  background: rgba(204, 68, 68, 0.05);
}
.faction-btn-horde:hover {
  color: #e07a7a;
  border-color: #cc4444;
  background: rgba(204, 68, 68, 0.12);
  box-shadow: 0 0 8px rgba(204, 68, 68, 0.2);
}
.faction-btn-horde.active {
  color: #f0a8a8;
  border-color: #cc4444;
  background: linear-gradient(135deg, rgba(204,68,68,0.22), rgba(140,40,40,0.14));
  box-shadow: 0 0 12px rgba(204,68,68,0.3), inset 0 0 12px rgba(204,68,68,0.06);
}
.dungeon-tab.faction-dimmed {
  opacity: 0.35;
}

/* ── FACTION BADGE ── */
.faction-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  border-radius: 2px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.faction-badge.faction-horde  { color: #cc4444; border: 1px solid rgba(204,68,68,0.35); background: rgba(204,68,68,0.08); }
.faction-badge.faction-alliance { color: #4488cc; border: 1px solid rgba(68,136,204,0.35); background: rgba(68,136,204,0.08); }

/* ── CLASS BADGE ── */
.class-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  border-radius: 2px;
  padding: 1px 6px 1px 3px;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid;
}
.class-icon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  display: block;
  flex-shrink: 0;
}
.class-badge.class-warrior  { color: #C79C6E; border-color: rgba(199,156,110,0.4); background: rgba(199,156,110,0.08); }
.class-badge.class-paladin  { color: #F58CBA; border-color: rgba(245,140,186,0.4); background: rgba(245,140,186,0.08); }
.class-badge.class-hunter   { color: #ABD473; border-color: rgba(171,212,115,0.4); background: rgba(171,212,115,0.08); }
.class-badge.class-rogue    { color: #FFF569; border-color: rgba(255,245,105,0.4); background: rgba(255,245,105,0.08); }
.class-badge.class-priest   { color: #e8e8e8; border-color: rgba(232,232,232,0.4); background: rgba(232,232,232,0.08); }
.class-badge.class-shaman   { color: #0096FF; border-color: rgba(0,150,255,0.4);   background: rgba(0,150,255,0.08); }
.class-badge.class-mage     { color: #69CCF0; border-color: rgba(105,204,240,0.4); background: rgba(105,204,240,0.08); }
.class-badge.class-warlock  { color: #9482C9; border-color: rgba(148,130,201,0.4); background: rgba(148,130,201,0.08); }
.class-badge.class-druid    { color: #FF7D0A; border-color: rgba(255,125,10,0.4);  background: rgba(255,125,10,0.08); }

/* ── QUEST CHAIN GROUP WRAPPER ── */
.quest-chain-group {
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  padding: 10px;
  position: relative;
  background: rgba(200,168,75,0.02);
}
.grid-view .quest-chain-group {
  grid-column: 1 / -1;       /* chain spans full grid width */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 10px;
}
.list-view .quest-chain-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chain-group-label {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dim);
  padding: 0 4px 8px 4px;
  grid-column: 1 / -1;
}

/* ── CHAINED QUEST CARD STYLE ── */
.quest-card.chain-quest {
  border-left: 3px solid var(--gold-dim);
  border-radius: 4px;
}
.quest-card.chain-quest:first-of-type,
.quest-chain-group .quest-card:nth-child(2) {  /* 2nd child because label is first */
  border-left-color: var(--gold);
}


/* ── GUIDES / MAP BOXES IN DUNGEON HEADER ── */
#dungeonHeaderGuides {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  margin-top: 14px;
}
.guides-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(180,150,60,0.35);
  border-radius: 3px;
  background: rgba(180,150,60,0.04);
  padding: 6px 10px;
}
.guides-box-label {
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.7;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}
.guides-box-wowhead-logo {
  width: 12px;
  height: 12px;
  object-fit: contain;
  vertical-align: middle;
}
.guides-box-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  justify-content: center;
  align-items: center;
}
.guides-box-link {
  font-family: 'Cinzel', serif;
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  color: #4da6ff;
  text-decoration: none;
  border: 1px solid rgba(77,166,255,0.3);
  border-radius: 2px;
  padding: 2px 8px;
  transition: all 0.2s;
  white-space: nowrap;
}
.guides-box-link:hover {
  color: #7fbfff;
  border-color: #4da6ff;
  background: rgba(77,166,255,0.08);
}
button.guides-box-link {
  background: transparent;
  cursor: pointer;
}
.map-instance-box {
  border-color: rgba(200,168,75,0.55);
  background: rgba(200,168,75,0.06);
  box-shadow: 0 0 8px rgba(200,168,75,0.08);
}
.map-instance-box .guides-box-label {
  opacity: 0.9;
}
.map-instance-box .guides-box-link {
  color: var(--gold);
  border-color: rgba(200,168,75,0.45);
  font-size: 0.72rem;
  padding: 3px 14px;
}
.map-instance-box .guides-box-link:hover {
  color: var(--gold-light);
  border-color: var(--gold);
  background: rgba(200,168,75,0.12);
}
.guides-box-youtube-logo {
  width: 13px;
  height: 13px;
  object-fit: contain;
  vertical-align: middle;
}
.video-guides-box {
  border-color: rgba(255,0,0,0.35);
  background: rgba(255,0,0,0.04);
}
.video-guides-box .guides-box-link {
  color: #ff4d4d;
  border-color: rgba(255,77,77,0.3);
}
.video-guides-box .guides-box-link:hover {
  color: #ff7a7a;
  border-color: #ff4d4d;
  background: rgba(255,77,77,0.08);
}

/* ── WOWHEAD LINK BUTTON ── */
.wowhead-link-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: #4da6ff;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
  cursor: pointer;
}
.wowhead-link-btn:hover {
  border-color: #4da6ff;
  color: #7fbfff;
  background: rgba(77,166,255,0.08);
}

/* LIST VIEW OVERRIDES */
.list-view .quest-card {
  border-radius: 3px;
}
.list-view .quest-card:hover { transform: none; }
.list-view .quest-card-header {
  padding: 10px 14px;
  border-bottom: none;
  flex-wrap: wrap;
}
.list-view .quest-card-body { display: none; }
.list-view .quest-card.expanded .quest-card-body { display: flex; }
.list-view .quest-card-footer { display: none; }
.list-view .quest-card.expanded .quest-card-footer { display: flex; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  grid-column: 1/-1;
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state-text {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

/* ── STATS BAR ── */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.stat-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-num {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.2rem;
  color: var(--gold-light);
  line-height: 1;
}
.stat-num--money {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  display: flex;
  gap: 4px;
  align-items: baseline;
}
.stat-label {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.stat-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

/* ── TOOLTIP ── */
.tooltip-wrap { position: relative; display: inline-block; }
.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a0f;
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--text-main);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,0.7);
}
.tooltip-wrap:hover .tooltip { opacity: 1; }

/* ── NO QUESTS ── */
.no-dungeon-quests {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-dim);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-panel);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border-gold); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ── PREREQUISITE / POSTCHAIN BREADCRUMB (inside chain group) ── */
.chain-prechain,
.chain-postchain {
  grid-column: 1 / -1;
  padding: 4px 4px 10px;
}
.list-view .chain-prechain,
.list-view .chain-postchain {
  padding: 4px 14px 8px;
}
.chain-postchain {
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.chain-context-label {
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 5px;
}
.prechain-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.8;
}
.prechain-step {
  color: #a08060;
  text-decoration: none;
  font-size: 0.78rem;
  padding: 1px 7px;
  border: 1px solid rgba(160,128,96,0.3);
  border-radius: 2px;
  white-space: nowrap;
  transition: all 0.15s;
}
.prechain-step:hover {
  color: var(--gold-light);
  border-color: var(--gold-dim);
  background: rgba(200,168,75,0.07);
}
/* Dungeon-quest prereq: was picked up by the guide page but is actually a prereq */
.prechain-step.is-dungeon {
  color: var(--gold-dim);
  border-color: rgba(200,168,75,0.4);
  background: rgba(200,168,75,0.05);
}
.prechain-step.is-dungeon::before {
  content: '⚔ ';
  font-size: 0.65rem;
  opacity: 0.7;
}
.prechain-step.is-dungeon:hover {
  color: var(--gold-light);
  border-color: var(--gold);
  background: rgba(200,168,75,0.1);
}
/* Post-chain steps have a slightly different hue */
.prechain-step.postchain-step {
  color: #809ab0;
  border-color: rgba(128,154,176,0.3);
}
.prechain-step.postchain-step:hover {
  color: #aac4d8;
  border-color: rgba(128,154,176,0.6);
  background: rgba(128,154,176,0.06);
}
.prechain-arrow {
  color: var(--text-dim);
  font-size: 0.8rem;
  opacity: 0.45;
  flex-shrink: 0;
}

/* ── ANIMATIONS ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.quest-card {
  animation: fadeInUp 0.3s ease both;
}
.quest-card:nth-child(1) { animation-delay: 0.02s; }
.quest-card:nth-child(2) { animation-delay: 0.04s; }
.quest-card:nth-child(3) { animation-delay: 0.06s; }
.quest-card:nth-child(4) { animation-delay: 0.08s; }
.quest-card:nth-child(5) { animation-delay: 0.1s; }
.quest-card:nth-child(6) { animation-delay: 0.12s; }

/* ── SIDE PANEL ── */
.layout { display: flex; gap: 24px; }
.sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sidebar-section {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.sidebar-title {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dim);
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(200,168,75,0.04);
}
.sidebar-item {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item:hover { background: rgba(200,168,75,0.05); }
.sidebar-item.active { background: rgba(200,168,75,0.08); color: var(--gold-light); }
.sidebar-item-count {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  color: var(--text-dim);
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 5px;
}
.content { flex: 1; min-width: 0; }

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .sidebar-section {
    flex: 1;
    min-width: 220px;
  }
  .sidebar-title {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .sidebar-title::after {
    content: '▼';
    font-size: 0.55rem;
    opacity: 0.5;
    transition: transform 0.2s;
  }
  .sidebar-section.expanded .sidebar-title::after {
    transform: rotate(180deg);
  }
  .sidebar-body {
    display: none;
    overflow-y: auto;
    max-height: 240px;
  }
  .sidebar-section.expanded .sidebar-body {
    display: block;
  }
}
@media (max-width: 768px) {
  .dungeon-tabs {
    justify-content: flex-start;
  }
}
@media (max-width: 600px) {
  #quest-container.grid-view {
    grid-template-columns: 1fr;
  }
  .filter-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .filter-btn {
    text-align: center;
  }
  .faction-group {
    width: 100%;
  }
  .faction-btn {
    flex: 1;
    text-align: center;
  }
  .controls-right {
    width: 100%;
    justify-content: center;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .dungeon-icon {
    width: 100%;
    justify-content: center;
  }
  #dungeonHeaderGuides {
    flex-direction: column;
  }
  #dungeonHeaderGuides .guides-box {
    width: 100%;
  }
  .map-footer-divider {
    display: none;
  }
  .map-pin-footer-hint {
    display: none;
  }
  .map-coord-input-group {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ── CLICKABLE LOCATION LINKS ── */
.location-link {
  cursor: pointer;
  border-bottom: 1px dashed rgba(138, 180, 212, 0.5);
  transition: color 0.15s, border-color 0.15s;
}
.location-link:hover {
  color: #b8d8f0;
  border-bottom-color: #8ab4d4;
}
/* When used inside dungeon-meta strong */
.dungeon-meta-item strong .location-link {
  color: var(--gold);
  border-bottom-color: rgba(200, 168, 75, 0.4);
}
.dungeon-meta-item strong .location-link:hover {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

/* ── MAP MODAL ── */
.map-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.map-modal.open {
  display: flex;
}
.map-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
}
.map-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1080px, 95vw);
  height: min(780px, 92vh);
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(200, 168, 75, 0.1) inset;
  overflow: hidden;
}
.map-modal-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  pointer-events: none;
}
.map-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-gold);
  background: rgba(200, 168, 75, 0.04);
  flex-shrink: 0;
}
.map-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  flex: 1;
}
.map-wowhead-link {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: #4da6ff;
  text-decoration: none;
  border: 1px solid rgba(77, 166, 255, 0.3);
  border-radius: 2px;
  padding: 2px 8px;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.map-wowhead-logo {
  width: 13px;
  height: 13px;
  object-fit: contain;
}
.map-wowhead-link:hover {
  color: #7fbfff;
  border-color: #4da6ff;
  background: rgba(77, 166, 255, 0.06);
}
.video-youtube-link {
  color: #ff4d4d;
  border-color: rgba(255, 77, 77, 0.3);
}
.video-youtube-link:hover {
  color: #ff7a7a;
  border-color: #ff4d4d;
  background: rgba(255, 77, 77, 0.08);
}
.map-modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.map-modal-close:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}
.map-level-nav {
  display: flex;
  gap: 4px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  overflow-x: auto;
  flex-wrap: wrap;
}
.map-level-nav:empty { display: none; }
.map-level-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: all 0.15s;
}
.map-level-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}
.map-level-btn.active {
  background: rgba(200, 168, 75, 0.15);
  border-color: var(--gold-dim);
  color: var(--gold-light);
}
.map-modal-viewport {
  flex: 1;
  overflow: hidden;
  cursor: grab;
  position: relative;
  background: #0a0805;
}
.map-modal-viewport:active { cursor: grabbing; }
#mapModalImg {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: 0 0;
  will-change: transform;
  transition: opacity 0.2s;
}
#mapModalImg.loading { opacity: 0; }
.map-no-image {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.map-no-image.visible { display: flex; }
.map-modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  row-gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.map-zoom-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.map-zoom-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: rgba(200, 168, 75, 0.07);
}
@keyframes mapFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}
.map-modal.open .map-modal-panel {
  animation: mapFadeIn 0.18s ease both;
}
.map-zoom-btn--fit { font-size: 0.85rem; }

/* ── ENCOUNTER LIST ── */
.encounter-section {
  padding: 5px 14px 3px;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dim);
  border-bottom: 1px solid var(--border);
  background: rgba(200,168,75,0.03);
}
.encounter-section:not(:first-child) {
  border-top: 1px solid var(--border);
}
.encounter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-main);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.encounter-item:last-child { border-bottom: none; }
.encounter-item:hover {
  background: rgba(200,168,75,0.05);
  color: var(--gold-light);
}
.encounter-skull {
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.encounter-item:hover .encounter-skull {
  opacity: 1;
  color: var(--gold-dim);
}
.encounter-name { flex: 1; }
.encounter-rare .encounter-name { color: var(--text-dim); }
.encounter-rare .encounter-skull { color: var(--gold-dim); }
.encounter-rare-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: var(--gold-dim);
  border: 1px solid rgba(200,168,75,0.3);
  border-radius: 2px;
  padding: 1px 5px;
  flex-shrink: 0;
  text-transform: uppercase;
}
.encounter-item:not(.has-model) {
  cursor: default;
  color: var(--text-dim);
}
.encounter-item:not(.has-model):hover {
  background: transparent;
  color: var(--text-dim);
}
.encounter-item:not(.has-model) .encounter-skull {
  color: var(--border-gold);
}
.encounter-event-wrapper {
  border-bottom: 1px solid var(--border);
}
.encounter-event-wrapper:last-child {
  border-bottom: none;
}
.encounter-event-header {
  cursor: default;
  border-bottom: none;
}
.encounter-event-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: #7dbcff;
  border: 1px solid rgba(125,188,255,0.3);
  border-radius: 2px;
  padding: 1px 5px;
  flex-shrink: 0;
  text-transform: uppercase;
}
.encounter-event-bosses {
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}
.encounter-event-boss {
  padding-left: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.encounter-event-boss:last-child {
  border-bottom: none;
}
.encounter-empty {
  padding: 10px 14px;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ── LOADING SCREEN LIGHTBOX ── */
.ls-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.ls-lightbox.open {
  display: flex;
}
.ls-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.ls-lightbox-img {
  position: relative;
  z-index: 1;
  max-width: min(960px, 92vw);
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border-gold);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(200, 168, 75, 0.12) inset;
  pointer-events: none;
}
@keyframes lsFadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
.ls-lightbox.open .ls-lightbox-img {
  animation: lsFadeIn 0.2s ease both;
}

/* ── ENCOUNTER MODEL MODAL ── */
.encounter-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.encounter-modal.open {
  display: flex;
}
.encounter-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(5px);
}
.encounter-modal-panel {
  position: relative;
  z-index: 1;
  width: min(860px, 92vw);
  max-height: 90vh;
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(200, 168, 75, 0.1) inset;
  overflow-x: hidden;
  overflow-y: auto;
}
.encounter-modal-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  pointer-events: none;
}
.encounter-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-gold);
  background: rgba(200, 168, 75, 0.04);
  flex-shrink: 0;
}
.encounter-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  flex: 1;
}
.encounter-modal-body {
  position: relative;
  background: #06060a;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.encounter-modal-img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.encounter-modal-img.hidden { display: none; }
.encounter-no-image {
  display: none;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.encounter-no-image.visible { display: flex; }
.encounter-modal.open .encounter-modal-panel {
  animation: mapFadeIn 0.18s ease both;
}

/* ── ENCOUNTER MODEL CREDIT ── */
.encounter-model-credit {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 18px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.68rem;
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--text-dim);
  text-align: center;
}
.encounter-model-credit-logo {
  width: 12px;
  height: 12px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.8;
}
.encounter-model-credit a {
  color: var(--gold-dim);
  text-decoration: none;
  font-style: normal;
}
.encounter-model-credit a:hover {
  color: var(--gold-light);
  text-decoration: underline;
}

/* ── ENCOUNTER LOOT ── */
.encounter-loot {
  display: none;
  flex-shrink: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: 16px 20px 18px;
  border-top: 1px solid var(--border-gold);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(200, 168, 75, 0.07) 0%, transparent 60%),
    #0d0b07;
  box-shadow: 0 -12px 24px -12px rgba(0, 0, 0, 0.6) inset;
}
.encounter-loot.visible {
  display: block;
}
.encounter-loot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-family: 'Cinzel', serif;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
  text-shadow: 0 0 10px rgba(200, 168, 75, 0.4);
}
.encounter-loot-header::before,
.encounter-loot-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
.encounter-loot-header::before { background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.encounter-loot-header::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.encounter-loot-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}
.encounter-loot-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 10px 0 4px;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-style: italic;
}

/* ── LOOT CARD ── */
.encounter-loot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.3));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.encounter-loot-row:hover {
  transform: translateY(-2px);
}
.encounter-loot-row .item-link {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}
.encounter-loot-row .item-link .iconmedium {
  display: inline-block;
  vertical-align: middle;
}
.encounter-loot-row .iconmedium {
  outline-style: solid;
  outline-offset: 1px;
  border-radius: 2px;
  margin-right: 8px !important;
}
.encounter-loot-chance {
  flex-shrink: 0;
  font-family: 'Cinzel', serif;
  font-size: 0.64rem;
  letter-spacing: 0.03em;
  color: var(--gold-light);
  background: rgba(200, 168, 75, 0.1);
  border: 1px solid rgba(200, 168, 75, 0.35);
  border-radius: 10px;
  padding: 2px 9px;
}

/* Quality-tinted card frames */
.encounter-loot-row.q0 { border-color: rgba(157,157,157,0.3); background: linear-gradient(135deg, rgba(157,157,157,0.07), rgba(0,0,0,0.3)); }
.encounter-loot-row.q0:hover { border-color: rgba(157,157,157,0.65); box-shadow: 0 0 14px rgba(157,157,157,0.2), 0 4px 12px rgba(0,0,0,0.55); }

.encounter-loot-row.q1 { border-color: rgba(255,255,255,0.22); background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(0,0,0,0.3)); }
.encounter-loot-row.q1:hover { border-color: rgba(255,255,255,0.55); box-shadow: 0 0 14px rgba(255,255,255,0.15), 0 4px 12px rgba(0,0,0,0.55); }

.encounter-loot-row.q2 { border-color: rgba(30,255,0,0.3); background: linear-gradient(135deg, rgba(30,255,0,0.09), rgba(0,0,0,0.3)); }
.encounter-loot-row.q2:hover { border-color: rgba(30,255,0,0.7); box-shadow: 0 0 16px rgba(30,255,0,0.3), 0 4px 12px rgba(0,0,0,0.55); }

.encounter-loot-row.q3 { border-color: rgba(74,144,217,0.4); background: linear-gradient(135deg, rgba(74,144,217,0.1), rgba(0,0,0,0.3)); }
.encounter-loot-row.q3:hover { border-color: rgba(74,144,217,0.8); box-shadow: 0 0 16px rgba(74,144,217,0.35), 0 4px 12px rgba(0,0,0,0.55); }

.encounter-loot-row.q4 { border-color: rgba(163,53,238,0.45); background: linear-gradient(135deg, rgba(163,53,238,0.12), rgba(0,0,0,0.3)); }
.encounter-loot-row.q4:hover { border-color: rgba(163,53,238,0.85); box-shadow: 0 0 18px rgba(163,53,238,0.4), 0 4px 12px rgba(0,0,0,0.55); }

.encounter-loot-row.q5 { border-color: rgba(255,128,0,0.5); background: linear-gradient(135deg, rgba(255,128,0,0.14), rgba(0,0,0,0.3)); }
.encounter-loot-row.q5:hover { border-color: rgba(255,128,0,0.9); box-shadow: 0 0 20px rgba(255,128,0,0.45), 0 4px 12px rgba(0,0,0,0.55); }

/* ── VIDEO GUIDE MODAL ── */
.video-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.video-modal.open {
  display: flex;
}
.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(5px);
}
.video-modal-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 92vw);
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(200, 168, 75, 0.1) inset;
  overflow: hidden;
}
.video-modal-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  pointer-events: none;
}
.video-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-gold);
  background: rgba(200, 168, 75, 0.04);
  flex-shrink: 0;
}
.video-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  flex: 1;
}
.video-modal-body {
  position: relative;
  background: #06060a;
  width: 100%;
  aspect-ratio: 16 / 9;
}
.video-modal-body iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-modal.open .video-modal-panel {
  animation: mapFadeIn 0.18s ease both;
}
.video-modal-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--border-gold);
  background: rgba(200, 168, 75, 0.04);
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  text-align: center;
  flex-shrink: 0;
}
.video-modal-credit-link {
  color: #ff4d4d;
  text-decoration: none;
}
.video-modal-credit-link:hover {
  color: #ff7a7a;
  text-decoration: underline;
}
/* Make encounter names with models look clickable */
.encounter-item.has-model {
  cursor: pointer;
}
.encounter-item.has-model .encounter-name {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(200, 168, 75, 0.35);
}

/* ── MAP MODAL MAIN (viewport + pin list side by side) ── */
.map-modal-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── MAP PIN LIST PANEL ── */
.map-pin-list-panel {
  width: 210px;
  flex-shrink: 0;
  border-left: 1px solid var(--border-gold);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.22s ease;
}
.map-pin-list-panel.collapsed {
  width: 28px;
}
.map-pin-list-panel.collapsed:hover {
  background: rgba(200, 168, 75, 0.04);
}
.map-pin-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 6px 8px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(200, 168, 75, 0.04);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
}
.map-pin-list-panel.collapsed .map-pin-list-header {
  padding: 8px 0;
  justify-content: center;
  border-bottom-color: transparent;
}
.map-pin-list-header-title {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
  flex: 1;
  overflow: hidden;
  transition: opacity 0.15s;
}
.map-pin-list-panel.collapsed .map-pin-list-header-title {
  opacity: 0;
  width: 0;
  flex: none;
}
.map-pin-list-toggle {
  background: none;
  border: 1px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  line-height: 1;
}
.map-pin-list-toggle:hover {
  color: var(--gold);
  border-color: var(--border-gold);
  background: rgba(200, 168, 75, 0.08);
}
.map-pin-list-panel.collapsed .map-pin-list {
  opacity: 0;
  pointer-events: none;
}
.map-pin-list {
  transition: opacity 0.15s;
}
.map-pin-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-gold) transparent;
}
.map-pin-list-section-label {
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 6px 12px 4px;
  opacity: 0.7;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.pin-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.15s;
}
.pin-list-item:last-child { border-bottom: none; }
.pin-list-item:hover { background: rgba(200, 168, 75, 0.06); }
.pin-list-item.is-active { background: rgba(200, 168, 75, 0.1); }
.pin-list-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex-shrink: 0;
  position: relative;
}
.pin-list-icon::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}
.pin-list-icon--system,
.pin-list-icon--boss,
.pin-list-icon--quest { border-radius: 2px; transform: rotate(45deg); }
.pin-list-icon--system,
.pin-list-icon--boss,
.pin-list-icon--quest { }
.pin-list-icon--system::after,
.pin-list-icon--boss::after,
.pin-list-icon--quest::after { border-radius: 1px; }

.pin-list-icon--user   { color: #4ec9d4; }
.pin-list-icon--system { color: var(--gold); }
.pin-list-icon--boss   { color: #e06060; }
.pin-list-icon--quest  { color: #ffd100; }
.pin-list-icon--npc    { color: #7dbcff; }
.pin-list-icon--point  { color: #a0d0a0; }

.pin-list-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pin-list-name {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  color: var(--text-main);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.pin-list-coords {
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.pin-list-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.65rem;
  padding: 2px 4px;
  border-radius: 2px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.pin-list-item:hover .pin-list-delete { opacity: 1; }
.pin-list-delete:hover {
  color: #e08080;
  background: rgba(204,68,68,0.12);
}
.pin-list-empty {
  padding: 18px 12px;
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.7;
  opacity: 0.7;
}

/* pulse animation when navigating to a pin */
@keyframes pinPulse {
  0%   { box-shadow: 0 0 0 0 currentColor; transform: scale(1.4); }
  70%  { box-shadow: 0 0 0 8px transparent; transform: scale(1); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.map-pin.pin-highlight .map-pin-marker {
  animation: pinPulse 0.6s ease-out;
}

/* ── MAP COORDINATE DISPLAY ── */
.map-coords-display {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 15;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(200, 168, 75, 0.45);
  border-radius: 3px;
  padding: 3px 9px;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  color: var(--gold);
  pointer-events: none;
  user-select: none;
}
.map-coords-display::before {
  content: '📍 ';
  font-size: 0.6rem;
  opacity: 0.7;
}

/* ── MAP PIN CONTAINER ── */
.map-pin-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

/* ── MAP PIN ── */
.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  z-index: 10;
}
/* Expanded hit area */
.map-pin::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
}

.map-pin-marker {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: rgba(0, 0, 0, 0.65);
  box-shadow: 0 0 6px currentColor, 0 2px 4px rgba(0,0,0,0.8);
  transition: box-shadow 0.15s, transform 0.15s;
}
.map-pin-marker::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.map-pin:hover .map-pin-marker {
  transform: scale(1.25);
  box-shadow: 0 0 10px currentColor, 0 2px 6px rgba(0,0,0,0.9);
}

.map-pin-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 6, 3, 0.95);
  border: 1px solid var(--border-gold);
  border-radius: 3px;
  padding: 6px 10px;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  color: var(--text-main);
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.8);
}
.map-pin-tooltip strong {
  color: var(--gold-light);
  display: block;
  margin-bottom: 2px;
}
.map-pin-tooltip span {
  color: var(--text-dim);
  font-size: 0.62rem;
}
.map-pin:hover .map-pin-tooltip,
.map-pin.label-active .map-pin-tooltip {
  display: block;
}

/* Pin type colours */
.map-pin--user    { color: #4ec9d4; }
.map-pin--system  { color: var(--gold); }
.map-pin--boss    { color: #e06060; }
.map-pin--quest   { color: #ffd100; }
.map-pin--npc     { color: #7dbcff; }
.map-pin--point   { color: #a0d0a0; }

/* System pin: diamond icon instead of circle */
.map-pin--system .map-pin-marker,
.map-pin--boss .map-pin-marker,
.map-pin--quest .map-pin-marker {
  border-radius: 2px;
  transform: rotate(45deg);
}
.map-pin--system .map-pin-marker::after,
.map-pin--boss .map-pin-marker::after,
.map-pin--quest .map-pin-marker::after {
  border-radius: 1px;
  inset: 2px;
}
.map-pin:hover .map-pin-marker { transform: scale(1.25); }
.map-pin--system:hover .map-pin-marker,
.map-pin--boss:hover .map-pin-marker,
.map-pin--quest:hover .map-pin-marker {
  transform: rotate(45deg) scale(1.25);
}

/* ── PIN EDIT DIALOG ── */
.map-pin-edit-dialog {
  position: absolute;
  z-index: 20;
  width: 210px;
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.85), 0 0 0 1px rgba(200,168,75,0.08) inset;
  overflow: hidden;
  pointer-events: auto;
}
.map-pin-edit-dialog::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.map-pin-edit-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(200,168,75,0.04);
}
.map-pin-edit-title {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--gold-dim);
  text-transform: uppercase;
  flex: 1;
}
.map-pin-edit-coords {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--gold);
}
.map-pin-edit-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}
.map-pin-edit-close:hover { color: var(--gold); }
.map-pin-edit-input {
  display: block;
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-card);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-bright);
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  outline: none;
}
.map-pin-edit-input::placeholder { color: var(--text-dim); }
.map-pin-edit-input:focus {
  background: rgba(200,168,75,0.03);
}
.map-pin-edit-footer {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
}
.map-pin-edit-btn {
  flex: 1;
  padding: 4px 0;
  border-radius: 2px;
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.15s;
}
.map-pin-save-btn {
  background: rgba(200,168,75,0.1);
  border: 1px solid var(--border-gold);
  color: var(--gold);
}
.map-pin-save-btn:hover {
  background: rgba(200,168,75,0.2);
  border-color: var(--gold);
  color: var(--gold-light);
}
.map-pin-delete-btn {
  background: rgba(180,40,40,0.08);
  border: 1px solid rgba(180,40,40,0.35);
  color: #c06060;
}
.map-pin-delete-btn:hover {
  background: rgba(180,40,40,0.18);
  border-color: #cc4444;
  color: #e08080;
}

/* ── MAP FOOTER HINT ── */
.map-pin-footer-hint {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  opacity: 0.6;
  white-space: nowrap;
  align-self: center;
}

/* ── MAP FOOTER COORDINATE INPUT ── */
.map-footer-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 0 10px;
  flex-shrink: 0;
}
.map-coord-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.map-coord-input-label {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  flex-shrink: 0;
}
.map-coord-input {
  width: 62px;
  padding: 4px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-bright);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  outline: none;
  text-align: center;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}
.map-coord-input::-webkit-inner-spin-button,
.map-coord-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.map-coord-input:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 6px rgba(200,168,75,0.15);
}
.map-coord-input.input-error {
  border-color: #cc4444;
  box-shadow: 0 0 6px rgba(204,68,68,0.2);
}
.map-coord-place-btn {
  padding: 4px 12px;
  background: rgba(200,168,75,0.08);
  border: 1px solid var(--border-gold);
  border-radius: 3px;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.map-coord-place-btn:hover {
  background: rgba(200,168,75,0.18);
  border-color: var(--gold);
  color: var(--gold-light);
}
