/* COFFEE-BARA — Mini App карты лояльности.
   Все размеры, цвета и отступы сняты с макета в Figma (экран 360px). */

:root {
  --bg: #100f08;
  --surface: #21190f;
  --line: #382d21;
  --line-soft: #372c21;
  --sheet: #1b1a17;

  --brand: #f1b778;
  --accent: #f0b47a;
  --gold: #dda765;
  --button: #e19c60;
  --ring: #bb7c51;
  --cream: #f9ebdc;

  --text: #ffffff;
  --text-soft: #f7f3e9;
  --muted: #afa498;
  --faint: #776f65;
  --dash: #756d63;

  --shadow-tile: 0 7.091px 14.183px rgba(0, 0, 0, .32);
  --shadow-card: 0 7.091px 7.091px rgba(0, 0, 0, .32);
  --shadow-row: 0 3.782px 4.255px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; }

.screen {
  max-width: 460px;
  margin: 0 auto;
  padding: 0 17px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─── Приветствие ──────────────────────────────────────────────────── */

.greeting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: fade-down .5s ease both;
}

.brand {
  margin: 0;
  font-size: 20.328px;
  font-weight: 700;
  line-height: normal;
  color: var(--brand);
  text-align: center;
}

.hello {
  margin: 0;
  max-width: 100%;
  font-size: 14px;
  font-weight: 300;
  line-height: 15.955px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Капибара и «Мой QR» ──────────────────────────────────────────── */

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 8px 0;
}

.hero-capybara {
  width: 148px;
  height: 153px;
  flex-shrink: 0;
  transform-origin: 50% 100%;
  animation:
    capy-in .7s cubic-bezier(.2, 1.2, .4, 1) both,
    capy-idle 5s ease-in-out .7s infinite;
}

.qr-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-tile);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
  cursor: pointer;
  transition: transform .15s ease;
}

.qr-tile img {
  width: 75.563px;
  height: 75.563px;
}

.qr-tile:active { transform: scale(.97); }

.qr-tile { animation: tile-in .6s cubic-bezier(.2, 1.1, .4, 1) .08s both; }

/* Гостю плитка мягко подсвечивается — «нажми меня» */
body:not(.is-staff) .qr-tile {
  animation:
    tile-in .6s cubic-bezier(.2, 1.1, .4, 1) .08s both,
    tile-glow 4.5s ease-in-out 1.4s infinite;
}

/* ─── Карта ────────────────────────────────────────────────────────── */

.card {
  animation: rise .55s cubic-bezier(.2, .9, .3, 1) .1s both;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.card-title,
.card-count {
  font-size: 12px;
  font-weight: 500;
  line-height: normal;
}

.card-title {
  color: var(--text);
  letter-spacing: .9455px;
}

.card-count {
  display: inline-block;
  color: var(--accent);
  letter-spacing: .4728px;
}

.card-count.bump { animation: bump .6s ease; }

/* Сетка всегда по три — на широких экранах flex-wrap перестроил бы её в 4+2 */
.stamps {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  justify-content: center;
  gap: 12px 16px;
}

.stamp {
  position: relative;
  width: 72px;
  height: 74px;
  border-radius: 1000px;
  overflow: hidden;
}

.stamp.empty {
  border: 1px dashed var(--dash);
}

/* В макете у зерна прозрачность слоя 6% (замер по пикселям) — в экспорт SVG она не попала */
.stamp.empty .bean {
  position: absolute;
  left: 15px;
  top: 15.53px;
  width: 40px;
  height: 40px;
  opacity: .06;
}

.stamp.empty.next {
  border-color: transparent;
}

.stamp.empty.next::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1000px;
  border: 1.5px dashed var(--brand);
  opacity: .7;
  animation: spin 14s linear infinite;
}

.stamp.empty.next .bean {
  animation: bean-breathe 2.6s ease-in-out infinite;
}

.stamp.filled {
  background: var(--cream);
}

.stamp .stamp-bg,
.stamp .face,
.avatar img {
  position: absolute;
  max-width: none;
  pointer-events: none;
}

.stamp .stamp-bg {
  width: 69px;
  height: 69px;
}

.stamp .face,
.avatar .avatar-face {
  object-fit: cover;
}

.stamp.pop {
  animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both;
}

/* Состояние «Ура! Бесплатный кофе» */

.card.is-reward {
  min-height: 336px;
  justify-content: space-between;
}

