:root {
  --bg: #0b0e1a;
  --bg2: #12162b;
  --card: #171c35;
  --card2: #1d2344;
  --line: #2b3157;
  --text: #e8ecff;
  --muted: #9aa3cf;
  --accent: #7ee8fa;
  --accent2: #b48cff;
  --gold: #ffd166;
  --green: #7ee787;
  --red: #ff6b81;
  --radius: 14px;
}

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

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #1b2150 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(300px 300px at 85% 20%, rgba(126,232,250,.10), transparent 70%),
    radial-gradient(400px 400px at 10% 80%, rgba(180,140,255,.10), transparent 70%);
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 24px;
  background: rgba(11,14,26,.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  font-size: 34px;
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(126,232,250,.6));
}
.logo h1 {
  font-size: 20px;
  letter-spacing: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo p { font-size: 12px; color: var(--muted); letter-spacing: 1px; }

.main-nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  transition: .2s;
}
.nav-btn:hover { color: var(--text); background: var(--card); }
.nav-btn.active {
  color: #04121a;
  background: linear-gradient(90deg, var(--accent), #9ef4ff);
  font-weight: 600;
  box-shadow: 0 0 14px rgba(126,232,250,.35);
}

.search-box { position: relative; }
.search-box input {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 999px;
  width: 230px;
  outline: none;
  transition: .2s;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(126,232,250,.15); }

#search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  display: none;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
  z-index: 30;
}
#search-results.open { display: block; animation: fade .2s ease; }
.sres {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: .15s;
}
.sres:hover { background: var(--card); }
.sres strong { font-size: 14px; font-weight: 600; }
.sres span {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--accent2);
  flex-shrink: 0;
}
.sres.muted { color: var(--muted); cursor: default; font-size: 13.5px; }

#app { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 26px 20px 60px; }

