/* ============================================================
   Гильермо — мини-апп. Стиль зала: беж-штукатурка, изумрудный
   бархат, янтарный свет, дуб. «Летающие» карточки.
   ============================================================ */

@font-face {
  font-family: "Prata";
  src: url("fonts/prata-cyr.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
  font-display: swap;
}
@font-face {
  font-family: "Prata";
  src: url("fonts/prata-lat.woff2") format("woff2");
  unicode-range: U+0000-00FF;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-cyr.woff2") format("woff2");
  font-weight: 400 800;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-lat.woff2") format("woff2");
  font-weight: 400 800;
  unicode-range: U+0000-00FF;
  font-display: swap;
}

:root {
  --cream: #f1e9d7;
  --cream-deep: #e7dcc3;
  --cocoa: #3b2b1e;
  --cocoa-soft: #6f5d49;
  --emerald: #2e6b4f;
  --emerald-deep: #1f4a36;
  --amber: #e8a84c;
  --amber-soft: #f2c37e;
  --heart: #c94f4e;
  --white-warm: #fdfaf4;
  --display: "Prata", Georgia, serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
}

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

html, body { height: 100%; }

/* Скроллит НЕ документ, а #main: скролл документа в Telegram-вьюпорте
   дерётся с жестом сворачивания шторки — страницы не докручивались до конца */
body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--cocoa);
  background: var(--cream);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* ---------- Атмосфера: зерно, свет, зелень ---------- */

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)'/%3E%3C/svg%3E");
}

.glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}
.glow-top {
  top: -140px; left: 50%; transform: translateX(-50%);
  width: 560px; height: 320px;
  background: radial-gradient(closest-side, rgba(255, 236, 195, 0.85), transparent);
}
.glow-bottom {
  bottom: -160px; left: 50%; transform: translateX(-50%);
  width: 640px; height: 340px;
  background: radial-gradient(closest-side, rgba(232, 168, 76, 0.28), transparent);
}

/* пряди зелени по углам — лёгкое покачивание */
.vine {
  position: fixed;
  top: -6px;
  width: 46px;
  height: 190px;
  pointer-events: none;
  z-index: 1;
  background-repeat: no-repeat;
  background-size: contain;
  transform-origin: 50% 0;
  animation: sway 9s ease-in-out infinite alternate;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 200'%3E%3Cpath d='M32 0 Q30 40 34 70 Q38 110 30 150 Q28 175 32 198' fill='none' stroke='%231f4a36' stroke-width='2.6' stroke-linecap='round'/%3E%3Cg fill='%232e6b4f'%3E%3Cpath d='M32 26 C36 17 48 15 53 23 C55 27 50 34 41 34 C35 34 32 30 32 26Z'/%3E%3Cpath d='M33 62 C29 53 17 51 12 59 C10 63 15 70 24 70 C30 70 33 66 33 62Z'/%3E%3Cpath d='M34 100 C38 91 50 89 55 97 C57 101 52 108 43 108 C37 108 34 104 34 100Z'/%3E%3Cpath d='M31 138 C27 129 15 127 10 135 C8 139 13 146 22 146 C28 146 31 142 31 138Z'/%3E%3Cpath d='M32 176 C36 167 48 165 53 173 C55 177 50 184 41 184 C35 184 32 180 32 176Z'/%3E%3C/g%3E%3C/svg%3E");
}
.vine-l { left: 8px; }
.vine-r { right: 8px; transform: scaleX(-1); animation-delay: -4s; }
@keyframes sway {
  from { rotate: -2deg; }
  to { rotate: 2.2deg; }
}
.vine-r { animation-name: sway-r; }
@keyframes sway-r {
  from { rotate: 2deg; }
  to { rotate: -2.2deg; }
}

/* ---------- Шапка ---------- */

.top {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 26px 16px 4px;
}
.top-logo {
  width: 74px;
  height: auto;
  filter:
    drop-shadow(0 0 16px rgba(255, 214, 140, 0.9))
    drop-shadow(0 0 46px rgba(232, 168, 76, 0.45));
  animation: sign-breathe 5.5s ease-in-out infinite;
}
@keyframes sign-breathe {
  0%, 100% { filter: drop-shadow(0 0 16px rgba(255, 214, 140, 0.9)) drop-shadow(0 0 46px rgba(232, 168, 76, 0.45)); }
  50% { filter: drop-shadow(0 0 11px rgba(255, 214, 140, 0.7)) drop-shadow(0 0 32px rgba(232, 168, 76, 0.32)); }
}
.top-name {
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: 0.04em;
  margin-top: 6px;
}
.top-sub {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--cocoa-soft);
}

