:root {
    --primary: #a855f7;
    --primary-soft: #7c3aed;
    --primary-strong: #c4b5fd;
    --bg: #020617;
    --bg-card: rgba(15, 23, 42, 0.92);
    --border-subtle: rgba(148, 163, 184, 0.32);
    --text: #e5e7eb;
    --text-muted: #9ca3af;

    --color-bg1: rgb(72, 7, 120);
    --color-bg2: rgb(4, 9, 35);
    --color1: 129, 140, 248;
    --color2: 221, 74, 255;
    --color3: 56, 189, 248;
    --color4: 236, 72, 153;
    --color5: 250, 204, 21;
    --color-interactive: 168, 85, 247;
    --circle-size: 80%;
    --blending: hard-light;
}

* { box-sizing: border-box; }

html {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Vazirmatn", system-ui, sans-serif;
    background: #020617;
    direction: rtl;
    text-align: right;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---------- بک‌گراند ---------- */

.gradient-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(40deg, var(--color-bg1), var(--color-bg2));
    z-index: 0;
    pointer-events: none;
}

.gradient-bg svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
}

.gradients-container {
    filter: url(#goo) blur(40px);
    width: 100%;
    height: 100%;
}

.gradients-container > div {
    position: absolute;
    mix-blend-mode: var(--blending);
}

.g1 {
    background: radial-gradient(circle, rgba(var(--color1), .85), transparent 55%);
    width: var(--circle-size);
    height: var(--circle-size);
    top: calc(50% - var(--circle-size)/2);
    left: calc(50% - var(--circle-size)/2);
    animation: moveVertical 30s infinite ease-in-out;
}

.g2 {
    background: radial-gradient(circle, rgba(var(--color2), .9), transparent 55%);
    width: var(--circle-size);
    height: var(--circle-size);
    top: calc(50% - var(--circle-size)/2);
    left: calc(50% - var(--circle-size)/2);
    animation: moveInCircle 22s infinite reverse;
}

.g3 {
    background: radial-gradient(circle, rgba(var(--color3), .85), transparent 55%);
    width: var(--circle-size);
    height: var(--circle-size);
    top: calc(50% - var(--circle-size)/2 + 200px);
    left: calc(50% - var(--circle-size)/2 - 500px);
    animation: moveInCircle 38s infinite linear;
}

.g4 {
    background: radial-gradient(circle, rgba(var(--color4), .8), transparent 55%);
    width: var(--circle-size);
    height: var(--circle-size);
    top: calc(50% - var(--circle-size)/2);
    left: calc(50% - var(--circle-size)/2);
    animation: moveHorizontal 32s infinite ease-in-out;
}

.g5 {
    background: radial-gradient(circle, rgba(var(--color5), .85), transparent 55%);
    width: calc(var(--circle-size)*2);
    height: calc(var(--circle-size)*2);
    top: calc(50% - var(--circle-size));
    left: calc(50% - var(--circle-size));
    animation: moveInCircle 26s infinite ease-in-out;
}

.interactive {
    background: radial-gradient(circle, rgba(var(--color-interactive), .95), transparent 55%);
    width: 100%;
    height: 100%;
    top: -50%;
    left: -50%;
    position: absolute;
}

@keyframes moveInCircle {
    0%   { transform: rotate(0deg); }
    50%  { transform: rotate(180deg); }
    100% { transform: rotate(360deg); }
}

@keyframes moveVertical {
    0%   { transform: translateY(-40%); }
    50%  { transform: translateY(40%); }
    100% { transform: translateY(-40%); }
}

@keyframes moveHorizontal {
    0%   { transform: translate(-40%, -10%); }
    50%  { transform: translate(40%, 10%); }
    100% { transform: translate(-40%, -10%); }
}

/* ---------- محتوا / استیکی فوتر ---------- */

.page-root {
    position: relative;
    min-height: 100vh;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.page-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

/* ---------- navbar ---------- */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100vw;
    max-width: 100vw;
    margin-right: calc(50% - 50vw);
    margin-left: 0;

    padding: 8px 16px;
    margin-bottom: 24px;

    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.45);
    border-top: none;
    border-right: none;
    border-left: none;
}