.view { display: none; animation: fade .35s ease; }
.view.active { display: block; }
.hint { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.results-info { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.tag {
  display: inline-block;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--accent2);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  margin: 4px 6px 0 0;
}
.tag::before { content: "#"; opacity: .55; margin-right: 2px; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, var(--card) 0%, var(--card2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
  margin-bottom: 34px;
  overflow: hidden;
}
.hero h2 { font-size: 32px; margin-bottom: 12px; }
.hero p { color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.hero-stats { display: flex; gap: 20px; margin-bottom: 20px; }
.stat {
  background: var(--bg2);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
}
.stat span { display: block; font-size: 24px; font-weight: 700; color: var(--accent); }

.cta {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #0a0d1c;
  border: none;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  transition: .2s;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(126,232,250,.3); }

.hero-art { display: flex; justify-content: center; }

.mask {
  position: relative;
  width: 170px;
  height: 170px;
  background: radial-gradient(circle at 50% 40%, #f4f7ff, #c3cbf0 70%);
  border-radius: 50% 50% 46% 46%;
  box-shadow: 0 0 50px rgba(180,140,255,.45), inset 0 -14px 26px rgba(0,0,0,.18);
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.horn {
  position: absolute;
  top: -34px;
  width: 34px;
  height: 74px;
  background: linear-gradient(#f4f7ff, #aeb8e6);
  border-radius: 50% 50% 20% 20%;
}
.horn.left { left: 18px; transform: rotate(-22deg); }
.horn.right { right: 18px; transform: rotate(22deg); }
.eye {
  position: absolute;
  top: 74px;
  width: 34px;
  height: 46px;
  background: #0a0d1c;
  border-radius: 50%;
  animation: blink 5s infinite;
}
.eye.left { left: 40px; }
.eye.right { right: 40px; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }

.chip {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: .2s;
  margin-bottom: 12px;
}
.chip:hover { color: var(--text); border-color: var(--accent2); }
.chip.active {
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  color: #0a0d1c;
  font-weight: 600;
  border-color: transparent;
}

.back-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Карта */
.map-frame {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 1040px;
}
.map-frame img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  background: #06070f;
  transition: filter .2s;
}
.map-frame img:hover { filter: brightness(1.08); }
.map-frame.zoomed img { cursor: zoom-out; }
.map-frame.zoomed {
  position: fixed;
  inset: 16px;
  max-width: none;
  z-index: 100;
  box-shadow: 0 0 0 200vmax rgba(4,6,14,.9), 0 30px 80px rgba(0,0,0,.7);
  display: flex;
  flex-direction: column;
}
.map-frame.zoomed img {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.map-frame .map-tip {
  display: none;
  margin: 0;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.map-frame.zoomed .map-tip { display: block; }

/* Колесо мыши: масштаб внутри похожей на каркас области */
.map-window {
  position: relative;
  height: clamp(320px, 62vh, 720px);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background:
    radial-gradient(600px 300px at 30% 20%, rgba(126,232,250,.07), transparent 70%),
    var(--bg2);
  border-top: 1px solid var(--line);
}
.map-window.dragging { cursor: grabbing; }
.map-window img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  max-height: none;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  transition: filter .2s;
}
.map-window img:hover { filter: brightness(1.06); }
.map-scale {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  display: flex;
  gap: 6px;
}
.map-scale button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(23,28,53,.92);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}
.map-scale button:hover { border-color: var(--accent); color: var(--accent); }
.map-hint {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 5;
  background: rgba(23,28,53,.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.map-caption {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 780px;
}
.article .art-cat {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #0a0d1c;
  background: var(--accent2);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.article h2 { font-size: 30px; margin-bottom: 6px; }
.article h3 {
  font-size: 19px;
  color: var(--accent);
  margin: 26px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.article p { font-size: 15px; line-height: 1.7; color: var(--text); margin-bottom: 12px; }
.article ul, .article ol { margin: 0 0 14px 22px; }
.article li { font-size: 14.5px; line-height: 1.65; margin-bottom: 7px; }
.article hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.article .tags { margin-top: 8px; color: var(--muted); font-size: 13.5px; }
.tag {
  display: inline-block;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--accent2);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  margin-right: 6px;
}

.section-title {
  font-size: 20px;
  margin-bottom: 18px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  width: 6px;
  height: 22px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
}
.section-title small { font-size: 13px; color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: .2s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(126,232,250,.08), transparent 50%);
  opacity: 0;
  transition: .25s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 10px 26px rgba(0,0,0,.4); }
.card:hover::before { opacity: 1; }
.card .cat {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #0a0d1c;
  background: var(--accent2);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.card h4 { font-size: 17px; margin-bottom: 8px; }
.card p { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.card .meta { margin-top: 12px; font-size: 12px; color: var(--accent); }

/* Boss cards */
.boss-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.boss-card {
  background: linear-gradient(160deg, var(--card), #241a3a);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: .2s;
}
.boss-card:hover { transform: translateY(-4px); border-color: var(--red); }
.boss-card .boss-icon { font-size: 30px; margin-bottom: 8px; }
.boss-card h4 { margin-bottom: 6px; }
.boss-card .loc { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.difficulty { display: flex; gap: 4px; }
.difficulty i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--line);
  display: inline-block;
}
.difficulty i.on { background: var(--red); box-shadow: 0 0 6px rgba(255,107,129,.7); }

.boss-detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 18px;
}
.boss-detail h4 { font-size: 22px; margin-bottom: 10px; }
.boss-detail .tip {
  background: var(--bg2);
  border-left: 4px solid var(--gold);
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 14px;
  font-size: 14.5px;
  color: var(--text);
}

/* Charms */
.charm-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: .2s;
  position: relative;
}
.charm-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.charm-card h4 { color: var(--gold); margin-bottom: 8px; padding-right: 60px; }
.charm-card p { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.charm-card .price {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg2);
  color: var(--gold);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.charm-card .notches { margin-top: 10px; font-size: 12px; color: var(--accent2); }

/* Article */
.article { background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
  line-height: 1.75;
}
.article h2 { font-size: 30px; margin-bottom: 6px; }
.article h3 { color: var(--accent); margin: 26px 0 12px; font-size: 21px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.article p { color: var(--muted); margin-bottom: 14px; }
.article ul, .article ol { margin: 0 0 16px 22px; color: var(--muted); }
.article li { margin-bottom: 7px; }
.article strong { color: var(--text); }
.article hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
.article em { color: var(--accent2); }

/* Progress */
.progress-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.progress-bar { height: 16px; background: var(--bg2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 999px;
  transition: width .5s ease;
  box-shadow: 0 0 12px rgba(126,231,135,.5);
}
.progress-label { margin-top: 8px; color: var(--muted); font-size: 14px; }
.checklist { list-style: none; margin-top: 20px; }
.checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: .2s;
  font-size: 14.5px;
}
.checklist li:hover { border-color: var(--accent); }
.checklist li .box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-radius: 6px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: transparent;
  transition: .2s;
}
.checklist li.done { color: var(--muted); text-decoration: line-through; }
.checklist li.done .box { background: var(--green); border-color: var(--green); color: #0a0d1c; }

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 22px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 15px;
}

@media (max-width: 780px) {
  .main-nav { order: 3; width: 100%; justify-content: center; }
  #search-results { width: 100%; left: 0; right: auto; }
  .hero-art { display: none; }
  .article h2 { font-size: 24px; }
  .hero { grid-template-columns: 1fr; padding: 24px; }
  .search-box input { width: 100%; }
  .topbar { padding: 12px 14px; }
  .article { padding: 22px; }
}