/* ---------- Вью и переходы ---------- */

main {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

.view {
  display: none;
  padding: 14px 18px 10px;
  max-width: 480px;
  margin-inline: auto;
}
.view.active { display: block; animation: view-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes view-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.hello {
  font-weight: 800;
  font-size: 15px;
  color: var(--cocoa-soft);
  text-align: center;
  margin-bottom: 12px;
}

/* ---------- «Летающие» карточки ---------- */

.float-card {
  background: var(--white-warm);
  border-radius: 24px;
  padding: 20px;
  box-shadow:
    0 24px 60px -24px rgba(59, 43, 30, 0.5),
    0 6px 18px -8px rgba(59, 43, 30, 0.18);
  margin-bottom: 16px;
  animation: floaty 7s ease-in-out infinite alternate;
}
.float-card:nth-child(odd) { animation-delay: -3.5s; }
@keyframes floaty {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

/* ---------- Карта штампов ---------- */

.sc-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 14px;
  border-bottom: 1.5px dashed rgba(59, 43, 30, 0.18);
}
.sc-head img { width: 32px; height: auto; }
.sc-head b { font-family: var(--display); font-weight: 400; font-size: 18px; display: block; }
.sc-head small { font-size: 12.5px; color: var(--cocoa-soft); font-weight: 600; }

.sc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-block: 18px 12px;
}
.sc-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed rgba(59, 43, 30, 0.25);
  display: grid;
  place-items: center;
  font-size: 26px;
  color: transparent;
  transition: border-color 0.25s ease;
}
.sc-cell.filled {
  background: var(--emerald);
  border-color: var(--emerald);
  color: var(--cream);
  animation: stamp-in 0.5s cubic-bezier(0.2, 1.5, 0.4, 1);
}
@keyframes stamp-in {
  0% { transform: scale(0.3) rotate(-14deg); }
  100% { transform: none; }
}
.sc-note {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cocoa-soft);
}

/* ---------- Подарок ---------- */

.gift-banner[hidden] { display: none !important; }
.gift-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(120deg, var(--amber) 0%, var(--amber-soft) 100%);
  color: #2c1f12;
  border-radius: 20px;
  padding: 15px 18px;
  font-size: 14.5px;
  margin-bottom: 16px;
  box-shadow: 0 18px 44px -18px rgba(232, 168, 76, 0.9);
  animation: gift-pulse 2.4s ease-in-out infinite;
}
.gift-ico { font-size: 30px; }
@keyframes gift-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ---------- QR ---------- */

.qr-card { text-align: center; }
.qr-title {
  font-family: var(--display);
  font-size: 18px;
}
.qr-box {
  margin: 12px auto 10px;
  width: min(240px, 62vw);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px -14px rgba(59, 43, 30, 0.4);
}
.qr-box img { width: 100%; display: block; }
.qr-sub { font-size: 12.5px; font-weight: 600; color: var(--cocoa-soft); }

/* ---------- Новости-тумблер ---------- */

.news-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(253, 250, 244, 0.7);
  border: 1px solid rgba(59, 43, 30, 0.1);
  border-radius: 18px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
}
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; }
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(59, 43, 30, 0.18);
  transition: background 0.25s ease;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--white-warm);
  box-shadow: 0 2px 6px rgba(59, 43, 30, 0.3);
  transition: translate 0.3s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.switch input:checked + i { background: var(--emerald); }
.switch input:checked + i::after { translate: 22px 0; }

/* ---------- Меню ---------- */

.cat-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 12px;
  margin-inline: -2px;
  background: linear-gradient(var(--cream) 82%, transparent);
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: none;
  border: 1.5px solid rgba(59, 43, 30, 0.2);
  background: none;
  color: var(--cocoa);
  border-radius: 999px;
  padding: 12px 18px;
  font: 700 14px/1 var(--body);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
.cat-tab:active { transform: scale(0.96); }
.cat-tab.active {
  background: var(--emerald);
  border-color: var(--emerald);
  color: var(--cream);
}

