/* Городской лабиринт — светлая коричнево-золотая тема */

:root {
  --bg: #faf5ea;
  --bg-2: #f3ead8;
  --card: #fffdf7;
  --ink: #3b2a18;
  --ink-2: #624a2e;
  --muted: #8d7551;
  --line: #e7d8bc;
  --primary: #c9962f;
  --primary-dark: #8a5a1e;
  --primary-soft: #fbf1dc;
  --accent: #a9741f;
  --ok: #4d7c3a;
  --ok-soft: #edf3e6;
  --err: #a8452f;
  --err-soft: #f8eae5;
  --shadow: 0 10px 28px rgba(90, 60, 20, .12);
  --shadow-sm: 0 3px 12px rgba(90, 60, 20, .08);
}

body {
  color: var(--ink);
  background-color: #faf5ea;
  background-image:
    radial-gradient(1000px 480px at 10% -10%, rgba(201, 150, 47, .18), transparent 60%),
    radial-gradient(900px 460px at 94% 2%, rgba(138, 90, 30, .10), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cg fill='none' stroke='%238a5a1e' stroke-opacity='0.05' stroke-width='2'%3E%3Cpath d='M8 8h164v164H8z'/%3E%3Cpath d='M30 30h120v120H30z'/%3E%3Cpath d='M52 52h76v76H52z'/%3E%3Cpath d='M74 74h32v32H74z'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed, fixed, fixed;
}

a { color: var(--primary-dark); }
a:hover { color: #5f3c11; }

/* шапка */
.topbar {
  background: rgba(255, 252, 245, .94);
  border-bottom: 1px solid var(--line);
}
.topbar a, .topbar .brand__title { color: var(--ink); }
.brand__tagline, .topbar .muted { color: var(--muted); }

/* hero */
.hero {
  background:
    radial-gradient(700px 300px at 88% -20%, rgba(201, 150, 47, .30), transparent 60%),
    linear-gradient(135deg, #fffdf8 0%, #fbf3e2 55%, #f6e7c8 100%);
  border: 1px solid #e3cfa4;
  color: var(--ink);
  box-shadow: 0 16px 36px rgba(90, 60, 20, .12);
}
.hero h1 {
  background: linear-gradient(92deg, #7a4a12 0%, #c9962f 50%, #8a5a1e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: -.5px;
  font-size: clamp(27px, 4.2vw, 40px);
  line-height: 1.1;
}
.hero p { color: var(--ink-2); }
.hero::after { opacity: .22; }

/* карточки */
.card {
  background: #fffdf8;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.card__title { color: #4a3319; }
.card__text { color: var(--ink-2); }
.card__meta { color: var(--muted); }
.card__cover { background: linear-gradient(135deg, #fbf3e2, #f2e3c3); }

/* панели, формы */
.panel, .notice, .empty {
  background: #fffdf8;
  color: var(--ink);
  border-color: var(--line);
}
.panel h2, .panel h3 { color: #4a3319; }
.field input, .field select, .field textarea {
  background: #fffdf8;
  color: var(--ink);
  border: 1px solid var(--line);
}
.field input:focus, .field select:focus { border-color: var(--primary); outline: none; }
.hint, .small, .muted { color: var(--muted); }

/* кнопки */
.btn {
  background: linear-gradient(180deg, #e0b45a 0%, #c9962f 100%);
  color: #2e1f10;
  border: 0;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(201, 150, 47, .30);
}
.btn:hover { filter: brightness(1.04); color: #2e1f10; }
.btn--ghost {
  background: #fffdf7;
  color: var(--primary-dark);
  border: 1px solid #dcc08a;
  box-shadow: none;
}
.btn--ghost:hover { background: #fbf1dc; color: #5f3c11; }
.btn--danger { background: linear-gradient(180deg, #c26a52, #a8452f); color: #fff; }

/* бейджи */
.badge--active { background: #c9962f; color: #2e1f10; }
.badge--upcoming { background: rgba(255, 253, 247, .95); color: #7a4a12; }
.badge--finished { background: rgba(74, 51, 25, .78); color: #fff6e2; }
.badge--draft { background: #f1e7d3; color: #7a6242; }
.card__city {
  background: rgba(255, 250, 240, .95);
  border: 1px solid #dcc08a;
  color: #7a4a12;
}
/* город — справа сверху, статус — справа снизу */
.card__corner {
  position: absolute; right: 12px; top: 12px; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.card__corner .card__city { position: static; right: auto; left: auto; top: auto; }
.card__cover .card__badge {
  position: absolute; right: 12px; bottom: 12px; left: auto; top: auto; z-index: 2;
}

/* заголовок квеста */
.quest-hero {
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  min-height: 240px;
  max-height: 620px;
  background: #f3ead8;
  box-shadow: var(--shadow-sm);
}
/* без белого засвета: фото чистое, текст читается за счёт тёмной подложки внизу */
.quest-hero::after { display: none; }
.quest-hero__overlay {
  padding: 22px 24px;
  color: #fff;
  background: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.quest-title { color: #4a3319; }
.quest-hero .meta-row {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  gap: 16px;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, .9),
    0 2px 7px rgba(0, 0, 0, .8),
    0 4px 16px rgba(0, 0, 0, .6);
}
.quest-hero .badge { position: static; }
.quest-hero__city {
  background: #fbf1dc;
  border: 1px solid #dcc08a;
  color: #7a4a12;
}

/* списки, таблицы */
.steps li { background: #fffdf8; border-color: var(--line); }
.table th { background: #f6ecd8; color: #4a3319; }
.table td { border-color: var(--line); }

/* ── плашки городов ─────────────────────────────────────────────── */
.citybar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fffdf8 0%, #fbf3e2 100%);
  border: 1px solid #e3cfa4;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.citybar__label {
  width: 100%;
  font-size: 12px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #8a5a1e;
  margin-bottom: 2px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid #dcc08a;
  background: #fffaf0;
  color: #624a2e;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
}
.chip:hover { border-color: var(--primary); color: #5f3c11; }
.chip.is-active {
  background: linear-gradient(180deg, #a9741f, #8a5a1e);
  border-color: transparent;
  color: #ffe9bd;
  box-shadow: 0 6px 14px rgba(138, 90, 30, .30);
}
.chip__count {
  font-size: 12px;
  opacity: .9;
  background: rgba(90, 60, 20, .08);
  border-radius: 999px;
  padding: 1px 7px;
}
.chip.is-active .chip__count { background: rgba(255, 233, 189, .22); }
.card.is-hidden { display: none; }

/* ── выбор города: панель как на gorodquest ─────────────────────── */
.citybar {
  display: block;
  padding: 12px 14px 14px;
  background: #fdf8ee;
  border: 1px solid #e3d3b2;
  border-radius: 16px;
}
.citybar__head { margin: 0 0 8px; }
.citybar__label {
  font-size: 11.5px;
  letter-spacing: 1.5px;
  color: #8a5a1e;
  font-weight: 600;
}
.citybar__chips { display: block; }
.citypick { position: relative; display: inline-block; }
#cityPickBtn {
  padding: 10px 16px;
  font-size: 15px;
  gap: 8px;
  border: 0;
  background: linear-gradient(180deg, #b07c22, #8a5a1e);
  color: #fff6e4;
  box-shadow: 0 6px 16px rgba(138, 90, 30, .28);
}
#cityPickBtn:hover { color: #fff; }
#cityPickBtn .chip__count {
  background: rgba(255, 255, 255, .28);
  color: #fff8ea;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}
.citypick__caret { font-size: 11px; opacity: .9; margin-left: 2px; }

.citypick__panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 50;
  width: min(330px, calc(100vw - 76px));
  padding: 12px 8px 8px;
  background: #fff;
  border: 1px solid #e7dcc6;
  border-radius: 18px;
  box-shadow: 0 20px 44px rgba(90, 60, 20, .18), 0 2px 6px rgba(90, 60, 20, .06);
}
.citybar__search { position: relative; margin: 0 5px 8px; }
.citybar__search input {
  width: 100%;
  height: 44px;
  padding: 0 34px 0 40px;
  border: 1px solid #ecdfc6;
  border-radius: 999px;
  background: #fffdf8;
  font-size: 15px;
  color: #4a3319;
  outline: none;
}
.citybar__search input::placeholder { color: #a8987e; }
.citybar__search input:focus { border-color: #b07c22; background: #fff; }
.citybar__icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: .5;
  pointer-events: none;
}
.citybar__clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #f3ead8;
  color: #8a5a1e;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.citypick__list {
  max-height: 292px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #cbb896 transparent;
}
.citypick__list::-webkit-scrollbar { width: 6px; }
.citypick__list::-webkit-scrollbar-track { background: transparent; }
.citypick__list::-webkit-scrollbar-thumb { background: #cbb896; border-radius: 999px; }
.citypick__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-size: 15.5px;
  color: #4a3319;
  text-align: left;
  cursor: pointer;
}
.citypick__item:hover { background: #fbf3e2; }
.citypick__item.is-active { background: #f6ecd8; }
.citypick__item:first-child > span:first-child { font-weight: 700; }
.citypick__item .chip__count {
  background: #f4e9d4;
  color: #8a5a1e;
  font-weight: 600;
  min-width: 24px;
  padding: 2px 7px;
  text-align: center;
  border-radius: 999px;
}
.citypick__item.is-active .chip__count { background: #e8d5ad; }
.citypick__empty { padding: 12px 14px; font-size: 14px; color: #8a7a63; }

/* ── список заданий: точка + кнопка «Ответить» ─────────────────── */
.task__openbtn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  letter-spacing: .6px;
  font-weight: 700;
  font-size: 14.5px;
}
.task__body { margin-top: 12px; }
.task__body[hidden] { display: none; }
.task__body .riddle { margin-top: 0; }

.finishbar {
  margin: 26px 0 8px;
  padding: 18px 16px 16px;
  border: 1px solid #e3d3b2;
  border-radius: 16px;
  background: #fdf8ee;
  text-align: center;
}
.finishbar form { margin: 0; }
.finishbar .btn--wide { max-width: 100%; }
.finishbar__note {
  margin: 12px auto 0;
  max-width: 46ch;
  font-size: 13px;
  line-height: 1.5;
  color: #7d6647;
}

/* ответ на точке: свёрнутая карточка с итогом */
.task__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin: 2px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7fbfe;
  font-size: 14.5px;
}
.task--ok .task__summary { background: #eef9f2; }
.task--err .task__summary { background: #fdf0ef; }
.task__summary-answer strong { color: var(--ink); }
.task__openbtn--ghost {
  background: transparent;
  border: 1px solid #d6c3a0;
  color: #8a5a1e;
  box-shadow: none;
  font-weight: 700;
  letter-spacing: .6px;
}
.task__openbtn--ghost:hover { background: #fbf3e2; color: #6d451a; }

/* ── текст задания: плотнее и без вылетов за рамку ──────────────── */
.riddle {
  line-height: 1.45;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.riddle > p { margin: 0 0 7px; }
.riddle > p:last-child { margin-bottom: 0; }
.riddle__fact,
.riddle__q,
.riddle__photo {
  border-radius: 12px;
  padding: 10px 14px;
  margin: 8px 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.riddle__fact { font-size: 15px; }
.riddle__q { font-size: 16.5px; }
.riddle__photo { font-size: 15px; }

/* ── мобильная шапка: без дублей и без вылета кнопки ──────────────── */
.topnav { min-width: 0; flex-wrap: nowrap; }
.topnav a { white-space: nowrap; }
/* логотип уже ведёт на главную — пункт «Путеводители» в меню не дублируем */
.topnav__home { display: none; }
@media (max-width: 719px) {
  .logo__text { display: none; }
  .topbar__in { padding: 10px 14px; gap: 8px; }
  .topnav { gap: 12px; font-size: 13.5px; }
  .topnav__cta { padding: 7px 14px; }
}
@media (max-width: 380px) {
  .topnav { gap: 9px; font-size: 13px; }
  .topnav__cta { padding: 6px 11px; }
}

/* карта не должна налезать на шапку при прокрутке */
.map-panel { position: relative; z-index: 1; }
.quest-map { position: relative; z-index: 0; isolation: isolate; }

/* рейтинг на телефоне: убираем лишнюю колонку, таблица влезает по ширине */
@media (max-width:640px){
  .results--rating th, .results--rating td{ padding:9px 5px; font-size:12.5px; }
  .results--rating th{ font-size:10px; letter-spacing:.02em; white-space:nowrap; }
  .results--rating th[style]{ width:auto !important; }
  .results--rating th:nth-child(4), .results--rating td:nth-child(4){ display:none; }
  .results--rating td b{ font-size:13px; }
  .results--rating .small{ display:block; font-size:11px; line-height:1.25; }
}
