/* =========================================
   RPG QUESTS PAGE v3 — полная переработка
   ========================================= */

/* ── Страница ─────────────────────────────── */
.rq-page .rq-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* Кнопка «Войти» на RPG-страницах — приглушённая */
.rq-page .site-nav-portal,
.rw-page .site-nav-portal {
  background: rgba(180,130,90,.08) !important;
  color: rgba(240,217,184,.85) !important;
  border: 1px solid rgba(180,130,90,.28) !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}
.rq-page .site-nav-portal:hover,
.rw-page .site-nav-portal:hover {
  background: rgba(180,130,90,.14) !important;
  border-color: rgba(180,130,90,.42) !important;
  color: rgba(255,255,255,.92) !important;
}

/* ── Hero ─────────────────────────────────── */
.rq-hero {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  margin-bottom: 1.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(180,130,90,.14) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 110%, rgba(130,110,160,.1) 0%, transparent 50%);
  border-radius: 18px;
  border: 1px solid rgba(180,130,90,.18);
  position: relative;
  overflow: hidden;
}
.rq-hero::before {
  content:'';
  position:absolute; top:0; left:25%; right:25%; height:1px;
  background: linear-gradient(90deg, transparent, rgba(180,130,90,.7), transparent);
}

.rq-kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(180,130,90,.9); margin-bottom: .6rem;
  font-family: 'Cinzel', serif;
}
.rq-kicker-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(180,130,90,.9);
  box-shadow: 0 0 10px rgba(180,130,90,.6);
  animation: rq-pulse 2s ease-in-out infinite;
}
.rq-title {
  font-size: clamp(1.6rem,5vw,2.5rem);
  margin-bottom: .5rem;
  background: linear-gradient(135deg, #f0dfc0 0%, #c4926a 45%, #9a80c0 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(180,130,90,.35));
  font-family: 'Cinzel', serif;
}
.rq-lead {
  max-width: 560px; margin: 0 auto .75rem;
  font-size: 1rem; line-height: 1.6;
  color: rgba(255,255,255,.68);
}
.rq-lead code {
  background: rgba(180,130,90,.18); padding: .15rem .45rem;
  border-radius: 5px; color: rgba(180,130,90,.95);
  border: 1px solid rgba(180,130,90,.22); font-size: .9em;
}

/* ── Stat row ─────────────────────────────── */
.rq-stat-row {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .5rem 1.2rem; margin: .75rem 0 1rem;
}
.rq-stat {
  display: flex; flex-direction: column; align-items: center;
  padding: .4rem .8rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  min-width: 62px;
}
.rq-stat-num {
  font-size: 1.3rem; font-weight: 700;
  color: rgba(232,213,185,.95);
  font-family: 'Cinzel', serif;
}
.rq-stat-label { font-size: .7rem; color: rgba(255,255,255,.5); }

/* ── Ranks ────────────────────────────────── */
.rq-ranks-track {
  display: flex; flex-wrap: wrap; justify-content: center;
  align-items: center; gap: .4rem .6rem; margin: .75rem 0 1rem;
}
.rq-rank-arrow { color: rgba(255,255,255,.3); font-size: .8rem; }
.rq-rank {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .6rem; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12); font-size: .8rem;
}
.rank-seeker   { color: #fbbf24; border-color: rgba(251,191,36,.25); }
.rank-hunter   { color: #f87171; border-color: rgba(248,113,113,.25); }
.rank-alchemist{ color: #e879f9; border-color: rgba(232,121,249,.25); }
.rank-qm       { color: #facc15; border-color: rgba(250,204,21,.25); }
.rank-scout    { color: #67e8f9; border-color: rgba(103,232,249,.25); }
.rank-default  { color: rgba(255,255,255,.65); }

/* ── Filters ──────────────────────────────── */
.rq-filters {
  display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center;
  margin: 1rem 0 .5rem;
}
.rq-filter {
  background: rgba(16,12,8,.55);
  border: 1px solid rgba(180,130,90,.22);
  color: rgba(255,255,255,.58);
  padding: .32rem .75rem; border-radius: 999px;
  font-size: .76rem; font-family: 'Cinzel', serif;
  letter-spacing: .03em; cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.rq-filter:hover {
  border-color: rgba(180,130,90,.38);
  color: rgba(240,217,184,.85);
  background: rgba(180,130,90,.06);
}
.rq-filter--active {
  border-color: rgba(180,130,90,.45);
  color: rgba(240,217,184,.92);
  background: rgba(180,130,90,.1);
}

/* ── Tips ─────────────────────────────────── */
.rq-tips {
  padding: 1rem 1.25rem;
  background: rgba(10,8,25,.55);
  border: 1px solid rgba(180,130,90,.18);
  border-radius: 12px; margin: .5rem 0;
}
.rq-tips-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap: .6rem .75rem;
}
.rq-tip-item {
  display: flex; align-items: flex-start; gap: .6rem;
  font-size: .84rem; color: rgba(255,255,255,.65);
  padding: .5rem .75rem;
  background: rgba(255,255,255,.03); border-radius: 8px;
}
.rq-tip-icon { font-size: 1.3rem; flex-shrink: 0; }
.rq-tip-item strong { color: rgba(232,213,185,.9); }
.rq-tip-item code {
  background: rgba(180,130,90,.15); padding: .1rem .35rem;
  border-radius: 4px; color: rgba(180,130,90,.9);
  font-size: .85em;
}

/* ── Grid ─────────────────────────────────── */
.rq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  align-items: start;
}

/* ── Branch card ──────────────────────────── */
.rq-branch {
  padding: 1.1rem;
  background: rgba(15,12,30,.65);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  position: relative;
  animation: rq-in .45s ease both;
  animation-delay: calc(var(--i,0) * 70ms);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  border-top: 2px solid var(--npc-color, rgba(180,130,90,.5));
}
.rq-branch:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  border-color: rgba(255,255,255,.14);
}
.rq-branch--soon {
  opacity: .7;
}

/* Branch header */
.rq-branch-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: .75rem; padding-bottom: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.rq-branch-npc { display: flex; align-items: center; gap: .6rem; }
.rq-branch-emoji {
  font-size: 1.8rem; line-height: 1;
  filter: drop-shadow(0 0 6px var(--npc-color, rgba(180,130,90,.4)));
}
.rq-branch-label {
  font-size: 1.05rem; margin: 0 0 .1rem;
  color: rgba(232,213,185,.95);
  font-family: 'Cinzel', serif;
}
.rq-branch-npc-name {
  font-size: .78rem; color: rgba(255,255,255,.4); margin: 0;
}
.rq-branch-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: .25rem;
}
.rq-branch-count {
  font-size: .75rem; color: var(--npc-color, rgba(180,130,90,.8));
  background: rgba(255,255,255,.04);
  padding: .15rem .5rem; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.07);
}
.rq-branch-stats {
  font-size: .7rem; color: rgba(255,255,255,.35);
}
.rq-soon-badge {
  font-size: .68rem; padding: .15rem .45rem;
  background: rgba(255,200,50,.12); color: #fcd34d;
  border: 1px solid rgba(255,200,50,.2); border-radius: 5px;
}
.rq-branch-desc {
  font-size: .83rem; color: rgba(255,255,255,.45);
  margin: 0 0 .75rem; line-height: 1.5;
}

/* ── Quest list ───────────────────────────── */
.rq-quest-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0;
  position: relative;
}