.menu-card {
  background: var(--white-warm);
  border-radius: 20px;
  padding: 4px 18px;
  margin-bottom: 14px;
  box-shadow: 0 16px 40px -20px rgba(59, 43, 30, 0.35);
}
.m-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px dashed rgba(59, 43, 30, 0.12);
}
.m-row:last-child { border-bottom: 0; }
.m-name { font-weight: 700; font-size: 15px; }
.m-name .heart { color: var(--heart); }
.m-note { display: block; font-size: 12.5px; font-weight: 500; color: var(--cocoa-soft); }
.m-stop { display: block; font-size: 12.5px; font-weight: 700; color: var(--heart); }
.m-price {
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.m-price small { font-size: 11px; color: var(--cocoa-soft); }
.m-row.signature {
  background: linear-gradient(90deg, rgba(232, 168, 76, 0.18), rgba(232, 168, 76, 0.03) 70%);
  border-radius: 12px;
  padding-inline: 12px;
  margin-inline: -12px;
}
.menu-note {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--cocoa-soft);
  padding: 4px 8px 12px;
}

/* ---------- «Скоро» и info ---------- */

.soon-card { text-align: center; padding: 30px 24px; }
.soon-emoji { font-size: 44px; }
.soon-card h2 { font-family: var(--display); font-weight: 400; font-size: 24px; margin-top: 8px; }
.soon-card p { color: var(--cocoa-soft); font-size: 14.5px; margin-top: 8px; }
.soon-list {
  list-style: none;
  margin-top: 14px;
  display: grid;
  gap: 8px;
  text-align: left;
  padding-inline: 12px;
}
.soon-list li {
  display: flex;
  gap: 10px;
  font-weight: 600;
  font-size: 14.5px;
}
.soon-list li::before { content: "✦"; color: var(--amber); }
.soon-badge {
  display: inline-block;
  margin-top: 18px;
  background: var(--emerald);
  color: var(--cream);
  border-radius: 999px;
  padding: 9px 20px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
}

.big-btn {
  display: inline-block;
  margin-top: 18px;
  background: var(--amber);
  color: #2c1f12;
  border-radius: 999px;
  padding: 15px 28px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 30px -10px rgba(232, 168, 76, 0.65);
}

.info-card { padding: 8px 20px; }
.info-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(59, 43, 30, 0.12);
}
.info-row:last-of-type { border-bottom: 0; }
.info-row .ico { font-size: 20px; margin-top: 1px; }
.info-row b { font-size: 15px; }
.info-row a { color: inherit; text-decoration: none; }
.info-row small { display: block; font-size: 12.5px; color: var(--cocoa-soft); font-weight: 600; }
.info-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 0 18px;
}
.chip-btn {
  border: 1.5px solid rgba(59, 43, 30, 0.25);
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--cocoa);
  text-decoration: none;
  transition: background 0.2s ease;
}
.chip-btn:active { background: rgba(59, 43, 30, 0.07); }

.kids-mini {
  font-size: 14px;
  color: var(--cocoa-soft);
  background: var(--cream-deep);
  font-weight: 600;
}
.kids-mini b { color: var(--emerald-deep); }

/* ---------- Таббар ---------- */

.tabbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(253, 250, 244, 0.82);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 43, 30, 0.1);
  border-radius: 24px;
  padding: 8px;
  box-shadow: 0 20px 50px -20px rgba(59, 43, 30, 0.5);
  max-width: 480px;
  margin-inline: auto;
}
.tab {
  position: relative;
  z-index: 2;
  background: none;
  border: 0;
  font: 700 11.5px/1.2 var(--body);
  color: var(--cocoa-soft);
  padding: 9px 4px 8px;
  cursor: pointer;
  display: grid;
  gap: 3px;
  justify-items: center;
  transition: color 0.25s ease, transform 0.15s ease;
}
.tab:active { transform: scale(0.94); }
.tab.active { color: #2c1f12; }
.t-ico { font-size: 20px; }

.tab-glider {
  position: absolute;
  z-index: 1;
  top: 8px;
  bottom: 8px;
  width: calc(25% - 4px);
  left: 8px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-soft) 100%);
  box-shadow: 0 8px 22px -8px rgba(232, 168, 76, 0.8);
  transition: translate 0.4s cubic-bezier(0.3, 1.35, 0.4, 1);
}

/* ---------- Доступность ---------- */

@media (prefers-reduced-motion: reduce) {
  .float-card, .vine, .top-logo, .gift-banner { animation: none !important; }
  .view.active { animation: none; }
  .tab-glider { transition: none; }
}