.navbar-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-section-right {
    justify-content: flex-start;
    flex: 1 1 0;
}

.navbar-section-center {
    justify-content: center;
    flex: 0 0 auto;
}

.navbar-section-left {
    justify-content: flex-end;
    flex: 1 1 0;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--primary-strong);
    white-space: nowrap;
}

.navbar-title {
    font-size: 18px;
    line-height: 1;
}

.navbar-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

.navbar-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transform: translateY(-2px);
}

.navbar-logo-fallback {
    background:
        radial-gradient(circle at 20% 20%, #f97316, transparent 60%),
        radial-gradient(circle at 80% 80%, var(--primary-soft), transparent 55%);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
}

.navbar-links {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
}

.navbar-links a {
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 14px;
    transition: 0.2s;
    white-space: nowrap;
}

.navbar-links a:hover {
    background: rgba(148, 163, 184, 0.18);
    color: var(--text);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-stars-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(250, 204, 21, 0.9);
    background: radial-gradient(circle at 0 0, rgba(250, 204, 21, 0.25), transparent 55%),
                rgba(15, 23, 42, 0.96);
    color: #fef9c3;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.9);
}

.navbar-stars-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.navbar-stars-count {
    min-width: 20px;
    text-align: center;
}

/* پِل تعداد توکن‌ها در هدر */
.navbar-tokens-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(129, 140, 248, 0.9);
    background:
        radial-gradient(circle at 0 0, rgba(129, 140, 248, 0.3), transparent 55%),
        rgba(15, 23, 42, 0.96);
    color: #e0e7ff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.9);
}

.navbar-tokens-icon {
    font-size: 16px;
    line-height: 1;
}

.navbar-tokens-label {
    font-size: 13px;
    opacity: 0.9;
}

.navbar-tokens-count {
    min-width: 20px;
    text-align: center;
    font-weight: 700;
}

.btn {
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    white-space: nowrap;
}

.btn-ghost {
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    border-color: rgba(30, 64, 175, 0.5);
}

.btn-ghost:hover {
    background: rgba(15, 23, 42, 0.96);
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    color: white;
    border-color: rgba(59, 130, 246, 0.9);
}

/* ---------- ریسپانسیو navbar ---------- */

@media (max-width: 768px) {
    .navbar {
        padding: 8px 10px;
    }

    .navbar-section-right,
    .navbar-section-center,
    .navbar-section-left {
        flex: 0 0 auto;
    }

    .navbar-section-right {
        justify-content: flex-start;
    }

    .navbar-section-center {
        display: none;
    }

    .navbar-section-left {
        justify-content: flex-end;
        gap: 8px;
    }

    .navbar-links {
        display: none;
    }

    .navbar-title {
        font-size: 16px;
    }

    .btn {
        padding: 6px 10px;
        font-size: 13px;
    }

    .navbar-stars-pill,
    .navbar-tokens-pill {
        padding: 5px 12px;
        font-size: 13px;
    }

    .navbar-stars-icon {
        width: 17px;
        height: 17px;
    }

    .navbar-tokens-icon {
        font-size: 14px;
    }
}

/* ---------- Footer ---------- */

.site-footer {
    margin-top: auto;

    padding: 28px 0 14px;

    width: 100vw;
    max-width: 100vw;
    margin-right: calc(50% - 50vw);
    margin-left: 0;

    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.9),
        rgba(15, 23, 42, 0.98)
    );
    border-top: 1px solid rgba(148, 163, 184, 0.4);
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.3fr; /* سه ستون: توضیح / ارتباط / اینماد */
    gap: 24px;
}

.footer-col-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-strong);
    margin-bottom: 10px;
}

.footer-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.9;
}

/* لینک تلگرام و شماره در فوتر */
.footer-telegram-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-top: 4px;
    padding: 7px 16px;
    border-radius: 999px;

    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(129, 140, 248, 0.8);
    color: #bfdbfe;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;

    box-shadow:
        0 10px 24px rgba(15, 23, 42, 0.95),
        0 0 0 1px rgba(15, 23, 42, 0.95);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        color 0.15s ease;
}

/* پِل دوم (شماره تماس) کمی فاصله از قبلی */
.footer-telegram-link + .footer-telegram-link {
    margin-top: 10px;
}

