:root {
    --nerd-50: #fdf2fc;
    --nerd-100: #fbe4fa;
    --nerd-300: #f09fe9;
    --nerd-500: #d03ec4;
    --nerd-700: #8e2081;
    --nerd-800: #751c6a;
    --nerd-900: #41103b;
    --nerd-950: #230420;
}

nerd-header,
nerd-footer,
nerd-download-modal {
    display: block;
}

.site-shell-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: box-shadow 180ms ease, background-color 180ms ease;
}

.site-shell-header.scrolled {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 32px -22px rgba(65, 16, 59, 0.5);
}

.site-shell-container {
    width: min(100% - 2rem, 80rem);
    margin-inline: auto;
}

.site-shell-nav {
    min-height: 4.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-shell-logo {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.site-shell-logo img {
    display: block;
    width: auto;
    height: 2.35rem;
}

.site-shell-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-shell-link {
    color: #475569;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 160ms ease;
}

.site-shell-link:hover {
    color: var(--nerd-800);
}

.site-shell-download {
    min-height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--nerd-700), var(--nerd-900));
    box-shadow: 0 10px 24px -14px rgba(65, 16, 59, 0.9);
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.site-shell-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -14px rgba(65, 16, 59, 0.95);
}

.site-shell-download svg,
.site-shell-footer-download svg {
    width: 1rem;
    height: 1rem;
    flex: none;
}

.site-shell-footer {
    position: relative;
    overflow: hidden;
    padding: 3rem 1rem 2rem;
    color: #94a3b8;
    background: #020617;
    text-align: center;
}

.site-shell-footer::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(208, 62, 196, 0.7), transparent);
}

.site-shell-footer-logo {
    display: block;
    width: auto;
    height: 2.5rem;
    margin: 0 auto;
}

.site-shell-footer-tagline {
    margin: 0.75rem 0 0;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 700;
}

.site-shell-footer-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.65rem 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: #f7c9f4;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease;
}

.site-shell-footer-download:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.site-shell-footer-rule {
    width: 6rem;
    height: 1px;
    margin: 1.5rem auto;
    border: 0;
    background: #1e293b;
}

.site-shell-copyright {
    margin: 0;
    color: #64748b;
    font-size: 0.75rem;
}

.site-shell-copyright strong {
    color: #cbd5e1;
}

.download-dialog[hidden] {
    display: none;
}

.download-dialog {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: end center;
}

.download-dialog__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(35, 4, 32, 0.76);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 220ms ease;
}

.download-dialog__card {
    position: relative;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    padding: 1.4rem 1.4rem 1.6rem;
    border-radius: 1.75rem 1.75rem 0 0;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.35);
    text-align: center;
    transform: translateY(24px);
    opacity: 0;
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
}

.download-dialog.open .download-dialog__backdrop,
.download-dialog.open .download-dialog__card {
    opacity: 1;
}

.download-dialog.open .download-dialog__card {
    transform: translateY(0);
}

.download-dialog__grabber {
    width: 3.5rem;
    height: 0.25rem;
    margin: 0 auto 1.2rem;
    border-radius: 999px;
    background: #e2e8f0;
}

.download-dialog__close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 2.3rem;
    height: 2.3rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    color: #64748b;
    background: #f1f5f9;
    cursor: pointer;
}

.download-dialog__close svg {
    width: 1rem;
    height: 1rem;
}

.download-dialog__icon {
    display: block;
    width: auto;
    height: 3.1rem;
    margin: 0 auto 0.75rem;
}

.download-dialog__title {
    margin: 0;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 900;
}

.download-dialog__subtitle {
    margin: 0.25rem 0 1.4rem;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 700;
}

.download-option {
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    margin-top: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: 0.85rem;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 900;
    text-decoration: none;
    transition: transform 160ms ease, filter 160ms ease;
}

.download-option:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.download-option--play {
    background: #09090b;
}

.download-option--apk {
    background: linear-gradient(135deg, var(--nerd-500), var(--nerd-800));
}

.download-option--telegram {
    background: linear-gradient(135deg, #38bdf8, #0284c7);
}

.download-option svg {
    width: 1.25rem;
    height: 1.25rem;
}

.download-dialog__note {
    margin: 0.85rem 0 0;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.7;
}

@media (min-width: 640px) {
    .site-shell-nav {
        min-height: 5rem;
    }

    .site-shell-logo img {
        height: 2.75rem;
    }

    .site-shell-download {
        padding-inline: 1.25rem;
        font-size: 0.875rem;
    }

    .download-dialog {
        place-items: center;
        padding: 1rem;
    }

    .download-dialog__card {
        width: min(100%, 27rem);
        padding: 2rem;
        border-radius: 1.75rem;
    }

    .download-dialog__grabber {
        display: none;
    }
}

@media (max-width: 767px) {
    .site-shell-link {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-shell-header,
    .site-shell-download,
    .site-shell-footer-download,
    .download-dialog__backdrop,
    .download-dialog__card,
    .download-option {
        transition: none;
    }
}
