:root {
  color: var(--messenger-text, #252220);
  background: var(--messenger-bg, #fff9f5);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --accent: #ef694b;
  --accent-dark: #d94d3f;
  --muted: var(--messenger-muted, #7b746f);
  --surface: var(--messenger-surface, #fff);
  --line: rgba(73, 49, 37, .1);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 12% 4%, rgba(249, 183, 67, .18), transparent 27%),
    radial-gradient(circle at 92% 20%, rgba(236, 70, 89, .12), transparent 29%),
    linear-gradient(180deg, #fffaf7 0%, #fff 54%, #fff8f2 100%);
}
html[data-messenger="telegram"] body {
  color: var(--messenger-text, #252220);
  background:
    radial-gradient(circle at 12% 4%, color-mix(in srgb, var(--messenger-button, #2aabee) 14%, transparent), transparent 27%),
    linear-gradient(180deg, var(--messenger-bg, #fff) 0%, color-mix(in srgb, var(--messenger-bg, #fff) 92%, #fff) 100%);
}
button { font: inherit; }
[hidden] { display: none !important; }

.app-shell {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
}
.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; padding: 2px 4px; }
.brand__logo { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; background: rgba(255,255,255,.85); box-shadow: 0 8px 24px rgba(106,61,38,.1); }
.brand__logo img { width: 35px; height: 27px; }
.brand > span:last-child { display: grid; gap: 2px; }
.brand b { font-size: 15px; font-weight: 650; }
.brand small { color: var(--muted); font-size: 12px; }

.bonus-card, .result-card, .state-card {
  overflow: hidden;
  border: 1px solid rgba(101,66,43,.08);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 22px 60px rgba(91,52,31,.11);
  backdrop-filter: blur(14px);
}
.bonus-card { position: relative; padding: 218px 24px 24px; }
.bonus-card__art { position: absolute; inset: 0 0 auto; height: 198px; overflow: hidden; background: linear-gradient(135deg,#fff1e8,#ffd9c9 55%,#ffe8c4); }
.bonus-card__art::after { position: absolute; inset: auto -20% -105px; height: 145px; border-radius: 50%; background: var(--surface); content: ""; }
.bonus-card__art img { position: absolute; z-index: 2; top: 33px; left: 50%; width: 190px; transform: translateX(-50%); filter: drop-shadow(0 18px 18px rgba(160,58,38,.16)); }
.bonus-card__art span { position: absolute; width: 70px; height: 70px; border-radius: 50%; background: rgba(255,255,255,.3); }
.bonus-card__art span:nth-child(1) { top: 18px; left: 10%; }
.bonus-card__art span:nth-child(2) { top: 95px; right: 8%; width: 38px; height: 38px; }
.bonus-card__art span:nth-child(3) { top: -25px; right: 21%; width: 105px; height: 105px; }

.eyebrow { margin: 0 0 8px; color: var(--accent-dark); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(27px,8vw,36px); line-height: 1.08; letter-spacing: -.035em; }
.lead { margin-bottom: 22px; color: var(--muted); font-size: 15px; line-height: 1.5; }

.primary-button, .secondary-button { display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 11px 18px; border-radius: 17px; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.primary-button { border: 0; background: linear-gradient(135deg,#f87951,#e9434f); box-shadow: 0 13px 25px rgba(224,68,64,.25); color: #fff; font-weight: 650; }
html[data-messenger="telegram"] .primary-button { background: var(--messenger-button, #2aabee); color: var(--messenger-button-text, #fff); box-shadow: 0 13px 25px color-mix(in srgb, var(--messenger-button, #2aabee) 28%, transparent); }
.primary-button__icon { width: 21px; height: 21px; }
.primary-button__icon svg { width: 100%; fill: currentColor; }
.primary-button:active, .secondary-button:active { transform: scale(.98); }
.secondary-button { min-height: 48px; border: 1px solid rgba(233,75,72,.2); background: #fff3ef; color: var(--accent-dark); font-weight: 600; }
.privacy { display: flex; align-items: flex-start; justify-content: center; gap: 6px; margin: 15px 0 0; color: #98908b; font-size: 11px; line-height: 1.4; text-align: center; }
.privacy span { color: #48ad75; font-size: 8px; transform: translateY(3px); }

.state-card { padding: 52px 24px 28px; text-align: center; }
.state-card h2 { margin-bottom: 8px; font-size: 22px; }
.state-card p { margin-bottom: 24px; color: var(--muted); line-height: 1.45; }
.state-card__icon { display: grid; width: 68px; height: 68px; margin: 0 auto 21px; place-items: center; border-radius: 22px; background: #fff0ea; color: var(--accent); font-size: 34px; }
.state-card--error .state-card__icon { background: #ffeded; color: #cf3e46; font-weight: 700; }
.loader { display: grid; width: 84px; height: 84px; margin: 0 auto 24px; place-items: center; border-radius: 28px; background: #fff2e9; }
.loader img { width: 64px; animation: flower-spin 1.15s linear infinite; }
@keyframes flower-spin { to { transform: rotate(360deg); } }

.result-card { padding: 20px; }
.created-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 13px; background: #e9f8ee; color: #24824d; font-size: 12px; line-height: 1.4; text-align: center; }
.result-card__top { display: flex; align-items: center; gap: 15px; padding: 19px; border-radius: 21px; background: linear-gradient(135deg,#fff0e8,#ffe4d4 55%,#fff0ca); }
.result-card__mark { display: grid; width: 64px; height: 64px; flex: 0 0 64px; place-items: center; border-radius: 21px; background: rgba(255,255,255,.65); }
.result-card__mark img { width: 54px; }
.result-card__top > span:last-child { display: grid; gap: 4px; min-width: 0; }
.result-card__top small { color: #906250; font-size: 12px; }
.result-card__top strong { color: #8d352d; font-size: clamp(31px,10vw,42px); font-weight: 700; line-height: 1; }
.result-card__top em { font-size: 14px; font-style: normal; font-weight: 550; }
.result-card__customer { display: grid; grid-template-columns: 44px minmax(0,1fr) 25px; align-items: center; gap: 11px; padding: 19px 3px 16px; border-bottom: 1px solid var(--line); }
.customer-avatar { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: linear-gradient(145deg,#f47d52,#e54159); color: #fff; font-size: 18px; }
.result-card__customer > div:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.result-card__customer b { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.result-card__customer span { color: var(--muted); font-size: 12px; }
.result-card__customer .verified { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: #e4f7eb; color: #2a9a5d; font-size: 13px; font-weight: 700; }
.stores { display: grid; gap: 8px; padding: 15px 0 4px; }
.store-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 13px; background: color-mix(in srgb,var(--store-color) 11%,var(--surface)); box-shadow: inset 3px 0 var(--store-color); font-size: 13px; }
.store-row strong { font-size: 14px; font-weight: 650; white-space: nowrap; }
.bonus-hint { margin: 13px 2px 18px; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }
footer { padding: 19px 10px 0; color: #a49b96; font-size: 10px; text-align: center; }

@media (max-width: 360px) { .app-shell { padding-inline: 10px; } .bonus-card { padding-inline: 18px; } .result-card__top { padding: 15px; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
