/* [2026-10-31] VidiPay motion layer — samples chosen by the owner: S, C1, D1, D2, E1, E2, F1, G1, H1.
   Rules: the logo doesn't change; the receipt keeps its own look; the tier list and profile/settings buttons stay in place.
   Soft colors (the app's own green/gold, low saturation), no blur at all on text,
   only transform/opacity — crisp and doesn't heat the phone. Everything is turned off under prefers-reduced-motion. */
:root {
    --vpm-spring: cubic-bezier(.34, 1.4, .64, 1);
    /* Smooth spring (owner's requirement): settles once with a light ~3.5% wobble — no shaking, no bouncing. */
    --vpm-glide: cubic-bezier(.22, 1.12, .36, 1);
    --vpm-out: cubic-bezier(.16, 1, .3, 1);
}
@supports (transition-timing-function: linear(0, 1)) {
    :root {
        --vpm-spring: linear(0, .012, .047 3.2%, .193, .391 9%, .784 15.6%, .925 19.2%, 1.031 23.3%, 1.068 26.7%, 1.083 30.2%, 1.078 33.9%, 1.024 43.8%, 1.002 50.6%, .995 58.4%, 1);
        --vpm-glide: linear(0, .007, .028 2.2%, .11 4.4%, .4 9.3%, .67 14.7%, .84 20%, .95 26%, 1.02 33%, 1.035 39%, 1.03 46%, 1.012 56%, 1.002 66%, 1);
    }
}

/* ---------- S: main screen ---------- */
/* Entrance: the existing sequence (mgRise) with spring motion. */
/* Large blocks settle into place with a soft ease-out, without jumping (owner's request: smooth, no jumps). */
.vpm-on .main-container > * { animation: vpmRise .8s var(--vpm-glide) both; }
@keyframes vpmRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
/* A very slowly floating soft glow in the background (background shapes only, doesn't affect text). */
.vpm-aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.vpm-aurora i { position: absolute; border-radius: 50%; opacity: .55; will-change: transform; }
.vpm-aurora i:nth-child(1) { width: 90vmax; height: 60vmax; left: -30vmax; top: -18vmax; background: radial-gradient(closest-side, rgba(43, 150, 128, .20), transparent); animation: vpmAu1 22s ease-in-out infinite alternate; }
.vpm-aurora i:nth-child(2) { width: 80vmax; height: 55vmax; right: -34vmax; top: 22vh; background: radial-gradient(closest-side, rgba(52, 96, 140, .16), transparent); animation: vpmAu2 26s ease-in-out infinite alternate; }
@keyframes vpmAu1 { to { transform: translate(18vmax, 10vmax) scale(1.12); } }
@keyframes vpmAu2 { to { transform: translate(-14vmax, -8vmax) scale(.92); } }
.vpm-modal-open .vpm-aurora i { animation-play-state: paused; }
/* Balance block (layout stays as before; slot-machine digits removed on 2026-10-31). */
.balance-amount-wrapper { position: relative; }
/* When Tier 1 is active its marker softly "breathes". */
.mg-chip:not(.is-tier-off) #mg-tier-chip { position: relative; }
.vpm-on .mg-chip:not(.is-tier-off):has(#mg-tier-chip) { animation: vpmChipGlow 3.6s ease-in-out infinite; }
@keyframes vpmChipGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(69, 230, 196, 0); } 50% { box-shadow: 0 0 0 4px rgba(69, 230, 196, .10); } }

/* ---------- sparks / coins layer ---------- */
.vpm-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2147483000; }

/* ---------- C1: frame flips open ---------- */
#friend-boost .fb-cell.vpm-flip { animation: vpmFlip .9s var(--vpm-spring) both !important; transform-style: preserve-3d; }
@keyframes vpmFlip { 0% { transform: perspective(240px) rotateY(0) scale(1); } 40% { transform: perspective(240px) rotateY(180deg) scale(1.12); } 100% { transform: perspective(240px) rotateY(360deg) scale(1); } }
#friend-boost .fb-cell.vpm-shake .fb-lock { animation: vpmShake .5s ease-in-out !important; }
@keyframes vpmShake { 15%, 55% { transform: rotate(-14deg); } 35%, 75% { transform: rotate(14deg); } }
.vpm-toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 14px); z-index: 2147483001; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
    background: rgba(20, 46, 44, .96); border: 1px solid rgba(69, 230, 196, .45); color: #CFF7EC; font: 700 13.5px/1 var(--font-num, system-ui); white-space: nowrap;
    box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .65); transform: translate(-50%, -140%); pointer-events: none; }