/* فقط برای شماره تماس، کمی فاصله حروف */
.footer-telegram-link-phone {
    letter-spacing: 0.04em;
}

.footer-telegram-link:hover {
    transform: translateY(-2px);
    background:
        radial-gradient(circle at 0 0, rgba(129, 140, 248, 0.2), transparent 55%),
        rgba(15, 23, 42, 0.98);
    border-color: rgba(191, 219, 254, 0.95);
    color: #e5edff;
    box-shadow:
        0 16px 36px rgba(15, 23, 42, 0.98),
        0 0 0 1px rgba(129, 140, 248, 0.9);
}

/* اینماد */

.footer-enamad-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.footer-enamad-label {
    font-size: 11px;
    color: var(--text-muted);
}

.footer-enamad-badge img {
    max-width: 96px;
    height: auto;
    display: block;
}

.footer-bottom {
    max-width: 960px;
    margin: 16px auto 0;
    padding: 12px 16px 0;
    border-top: 1px solid rgba(30, 64, 175, 0.45);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.footer-bottom-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.6);
    font-size: 11px;
    color: #bfdbfe;
}

@media (max-width: 900px) {
    .footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .site-footer {
        padding-top: 22px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---------- Bottom Nav ---------- */

.bottom-nav { display: none; }

@media (max-width: 768px) {
    .page-root {
        padding-bottom: 0;
    }

    .site-footer {
        padding-bottom: calc(14px + 76px);
    }

    .bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        margin-right: calc(50% - 50vw);
        margin-left: 0;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
        background: linear-gradient(
            180deg,
            rgba(15, 23, 42, 0) 0%,
            rgba(15, 23, 42, 0.9) 35%
        );
        display: block;
        z-index: 40;
    }

    .bottom-nav-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 0 4px 2px;
        background: transparent;
        border: none;
        box-shadow: none;
    }

    .bottom-nav-auth { width: 100%; }

    .bottom-nav-item {
        flex: 1 1 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;

        padding: 8px 10px;
        border-radius: 999px;

        background: rgba(15, 23, 42, 0.96);
        border: 1px solid rgba(148, 163, 184, 0.65);
        color: #e5e7eb;
        font-size: 12px;
        font-weight: 600;
        text-align: center;

        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.95);
        transition:
            transform 0.12s ease,
            box-shadow 0.12s ease,
            border-color 0.12s ease,
            background 0.12s ease,
            color 0.12s ease;
    }

    .bottom-nav-item-primary {
        background: linear-gradient(135deg, #4f46e5, #8b5cf6);
        border-color: rgba(191, 219, 254, 0.95);
        color: #f9fafb;
    }

    .bottom-nav-item:active {
        transform: translateY(1px);
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.95);
    }

    .bottom-nav-item-icon {
        font-size: 16px;
        line-height: 1;
    }

    .bottom-nav-item-label {
        line-height: 1;
        white-space: nowrap;
    }

    .bottom-nav-guest {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        max-width: 480px;
        margin: 0 auto;
        padding: 11px 18px;

        border-radius: 999px;
        background: linear-gradient(135deg, #6366f1, #a855f7);
        border: 1px solid rgba(219, 234, 254, 0.9);

        color: #f9fafb;
        font-size: 14px;
        font-weight: 700;
        text-align: center;

        box-shadow:
            0 12px 32px rgba(15, 23, 42, 0.9),
            0 0 0 1px rgba(15, 23, 42, 0.85);

        animation: bottom-nav-pulse 2.3s ease-out infinite;
    }

    .bottom-nav-guest-icon { font-size: 16px; }

    @keyframes bottom-nav-pulse {
        0% {
            box-shadow:
                0 12px 32px rgba(15, 23, 42, 0.9),
                0 0 0 0 rgba(129, 140, 248, 0.8);
        }
        70% {
            box-shadow:
                0 16px 40px rgba(15, 23, 42, 1),
                0 0 0 18px rgba(129, 140, 248, 0);
        }
        100% {
            box-shadow:
                0 12px 32px rgba(15, 23, 42, 0.9),
                0 0 0 0 rgba(129, 140, 248, 0);
        }
    }
}
