/* =====================================================================
   ОТКРЫТИЕ КРУТОК — сцена призыва (summon-fx.js)
   Фазы (data-phase): charge → burst → reveal → done
   Цвет сцены: --sx-c / --sx-c2 / --sx-rgb — по лучшей карте в призыве.
   ===================================================================== */

.sx {
    --sx-c: #a78bfa;
    --sx-c2: #6d28d9;
    --sx-rgb: 167, 139, 250;
    position: fixed;
    inset: 0;
    z-index: 11500;
    display: none;
    flex-direction: column;
    color: #fff;
    font-family: 'Inter', system-ui, sans-serif;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.sx.open { display: flex; }
.sx * { box-sizing: border-box; }

/* ---------- Фон ---------- */
.sx-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 70% at 50% 42%, rgba(var(--sx-rgb), 0.20), transparent 62%),
        radial-gradient(80% 50% at 50% 110%, rgba(var(--sx-rgb), 0.16), transparent 70%),
        #04030a;
    opacity: 0;
    transition: opacity 0.35s ease, background 0.6s ease;
}
.sx.open .sx-bg { opacity: 1; }
/* Медленно плывущая туманность в цвет редкости */
.sx-bg::before {
    content: '';
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(40% 30% at 30% 30%, rgba(var(--sx-rgb), 0.22), transparent 70%),
        radial-gradient(35% 28% at 72% 68%, rgba(var(--sx-rgb), 0.16), transparent 70%);
    filter: blur(20px);
    animation: sxNebula 14s ease-in-out infinite alternate;
}
@keyframes sxNebula { to { transform: rotate(14deg) scale(1.08); } }
/* Виньетка */
.sx-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.75) 100%);
}

.sx-fx {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 30;  /* искры поверх карт и крупного показа */
}