/* Chain line */
.rq-quest-list::before {
  content: '';
  position: absolute; left: 12px; top: 22px; bottom: 22px;
  width: 1px; background: rgba(255,255,255,.08);
}

/* ── Quest item ───────────────────────────── */
.rq-quest {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .55rem .6rem .55rem 0;
  position: relative;
  transition: background .18s ease;
  border-radius: 8px;
}
.rq-quest:hover {
  background: rgba(255,255,255,.03);
}
.rq-quest--last .rq-quest-list::before {
  display: none;
}

/* Step number */
.rq-quest-num {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: .72rem; font-weight: 700;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.5);
  position: relative; z-index: 1;
}
.rq-quest-body { flex: 1; min-width: 0; }
.rq-quest-head {
  display: flex; align-items: baseline; gap: .4rem;
  margin-bottom: .2rem;
}
.rq-quest-type-icon { font-size: .9rem; flex-shrink: 0; }
.rq-quest-title {
  font-size: .88rem; font-weight: 500;
  color: rgba(255,255,255,.88);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rq-quest-obj {
  font-size: .76rem; color: rgba(255,255,255,.42); margin: 0 0 .2rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rq-quest-reward {
  font-size: .74rem; color: rgba(180,160,80,.7); margin: 0 0 .25rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rq-quest-tags {
  display: flex; flex-wrap: wrap; gap: .25rem;
}

/* Tags */
.rq-tag {
  font-size: .68rem; padding: .1rem .4rem;
  border-radius: 4px; background: rgba(255,255,255,.06);
  white-space: nowrap;
}
.rq-tag--daily   { color: #86efac; background: rgba(134,239,172,.08); }
.rq-tag--weekly  { color: #93c5fd; background: rgba(147,197,253,.08); }
.rq-tag--unlock  { color: #fcd34d; background: rgba(252,211,77,.08); }
.rq-tag--party   { color: #a78bfa; background: rgba(167,139,250,.08); }

/* ── Live bar ─────────────────────────────── */
.rq-live-bar {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: .35rem .65rem; margin: .5rem 0 .75rem;
  font-size: .78rem; color: rgba(255,255,255,.5);
}
.rq-live-item { display: inline-flex; align-items: center; gap: .35rem; }
.rq-live-item strong { color: rgba(232,213,185,.95); font-weight: 600; }
.rq-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #55ff55; box-shadow: 0 0 8px rgba(85,255,85,.6);
  animation: rq-pulse 2s ease-in-out infinite;
}
.rq-live-sep { opacity: .35; }

/* ── RPG system panel ─────────────────────── */
.rq-rpg-system {
  text-align: left; margin: 1rem 0;
  padding: 1.1rem 1.25rem;
  background: rgba(154,128,192,.06);
  border: 1px solid rgba(154,128,192,.2);
  border-radius: 14px;
}
.rq-rpg-system-title {
  font-family: 'Cinzel', serif; font-size: 1rem;
  color: rgba(180,130,90,.95); margin: 0 0 .45rem;
  text-align: center;
}
.rq-rpg-system-lead {
  font-size: .86rem; line-height: 1.55; color: rgba(255,255,255,.58);
  margin: 0 0 .85rem; text-align: center; max-width: 640px; margin-left: auto; margin-right: auto;
}
.rq-rpg-system-lead code {
  background: rgba(180,130,90,.15); padding: .1rem .35rem;
  border-radius: 4px; color: rgba(180,130,90,.9); font-size: .9em;
}
.rq-rpg-system-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .65rem;
}
.rq-rpg-panel {
  background: rgba(10,8,20,.45); border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px; padding: .75rem .85rem;
}
.rq-rpg-panel h3 {
  font-family: 'Cinzel', serif; font-size: .78rem;
  color: rgba(232,213,185,.85); margin: 0 0 .5rem;
  letter-spacing: .04em;
}
.rq-rpg-panel--warn { border-color: rgba(255,100,100,.15); }
.rq-rpg-xp-list, .rq-rpg-death {
  list-style: none; margin: 0; padding: 0;
  font-size: .78rem; color: rgba(255,255,255,.55);
}
.rq-rpg-xp-list li, .rq-rpg-death li {
  display: flex; justify-content: space-between; gap: .5rem;
  padding: .22rem 0; border-bottom: 1px solid rgba(255,255,255,.05);
}
.rq-rpg-xp-list li:last-child, .rq-rpg-death li:last-child { border-bottom: none; }
.rq-rpg-xp-list strong { color: rgba(134,239,172,.85); font-weight: 600; }
.rq-rpg-death li span:last-child { color: rgba(248,113,113,.85); }
.rq-rpg-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .4rem; }
.rq-rpg-chip {
  font-size: .72rem; padding: .15rem .45rem; border-radius: 6px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.65);
}
.rq-rpg-chip--gold {
  color: rgba(180,130,90,.9); border-color: rgba(180,130,90,.25);
  background: rgba(180,130,90,.08);
}
.rq-rpg-chip--gear {
  color: rgba(147,197,253,.85); border-color: rgba(147,197,253,.25);
  background: rgba(147,197,253,.06);
}
.rq-rpg-note {
  font-size: .72rem; color: rgba(255,255,255,.4); margin: 0; line-height: 1.45;
}
.rq-rpg-note code {
  background: rgba(180,130,90,.12); padding: .05rem .3rem;
  border-radius: 3px; color: rgba(180,130,90,.85); font-size: .95em;
}

.rq-branch--highlight {
  box-shadow: 0 0 0 2px rgba(180,130,90,.45), 0 12px 40px rgba(0,0,0,.5) !important;
  animation: rq-in .45s ease both, rq-highlight 2.5s ease;
}
@keyframes rq-highlight {
  0%, 40% { border-top-color: rgba(255,220,150,.95); }
  100% { border-top-color: var(--npc-color, rgba(180,130,90,.5)); }
}

/* ── Error ────────────────────────────────── */
.rq-error { text-align:center; color: rgba(255,100,100,.7); padding: 3rem; }

/* ── Animations ───────────────────────────── */
@keyframes rq-in {
  from { opacity:0; transform: translateY(14px); }
  to   { opacity:1; transform: translateY(0); }
}
@keyframes rq-pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.55; transform:scale(1.15); }
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 700px) {
  .rq-page .rq-main { padding: 0 .75rem 2rem; }
  .rq-hero { padding: 1.5rem .75rem 1.25rem; }
  .rq-grid { grid-template-columns: 1fr; }
  .rq-stat-row { gap: .4rem .8rem; }
  .rq-stat { padding: .35rem .6rem; min-width: 55px; }
  .rq-tips-grid { grid-template-columns: 1fr 1fr; }
  .rq-quest-title { font-size: .84rem; }
}
@media (max-width: 450px) {
  .rq-tips-grid { grid-template-columns: 1fr; }
}
