/* ============================================
   QuickGames — polish layer
   جلوه‌های تکمیلی: تیکر، بوردر متحرک، پروگرس اسکرول
   ============================================ */

/* ---------- نوار پیشرفت اسکرول ---------- */

.scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    z-index: 2000;
    pointer-events: none;
    background: transparent;
}

.scroll-progress__bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.6);
    border-radius: 0 3px 3px 0;
    transition: width 80ms linear;
}

/* ---------- تیکر بازی‌ها (marquee) ---------- */

.game-ticker {
    position: relative;
    direction: ltr;
    overflow: hidden;
    padding: 18px 0;
    border-block: 1px solid rgba(var(--primary-rgb), 0.1);
    background: rgba(8, 12, 22, 0.55);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

/* حرکت توسط JS انجام می‌شود (data-ticker در main.js) تا مستقل از RTL و
   تنظیم reduced-motion سیستم‌عامل همیشه روان باشد */
.game-ticker__track {
    display: flex;
    gap: 44px;
    width: max-content;
    will-change: transform;
}

.game-ticker__item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: rgba(200, 212, 240, 0.65);
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.2s ease;
}

.game-ticker__item:hover {
    color: var(--primary);
}

.game-ticker__item img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
}

.game-ticker__sep {
    color: rgba(var(--primary-rgb), 0.4);
    font-size: 0.8em;
}


/* ---------- بوردر گرادیان چرخان برای پنل CTA ---------- */

.landing-cta__panel {
    position: relative;
}

.landing-cta__panel::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(
        from var(--cta-angle, 0deg),
        transparent 0%,
        var(--primary) 12%,
        transparent 28%,
        transparent 50%,
        var(--accent) 62%,
        transparent 78%
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    animation: cta-border-spin 6s linear infinite;
    pointer-events: none;
}

@property --cta-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes cta-border-spin {
    to { --cta-angle: 360deg; }
}

/* ---------- درخشش کارت بازی روی هاور ---------- */

.game-card {
    position: relative;
}

.game-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--primary-rgb), 0.1), transparent 45%);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.game-card:hover::after {
    opacity: 1;
}

/* ---------- badge پالس زنده برای آمار ---------- */

.landing-tag--live {
    position: relative;
}

.landing-tag--live .live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
    animation: live-ping 1.8s cubic-bezier(0.66, 0, 0, 1) infinite;
}

@keyframes live-ping {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
    70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------- دکمه تعویض تم ---------- */

button.icon-btn,
button.mobile-icon-btn {
    cursor: pointer;
    font: inherit;
    padding: 0;
}

button[data-theme-toggle]:active i {
    transform: rotate(40deg);
}

button[data-theme-toggle] i {
    transition: transform 0.3s ease;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .landing-cta__panel::before,
    .landing-tag--live .live-dot {
        animation: none;
    }
}
