/* ──────────────────────────────────────────────────────
   WIN POPUP — magazine-style ticker
   ────────────────────────────────────────────────────── */

/* Лента чужих выигрышей — компактная строка-бегунок ПОД чипами шапки, а не у
   нижней кромки экрана. Раньше карточка тикера стояла над рядом кнопок игры
   («Купить/Открыть приз») и на телефоне (390×844, где до кромки остаётся
   5–32 точки) закрывала кнопку целиком — жалоба со стенда: «история ставок
   других юзеров... перекрывает... ключевое действие», карточку приходилось
   поднимать над кнопками расчётом их координат на канвасе (см. удалённый
   liftAboveActions в win-popup.js). Здесь ей взяться неоткуда: верхний
   отступ считается от той же формулы, что и чипы (env(safe-area-inset-top)),
   плюс высота чипа с запасом — лента всегда ниже них и никогда не касается
   ни карты, ни кнопок под ней. */
#popupStack {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  left: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 300;
  pointer-events: none;
  max-width: 340px;
  margin: 0 auto;
}
@media (max-width: 480px) {
  #popupStack {
    left: 12px;
    right: 12px;
    max-width: none;
  }
}

.win-popup {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(42, 26, 71, 0.96), rgba(20, 9, 43, 0.96));
  border: 1px solid rgba(212, 169, 92, 0.32);
  border-left: 2px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 10px 24px -12px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,0,0,0.5);
  font-family: var(--font-body);
  /* Нажатия проходят насквозь — лента лежит поверх канваса, и без этого
     первый тап уходил бы в неё, а не в игру. */
  pointer-events: none;
  animation: slideIn 320ms cubic-bezier(.22,.61,.36,1) both;
  /* backdrop-filter removed — iOS WebKit promotes the canvas behind it into a
     compositing layer with integer-DPI downsampling, leaving canvas blurry
     even after popup is removed. The 96% opaque gradient above masks the loss. */
}
.win-popup--out { animation: fadeOut 240ms ease both; }

.win-popup__icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold) 60%, var(--gold-deep));
  color: #2A1A47;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(244, 213, 141, 0.35);
}
.win-popup__icon svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.win-popup__body { min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.win-popup__name {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.win-popup__meta {
  color: var(--ink-faded);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}
.win-popup__amount {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--gold-bright);
  line-height: 1;
  white-space: nowrap;
  text-shadow:
    0 2px 0 rgba(0,0,0,0.45),
    0 0 16px rgba(244, 213, 141, 0.30);
}

@keyframes slideIn {
  from { transform: translateY(-40%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-20%); }
}

/* ─── Toast ─── */
#toastStack {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 320;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.toast {
  pointer-events: auto;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(42, 26, 71, 0.96), rgba(20, 9, 43, 0.96));
  border: 1px solid rgba(212, 169, 92, 0.30);
  border-radius: var(--radius-soft);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.01em;
  /* backdrop-filter removed (same iOS canvas-downsample reason as .win-popup). */
  animation: toast-rise 240ms ease both;
}
.toast--error { border-color: rgba(197, 56, 75, 0.5); }
@keyframes toast-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