/* ---------- Портал ---------- */
.sx-portal {
    position: absolute;
    left: 50%;
    top: 46%;
    width: min(78vw, 360px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.2, 1.15), opacity 0.4s ease;
}
.sx[data-phase="charge"] .sx-portal { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.sx[data-phase="burst"] .sx-portal {
    transform: translate(-50%, -50%) scale(2.6);
    opacity: 0;
    transition: transform 0.55s cubic-bezier(0.5, 0, 0.8, 0.4), opacity 0.5s ease 0.05s;
}
.sx[data-phase="reveal"] .sx-portal,
.sx[data-phase="done"] .sx-portal { display: none; }

.sx-vortex,
.sx-ring,
.sx-core,
.sx-sigil { position: absolute; border-radius: 50%; }

.sx-vortex {
    inset: 0;
    background:
        conic-gradient(from 0deg,
            transparent 0deg, rgba(var(--sx-rgb), 0.55) 40deg, transparent 90deg,
            rgba(var(--sx-rgb), 0.35) 150deg, transparent 200deg,
            rgba(var(--sx-rgb), 0.6) 260deg, transparent 320deg);
    -webkit-mask: radial-gradient(circle, transparent 18%, #000 30%, #000 58%, transparent 71%);
    mask: radial-gradient(circle, transparent 18%, #000 30%, #000 58%, transparent 71%);
    filter: blur(2px);
    animation: sxSpin 2.4s linear infinite;
}
.sx-vortex.b {
    inset: 8%;
    opacity: 0.7;
    animation-duration: 1.6s;
    animation-direction: reverse;
}
.sx-ring {
    inset: 14%;
    border: 2px solid rgba(var(--sx-rgb), 0.75);
    box-shadow: 0 0 24px rgba(var(--sx-rgb), 0.7), inset 0 0 24px rgba(var(--sx-rgb), 0.5);
    animation: sxPulseRing 1.4s ease-in-out infinite;
}
.sx-ring.r2 { inset: 24%; border-style: dashed; border-width: 1.5px; animation: sxSpin 6s linear infinite; box-shadow: none; }
.sx-ring.r3 { inset: 2%; border-width: 1px; opacity: 0.45; animation: sxSpin 11s linear infinite reverse; box-shadow: none; }
.sx-core {
    inset: 33%;
    background: radial-gradient(circle, #fff 0%, rgba(var(--sx-rgb), 1) 30%, rgba(var(--sx-rgb), 0.35) 58%, transparent 72%);
    filter: blur(1px);
    animation: sxCore 0.9s ease-in-out infinite;
}
.sx-sigil {
    inset: -6%;
    background: center / contain no-repeat;
    opacity: 0.55;
    animation: sxSpin 18s linear infinite;
}
.sx-sigil svg { width: 100%; height: 100%; display: block; color: rgba(var(--sx-rgb), 0.85); }

/* Ступень «разгона» — портал вздрагивает и расширяется */
.sx-portal.kick { animation: sxKick 0.38s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes sxKick {
    0%   { transform: translate(-50%, -50%) scale(1); }
    40%  { transform: translate(-50%, -50%) scale(1.16); }
    100% { transform: translate(-50%, -50%) scale(1); }
}
@keyframes sxSpin { to { transform: rotate(360deg); } }
@keyframes sxPulseRing { 50% { transform: scale(1.06); opacity: 0.7; } }
@keyframes sxCore { 50% { transform: scale(1.12); filter: blur(2px) brightness(1.3); } }

/* Подсказка под порталом */
.sx-hint {
    position: absolute;
    left: 0; right: 0;
    bottom: calc(18% + var(--app-bottom, 0px));
    z-index: 4;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.sx[data-phase="charge"] .sx-hint { opacity: 1; animation: sxBlink 1.6s ease-in-out infinite; }
@keyframes sxBlink { 50% { opacity: 0.35; } }

/* Вспышка и ударная волна */
.sx-flash {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    background: radial-gradient(circle at 50% 46%, #fff 0%, rgba(var(--sx-rgb), 0.85) 35%, transparent 75%);
    opacity: 0;
}
.sx-flash.go { animation: sxFlash 0.75s ease-out; }
@keyframes sxFlash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }

.sx-wave {
    position: absolute;
    left: 50%;
    top: 46%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    z-index: 5;
    pointer-events: none;
    border: 3px solid rgba(var(--sx-rgb), 0.9);
    box-shadow: 0 0 40px rgba(var(--sx-rgb), 0.8), inset 0 0 30px rgba(var(--sx-rgb), 0.6);
    opacity: 0;
}
.sx-wave.go { animation: sxWave 0.9s cubic-bezier(0.1, 0.7, 0.3, 1); }
@keyframes sxWave {
    0%   { opacity: 1; transform: scale(0.2); }
    100% { opacity: 0; transform: scale(28); border-width: 1px; }
}

/* Тряска всей сцены */
.sx.shake-s .sx-stage { animation: sxShake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
.sx.shake-l .sx-stage,
.sx.shake-l .sx-spot-stage { animation: sxShakeL 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes sxShake {
    20% { transform: translate(-3px, 2px); } 40% { transform: translate(3px, -2px); }
    60% { transform: translate(-2px, -1px); } 80% { transform: translate(2px, 1px); }
}
@keyframes sxShakeL {
    10% { transform: translate(-7px, 3px) rotate(-0.6deg); } 25% { transform: translate(7px, -4px) rotate(0.6deg); }
    40% { transform: translate(-6px, -2px); } 55% { transform: translate(5px, 3px); }
    70% { transform: translate(-3px, 1px); } 85% { transform: translate(2px, -1px); }
}

/* ---------- Верх: заголовок и прогресс ---------- */
.sx-top {
    position: relative;
    z-index: 7;
    flex-shrink: 0;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(14px + var(--app-top, 0px)) 16px 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.sx[data-phase="reveal"] .sx-top,
.sx[data-phase="done"] .sx-top { opacity: 1; transform: none; }
.sx-title { flex: 1; min-width: 0; }
.sx-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(var(--sx-rgb), 1);
    text-shadow: 0 0 12px rgba(var(--sx-rgb), 0.6);
}
.sx-head {
    margin-top: 2px;
    font-family: 'Unbounded', 'Inter', sans-serif;
    font-size: 19px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sx-count {
    flex-shrink: 0;
    min-width: 64px;
    padding: 8px 12px;
    border-radius: 14px;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}
.sx-count small { color: rgba(255, 255, 255, 0.5); font-weight: 700; }
.sx-bar {
    position: absolute;
    left: 16px; right: 16px; bottom: 0;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}
.sx-bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--sx-c2), var(--sx-c));
    box-shadow: 0 0 10px rgba(var(--sx-rgb), 0.8);
    transition: width 0.35s ease;
}

/* ---------- Сетка карт ----------
   Размер карт считает JS так, чтобы всё влезало в экран.
   Отступы по краям — запас под свечение, тряску и подъём карты,
   чтобы ничего не обрезалось. */
.sx-stage {
    position: relative;
    z-index: 4;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 14px;
    overflow: visible;
}
.sx-stage.scroll {
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.sx-stage.scroll::-webkit-scrollbar { display: none; }
.sx-grid {
    display: grid;
    gap: var(--sx-gap, 10px);
    justify-content: center;
    align-content: center;
    padding: 6px;
}

/* ---------- Карта ---------- */
.sx-card {
    --tc: #e2e8f0;
    --trgb: 226, 232, 240;
    position: relative;
    width: var(--sx-w, 100px);
    aspect-ratio: 3 / 4;
    perspective: 900px;
    cursor: pointer;
    opacity: 0;
}
.sx-card.in { opacity: 1; }
.sx-card-in {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.62s cubic-bezier(0.3, 1.3, 0.45, 1);
}
.sx-card.flipped .sx-card-in { transform: rotateY(180deg); }
.sx-face {
    position: absolute;
    inset: 0;
    border-radius: calc(var(--sx-w, 100px) * 0.07);
    overflow: hidden;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.sx-back {
    background: var(--back) center / 100% 100% no-repeat;
    /* Блик и всё содержимое — строго по форме рубашки (у PNG прозрачные края) */
    -webkit-mask: var(--back) center / 100% 100% no-repeat;
    mask: var(--back) center / 100% 100% no-repeat;
}
/* Блик, пробегающий по рубашке */
.sx-back::after {
    content: '';
    position: absolute;
    inset: -40% -60%;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
    transform: translateX(-60%);
    animation: sxSheen 2.8s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes sxSheen { 0%, 60% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }

.sx-front {
    transform: rotateY(180deg);
    background: #0b0a12;
    box-shadow: 0 0 0 1.5px rgba(var(--trgb), 0.9), 0 8px 22px rgba(0, 0, 0, 0.6);
}
.sx-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
/* Голографическая полоса по лицевой стороне (лег. и выше) */
.sx-card.t3 .sx-front::after,
.sx-card.t4 .sx-front::after,
.sx-card.t5 .sx-front::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.0) 38%, rgba(var(--trgb), 0.35) 46%, rgba(255, 255, 255, 0.45) 50%, rgba(var(--trgb), 0.35) 54%, transparent 62%);
    background-size: 250% 250%;
    mix-blend-mode: screen;
    animation: sxHolo 3.2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes sxHolo { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

/* Аура вокруг карты — цвет редкости */
.sx-aura {
    position: absolute;
    inset: -14%;
    border-radius: 30%;
    background: radial-gradient(closest-side, rgba(var(--trgb), 0.75), transparent);
    filter: blur(6px);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    z-index: -1;
}
.sx-card.t2 .sx-aura { --aura: 0.35; }
.sx-card.t3 .sx-aura { --aura: 0.6; }
.sx-card.t4 .sx-aura,
.sx-card.t5 .sx-aura { --aura: 0.9; }
.sx-card.flipped .sx-aura { opacity: var(--aura, 0); transform: scale(1); }
.sx-card.t4.flipped .sx-aura,
.sx-card.t5.flipped .sx-aura { animation: sxAura 1.8s ease-in-out infinite; }
@keyframes sxAura { 50% { transform: scale(1.08); opacity: 0.6; } }

/* Перед переворотом редкой карты — «заряд»: дрожь и свечение */
.sx-card.charging .sx-card-in { animation: sxCharge 0.12s linear infinite; }
.sx-card.charging .sx-aura { opacity: 1; transform: scale(1.15); transition-duration: 0.3s; }
@keyframes sxCharge {
    0% { transform: translate(0, 0) rotate(0); }
    25% { transform: translate(-1.5px, 1px) rotate(-1deg); }
    50% { transform: translate(1.5px, -1px) rotate(1deg); }
    75% { transform: translate(-1px, -1px) rotate(-0.5deg); }
}
.sx-card.pop { animation: sxPop 0.55s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes sxPop { 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* Кольцо-ударная волна вокруг карты при раскрытии */
.sx-ring-hit {
    position: absolute;
    left: 50%; top: 50%;
    width: 60%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid rgba(var(--trgb), 0.95);
    box-shadow: 0 0 18px rgba(var(--trgb), 0.9);
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 0;
    pointer-events: none;
    animation: sxHit 0.7s cubic-bezier(0.1, 0.7, 0.3, 1) forwards;
}
@keyframes sxHit {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.3); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2.6); }
}

/* Метки «НОВАЯ» и «ДУБЛЬ» */
.sx-tag {
    position: absolute;
    left: 50%;
    bottom: 5%;
    transform: translateX(-50%) scale(0.6);
    padding: 3px 7px;
    border-radius: 6px;
    font-size: clamp(7px, calc(var(--sx-w, 100px) * 0.085), 11px);
    font-weight: 900;
    letter-spacing: 0.06em;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease 0.35s, transform 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) 0.35s;
    z-index: 2;
}
.sx-card.flipped .sx-tag { opacity: 1; transform: translateX(-50%) scale(1); }
.sx-tag.new { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #1a1005; box-shadow: 0 0 12px rgba(251, 191, 36, 0.7); }
.sx-tag.dup { background: rgba(10, 10, 16, 0.86); color: #d1d5db; border: 1px solid rgba(255, 255, 255, 0.18); }
.sx-tag.dup b { color: #fde68a; }
.sx-card.dup.flipped .sx-front img { filter: saturate(0.75) brightness(0.88); }

/* ---------- Низ: сводка и кнопки ---------- */
.sx-bottom {
    position: relative;
    z-index: 7;
    flex-shrink: 0;
    padding: 6px 16px calc(16px + var(--app-bottom, 0px));
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.sx[data-phase="reveal"] .sx-bottom,
.sx[data-phase="done"] .sx-bottom { opacity: 1; transform: none; }
.sx-bottom-in { max-width: 520px; margin: 0 auto; }

.sx-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-end;
    gap: 6px;
    min-height: 62px;
    margin-bottom: 10px;
    visibility: hidden;
}
.sx[data-phase="done"] .sx-summary { visibility: visible; animation: sxRise 0.45s ease both; }
@keyframes sxRise { from { opacity: 0; transform: translateY(8px); } }
.sx-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(var(--trgb), 0.35);
    font-size: 12px;
    font-weight: 800;
}
.sx-chip i {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgb(var(--trgb));
    box-shadow: 0 0 8px rgb(var(--trgb));
}
.sx-chip.meta { --trgb: 255, 255, 255; border-color: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.75); }
.sx-chip.meta b { color: #fde68a; }

.sx-actions { display: flex; gap: 10px; min-height: 54px; }  /* место под кнопки занято сразу — сетка не прыгает */
.sx-btn {
    flex: 1;
    height: 54px;
    border: none;
    border-radius: 18px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, opacity 0.2s ease;
}
.sx-btn:active { transform: scale(0.97); }
.sx-btn[hidden] { display: none; }
.sx-btn.ghost {
    flex: 0 0 auto;
    padding: 0 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.sx-btn.main {
    color: #1f1405;
    background: linear-gradient(135deg, #fff4cf, #f3c969 40%, #d9a650 70%, #f3d38b);
    box-shadow: 0 12px 30px rgba(243, 201, 105, 0.35), inset 0 -3px 0 rgba(120, 72, 10, 0.3);
}
.sx-btn.main::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    transform: skewX(-20deg);
    animation: sxBtnSheen 2.6s ease-in-out infinite;
}
@keyframes sxBtnSheen { 0%, 55% { left: -60%; } 100% { left: 140%; } }
.sx-btn.tint {
    background: linear-gradient(135deg, rgba(var(--sx-rgb), 0.55), rgba(var(--sx-rgb), 0.25));
    border: 1px solid rgba(var(--sx-rgb), 0.6);
    box-shadow: 0 10px 26px rgba(var(--sx-rgb), 0.3);
}
.sx-btn small { display: block; font-size: 11px; font-weight: 700; opacity: 0.7; margin-top: 1px; }

/* ---------- Крупный показ (мифические, божественные, тап по карте) ---------- */
.sx-spot {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(var(--app-top, 0px) + 20px) 20px calc(var(--app-bottom, 0px) + 24px);
    background: radial-gradient(circle at 50% 45%, rgba(var(--tr, 167, 139, 250), 0.28), rgba(2, 2, 6, 0.94) 60%);
    cursor: pointer;
}
.sx-spot.open { display: flex; animation: sxFade 0.3s ease; }
.sx-spot.closing { animation: sxFadeOut 0.25s ease forwards; }
@keyframes sxFade { from { opacity: 0; } }
@keyframes sxFadeOut { to { opacity: 0; } }

.sx-spot-rays {
    position: absolute;
    left: 50%; top: 45%;
    width: 170vmax;
    height: 170vmax;
    margin: -85vmax 0 0 -85vmax;
    background: repeating-conic-gradient(from 0deg, rgba(var(--tr, 167, 139, 250), 0.22) 0deg 6deg, transparent 6deg 18deg);
    -webkit-mask: radial-gradient(circle, #000 0%, transparent 55%);
    mask: radial-gradient(circle, #000 0%, transparent 55%);
    animation: sxSpin 24s linear infinite;
    pointer-events: none;
}
.sx-spot-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 100%;
}
.sx-spot-rarity {
    font-family: 'Unbounded', 'Inter', sans-serif;
    font-size: clamp(22px, 7.5vw, 34px);
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: linear-gradient(180deg, #fff 10%, rgb(var(--tr, 167, 139, 250)) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 16px rgba(var(--tr, 167, 139, 250), 0.8));
    animation: sxTitleIn 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes sxTitleIn { from { opacity: 0; transform: scale(1.8); letter-spacing: 0.5em; } }

.sx-spot-card {
    position: relative;
    width: min(66vw, 320px, calc((100vh - var(--app-top, 0px) - var(--app-bottom, 0px) - 220px) * 0.75));
    aspect-ratio: 3 / 4;
    border-radius: 16px;
    transform-style: preserve-3d;
    animation: sxSpotIn 0.75s cubic-bezier(0.2, 1.2, 0.35, 1) both;
}
@keyframes sxSpotIn {
    0%   { opacity: 0; transform: perspective(900px) rotateY(-200deg) scale(0.4); }
    60%  { opacity: 1; }
    100% { transform: perspective(900px) rotateY(0) scale(1); }
}
.sx-spot-tilt {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.15s ease-out;
}
.sx-spot-tilt img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
    box-shadow: 0 0 0 2px rgba(var(--tr, 167, 139, 250), 0.9), 0 0 60px rgba(var(--tr, 167, 139, 250), 0.6), 0 30px 60px rgba(0, 0, 0, 0.7);
}
.sx-spot-tilt::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 48%, rgba(var(--tr, 167, 139, 250), 0.25) 52%, transparent 66%);
    background-size: 250% 250%;
    background-position: var(--hx, 120%) 0;
    mix-blend-mode: screen;
    animation: sxHolo 3.4s ease-in-out infinite;
    pointer-events: none;
}
.sx-spot-name {
    font-size: 20px;
    font-weight: 900;
    text-align: center;
    max-width: 90vw;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
    animation: sxRise 0.5s ease 0.25s both;
}
.sx-spot-sub {
    display: flex;
    gap: 8px;
    justify-content: center;
    animation: sxRise 0.5s ease 0.35s both;
}
.sx-spot-sub span {
    padding: 5px 10px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
}
.sx-spot-sub .new { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #1a1005; }
.sx-spot-sub .dup { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); }
.sx-spot-sub .dup b { color: #fde68a; }
.sx-spot-tap {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    animation: sxRise 0.5s ease 0.6s both, sxBlink 1.6s ease-in-out 1.1s infinite;
}

/* ---------- Быстрый режим: короткая вспышка, карты сразу лицом ---------- */
.sx.fast .sx-card { transition: none; }

/* ---------- Лёгкая графика: без тяжёлых слоёв ---------- */
html.perf-lite .sx-bg::before,
html.perf-lite .sx-back::after,
html.perf-lite .sx-card .sx-front::after,
html.perf-lite .sx-spot-tilt::after { display: none !important; }
html.perf-lite .sx-vortex { filter: none; }
html.perf-lite .sx-aura { filter: none; }
html.perf-lite .sx-card.t4.flipped .sx-aura,
html.perf-lite .sx-card.t5.flipped .sx-aura { animation: none; }
html.perf-lite .sx-spot-rays { animation: none; }

@media (prefers-reduced-motion: reduce) {
    .sx-vortex, .sx-ring, .sx-sigil, .sx-spot-rays, .sx-back::after, .sx-bg::before { animation: none !important; }
}

/* ---------- Выбор режима в магазине ---------- */
.sx-modes {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    margin-bottom: 10px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.07);
}
.sx-mode {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px 7px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: color 0.25s ease;
}
.sx-mode small { font-size: 10px; font-weight: 700; opacity: 0.75; letter-spacing: 0.01em; }
.sx-mode svg { width: 16px; height: 16px; margin-bottom: 1px; }
.sx-mode.active { color: #fff; }
.sx-modes-glider {
    position: absolute;
    top: 4px; bottom: 4px; left: 4px;
    width: calc((100% - 16px) / 3);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.55), rgba(76, 29, 149, 0.55));
    box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.4), 0 6px 18px rgba(139, 92, 246, 0.35);
    transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.5, 1);
}
.sx-modes[data-mode="manual"] .sx-modes-glider { transform: translateX(calc(100% + 4px)); }
.sx-modes[data-mode="fast"] .sx-modes-glider { transform: translateX(calc(200% + 8px)); }
#tab-shop .es-actions .gacha-btn-main { flex: 1; }
