:root {
  --bg: #0b0c11;
  --bg2: #111219;
  --surface: #181a22;
  --surface2: #1f2230;
  --text: #f3f4f8;
  --hint: #888ea3;
  --line: rgba(255, 255, 255, 0.07);
  --accent1: #7c5cff;
  --accent2: #a35cff;
  --accent: linear-gradient(135deg, #7c5cff, #a35cff);
  --radius: 22px;

  /* Цвета категорий */
  --c-food: #ff7a4d;
  --c-beauty: #ff5ca0;
  --c-fun: #9d5cff;
  --c-sport: #2fd07a;
  --c-shops: #3ba1ff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(120% 60% at 50% -10%, #1a1530 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  padding-bottom: 150px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: var(--hint); font-size: 13.5px; line-height: 1.45; margin: 4px 0; }
.block { width: 100%; }

svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic16 { width: 17px; height: 17px; flex: 0 0 auto; }
.ic12 { width: 13px; height: 13px; flex: 0 0 auto; opacity: 0.7; }

/* ---------- Topbar ---------- */
.topbar { text-align: center; padding: 14px 16px 8px; }
.topbar h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.subtitle { font-size: 12.5px; color: var(--hint); margin-top: 2px; }

/* ---------- Search row ---------- */
.searchrow { display: flex; gap: 10px; padding: 8px 16px 14px; }
.loc-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--text);
  border: none; border-radius: 15px; padding: 0 13px;
  font-size: 14.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border-radius: 15px; padding: 0 14px;
  color: var(--hint);
}
.search input {
  flex: 1; border: none; background: transparent; color: var(--text);
  font-size: 15px; padding: 13px 0; outline: none; font-family: inherit;
}
.search input::placeholder { color: var(--hint); }