.card.is-reward .card-head {
  justify-content: center;
}

.card.is-reward .card-title {
  width: 100%;
  text-align: center;
}

.reward {
  position: relative;
  display: flex;
  justify-content: center;
}

.reward-circle {
  position: relative;
  width: 155px;
  height: 160px;
  border-radius: 1000px;
  background: var(--bg);
  overflow: hidden;
  animation: reward-glow 2.8s ease-in-out infinite;
}

.reward-bg {
  position: absolute;
  left: -11.5px;
  top: -7.47px;
  width: 111px;
  height: 111px;
}

.reward-capybara {
  position: absolute;
  left: 50%;
  top: calc(50% - .47px);
  width: 90px;
  height: 90px;
  object-fit: cover;
  transform: translate(-50%, -50%);
  animation: capy-float 3.4s ease-in-out infinite;
}

.reward.enter .reward-circle {
  animation:
    reward-in .6s cubic-bezier(.2, 1.3, .4, 1) both,
    reward-glow 2.8s ease-in-out .6s infinite;
}

.heart {
  position: absolute;
  bottom: 30%;
  color: #ef7d6d;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  animation: heart-up 3.6s ease-in infinite;
}

.heart-1 { left: calc(50% - 64px); animation-delay: .2s; }
.heart-2 { left: calc(50% + 52px); animation-delay: 1.4s; font-size: 11px; }
.heart-3 { left: calc(50% - 12px); animation-delay: 2.6s; font-size: 12px; }

.gift {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  border: 1px solid var(--gold);
  border-radius: 16px;
}

.gift strong {
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
  color: var(--text);
}

.gift span {
  font-size: 14px;
  font-weight: 300;
  line-height: 15.955px;
  color: var(--muted);
}

/* ─── Подписка ─────────────────────────────────────────────────────── */

.sub {
  animation: rise .55s cubic-bezier(.2, .9, .3, 1) .16s both;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.sub-star { font-size: 22px; line-height: 1; }

.sub-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sub-text strong {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.sub-text span {
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
}

.sub-count {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.sub-count.bump { animation: bump .5s ease-out; }

.sub.is-empty .sub-count { color: var(--faint); }

.dialog-gift + .dialog-gift { margin-top: 10px; }

/* ─── История ──────────────────────────────────────────────────────── */

.history {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: normal;
  letter-spacing: .9455px;
  color: var(--text);
}

.history li.in {
  animation: rise .45s cubic-bezier(.2, .9, .3, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms + .2s);
}

.history ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: var(--shadow-row);
}

.avatar-wrap {
  width: 34px;
  flex-shrink: 0;
}

.avatar {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 444.868px;
  background: var(--cream);
  overflow: hidden;
}

.avatar.free {
  background: var(--bg);
  border: 1px solid var(--ring);
}

.avatar .avatar-bg {
  width: 30.785px;
  height: 30.785px;
}

.tx-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 300;
  line-height: normal;
  color: var(--text-soft);
}

.tx-date {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
  color: var(--faint);
  white-space: pre;
}

/* ─── Ошибка ───────────────────────────────────────────────────────── */

.error {
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(217, 83, 79, .1);
  border: 1px solid rgba(217, 83, 79, .35);
  color: #e8847f;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.4;
  text-align: center;
}

/* ─── Шторка «Мой QR» ──────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(10, 10, 10, .6);
  opacity: 0;
  transition: opacity .28s ease;
}

.overlay.show { opacity: 1; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  max-width: 460px;
  max-height: 100%;
  margin: 0 auto;
  overflow-y: auto;
  background: var(--sheet);
  border-radius: 24px 24px 0 0;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .32s;
}

.sheet.open {
  transform: none;
  visibility: visible;
  transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}

.sheet-head {
  height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-top: 8px;
  border-bottom: .75px solid var(--line);
}

.sheet-tab {
  width: 44px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
}

.sheet-title {
  font-size: 16px;
  font-weight: 500;
  line-height: normal;
  color: var(--text);
}

.sheet-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 46px 24px 24px;
}

.qr {
  width: 260px;
  height: 260px;
}

.qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.qr.swap { animation: qr-swap .35s ease; }

.sheet-text {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: normal;
  color: var(--text);
  text-align: center;
}

.sheet-foot {
  padding: 16px 23px calc(16px + max(24px, env(safe-area-inset-bottom)));
  box-shadow: 0 -.75px 0 #1d1d1d;
}

/* ─── Кнопки ───────────────────────────────────────────────────────── */

.btn-primary,
.btn-ghost,
.btn-outline,
.step {
  border: 0;
  cursor: pointer;
  transition: transform .12s ease, opacity .2s ease;
}

.btn-primary:active,
.btn-ghost:active,
.btn-outline:active,
.step:active:not(:disabled) { transform: scale(.97); }

.btn-primary:disabled,
.btn-ghost:disabled,
.btn-outline:disabled { opacity: .55; cursor: default; }

.btn-primary {
  width: 100%;
  padding: 20px 24px;
  border-radius: 12px;
  background: var(--button);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: normal;
}

.btn-ghost {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 500;
}

.btn-outline {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--brand);
  font-size: 14px;
  font-weight: 500;
}

