/* DeliGame — страница профиля. Мобильная вёрстка по умолчанию, десктоп от 900px. */

.dg {
  --dg-bg: #F5F5F7;
  --dg-card: #FFFFFF;
  --dg-text: #1D1D1F;
  --dg-text-2: #6E6E73;
  --dg-text-3: #86868B;
  --dg-line: #D2D2D7;
  --dg-line-soft: #E5E5EA;
  --dg-accent: #0071E3;      /* главная кнопка, фокус */
  --dg-link: #0066CC;        /* ссылки (контраст 4.5:1+) */
  --dg-warn-bg: #FFF4E5;
  --dg-warn-text: #A04100;
  --dg-warn-dot: #FF9500;
  --dg-green: #34C759;
  --dg-green-text: #1F8A3B;
  --dg-pink: #FF2D55;
  --dg-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.03);
  --dg-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", sans-serif;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--dg-bg);
  color: var(--dg-text);
  font-family: var(--dg-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { margin: 0; background: #F5F5F7; }
.dg *, .dg *::before, .dg *::after { box-sizing: border-box; }
.dg a { color: var(--dg-link); }
.dg a:hover { color: #004C99; }
.dg button { font-family: inherit; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.desk-only { display: none !important; }

/* ---------- Шапка ---------- */
.dg-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(245,245,247,.8);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  padding-top: env(safe-area-inset-top);
}
.dg-header__inner {
  max-width: 1120px; margin: 0 auto;
  padding: 0 12px; min-height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.dg-header__left { display: flex; align-items: center; gap: 28px; }
.dg-logo { font-size: 13px; font-weight: 600; letter-spacing: -.01em; color: var(--dg-text) !important; text-decoration: none; }
.dg-topnav { display: flex; gap: 22px; font-size: 13px; }
.dg-topnav a { color: #424245; text-decoration: none; }
.dg-topnav a:hover { color: var(--dg-text); }

.dg-iconbtn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--dg-text) !important; text-decoration: none; }
.dg-iconbtn__circle { width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06); display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.dg-iconbtn:hover .dg-iconbtn__circle { transform: scale(1.06); }

/* ---------- Каркас ---------- */
.dg-main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; flex: 1; }
.dg-title { margin: 2px 4px 12px; font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }

.dg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "user" "login" "tiles" "menu";
  gap: 10px;
}
.dg-user  { grid-area: user; }
.dg-login { grid-area: login; }
.dg-tiles { grid-area: tiles; }
.dg-menu  { grid-area: menu; }

.dg-card { background: var(--dg-card); border-radius: 20px; box-shadow: var(--dg-shadow); }

/* ---------- Пользователь ---------- */
.dg-user { border-radius: 16px; padding: 10px 12px; }
.dg-user__row { display: flex; align-items: center; gap: 10px; }
.dg-avatar { width: 38px; height: 38px; border-radius: 50%; padding: 2px; border: 1.5px solid var(--dg-accent); flex-shrink: 0; }
.dg-avatar__inner { width: 100%; height: 100%; border-radius: 50%; background: var(--dg-text); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.dg-user__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dg-user__name { font-size: 15px; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-user__meta { font-size: 12px; color: var(--dg-text-2); font-variant-numeric: tabular-nums; }

.dg-pill { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.dg-pill--warn { background: var(--dg-warn-bg); color: var(--dg-warn-text); }
.dg-pill--ok { background: #E8F8EC; color: var(--dg-green-text); }
.dg-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--dg-warn-dot); }
.dg-pill--ok .dg-dot { background: var(--dg-green); }
.dg-dot--green { width: 6px; height: 6px; background: var(--dg-green); }

.dg-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.dg-stat { background: var(--dg-bg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.dg-stat__label { font-size: 11px; color: var(--dg-text-2); }
.dg-stat__value { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dg-stat__value--sm { font-size: 14px; line-height: 25px; }
.dg-stat--warn { background: var(--dg-warn-bg); }
.dg-stat--warn .dg-stat__label, .dg-stat--warn .dg-stat__value { color: var(--dg-warn-text); }
.dg-stat--ok { background: #E8F8EC; }
.dg-stat--ok .dg-stat__label, .dg-stat--ok .dg-stat__value { color: var(--dg-green-text); }

/* ---------- Вход ---------- */
.dg-login { padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.dg-login__intro { display: flex; flex-direction: column; gap: 12px; }
.dg-login__title { margin: 0 0 2px; font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.dg-login__title span { color: var(--dg-text-3); }
.dg-login__desc { margin: 0; font-size: 14px; line-height: 1.5; color: var(--dg-text-2); }
.dg-badge-icon { width: 40px; height: 40px; border-radius: 12px; background: #EAF3FF; color: var(--dg-accent); display: flex; align-items: center; justify-content: center; }

.dg-login__form { display: flex; flex-direction: column; gap: 12px; }
.dg-line { display: flex; gap: 8px; }
.dg-field { flex: 1; min-width: 0; border: 1px solid var(--dg-line); border-radius: 12px; background: #fff; transition: box-shadow .2s, border-color .2s; }
.dg-field--with-action { display: flex; align-items: center; }
.dg-field:focus-within { border-color: var(--dg-accent); box-shadow: 0 0 0 3px rgba(0,113,227,.18); }
.dg-field.is-invalid { border-color: #D70015; box-shadow: 0 0 0 3px rgba(215,0,21,.12); }
.dg-input { width: 100%; height: 44px; border: 0; background: transparent; color: var(--dg-text); padding: 0 12px; font: inherit; font-size: 16px; /* 16px — iOS не зумит */ }
.dg-input:focus { outline: none; }
.dg-input::placeholder { color: #8E8E93; }
.dg-input--code { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.dg-input--sm { height: 40px; }

.dg-btn { height: 44px; padding: 0 16px; border: 0; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; flex-shrink: 0; white-space: nowrap; transition: transform .15s, filter .15s, opacity .15s; }
.dg-btn:hover { filter: brightness(1.08); }
.dg-btn:active { transform: scale(.98); }
.dg-btn:focus-visible { outline: 2px solid var(--dg-accent); outline-offset: 2px; }
.dg-btn[disabled] { opacity: .45; cursor: default; filter: none; transform: none; }
.dg-btn--primary { background: var(--dg-accent); color: #fff; }
.dg-btn--dark { background: var(--dg-text); color: #fff; padding: 0 20px; }
.dg-btn.is-loading { position: relative; color: transparent !important; }
.dg-btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: dg-spin .7s linear infinite; }
@keyframes dg-spin { to { transform: rotate(360deg); } }

.dg-textbtn { height: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--dg-link); font-size: 13px; font-weight: 500; cursor: pointer; flex-shrink: 0; }
.dg-textbtn:focus-visible { outline: 2px solid var(--dg-accent); outline-offset: -2px; border-radius: 8px; }

.dg-receipts { border-radius: 12px; background: var(--dg-bg); overflow: hidden; }
.dg-receipts__row { display: flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 44px; cursor: pointer; }
.dg-receipts__label { flex: 1; font-size: 13px; font-weight: 500; }
.dg-receipts__extra { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .38s cubic-bezier(.2,.8,.2,1), opacity .25s ease; }
.dg-receipts__extra.is-open { grid-template-rows: 1fr; opacity: 1; }
.dg-receipts__clip { overflow: hidden; min-height: 0; padding: 0 8px; }
.dg-receipts__extra.is-open .dg-receipts__clip { padding-bottom: 8px; }
.dg-receipts__extra .dg-field { border-radius: 10px; }

.dg-switch { appearance: none; -webkit-appearance: none; margin: 0; flex-shrink: 0; width: 42px; height: 26px; border-radius: 999px; background: #E9E9EB; position: relative; cursor: pointer; transition: background .25s; }
.dg-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .25s; }
.dg-switch:checked { background: var(--dg-green); }
.dg-switch:checked::after { transform: translateX(16px); }
.dg-switch:focus-visible { outline: 2px solid var(--dg-accent); outline-offset: 2px; }

.dg-consent { display: flex; gap: 10px; align-items: flex-start; padding: 0 2px; cursor: pointer; font-size: 11px; line-height: 1.45; color: var(--dg-text-2); }
.dg-consent a { text-decoration: none; }
.dg-consent.is-invalid { color: #D70015; }
.dg-check { appearance: none; -webkit-appearance: none; margin: 0; flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #C7C7CC; background: #fff; cursor: pointer; position: relative; }
.dg-check:checked { background: var(--dg-accent); border-color: var(--dg-accent); }
.dg-check:checked::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dg-check:focus-visible { outline: 2px solid var(--dg-accent); outline-offset: 2px; }
.dg-consent.is-invalid .dg-check { border-color: #D70015; }

.dg-msg { margin: 0; font-size: 12px; line-height: 1.4; min-height: 0; }
.dg-msg:empty { display: none; }
.dg-msg.is-error { color: #D70015; }
.dg-msg.is-ok { color: var(--dg-green-text); }

/* ---------- Плитки ---------- */
.dg-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dg-tile { text-decoration: none; color: var(--dg-text) !important; background: #fff; border-radius: 20px; padding: 14px; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--dg-shadow); transition: transform .2s ease; }
.dg-tile:hover { transform: translateY(-2px); }
.dg-tile--dark { background: var(--dg-text); color: #fff !important; box-shadow: none; }
.dg-tile__top, .dg-tile__bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dg-tile__bottom { align-items: flex-end; color: var(--dg-text-3); }
.dg-tile--dark .dg-tile__bottom { color: #A1A1A6; }
.dg-tile__icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.dg-tile__icon--pink { background: var(--dg-pink); }
.dg-tile__icon--green { background: #E8F8EC; color: var(--dg-green-text); }
.dg-tile__num { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dg-tile__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dg-tile__title { font-size: 14px; font-weight: 600; color: var(--dg-text); }
.dg-tile--dark .dg-tile__title { color: #fff; }
.dg-tile__sub { font-size: 11px; color: var(--dg-text-2); }
.dg-tile--dark .dg-tile__sub { color: #A1A1A6; }
.dg-online { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--dg-green-text); }

/* ---------- Меню ---------- */
.dg-menu { border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.dg-menu__item { display: flex; align-items: center; gap: 12px; padding: 0 12px; min-height: 44px; text-decoration: none; color: var(--dg-text) !important; position: relative; transition: background .15s; }
.dg-menu__item:not(.desk-only) ~ .dg-menu__item::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; height: .5px; background: var(--dg-line-soft); }
.dg-menu__item:hover { background: #FAFAFC; }
.dg-menu__icon { width: 26px; height: 26px; border-radius: 7px; background: var(--dg-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dg-menu__label { flex: 1; font-size: 14px; }
.dg-chev { color: #C4C4C7; }

/* ---------- Подвал ---------- */
.dg-footer { width: 100%; max-width: 1120px; margin: 0 auto; padding: 20px 24px calc(32px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--dg-text-2); font-size: 11px; text-align: center; }

/* ---------- Чеки (после привязки) ---------- */
.dg-account { grid-area: login; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.dg-account__head { display: flex; align-items: center; gap: 12px; }
.dg-account__badge { width: 36px; height: 36px; border-radius: 11px; background: #EAF3FF; color: var(--dg-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dg-account__text { min-width: 0; }
.dg-account__title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.dg-account__sub { margin: 2px 0 0; font-size: 12px; color: var(--dg-text-2); }
.dg-account__row { display: flex; align-items: center; gap: 12px; padding: 0 4px 0 14px; min-height: 48px; background: var(--dg-bg); border-radius: 12px; }
.dg-account__value { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-account__edit { flex-shrink: 0; min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; text-decoration: none; border-radius: 10px; }
.dg-account__edit:hover { background: rgba(0,113,227,.08); }

/* ---------- Отвязка ---------- */
button.dg-menu__item { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.dg-menu__item--danger { color: #D70015 !important; }
.dg-menu__item--danger .dg-menu__icon { background: #FFECEE; color: #D70015; }
.dg-menu__item--danger:hover { background: #FFF5F6; }
.dg-menu__item:focus-visible { outline: 2px solid var(--dg-accent); outline-offset: -2px; }

.dg-btn--danger { background: linear-gradient(180deg, #E5262F, #D70015); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(215,0,21,.3); }
.dg-btn--danger:hover { box-shadow: 0 6px 18px rgba(215,0,21,.28); }
.dg-btn--ghost { background: var(--dg-bg); color: var(--dg-text); }
.dg-btn--ghost:hover { filter: none; background: #EBEBF0; }

.dg-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; padding: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.dg-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.32); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .26s ease; }
.dg-modal__sheet {
  position: relative; width: 100%; max-width: 420px; background: #fff; border-radius: 28px; padding: 24px 20px 16px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25); transform: translateY(110%); transition: transform .38s var(--dg-ease, ease);
}
.dg-modal__sheet:focus { outline: none; }
.dg-modal.is-open .dg-modal__backdrop { opacity: 1; }
.dg-modal.is-open .dg-modal__sheet { transform: none; }
.dg-modal__icon { width: 48px; height: 48px; border-radius: 50%; background: #FFECEE; color: #D70015; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.dg-modal__title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.dg-modal__text { margin: 0 0 4px; font-size: 14px; line-height: 1.45; color: var(--dg-text-2); max-width: 34ch; }
.dg-modal__text b { color: var(--dg-text); font-weight: 600; word-break: break-all; }
.dg-modal__actions { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.dg-modal__actions .dg-btn { width: 100%; height: 48px; font-size: 15px; }

/* =========================================================
   ДЕСКТОП (от 900px)
   ========================================================= */
@media (min-width: 900px) {
  .mob-only { display: none !important; }
  .desk-only { display: revert !important; }
  .dg-stats.desk-only { display: grid !important; }
  .dg-topnav.desk-only, .dg-badge-icon.desk-only, .dg-menu__item.desk-only { display: flex !important; }

  .dg-header { border-bottom: .5px solid var(--dg-line); }
  .dg-header__inner { padding: 0 32px; min-height: 52px; }
  .dg-logo { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
  .dg-iconbtn__circle { width: 34px; height: 34px; }

  .dg-main { padding: 36px 32px 0; }
  .dg-title { margin: 0 0 24px; font-size: 40px; letter-spacing: -.03em; line-height: 1.05; }

  .dg-grid {
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "user  login"
      "menu  login"
      "menu  tiles";
    gap: 14px 20px;
    align-items: start;
  }

  .dg.is-linked .dg-grid {
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "user  login"
      "menu  tiles";
  }
  .dg.is-linked .dg-account { align-self: stretch; align-content: center; }
  .dg-account { border-radius: 24px; padding: 24px 28px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
  .dg-account__head { flex: 1 1 260px; gap: 14px; }
  .dg-account__badge { width: 44px; height: 44px; border-radius: 13px; }
  .dg-account__badge svg { width: 20px; height: 20px; }
  .dg-account__title { font-size: 24px; letter-spacing: -.025em; }
  .dg-account__sub { font-size: 14px; margin-top: 4px; }
  .dg-account__row { flex: 1 1 320px; min-height: 52px; }

  .dg-modal { align-items: center; padding: 24px; }
  .dg-modal__sheet { max-width: 400px; padding: 28px 28px 22px; transform: scale(.94); opacity: 0; transition: transform .3s var(--dg-spring, ease), opacity .2s ease; }
  .dg-modal.is-open .dg-modal__sheet { transform: none; opacity: 1; }
  .dg-modal__actions { flex-direction: row-reverse; }
  .dg-modal__actions .dg-btn { flex: 1 1 0; width: auto; height: 44px; font-size: 14px; }

  .dg-user { border-radius: 20px; padding: 18px; }
  .dg-user__row { gap: 12px; }
  .dg-avatar { width: 48px; height: 48px; }
  .dg-avatar__inner { font-size: 16px; }
  .dg-user__name { font-size: 17px; }

  .dg-menu { padding: 6px; }
  .dg-menu__item { border-radius: 10px; padding: 0 10px; }
  .dg-menu__item::before { display: none !important; }
  .dg-menu__item:hover { background: var(--dg-bg); }
  .dg-menu__item.is-active { background: var(--dg-bg); font-weight: 600; }
  .dg-menu__icon { background: transparent; width: 20px; }
  .dg-chev { display: none; }

  .dg-login { border-radius: 24px; padding: 28px; flex-direction: row; flex-wrap: wrap; gap: 28px 40px; }
  .dg-login__intro { flex: 1 1 240px; }
  .dg-login__form { flex: 1 1 320px; gap: 10px; }
  .dg-login__title { font-size: 26px; letter-spacing: -.025em; line-height: 1.15; margin: 0; }
  .dg-input { font-size: 15px; padding: 0 14px; }
  .dg-btn { padding: 0 18px; }
  .dg-btn--dark { padding: 0 24px; }
  .dg-receipts__row { padding: 0 14px; }
  .dg-consent { font-size: 12px; padding-top: 2px; }

  .dg-tiles { gap: 14px; }
  .dg-tile { border-radius: 22px; padding: 20px; min-height: 132px; }
  .dg-tile__icon { width: 34px; height: 34px; }
  .dg-tile__icon svg { width: 16px; height: 16px; }
  .dg-tile__num { font-size: 28px; letter-spacing: -.03em; }
  .dg-tile__title { font-size: 16px; }
  .dg-tile__sub, .dg-online { font-size: 12px; }

  .dg-footer { justify-content: flex-start; padding: 32px 32px 40px; font-size: 12px; }
}

/* Узкие телефоны: кнопка под полем, чтобы не сжимать ввод */
@media (max-width: 359px) {
  .dg-line { flex-wrap: wrap; }
  .dg-line .dg-btn { width: 100%; }
}



/* =========================================================
   СТИЛЬ И АНИМАЦИИ
   ========================================================= */
:root { --dg-ease: cubic-bezier(.2,.8,.2,1); --dg-spring: cubic-bezier(.34,1.56,.64,1); }

/* Появление блоков по очереди */
@keyframes dg-rise { from { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.dg-rise { animation: dg-rise .7s var(--dg-ease) backwards; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }

/* Шапка: тень появляется при прокрутке */
.dg-header { transition: box-shadow .3s ease, background .3s ease; }
.dg-header.is-scrolled { box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.05); background: rgba(245,245,247,.72); }

/* Карточки: мягкий подъём */
.dg-card { transition: box-shadow .35s var(--dg-ease), transform .35s var(--dg-ease); }
.dg-login:focus-within { box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 18px 50px rgba(0,113,227,.10); }

/* Подсветка, которая следует за курсором */
.dg-spot { position: relative; isolation: isolate; overflow: hidden; }
.dg-spot::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, -40%), rgba(0,113,227,.08), transparent 60%);
  opacity: 0; transition: opacity .3s ease;
}
.dg-spot:hover::after { opacity: 1; }
.dg-tile--dark.dg-spot::after { background: radial-gradient(240px circle at var(--mx, 50%) var(--my, -40%), rgba(255,255,255,.14), transparent 60%); }
.dg-tile.dg-spot { z-index: 0; }

/* Аватар: переливающееся кольцо, пока аккаунт не привязан */
.dg-avatar { position: relative; border: 0; padding: 2.5px; isolation: isolate; }
.dg-avatar::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 0deg, #0071E3, #5AC8FA, #AF52DE, #FF2D55, #FF9500, #0071E3);
  animation: dg-spin 6s linear infinite;
}
.dg-avatar__inner { box-shadow: 0 0 0 2px #fff; position: relative; }
.dg.is-linked .dg-avatar::before { background: #34C759; animation: none; }

/* Пульсирующие точки статуса */
.dg-ping { position: relative; }
.dg-ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: dg-ping 1.8s cubic-bezier(0,0,.2,1) infinite; }
@keyframes dg-ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.8); opacity: 0; } }

/* Кнопки: блик при наведении, пружина при нажатии */
.dg-btn { position: relative; overflow: hidden; transition: transform .25s var(--dg-spring), filter .2s, opacity .2s, box-shadow .25s; }
.dg-btn:active { transform: scale(.96); }
.dg-btn--primary:hover { box-shadow: 0 6px 18px rgba(0,113,227,.32); }
.dg-btn--dark:hover { box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.dg-btn--shine::before, .dg-btn--dark::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); pointer-events: none;
}
.dg-btn--shine:hover::before, .dg-btn--dark:hover::before { animation: dg-shine .8s var(--dg-ease); }
@keyframes dg-shine { to { left: 130%; } }
.dg-btn__label { position: relative; z-index: 1; }

/* Таймер повторной отправки — полоска внутри кнопки */
.dg-btn.is-counting { filter: none; opacity: 1; background: #E8F0FB; color: #0058B0; box-shadow: none; }
.dg-btn.is-counting::before { animation: none; left: 0; top: 0; bottom: 0; width: 100%; transform: none; transform-origin: left; background: rgba(0,113,227,.14); animation: dg-count var(--dg-count, 60s) linear forwards; }
@keyframes dg-count { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Поля: ошибка — лёгкое покачивание */
@keyframes dg-shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }
.is-shake { animation: dg-shake .45s ease both; }

/* Переключатель и галочка — с пружиной */
.dg-switch { transition: background .3s ease, box-shadow .3s ease; }
.dg-switch::after { transition: transform .35s var(--dg-spring), width .2s ease; }
.dg-switch:active::after { width: 28px; }
.dg-switch:checked:active::after { transform: translateX(10px); }
.dg-check { transition: background .2s, border-color .2s, transform .25s var(--dg-spring); }
.dg-check:active { transform: scale(.85); }
.dg-check:checked::after { animation: dg-pop .35s var(--dg-spring); }
@keyframes dg-pop { from { transform: rotate(45deg) scale(0); } to { transform: rotate(45deg) scale(1); } }

/* Сообщение под формой */
@keyframes dg-msg-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dg-msg.is-in { animation: dg-msg-in .3s var(--dg-ease); }

/* Плитки: 3D-наклон, подъём, стрелка */
.dg-tile { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0)); transition: transform .45s var(--dg-ease), box-shadow .35s var(--dg-ease); will-change: transform; }
.dg-tile:hover { --ty: -3px; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty)); box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 18px 40px rgba(0,0,0,.08); }
.dg-tile--dark:hover { box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.dg-tile.is-tilting { transition: transform .1s linear, box-shadow .35s var(--dg-ease); }
.dg-tile__bottom svg { transition: transform .35s var(--dg-spring); }
.dg-tile:hover .dg-tile__bottom svg { transform: translate(3px, -3px); }
.dg-tile__icon { transition: transform .35s var(--dg-spring); }
.dg-tile--dark:hover .dg-tile__icon { animation: dg-beat 1s ease-in-out infinite; }
.dg-tile:not(.dg-tile--dark):hover .dg-tile__icon { transform: rotate(-12deg) scale(1.08); }
@keyframes dg-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }
.dg-tile__num { display: inline-block; }

/* Меню */
.dg-menu__icon { transition: transform .3s var(--dg-spring), background .2s; }
.dg-menu__item:hover .dg-menu__icon { transform: scale(1.1); }
.dg-chev { transition: transform .3s var(--dg-spring), color .2s; }
.dg-menu__item:hover .dg-chev { transform: translateX(3px); color: #8E8E93; }
.dg-menu__item:active { background: #EFEFF4; }
.dg-iconbtn:active .dg-iconbtn__circle { transform: scale(.9); }

/* Успешный вход: галочка и сворачивание карточки */
.dg-login { position: relative; overflow: hidden; }
.dg-success {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--dg-green); opacity: 0; pointer-events: none; transition: opacity .35s ease; text-align: center; padding: 16px;
}
.dg-success__title { color: var(--dg-text); font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin-top: 6px; opacity: 0; transform: translateY(6px); transition: all .4s var(--dg-ease) .35s; }
.dg-success__sub { color: var(--dg-text-2); font-size: 13px; opacity: 0; transform: translateY(6px); transition: all .4s var(--dg-ease) .45s; }
.dg-success__ring { stroke-dasharray: 158; stroke-dashoffset: 158; }
.dg-success__tick { stroke-dasharray: 36; stroke-dashoffset: 36; }
.dg-login.is-success .dg-success { opacity: 1; pointer-events: auto; }
.dg-login.is-success .dg-success__ring { animation: dg-draw .6s var(--dg-ease) .1s forwards; }
.dg-login.is-success .dg-success__tick { animation: dg-draw .35s var(--dg-ease) .55s forwards; }
.dg-login.is-success .dg-success__title, .dg-login.is-success .dg-success__sub { opacity: 1; transform: none; }
@keyframes dg-draw { to { stroke-dashoffset: 0; } }
.dg-login.is-collapsing { animation: dg-collapse .5s var(--dg-ease) forwards; }
@keyframes dg-collapse { to { opacity: 0; transform: scale(.96); } }

/* Счётчики «набегают» при обновлении */
@keyframes dg-tick { from { opacity: 0; transform: translateY(40%); } to { opacity: 1; transform: none; } }
.is-ticking { display: inline-block; animation: dg-tick .4s var(--dg-ease); }

/* ---------- Ещё стиля: свечение и глубина ---------- */
@property --dg-ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes dg-ang { to { --dg-ang: 360deg; } }
@keyframes dg-flow { to { background-position: 300% 50%; } }
@keyframes dg-float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-24px, 18px) scale(1.08); } }

/* Цветная глубина за карточками */
.dg { position: relative; isolation: isolate; overflow-x: clip; }
.dg::before, .dg::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none; border-radius: 50%;
  filter: blur(70px); opacity: .45; animation: dg-float 14s ease-in-out infinite;
}
.dg::before { width: 340px; height: 340px; top: 80px; right: -120px; background: radial-gradient(circle, #8EC5FF, transparent 70%); }
.dg::after { width: 300px; height: 300px; top: 520px; left: -140px; background: radial-gradient(circle, #F5B5D0, transparent 70%); animation-delay: -7s; }

/* Карточки чётче: тонкий внутренний контур */
.dg-card, .dg-tile:not(.dg-tile--dark) { box-shadow: inset 0 0 0 .5px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.04); }

/* Карточка входа: переливающаяся рамка */
.dg-login {
  border: 1.5px solid transparent;
  background:
    linear-gradient(#FFFFFF, #FFFFFF) padding-box,
    conic-gradient(from var(--dg-ang), rgba(0,113,227,.45), rgba(175,82,222,.45), rgba(255,45,85,.40), rgba(255,149,0,.40), rgba(90,200,250,.45), rgba(0,113,227,.45)) border-box;
  animation: dg-ang 8s linear infinite, dg-rise .7s var(--dg-ease) backwards;
  animation-delay: 0s, calc(var(--i, 0) * 70ms + 60ms);
}
.dg-login:focus-within {
  background:
    linear-gradient(#FFFFFF, #FFFFFF) padding-box,
    conic-gradient(from var(--dg-ang), #0071E3, #AF52DE, #FF2D55, #FF9500, #5AC8FA, #0071E3) border-box;
  box-shadow: 0 0 0 4px rgba(124,92,255,.08), 0 18px 50px rgba(124,92,255,.16);
}

/* Градиентный заголовок */
.dg-login__title span {
  background: linear-gradient(90deg, #0066CC, #7D3CDB, #C2185B, #7D3CDB, #0066CC);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: dg-flow 10s linear infinite;
}

/* Кнопки: объём */
.dg-btn--primary { background: linear-gradient(180deg, #1A84F2, #0071E3); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 1px 2px rgba(0,113,227,.3); }
.dg-btn--dark { background: linear-gradient(180deg, #3A3A3C, #1D1D1F); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(0,0,0,.25); }
.dg-btn.is-counting { background: #E8F0FB; box-shadow: none; }

/* Аватар: мягкий ореол вокруг кольца */
.dg-avatar::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%; z-index: -2;
  background: conic-gradient(from 0deg, #0071E3, #5AC8FA, #AF52DE, #FF2D55, #FF9500, #0071E3);
  filter: blur(6px); opacity: .55; animation: dg-spin 6s linear infinite;
}
.dg.is-linked .dg-avatar::after { background: #34C759; animation: none; opacity: .35; }

/* Тёмная плитка: розовое свечение */
.dg-tile--dark::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(circle at 0% 0%, rgba(255,45,85,.38), transparent 55%), radial-gradient(circle at 100% 100%, rgba(175,82,222,.22), transparent 60%);
}
.dg-tile__icon--pink { box-shadow: 0 4px 14px rgba(255,45,85,.55); }
.dg-tile__icon--green { box-shadow: 0 4px 12px rgba(52,199,89,.25); }

/* «Печатает…» в плитке поддержки */
.dg-typing { display: inline-flex; gap: 2px; margin-left: 3px; vertical-align: middle; }
.dg-typing i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; animation: dg-dots 1.2s ease-in-out infinite; }
.dg-typing i:nth-child(2) { animation-delay: .15s; }
.dg-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dg-dots { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-3px); opacity: 1; } }

/* Без движения — для тех, кто отключил анимации в системе */
@media (prefers-reduced-motion: reduce) {
  .dg *, .dg *::before, .dg *::after { animation: none !important; transition: none !important; }
  .dg-success__ring, .dg-success__tick { stroke-dashoffset: 0 !important; }
}
.dg [hidden] { display: none !important; }

/* DeliGame integration: existing account/receipt functions in the supplied layout. */
.dg-connection { grid-area:login; display:grid; grid-template-columns:minmax(0,1fr); gap:10px; min-width:0; }
.dg-account__row { min-width:0; }
.dg-connection > section { grid-area:auto; }
.dg-page-msg:empty { display:none; }
.dg-page-msg { margin:0 4px 12px; }
.dg #dg-retry { margin:0 4px 12px; }
.dg-iconbtn { position:relative; }
.dg-cart-badge { position:absolute; right:0; top:0; padding:2px 5px; border-radius:12px; background:var(--dg-accent); color:#fff; font-size:10px; }
.dg-editor-consent { margin:16px 0 0; }
.dg-modal__sheet .dg-input { width:100%; }
.dg-receipt-shortcut { align-self:flex-start; font-size:11px; margin-top:2px; }
.dg-account__edit { border:0; background:none; cursor:pointer; }
.dg-header { padding-top:var(--app-content-top,env(safe-area-inset-top)); }
.dg-footer { padding-bottom:max(16px,var(--app-content-bottom,env(safe-area-inset-bottom))); }
