/* LARUS — MVP-шаблон. Мобильный макет 390×844 в рамке телефона. */

:root {
  --bg: oklch(0.95 0.01 80);
  --surface: oklch(0.99 0.005 80);
  --card: oklch(1 0 0);
  --ink: oklch(0.22 0.015 80);
  --ink-2: oklch(0.55 0.01 80);
  --ink-3: oklch(0.64 0.01 80);
  --line: oklch(0.92 0.008 80);
  --accent: oklch(0.55 0.15 255);
  --accent-soft: oklch(0.93 0.03 255);
  --gold: oklch(0.55 0.13 75);
  --gold-soft: oklch(0.94 0.04 75);
  --dark: oklch(0.20 0.012 80);
  --ok: oklch(0.55 0.13 155);
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: oklch(0.45 0.15 255); }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.ms {
  font-family: 'Material Symbols Rounded';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
  font-size: 18px;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ——— сцена и рамка телефона ——— */

.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 36px 24px 60px;
}

.brand { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 9px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-2);
}

.phone {
  position: relative;
  width: 390px; height: 844px;
  background: var(--surface);
  border: 1px solid oklch(0.90 0.008 80);
  border-radius: 44px;
  box-shadow: 0 26px 64px -22px oklch(0.4 0.03 80 / 0.4);
  overflow: hidden;
}

.screen { position: absolute; inset: 0; }
.screen-dark { background: var(--dark); color: oklch(0.97 0.005 80); padding: 26px 24px 120px; }

.scroll { position: absolute; inset: 0; overflow-y: auto; padding-bottom: 116px; }
.scroll::-webkit-scrollbar, .chips::-webkit-scrollbar { width: 0; height: 0; }

/* ——— шапки ——— */

.head { padding: 20px 20px 13px; }
.head.sticky {
  position: sticky; top: 0; z-index: 5;
  background: oklch(0.99 0.005 80 / 0.93);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.head-dark { background: var(--dark); color: oklch(0.97 0.005 80); padding: 22px 20px 20px; }
.head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.head h1 { margin: 0; font-size: 25px; font-weight: 700; letter-spacing: -0.025em; }
.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.row-between { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.head-back { display: flex; align-items: center; gap: 10px; }

.pill {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 9px;
  border: 1px solid oklch(0.90 0.008 80);
  font-size: 12.5px; font-weight: 500; color: oklch(0.45 0.01 80);
}
.pill-lang { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; padding: 7px 9px; }
.pill.is-active { background: var(--accent-soft); color: oklch(0.42 0.13 255); border-color: var(--accent-soft); }
.pill.on-dark { border-color: oklch(0.35 0.012 80); color: oklch(0.92 0.005 80); }

.balance-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--gold-soft); border-radius: 999px; padding: 6px 12px 6px 7px;
}
.balance-pill .mono { font-size: 14px; font-weight: 600; color: oklch(0.42 0.11 75); }

/* ——— монета ——— */

.coin {
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, #ffeaa8, #f2b83c 52%, #b57a1c);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
  color: #7a4d0c; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.coin::after { content: 'C'; }
.coin-md { width: 24px; height: 24px; font-size: 13px; }
.coin-lg { width: 30px; height: 30px; font-size: 17px; }
.coin-xl {
  width: 108px; height: 108px; font-size: 42px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.45), 0 10px 24px -8px rgba(180,120,20,0.7);
  animation: pop 0.45s cubic-bezier(0.34,1.56,0.64,1);
}

/* ——— поиск и фильтры ——— */

.search {
  margin-top: 13px; height: 44px;
  display: flex; align-items: center; gap: 10px;
  background: oklch(0.96 0.006 80); border: 1px solid var(--line);
  border-radius: 14px; padding: 0 14px;
  color: var(--ink-3);
}
.search .ms { font-size: 20px; }

.chips { margin-top: 11px; display: flex; gap: 7px; overflow-x: auto; }
.chip {
  flex: none; white-space: nowrap;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid oklch(0.90 0.008 80); background: var(--card);
  font-size: 13px; font-weight: 500; color: oklch(0.42 0.01 80);
}
.chip.is-active { background: var(--dark); border-color: var(--dark); color: oklch(0.97 0.005 80); }

/* ——— списки ——— */