/* ---------- Hero carousel ---------- */
.hero-track {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 2px 16px 0; scrollbar-width: none;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-card {
  position: relative; flex: 0 0 100%; scroll-snap-align: center;
  aspect-ratio: 16 / 11; border-radius: var(--radius); overflow: hidden;
  background: #20203a center/cover no-repeat;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px; color: #fff;
}
.hero-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(8,8,14,0.92) 0%, rgba(8,8,14,0.55) 45%, rgba(8,8,14,0.1) 100%);
}
.hero-card > * { position: relative; z-index: 1; }
.hero-deal { margin: 0 0 8px; font-size: 23px; font-weight: 800; line-height: 1.12; max-width: 80%; }
.hero-row { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.hero-row.addr { color: rgba(255,255,255,0.72); font-weight: 500; font-size: 13px; margin-top: 2px; }
.hero-badge {
  position: absolute; top: 14px; left: 14px; z-index: 1;
  padding: 6px 12px; border-radius: 13px; font-size: 12.5px; font-weight: 700;
  background: var(--accent); color: #fff;
}
.hero-pill {
  align-self: flex-start; margin-top: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 13px; font-size: 13.5px; font-weight: 700;
  background: rgba(124,92,255,0.28); color: #cdbcff;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.heart {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.35); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.heart svg { width: 20px; height: 20px; }
.heart.on svg { fill: #ff4d6d; stroke: #ff4d6d; }
.heart:active { transform: scale(0.88); }

.dots { display: flex; justify-content: center; gap: 6px; padding: 12px 0 4px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--surface2); transition: all 0.2s; }
.dot.active { width: 18px; background: var(--accent1); }

/* ---------- Category icons ---------- */
.cats { display: flex; gap: 10px; overflow-x: auto; padding: 14px 16px 6px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: 0 0 auto; width: 74px; height: 74px; border-radius: 18px; border: 1.5px solid transparent;
  background: var(--surface); color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; transition: transform 0.15s, border-color 0.2s;
}
.cat .emoji { font-size: 22px; line-height: 1; }
.cat:active { transform: scale(0.94); }
.cat.active { border-color: var(--accent1); color: #fff; }
.cat.active .emoji { filter: drop-shadow(0 0 8px rgba(124,92,255,0.6)); }

/* ---------- Section head ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 10px; }
.section-head h2 { margin: 0; font-size: 18px; font-weight: 800; }

/* ---------- List (horizontal cards) ---------- */
.list { display: flex; flex-direction: column; gap: 12px; padding: 0 16px; }
.status { text-align: center; color: var(--hint); padding: 40px 20px; font-size: 14.5px; line-height: 1.5; }

.row {
  position: relative; display: grid; grid-template-columns: 96px 1fr;
  gap: 13px; background: var(--surface); border-radius: 18px; padding: 11px;
  animation: rise 0.35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.row-img { width: 96px; height: 96px; border-radius: 13px; object-fit: cover; background: #24243c; }
.row-main { min-width: 0; padding-right: 30px; }
.row-badge {
  display: inline-block; padding: 4px 9px; border-radius: 9px;
  font-size: 11px; font-weight: 800; margin-bottom: 6px;
  background: color-mix(in srgb, var(--cat) 22%, transparent); color: var(--cat);
}
.row-title { margin: 0 0 6px; font-size: 15.5px; font-weight: 700; line-height: 1.25; }
.row-venue { display: flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.row-venue b { font-weight: 700; }
.row-addr { font-size: 12.5px; color: var(--hint); margin-top: 2px; }
.row .heart { width: 30px; height: 30px; top: 10px; right: 10px; background: transparent; }
.row .heart svg { width: 18px; height: 18px; stroke: var(--hint); }
.row .heart.on svg { fill: #ff4d6d; stroke: #ff4d6d; }
.row-when {
  display: flex; align-items: center; gap: 5px; margin-top: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--cat);
}
.row-when svg { width: 14px; height: 14px; }
.row-admin { display: flex; gap: 8px; margin-top: 11px; }
.row-admin button { flex: 1; border: none; cursor: pointer; padding: 9px; border-radius: 11px; font-size: 13px; font-weight: 700; }
.row-admin button:active { transform: scale(0.97); }
.row-edit { background: rgba(124,92,255,0.2); color: #b9a3ff; }
.row-del { background: rgba(255,77,77,0.15); color: #ff6b6b; }

/* category color helpers */
.cat-food, .c-food { --cat: var(--c-food); }
.cat-beauty, .c-beauty { --cat: var(--c-beauty); }
.cat-fun, .c-fun { --cat: var(--c-fun); }
.cat-sport, .c-sport { --cat: var(--c-sport); }
.cat-shops, .c-shops { --cat: var(--c-shops); }

/* ---------- Placeholder / Profile ---------- */
.placeholder { text-align: center; padding: 70px 30px; }
.placeholder-ic { font-size: 54px; }
.placeholder h3 { margin: 14px 0 6px; font-size: 18px; }

.profile-head { display: flex; align-items: center; gap: 14px; padding: 16px; }
.avatar {
  width: 60px; height: 60px; border-radius: 50%; font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
}
.profile-name { font-size: 18px; font-weight: 800; }
.admin-tools { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- FAB ---------- */
.fab {
  position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 8; border: none; border-radius: 16px; padding: 15px;
  font-size: 15.5px; font-weight: 700; color: #fff; background: var(--accent); cursor: pointer;
  box-shadow: 0 10px 26px rgba(124,92,255,0.45); transition: transform 0.15s;
}
.fab:active { transform: scale(0.97); }

/* ---------- Bottom tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  display: flex; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbtn {
  flex: 1; border: none; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--hint); font-size: 11px; font-weight: 600; padding: 4px 0;
}
.tabbtn svg { width: 24px; height: 24px; }
.tabbtn.active { color: var(--accent1); }
.tabbtn.active svg { filter: drop-shadow(0 0 6px rgba(124,92,255,0.5)); }

/* ---------- Detail screen ---------- */
.detail {
  position: fixed; inset: 0; z-index: 25; overflow-y: auto;
  background:
    radial-gradient(120% 60% at 50% -10%, #1a1530 0%, transparent 55%),
    var(--bg);
  padding-bottom: 40px;
  animation: detailIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes detailIn { from { opacity: 0; transform: translateX(12%); } to { opacity: 1; transform: none; } }

.detail-hero {
  position: relative; aspect-ratio: 16 / 12; background: #20203a center/cover no-repeat;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; color: #fff;
}
.detail-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,8,14,0.95) 0%, rgba(8,8,14,0.35) 50%, rgba(8,8,14,0.25) 100%);
}
.detail-hero > * { position: relative; z-index: 1; }
.detail-back {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,0.4); color: #fff; font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.detail-back:active { transform: scale(0.9); }
.detail-cat {
  align-self: flex-start; padding: 6px 12px; border-radius: 13px;
  font-size: 12.5px; font-weight: 700; color: #fff; margin-bottom: 10px;
  background: color-mix(in srgb, var(--cat) 85%, #000);
}
.detail-title { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.1; text-shadow: 0 2px 14px rgba(0,0,0,0.5); }

.detail-body { padding: 18px 16px 0; }
.detail-body .deal {
  display: block; font-size: 17px; font-weight: 800; line-height: 1.3;
  padding: 14px 16px; border-radius: 16px; margin-bottom: 18px; color: #fff;
  background: var(--accent); box-shadow: 0 10px 26px rgba(124,92,255,0.35);
}
.dsection { display: flex; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.dsection:last-of-type { border-bottom: none; }
.dsection .dic { flex: 0 0 26px; font-size: 19px; line-height: 1.2; }
.dlabel { font-size: 12.5px; font-weight: 700; color: var(--hint); text-transform: uppercase; letter-spacing: 0.03em; }
.dvalue { font-size: 15.5px; line-height: 1.45; margin-top: 3px; }
.route-btn {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 7px;
  border: none; cursor: pointer; padding: 11px 16px; border-radius: 13px;
  font-size: 14.5px; font-weight: 700; color: #fff; background: var(--accent);
}
.route-btn:active { transform: scale(0.97); }
.detail-fav {
  margin: 22px 0 0; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--line); cursor: pointer; padding: 14px; border-radius: 14px;
  font-size: 15px; font-weight: 700; background: var(--surface); color: var(--text);
}
.detail-fav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.detail-fav.on { color: #ff4d6d; border-color: rgba(255,77,109,0.4); }
.detail-fav.on svg { fill: #ff4d6d; stroke: #ff4d6d; }

.row, .hero-card { cursor: pointer; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,0.55); display: flex; align-items: flex-end; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card { width: 100%; background: var(--bg2); border-radius: 24px 24px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); animation: slideup 0.28s cubic-bezier(0.2,0.8,0.2,1); }
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.modal-card h2 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }

/* ---------- Forms ---------- */
.admin-view { padding: 0 16px 24px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--hint); margin: 14px 0 0; }
input, select, textarea {
  width: 100%; margin-top: 7px; padding: 13px 14px; border-radius: 13px;
  border: 1.5px solid transparent; background: var(--surface); color: var(--text);
  font-size: 15px; font-family: inherit; transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent1); }
textarea { resize: vertical; }

.modal-actions { display: flex; gap: 11px; margin-top: 20px; }
.primary-btn { flex: 1; border: none; border-radius: 14px; padding: 14px; font-size: 15px; font-weight: 700; color: #fff; background: var(--accent); cursor: pointer; transition: transform 0.15s; }
.primary-btn:active { transform: scale(0.98); }
.ghost-btn { border: none; border-radius: 14px; padding: 13px 16px; font-size: 14.5px; font-weight: 600; background: var(--surface); color: var(--text); cursor: pointer; }
.link-btn { border: none; background: transparent; color: var(--accent1); font-size: 14px; font-weight: 600; cursor: pointer; }
