/* ==========================================================================
    1. Base Styles
========================================================================== */
body, .markdown-body, .markdown-body *:not(a) {
    color: #e6e6e6 !important;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../background.svg') center/cover no-repeat fixed;
    z-index: -2;
    min-height: 100vh;
    transform: translateZ(0);
    will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
    body::before {
        transform: translateY(calc(var(--scroll) * -0.05)) scale(1.1);
    }
}

body,
h1, h2, h3, h4, h5, h6,
button, input, textarea, select,
.markdown-body {
    font-family: 'Nunito', sans-serif !important;
}

#count {
    color: #ffbc00 !important;
}

body {
    background: #2d2d33;
    position: relative;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-weight: 400;
    min-height: 100vh;
    color: #e6e6e6 !important;
    font-size: 16px; /* Базовый размер шрифта */
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(32px) brightness(0.85);
    z-index: -1;
}

.splide__arrow--next {
    right: 2em !important;
}

.splide__arrow--prev {
    left: 2em !important;
}

#spline-model,
#spline-model-2 {
    position: fixed;
    width: 60vw;
    height: 80vh;
    z-index: 0;
    opacity: 0.7;
    filter: blur(4px) saturate(75%);
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}

#spline-model {
    top: 67%;
    right: -72%;
    transform: scale(2.4);
}

#spline-model-2 {
    bottom: -89%;
    left: 43%;
    transform: scale(2.5);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), bottom 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, bottom;
}

.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
    2. Markdown Content
========================================================================== */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    color: #f0f0f0 !important;
}

.markdown-body {
    box-sizing: border-box;
    min-width: 200px;
    max-width: 980px;
    margin: -10px auto 0;
    padding: 45px;
    background-color: inherit;
}

.markdown-body h1 {
    font-weight: 800;
    font-size: 44px;
}

.markdown-body h2 {
    font-weight: 200;
    font-size: 44px;
}

.markdown-body h3 {
    font-weight: 600;
}

.markdown-body a {
    color: #ffbc00 !important;
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body p {
    margin: 0 20px;
    font-size: 18px;
    padding-top: 15px;
    color: inherit !important;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin: 0 18px 28px;
    letter-spacing: -0.03em;
    border-bottom: 0 solid #404040;
    padding-bottom: 0.3em;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5em auto;
    border-radius: 8px;
}

.markdown-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.markdown-body th,
.markdown-body td {
    padding: 12px;
    background-color: #252525;
}

.markdown-body hr {
    height: 0;
    background-color: rgba(136, 136, 136, 0.21);
    margin-top: 16px;
}

.markdown-body pre {
    background: #1a1a1a;
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
}

.markdown-body code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

/* ==========================================================================
    3. Components
========================================================================== */
.embed {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 2px;
    padding-left: 20px;
    margin-left: 50px;
    position: relative;
}

.embed::before {
    content: "";
    position: absolute;
    left: -4px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ffbc00;
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(255, 188, 0, 0.4), 0 0 20px rgba(255, 188, 0, 0.3);
}

.vidget {
    width: 94%;
    padding: 15px;
    margin: auto;
    background: #18181c;
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    box-shadow: 0 10px 18px rgba(0,0,0,0.24);
    gap: 15px;
}

.status-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 2em 0;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
}

.status-panel {
    padding: 20px;
    background: #252525;
    border-radius: 8px;
    text-align: center;
}

.guild-count {
    font-size: 2em;
    font-weight: bold;
    color: #7289da !important;
    margin-bottom: 8px;
    text-shadow: 0 0 12px rgba(114,137,218,0.3);
}

.status-label {
    color: #888 !important;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
    box-shadow: 0 0 10px currentColor;
}

.status-dot.online {
    background-color: #4CAF50;
    animation: pulse-green 1.5s infinite;
}

.status-dot.offline {
    background-color: #F44336;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(76,175,80,0.4); }
    70% { box-shadow: 0 0 0 10px rgba(76,175,80,0); }
    100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
}

.discord-logo {
    margin: -3px -3px -3px 0;
    width: 65px;
    height: 35px;
}

.carousel-mobile {
    display: none;
}

.carousel-desktop {
    display: block;
}

/* ==========================================================================
    4. Discord Widget
========================================================================== */
.widget-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 40px 0;
}

.widget-header {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 300px;
}

.widget-header::after,
.widget-header::before {
    content: "";
    display: block;
    height: 3px;
    background: #ffbc00;
    margin: 0 auto;
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(255, 188, 0, 0.4), 0 0 20px rgba(255, 188, 0, 0.3);
}