.list { padding: 14px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.list-flush { padding-top: 6px; gap: 0; }

.venue {
  display: flex; align-items: center; gap: 13px;
  padding: 13px; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px;
  text-align: left; width: 100%;
}
.venue:hover { border-color: oklch(0.80 0.05 255); }
.venue img {
  width: 52px; height: 52px; flex: none; border-radius: 15px;
  object-fit: cover; background: oklch(0.96 0.006 80);
}
.venue-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.venue-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.venue-rate { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.rate-row { display: flex; align-items: center; gap: 5px; }
.rate-row .mono { font-size: 15px; font-weight: 600; color: var(--gold); }
.rate-cap { font-size: 10.5px; color: var(--ink-3); }

.promo {
  margin: 16px 20px 0; padding: 16px;
  background: oklch(0.96 0.006 80);
  border: 1px dashed oklch(0.86 0.01 80); border-radius: 18px;
}
.promo-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.promo-body { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }

/* ——— карточка заведения ——— */

.hero { position: relative; height: 200px; background: oklch(0.96 0.006 80); }
.hero img { width: 100%; height: 100%; object-fit: contain; padding: 26px; display: block; }
.round-btn {
  position: absolute; top: 18px; left: 18px;
  width: 36px; height: 36px; border-radius: 50%;
  background: oklch(1 0 0 / 0.92);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px oklch(0.4 0.02 80 / 0.2);
}
.pad { padding: 18px 20px 0; }
.pad h2 { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -0.025em; }
.muted { font-size: 13px; color: var(--ink-2); }
.pad .muted { margin-top: 4px; }

.stats { margin-top: 14px; display: flex; gap: 10px; }
.stat { flex: 1; padding: 13px; border-radius: 15px; background: oklch(0.96 0.006 80); }
.stat-gold { background: var(--gold-soft); }
.stat-val { display: flex; align-items: center; gap: 7px; }
.stat-val .mono, .stat-num { font-size: 19px; font-weight: 600; }
.stat-gold .mono { color: oklch(0.45 0.12 75); }
.stat-cap { margin-top: 2px; font-size: 11.5px; color: var(--ink-2); }

.section-cap {
  margin-top: 20px; font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase; color: oklch(0.6 0.01 80);
}
.steps { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps b {
  width: 24px; height: 24px; flex: none; border-radius: 50%;
  background: var(--accent-soft); color: oklch(0.45 0.13 255);
  font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.steps span { font-size: 14px; line-height: 1.45; color: oklch(0.35 0.012 80); text-wrap: pretty; }

.btn-primary {
  background: var(--accent); color: #fff;
  font-weight: 600; border-radius: 16px;
}
.btn-primary.wide { display: block; width: 100%; margin-top: 22px; padding: 16px; font-size: 15.5px; }
.btn-primary.round { border-radius: 999px; padding: 15px 34px; font-size: 15.5px; }
.btn-light {
  margin-top: 12px; padding: 14px 30px; border-radius: 999px;
  background: oklch(0.97 0.005 80); color: var(--dark);
  font-size: 15px; font-weight: 600;
}

/* ——— сканер ——— */

.scan-head { display: flex; align-items: center; justify-content: space-between; }
.scan-title { font-size: 15px; font-weight: 600; }
.ghost { font-size: 22px; opacity: 0.7; }
.ghost.dark { opacity: 1; color: oklch(0.35 0.012 80); display: flex; }

.scan-idle { margin-top: 46px; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.viewfinder {
  position: relative; width: 232px; height: 232px;
  border-radius: 26px; background: oklch(0.26 0.012 80);
  border: 2px solid oklch(0.55 0.15 255 / 0.35); overflow: hidden;
}
.sweep {
  position: absolute; left: 8%; right: 8%; height: 2px;
  background: oklch(0.62 0.16 255); box-shadow: 0 0 14px oklch(0.62 0.16 255);
  animation: sweep 1.9s ease-in-out infinite alternate;
}
.qr {
  position: absolute; inset: 26px; opacity: 0.3;
  display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr); gap: 6px;
}
.qr i { border-radius: 3px; }
.qr i.on { background: oklch(0.97 0.005 80); }
.scan-hint { margin: 0; max-width: 250px; text-align: center; font-size: 14px; line-height: 1.5; opacity: 0.65; text-wrap: pretty; }

.scan-done { margin-top: 74px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.earned { font-size: 46px; font-weight: 600; letter-spacing: -0.03em; color: oklch(0.80 0.13 75); animation: pop 0.45s 0.08s backwards cubic-bezier(0.34,1.56,0.64,1); }
.earned-cap { font-size: 16px; font-weight: 600; }
.muted-light { font-size: 14px; opacity: 0.6; }
.muted-light.small { font-size: 13.5px; opacity: 0.5; }

/* ——— магазин ——— */

.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; opacity: 0.55; }
.eyebrow-plain { font-size: 12px; opacity: 0.55; }
.big-balance { margin-top: 7px; display: flex; align-items: center; gap: 10px; }
.big-balance .mono { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; color: oklch(0.80 0.13 75); }
.big-balance.sm .mono { font-size: 34px; }
.unit { font-size: 16px; opacity: 0.65; }

.product {
  display: flex; align-items: center; gap: 13px;
  min-height: 100px; padding: 11px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
}
.product img {
  width: 76px; height: 76px; flex: none; border-radius: 14px;
  object-fit: contain; padding: 4px; background: oklch(0.97 0.004 80);
}
.product-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.product-top { display: flex; align-items: flex-start; gap: 10px; }
.product-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; text-wrap: pretty; }
.buy {
  flex: none; padding: 7px 13px; border-radius: 10px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--accent); color: #fff;
}
.buy.is-off { background: oklch(0.94 0.006 80); color: var(--ink-3); }
.price-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.price-row .mono { font-size: 15px; font-weight: 600; color: oklch(0.52 0.13 75); }
.left-count { font-size: 11.5px; color: var(--ink-3); margin-left: 2px; }
.track { height: 5px; border-radius: 3px; background: oklch(0.93 0.008 80); overflow: hidden; }
.track-fill { height: 100%; border-radius: 3px; background: oklch(0.72 0.14 78); transition: width 0.3s ease; }
.track-fill.is-ok { background: var(--ok); }
.need { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.need.is-ok { color: oklch(0.52 0.11 155); }

/* ——— профиль ——— */

.profile-head { padding: 24px 20px 16px; display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 56px; height: 56px; flex: none; border-radius: 50%;
  background: var(--accent-soft); color: oklch(0.45 0.13 255);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}
.profile-id { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile-name { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.profile-id .mono { font-size: 13px; }

.card-dark { margin: 0 20px; padding: 18px; border-radius: 20px; background: var(--dark); color: oklch(0.97 0.005 80); }
.card-row { display: flex; align-items: flex-end; justify-content: space-between; }
.card-row .right { text-align: right; }
.visits { font-size: 20px; font-weight: 600; }
.card-dark .track { margin: 16px 0 8px; background: oklch(0.30 0.012 80); height: 6px; }
.card-dark .track-fill { background: oklch(0.80 0.13 75); }

.menu { padding: 20px 20px 0; display: flex; flex-direction: column; }
.menu button {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 0; border-bottom: 1px solid oklch(0.93 0.008 80);
  text-align: left;
}
.menu .ms { font-size: 22px; color: oklch(0.45 0.01 80); }
.menu-label { flex: 1; font-size: 15px; }
.menu-meta { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.menu .chevron { font-size: 20px; color: oklch(0.7 0.01 80); }

/* ——— история ——— */

.entry { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid oklch(0.93 0.008 80); }
.entry img { width: 38px; height: 38px; flex: none; border-radius: 12px; object-fit: cover; background: oklch(0.96 0.006 80); }
.entry-body { flex: 1; min-width: 0; }
.entry-name { font-size: 14.5px; font-weight: 500; }
.entry-when { font-size: 12px; color: oklch(0.6 0.01 80); }
.delta { display: flex; align-items: center; gap: 5px; }
.delta .mono { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.delta.plus .mono { color: var(--ok); }

/* ——— нижняя навигация ——— */

.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 96px;
  display: grid; grid-template-columns: 1fr 96px 1fr; align-items: start;
  padding: 13px 8px 0;
  background: oklch(0.99 0.005 80 / 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 500; color: oklch(0.6 0.01 80);
}
.tab.is-active { color: var(--accent); }
.tab-icon {
  width: 24px; height: 24px; display: block;
  background-color: currentColor;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.icon-shop { -webkit-mask-image: url('assets/icon-shop.png'); mask-image: url('assets/icon-shop.png'); }
.icon-user { -webkit-mask-image: url('assets/icon-user.png'); mask-image: url('assets/icon-user.png'); }
.icon-scan { -webkit-mask-image: url('assets/icon-scan.png'); mask-image: url('assets/icon-scan.png'); width: 28px; height: 28px; }

.tab-scan { margin-top: -22px; gap: 6px; color: var(--accent); font-weight: 600; }
.scan-fab {
  width: 58px; height: 58px; border-radius: 20px;
  background: var(--accent); color: #fff;
  box-shadow: 0 8px 20px -6px oklch(0.55 0.15 255 / 0.6);
  display: flex; align-items: center; justify-content: center;
}

/* ——— тост ——— */

.toast {
  position: absolute; left: 20px; right: 20px; bottom: 112px; z-index: 20;
  padding: 14px 16px; border-radius: 15px;
  background: var(--dark); color: oklch(0.97 0.005 80);
  font-size: 13.5px; line-height: 1.45;
  animation: rise 0.22s ease-out;
}

/* ——— анимации ——— */

@keyframes rise { from { transform: translateY(18px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0 } 60% { transform: scale(1.08) } 100% { transform: scale(1); opacity: 1 } }
@keyframes sweep { 0% { top: 8% } 100% { top: 88% } }

/* ——— на узких экранах рамка убирается ——— */

@media (max-width: 460px) {
  .stage { padding: 0; gap: 0; }
  .brand { display: none; }
  .phone { width: 100%; height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
}