/* ─── Окно бариста ─────────────────────────────────────────────────── */

.dialog-wrap {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 10, 10, .6);
  animation: fade .2s ease;
}

.dialog {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 16px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  text-align: center;
  animation: dialog-in .28s cubic-bezier(.2, 1.2, .4, 1);
}

.dialog-name {
  margin: 0;
  max-width: 100%;
  font-size: 18px;
  font-weight: 500;
  line-height: normal;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-sub {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.35;
  color: var(--muted);
}

.dialog-label {
  margin: 24px 0 12px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 24px;
}

.step {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--button);
  color: var(--text);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.step:disabled {
  background: #4a3420;
  color: #8a7a68;
  cursor: default;
}

.step-value {
  min-width: 40px;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.dialog-gift {
  width: 100%;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--gold);
  border-radius: 16px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  text-align: left;
}

.dialog-actions {
  width: 100%;
  margin-top: 24px;
  display: grid;
  /* «Начислить (+10)» длиннее «Отклонить» — даём ей больше места */
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
}

.dialog-actions button {
  white-space: nowrap;
}

.dialog .btn-primary {
  padding: 14px 10px;
  font-size: 15px;
}

.code-input {
  width: 100%;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 12px;
  text-indent: 12px; /* компенсирует разрядку справа — цифры по центру */
  text-align: center;
  outline: none;
}

.code-input:focus { border-color: var(--gold); }

.code-input::placeholder { color: #3a3128; }

/* ─── Тост ─────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  transform: translateX(-50%);
  animation: toast-in .25s ease both;
}

/* ─── Конфетти ─────────────────────────────────────────────────────── */

.confetti {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ─── Анимации ─────────────────────────────────────────────────────── */

@keyframes pop {
  0%   { transform: scale(.4); opacity: 0; }
  70%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes reward-in {
  0%   { transform: scale(.6) rotate(-8deg); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

@keyframes qr-swap {
  0%   { opacity: .2; transform: scale(.96); }
  100% { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
}



/* ═══ Бариста: режимы ════════════════════════════════════════════════ */

.modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  animation: rise .45s ease both;
}

.mode {
  position: relative;
  padding: 11px 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.mode.active {
  background: var(--button);
  color: var(--text);
}

.mode-badge {
  position: absolute;
  top: -6px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #ef7d6d;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  box-shadow: 0 2px 8px rgba(239, 125, 109, .45);
  animation: pop .4s cubic-bezier(.2, 1.4, .4, 1) both;
}

.mode-panel-in { animation: rise .35s ease both; }

/* ═══ Гость: запрос ждёт бариста ═════════════════════════════════════ */

.pending {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--gold);
  border-radius: 16px;
  background: rgba(221, 167, 101, .06);
  animation: rise .4s ease both;
}

.pending-spin {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(241, 183, 120, .22);
  border-top-color: var(--brand);
  animation: spin .9s linear infinite;
}

.pending-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pending-text strong {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.pending-text span {
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
}

.dots::after {
  content: "";
  animation: dots 1.4s steps(1) infinite;
}

.pending-cancel {
  flex-shrink: 0;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* ═══ Бариста: запросы ═══════════════════════════════════════════════ */

.queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.requests {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.request {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: var(--shadow-row);
  cursor: pointer;
}

.request.enter { animation: req-in .45s cubic-bezier(.2, 1.2, .4, 1) both; }
.request.leave { animation: req-out .3s ease forwards; pointer-events: none; }

.req-avatar,
.dialog-photo {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  background: var(--line);
  color: var(--brand);
  font-weight: 700;
}

.req-avatar {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.req-avatar img,
.dialog-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.req-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.req-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.req-meta {
  font-size: 12px;
  font-weight: 400;
  color: var(--faint);
}

.request.stale .req-meta { color: #a46a5f; }

.req-decline,
.req-approve {
  flex-shrink: 0;
  height: 38px;
  border-radius: 19px;
  cursor: pointer;
  transition: transform .12s ease;
}

.req-decline {
  width: 38px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 15px;
}

.req-approve {
  padding: 0 16px;
  border: 0;
  background: var(--button);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.req-decline:active,
.req-approve:active { transform: scale(.94); }

.queue-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px 8px;
  text-align: center;
}

.queue-empty img {
  width: 96px;
  height: auto;
  margin-bottom: 8px;
  opacity: .92;
  transform-origin: 50% 100%;
  animation: capy-idle 5s ease-in-out infinite;
}

.queue-empty strong {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.queue-empty span {
  max-width: 280px;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.4;
  color: var(--muted);
}

/* ═══ Бариста: ввод кода ═════════════════════════════════════════════ */

.code-pad {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.code-pad-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.code-pad-sub {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.4;
  color: var(--muted);
}

.code-input.shake { animation: shake .4s ease; }

/* ═══ Шторка: доп. элементы ══════════════════════════════════════════ */

.sheet-link {
  margin-top: -4px;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* QR для кассы печатается — классический тёмный на белом */
.qr.light {
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
}

.sheet.open .qr { animation: qr-in .45s cubic-bezier(.2, 1.2, .4, 1) .12s both; }

.dialog-photo {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  font-size: 22px;
  box-shadow: 0 0 0 2px var(--gold);
}

/* ═══ Штамп прилетел: брызги и «+1» ══════════════════════════════════ */

.burst {
  position: fixed;
  z-index: 55;
  width: 0;
  height: 0;
  pointer-events: none;
}

.burst-bit {
  position: absolute;
  left: 0;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
  animation: burst .85s cubic-bezier(.2, .8, .3, 1) forwards;
}

.burst-bit.heart-bit {
  width: auto;
  height: auto;
  background: none;
  color: var(--c);
  font-size: 12px;
  line-height: 1;
}

.float-plus {
  position: fixed;
  z-index: 56;
  color: var(--brand);
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
  pointer-events: none;
  animation: float-plus 1.1s ease-out forwards;
}

/* ═══ Ключевые кадры ═════════════════════════════════════════════════ */

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-8px); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}

@keyframes capy-in {
  from { opacity: 0; transform: translateX(-22px) scale(.92); }
}

@keyframes capy-idle {
  0%, 100% { transform: rotate(0); }
  22%      { transform: rotate(-1.6deg) translateY(-2px); }
  48%      { transform: rotate(0); }
  74%      { transform: rotate(1deg); }
}

@keyframes tile-in {
  from { opacity: 0; transform: translateX(22px) scale(.94); }
}

@keyframes tile-glow {
  0%, 100% { box-shadow: var(--shadow-tile); border-color: var(--line); }
  50%      { box-shadow: var(--shadow-tile), 0 0 22px rgba(241, 183, 120, .16); border-color: #5a4630; }
}

@keyframes bump {
  30% { transform: scale(1.4); color: var(--text); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bean-breathe {
  0%, 100% { opacity: .06; transform: scale(1); }
  50%      { opacity: .16; transform: scale(1.06); }
}

@keyframes reward-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(241, 183, 120, 0); }
  50%      { box-shadow: 0 0 30px 2px rgba(241, 183, 120, .26); }
}

@keyframes capy-float {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  50%      { transform: translate(-50%, calc(-50% - 6px)) rotate(-2deg); }
}

@keyframes heart-up {
  0%   { opacity: 0; transform: translateY(0) scale(.6); }
  15%  { opacity: .9; }
  100% { opacity: 0; transform: translateY(-90px) scale(1.1); }
}

@keyframes dots {
  0%  { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

@keyframes req-in {
  from { opacity: 0; transform: translateX(-18px) scale(.97); }
}

@keyframes req-out {
  to { opacity: 0; transform: translateX(40px); height: 0; margin: 0; padding: 0; }
}

@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@keyframes qr-in {
  from { opacity: 0; transform: scale(.9); }
}

@keyframes burst {
  from { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  to {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.3) rotate(var(--rot));
    opacity: 0;
  }
}

@keyframes float-plus {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(.6); }
  20%  { opacity: 1; transform: translate(-50%, -10px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -52px) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