.vpm-toast svg { width: 16px; height: 16px; stroke: #45E6C4; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.vpm-toast.show { animation: vpmToast 2.8s var(--vpm-spring) forwards; }
@keyframes vpmToast { 0% { transform: translate(-50%, -140%); } 16%, 82% { transform: translate(-50%, 0); } 100% { transform: translate(-50%, -140%); } }

/* ---------- D2: gift box (when a bonus is claimed) ---------- */
.vpm-gift-ov { position: fixed; inset: 0; z-index: 2147482999; display: grid; place-items: center; background: rgba(5, 12, 13, .84); opacity: 0; transition: opacity .3s ease; }
.vpm-gift-ov.on { opacity: 1; }
.vpm-gift-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; transform: scale(.85); transition: transform .7s var(--vpm-spring); }
.vpm-gift-ov.on .vpm-gift-card { transform: none; }
.vpm-rays { position: absolute; width: 300px; height: 300px; left: 50%; top: 70px; transform: translate(-50%, -50%) scale(.4); opacity: 0; border-radius: 50%; z-index: -1;
    background: repeating-conic-gradient(rgba(239, 193, 79, .13) 0 9deg, transparent 9deg 22deg);
    -webkit-mask: radial-gradient(circle, #000 14%, transparent 66%); mask: radial-gradient(circle, #000 14%, transparent 66%);
    transition: opacity .6s ease, transform .9s var(--vpm-spring); }
.vpm-rays.on { opacity: 1; transform: translate(-50%, -50%) scale(1); animation: vpmRaySpin 18s linear infinite; }
@keyframes vpmRaySpin { from { transform: translate(-50%, -50%) rotate(0); } to { transform: translate(-50%, -50%) rotate(360deg); } }
.vpm-gift { width: 116px; height: 116px; }
.vpm-gift svg { width: 100%; height: 100%; overflow: visible; }
.vpm-gift .lid { transform-box: view-box; transform-origin: 54px 40px; transition: transform .9s var(--vpm-spring); }
.vpm-gift.open .lid { transform: translate(-6px, -30px) rotate(-18deg); }
.vpm-gift-amt { font: 800 46px/1 var(--font-num, system-ui); letter-spacing: -.03em; color: #EFC14F; opacity: 0; transform: scale(.5); transition: opacity .3s ease, transform .8s var(--vpm-spring); }
.vpm-gift-amt.on { opacity: 1; transform: none; }
.vpm-gift-lbl { font: 600 14px/1.3 var(--font, system-ui); color: #C3D3CF; max-width: 260px; }

/* ---------- E1: airport split-flap board timer ---------- */
.vpm-flap-src { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
/* [2026-10-31] Fix (owner: digits are not fully visible): border on the whole cell, no border on the halves — the top and bottom
   halves line up exactly (previously each half's 1px border shifted the digit by 1–2px, and a gap showed in the middle).
   Sizes are whole pixels (34 = 17 + 17), larger digit, softer middle line. */
.vpm-flaps { display: inline-flex; gap: 3px; align-items: center; }
.vpm-flaps .sep { font: 800 19px/1 var(--font-num, system-ui); color: var(--muted, #A8B8B4); padding-bottom: 2px; }
/* [2026-10-31] Fix 2 (owner: withdrawal and bonus timers identical, digits sharp and clear, the middle line must not get in
   the digit's way): at rest each cell holds ONE whole digit (.n) — not assembled from two halves, the line is BEHIND
   the digit (background shadow), the digit is drawn over it. Halves and 3D only during the flip (0.52 s), then flat again. */
.vpm-flap { position: relative; width: 22px; height: 34px; border-radius: 7px; background: #142729;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09); font: 800 21px/34px var(--font-num, system-ui); color: var(--text, #E6EFEC);
    text-align: center; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
.vpm-flap.go { perspective: 220px; }
.vpm-flap > span { position: absolute; left: 0; right: 0; height: 17px; overflow: hidden; }
.vpm-flap > span::after { content: attr(data-d); position: absolute; left: 0; right: 0; height: 34px; line-height: 34px; }
.vpm-flap .t, .vpm-flap .ft { top: 0; border-radius: 7px 7px 0 0; background: linear-gradient(180deg, #1d3538, #18302f); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .2); }
.vpm-flap .t::after, .vpm-flap .ft::after { top: 0; }
.vpm-flap .b, .vpm-flap .fb { top: 17px; border-radius: 0 0 7px 7px; background: linear-gradient(180deg, #152a2c, #122527); }
.vpm-flap .b::after, .vpm-flap .fb::after { top: -17px; }
.vpm-flap > .n { top: 0; height: 34px; overflow: visible; z-index: 4; }
.vpm-flap > .n::after { top: 0; }
.vpm-flap:not(.go) > .t::after, .vpm-flap:not(.go) > .b::after, .vpm-flap:not(.go) > .ft, .vpm-flap:not(.go) > .fb, .vpm-flap.go > .n { visibility: hidden; }
.vpm-flap .ft { transform-origin: 50% 100%; z-index: 3; }
.vpm-flap .fb { transform-origin: 50% 0; z-index: 2; }
.vpm-flap.go .ft { animation: vpmFt .26s ease-in forwards; }
.vpm-flap.go .fb { animation: vpmFb .26s var(--vpm-out) .26s both; }
.vpm-flap::after { content: ""; position: absolute; inset: 0; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09); pointer-events: none; z-index: 6; }
@keyframes vpmFt { from { transform: rotateX(0); } to { transform: rotateX(-90deg); } }
@keyframes vpmFb { from { transform: rotateX(90deg); } to { transform: rotateX(0); } }

/* ---------- E2: changes the shape of the withdrawal button ---------- */
#main-withdraw-submit-btn { transition: max-width .5s var(--vpm-spring), border-radius .5s var(--vpm-spring), background .35s ease; max-width: 100%; margin-inline: auto; position: relative; }
#main-withdraw-submit-btn > * { transition: opacity .2s ease; }
#main-withdraw-submit-btn.vpm-busy { max-width: 52px; border-radius: 50% !important; margin-left: auto !important; margin-right: auto !important; }
#main-withdraw-submit-btn.vpm-busy, #main-withdraw-submit-btn.vpm-done { margin-left: auto !important; margin-right: auto !important; }
#main-withdraw-submit-btn.vpm-busy > *, #main-withdraw-submit-btn.vpm-done > * { opacity: 0; }
/* [2026-11-19] The circle and the check mark below share this button's ::after with the buttons' sheen (vidipay-pro.css):
   "transform: none", "background: none" and "bottom: auto" keep the sheen's sideways push, its light streak and its
   stretched edge out of them, so both stay exactly in the middle of the button. The circle's ring is light now: while the
   request is on its way the button is dimmed (dark), and the old dark ring could not be seen on it - what moved there
   before was the sheen's streak, not the ring. */
#main-withdraw-submit-btn.vpm-busy::after { content: ""; position: absolute; left: 50%; top: 50%; bottom: auto; width: 22px; height: 22px; margin: -11px 0 0 -11px; background: none; transform: none; border-radius: 50%; border: 3px solid rgba(191, 241, 226, .22); border-top-color: #BFF1E2; animation: vpmSpin .8s linear infinite; }
#main-withdraw-submit-btn.vpm-done { background: linear-gradient(135deg, #6fdcb8, #2bb58a) !important; }
#main-withdraw-submit-btn.vpm-done::after { content: ""; position: absolute; left: 50%; top: 50%; bottom: auto; width: 26px; height: 26px; margin: -13px 0 0 -13px; transform: none;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23052019' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
    animation: vpmPop .5s var(--vpm-spring); }
@keyframes vpmSpin { to { transform: rotate(360deg); } }
@keyframes vpmPop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
#mg-wd-processing:not([hidden]) { animation: vpmRise .8s var(--vpm-glide) both; }

/* ---------- Switching between modals: INSTANT, no flicker ----------
   [2026-11-01] Owner: "When switching to the Bonus and History modals the main screen shows through". Previously, when opened from the main screen,
   the whole modal (with its background) faded in from transparent over 0.18 s — at that moment the main screen behind it was visible. Now the modal (background
   and content) is complete from the very first frame: neither background nor content fades in from transparent (modal to modal, and from the main screen too). */
.modal-overlay.vpm-swap,
.modal-overlay.vpm-enter,
.modal-overlay.vpm-swap > .modal-content,
.modal-overlay.vpm-enter > .modal-content { animation: none !important; opacity: 1; }

/* ---------- H1: login modal (logo does not change) ---------- */
.mg-auth-word .vpm-l { display: inline-block; }
.vpm-auth-in .mg-auth-word .vpm-l { animation: vpmLetter .7s var(--vpm-spring) both; animation-delay: calc(var(--k, 0) * .05s + .15s); }
@keyframes vpmLetter { from { opacity: 0; transform: translateY(16px) rotateX(70deg); } to { opacity: 1; transform: none; } }
.vpm-auth-in .mg-auth-pane:not([hidden]) > * { animation: vpmRise .8s var(--vpm-glide) both; }
.vpm-auth-in .mg-auth-pane:not([hidden]) > :nth-child(2) { animation-delay: .5s; }
.vpm-auth-in .mg-auth-pane:not([hidden]) > :nth-child(3) { animation-delay: .62s; }
.vpm-auth-in .mg-auth-pane:not([hidden]) > :nth-child(4) { animation-delay: .74s; }
.vpm-auth-in .mg-auth-pane:not([hidden]) > :nth-child(5) { animation-delay: .86s; }
.vpm-auth-in .mg-auth-pane:not([hidden]) > :nth-child(n+6) { animation-delay: .98s; }
.mg-auth-btn { position: relative; overflow: hidden; }
.vpm-on .mg-auth-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%); transform: translateX(-130%); animation: vpmSheen 4.5s ease-in-out 1.4s infinite; pointer-events: none; }
@keyframes vpmSheen { 0%, 55% { transform: translateX(-130%); } 85%, 100% { transform: translateX(130%); } }

/* The balance chart unfolds smoothly from left to right the first time it is drawn. */
.vp-chart.vpm-draw { animation: vpmReveal 1.5s var(--vpm-out) both; }
@keyframes vpmReveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

@media (prefers-reduced-motion: reduce) {
    .vp-chart.vpm-draw,
    .vpm-on .main-container > *, .vpm-aurora i, .vpm-on .mg-chip,
    .vpm-auth-in *, .vpm-on .mg-auth-btn::after, #mg-wd-processing, #friend-boost .fb-cell.vpm-flip { animation: none !important; }
    .vpm-fx, .vpm-aurora { display: none !important; }
}