.widget-header::after {
    width: 50px;
}

.widget-header::before {
    width: 170px;
    margin-top: -40px;
}

.widget-header h3 {
    color: #fff !important;
    font-size: 1.3em;
    margin: 0;
    padding: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.discord-widget {
    background: #1a1a1e;
    border-radius: 8px;
    padding: 16px;
    width: 300px;
    color: #dcddde !important;
    box-shadow: 0 8px 16px rgba(0,0,0,0.24);
    margin: 30px 0 10px;
}

.server-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.server-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid #353535;
}

.server-name {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.join-button {
    display: block;
    width: 100%;
    padding: 10px 0;
    background: #3ba55c;
    color: #fff !important;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.join-button:hover {
    background: #2d7d46;
}

.join-button:active {
    background: #265f39;
}

.members-count {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #b9bbbe !important;
    margin: 10px 0;
    padding: 6px;
    background: #242429;
    border-radius: 6px;
    border: 1px solid #404040;
}

.members-icon {
    width: 24px;
    height: 24px;
    filter: invert(0.8);
    transition: transform 0.2s ease;
}

.members-count:hover .members-icon {
    transform: scale(1.1);
}

/* ==========================================================================
    5. Footer
========================================================================== */
.footer {
    background: rgba(26, 26, 29, 0.8);
    backdrop-filter: blur(2px);
    border-top: 1px solid rgba(54, 54, 54, 0.53);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    color: #888 !important;
    padding: 1px 0;
    text-align: center;
    width: 100%;
}

.footer-content {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
    6. Cookie Banner
========================================================================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #18181c;
    padding: 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    z-index: 2000;
}

.cookie-content {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.cookie-content p {
    margin: 0;
    color: #888 !important;
    font-size: 0.9em;
}

.cookie-btn {
    background: #242429;
    color: #fff !important;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ==========================================================================
    7. Responsive Styles
========================================================================== */
@media (max-width: 3456px) {
    #spline-model {
        top: 77%;
        right: -122%;
        transform: scale(4.2);
    }

    #spline-model-2 {
        bottom: -119%;
        left: 107%;
        transform: scale(4.6);
    }
}

@media (max-width: 3024px) {
    #spline-model {
        top: 77%;
        right: -112%;
        transform: scale(3.9);
    }

    #spline-model-2 {
        bottom: -119%;
        left: 97%;
        transform: scale(4.2);
    }
}

@media (max-width: 2880px) {
    #spline-model {
        top: 77%;
        right: -93%;
        transform: scale(3.2);
    }

    #spline-model-2 {
        bottom: -119%;
        left: 75%;
        transform: scale(3.4);
    }
}

@media (max-width: 2560px) {
    body {
        font-size: 16px;
    }
    
    #spline-model {
        top: 77%;
        right: -80%;
        transform: scale(2.8);
    }

    #spline-model-2 {
        bottom: -119%;
        left: 61%;
        transform: scale(2.8);
    }
}

@media (max-width: 1920px) {
    body {
        font-size: 16px;
    }
    
    #spline-model {
        top: 67%;
        right: -72%;
        transform: scale(2.4);
    }

    #spline-model-2 {
        bottom: -89%;
        left: 43%;
        transform: scale(2.5);
    }
}

@media (max-width: 1440px) {
    body {
        font-size: 16px;
    }
    
    #spline-model {
        top: 27%;
        right: -48%;
        transform: scale(1.4);
    }

    #spline-model-2 {
        bottom: -59%;
        left: 11%;
        transform: scale(1.4);
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    #spline-model,
    #spline-model-2 {
        display: none !important;
    }

    .markdown-body {
        padding: 25px;
        font-size: 0.95em;
    }

    .status-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }

    .discord-widget {
        width: 90%;
        margin: 20px auto -40px;
    }
    
    body::before {
        background-attachment: scroll;
        transform: none !important;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
        margin: 0;
        padding: 0;
    }

    .carousel-mobile {
        display: block;
    }

    .carousel-desktop {
        display: none;
    }

    .markdown-body {
        padding: 15px 15px 35px;
        font-size: 0.9em;
    }

    .markdown-body h2 {
        font-size: 28px;
        margin-bottom: 14px;
    }

    .embed {
        margin-left: 25px;
    }

    .status-container {
        padding: 10px;
        gap: 10px;
    }

    .discord-widget {
        width: 80%;
        margin: 20px auto 10px;
    }

    .vidget {
        margin-top: 15px;
        width: 87%;
    }

    .discord-logo {
        width: 54px;
        height: 25px;
    }
}