:root {
    --rf6-bg: #0b0d11;
    --rf6-surface: #101318;
    --rf6-surface-2: #11151b;
    --rf6-surface-3: #151a21;
    --rf6-text: #f5f6f7;
    --rf6-secondary: #9ba1aa;
    --rf6-muted: #686f79;
    --rf6-red: #e52b32;
    --rf6-red-hover: #f2383f;
    --rf6-border: #242a33;
    --rf6-green: #43d17b;
    --rf6-container: 1240px;
}

html { background: var(--rf6-bg); }
body.dark,
body.dark.pushable,
body:has(.redful-home-v6),
body.pushable:has(.redful-home-v6) {
    color: var(--rf6-text);
    background: var(--rf6-bg) !important;
    font-family: Inter, Geist, Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.dark.rf-page-background {
    background-color: var(--rf6-bg) !important;
    background-image: var(--rf-page-background-image) !important;
    background-position: center top !important;
    background-size: cover !important;
    background-attachment: fixed !important;
}
body.dark.rf-page-background > .pusher {
    background: rgba(11, 13, 17, .82) !important;
}

.rf6-container {
    width: min(var(--rf6-container), calc(100% - 48px));
    margin-right: auto;
    margin-left: auto;
}

body:has(.redful-home-v6) #redful-main-content.ui.container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body:has(.redful-home-v6) .redful-page-shell,
body:has(.redful-home-v6) #wrapper { background: var(--rf6-bg) !important; }

/* Header */
.redful-site-header {
    min-height: 72px !important;
    border-bottom: 1px solid var(--rf6-border) !important;
    background: rgba(11, 13, 17, .97) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.redful-header-inner.ui.container {
    width: min(var(--rf6-container), calc(100% - 48px)) !important;
    min-height: 71px !important;
    padding: 0 !important;
}

.redful-wordmark { gap: 0 !important; }
.redful-wordmark-mark { display: none !important; }
.redful-wordmark-text {
    color: var(--rf6-text) !important;
    font-size: 1.55rem !important;
    font-weight: 800 !important;
    letter-spacing: -.045em !important;
}
.redful-wordmark-text b { color: var(--rf6-red) !important; }

.redful-primary-navigation { gap: 18px !important; }
.redful-primary-links { gap: 24px !important; }
.redful-nav-link,
.redful-nav-group > summary {
    min-height: 71px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--rf6-secondary) !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: .72rem !important;
    font-weight: 700 !important;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.redful-nav-link > i.icon,
.redful-nav-group > summary > i:first-child { display: none !important; }
.redful-nav-link:hover,
.redful-nav-group > summary:hover,
.redful-nav-link.active { color: var(--rf6-text) !important; }
.redful-nav-link.active::after {
    right: 0 !important;
    bottom: 14px !important;
    left: 0 !important;
    height: 2px !important;
    border-radius: 0 !important;
    background: var(--rf6-red) !important;
}

.redful-primary-links .redful-nav-cta,
.redful-primary-links [href="/modpacks/"],
.redful-primary-links [href="/p/pravila-proekta/"] { display: none !important; }

.redful-nav-tools { gap: 14px !important; }
.redful-language-switcher { font-size: .69rem !important; }
.redful-account-link {
    min-height: 36px !important;
    padding: 0 !important;
    border: 0 !important;
    color: var(--rf6-secondary) !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: .72rem !important;
    text-transform: uppercase;
}
.redful-account-link:hover { color: var(--rf6-text) !important; }
.redful-register-link { display: none !important; }
.redful-account-trigger,
.redful-icon-trigger {
    min-height: 38px !important;
    border-color: var(--rf6-border) !important;
    border-radius: 6px !important;
    background: var(--rf6-surface) !important;
    box-shadow: none !important;
}
.redful-user-menu[data-redful-user-menu="pms"] > .redful-icon-trigger > i.icon,
.redful-user-menu[data-redful-user-menu="alerts"] > .redful-icon-trigger > i.icon,
.redful-icon-trigger > i.fa-envelope,
.redful-icon-trigger > i.fa-flag {
    width: 1em !important;
    margin: 0 !important;
    font-size: 1rem !important;
    line-height: 1 !important;
}
@media (min-width: 901px) {
    .redful-user-menu[data-redful-user-menu="pms"] > .redful-icon-trigger,
    .redful-user-menu[data-redful-user-menu="alerts"] > .redful-icon-trigger {
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        padding: 0 !important;
    }
}
.rf6-header-cta {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 14px;
    padding: 0 17px;
    border-radius: 6px;
    color: #fff !important;
    background: var(--rf6-red);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
    transition: background-color .18s ease, transform .18s ease;
}
.rf6-header-cta:hover { color: #fff !important; background: var(--rf6-red-hover); transform: translateY(-1px); }
.rf6-header-cta i.icon { margin: 0 !important; }

/* Homepage */
.redful-home-v6 {
    width: 100% !important;
    max-width: none !important;
    overflow: hidden;
    padding: 0 0 56px !important;
    color: var(--rf6-text);
    background: var(--rf6-bg);
}

.rf6-hero.redful-hero {
    position: relative;
    isolation: isolate;
    width: 100% !important;
    min-height: clamp(520px, 64vh, 680px) !important;
    margin: 0 !important;
    overflow: hidden;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--rf6-bg) !important;
    box-shadow: none !important;
}
.rf6-hero.redful-hero::before,
.rf6-hero.redful-hero::after { display: none !important; }
.rf6-hero-visual {
    position: absolute;
    z-index: -3;
    inset: 0;
    background: var(--redful-hero-image, none) center 45% / cover no-repeat;
}
.rf6-hero-overlay {
    position: absolute;
    z-index: -2;
    inset: 0;
    background:
        linear-gradient(90deg, #0b0d11 0%, rgba(11, 13, 17, .96) 34%, rgba(11, 13, 17, .58) 66%, rgba(11, 13, 17, .22) 100%),
        linear-gradient(0deg, #0b0d11 0%, transparent 34%);
}
.rf6-hero-inner {
    display: flex;
    min-height: clamp(520px, 64vh, 680px);
    align-items: center;
    padding: 52px 0;
}
.rf6-hero-copy { max-width: 650px; }
.rf6-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--rf6-secondary);
    font-size: .76rem;
    font-weight: 650;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.rf6-eyebrow > span { width: 28px; height: 2px; background: var(--rf6-red); }
.rf6-hero-copy h1 {
    max-width: 630px;
    margin: 0;
    color: var(--rf6-text);
    font-size: clamp(3.25rem, 4.55vw, 4rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -.045em;
    text-wrap: balance;
}
.rf6-hero-copy p {
    max-width: 560px;
    margin: 20px 0 0;
    color: var(--rf6-secondary);
    font-size: 1rem;
    line-height: 1.6;
}
.rf6-hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 28px; }
.rf6-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--rf6-text) !important;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .025em;
    text-transform: uppercase;
    transition: color .18s ease, background-color .18s ease, transform .18s ease;
}
.rf6-button-primary { padding: 0 18px; border-radius: 6px; background: var(--rf6-red); }
.rf6-button-primary:hover { color: #fff !important; background: var(--rf6-red-hover); transform: translateY(-2px); }
.rf6-button-text { color: var(--rf6-secondary) !important; }
.rf6-button-text:hover { color: var(--rf6-text) !important; }
.rf6-button i.icon { margin: 0 !important; color: var(--rf6-red); }

.rf6-section { margin-top: 34px; }
.rf6-servers { position: relative; z-index: 3; margin-top: -120px; }
.rf6-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}
.rf6-section-head h2 {
    margin: 0;
    color: var(--rf6-text);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .015em;
    text-transform: uppercase;
}
.rf6-section-head a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--rf6-secondary) !important;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .025em;
    text-transform: uppercase;
}
.rf6-section-head a:hover { color: var(--rf6-text) !important; }
.rf6-section-head a i.icon { margin: 0 !important; color: var(--rf6-red); }

.rf6-server-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rf6-server-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--rf6-border);
    border-radius: 8px;
    background: var(--rf6-surface);
    transition: border-color .18s ease, transform .18s ease;
}
.rf6-server-card:hover { border-color: #3a424e; transform: translateY(-2px); }
.rf6-server-link { position: relative; display: block; min-height: 162px; color: var(--rf6-text) !important; }
.rf6-server-media,
.rf6-server-shade { position: absolute; inset: 0; }
.rf6-server-media img { width: 100%; height: 100%; object-fit: cover; }
.rf6-server-fallback {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: #39414c;
    background: var(--rf6-surface-3);
    font-size: 2rem;
}
.rf6-server-fallback i.icon { margin: 0 !important; }
.rf6-server-shade { background: linear-gradient(90deg, rgba(8, 10, 14, .93), rgba(8, 10, 14, .48) 70%, rgba(8, 10, 14, .64)); }
.rf6-server-content {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 162px;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}
.rf6-server-content > strong {
    overflow: hidden;
    color: #fff;
    font-size: 1.36rem;
    font-weight: 750;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.rf6-server-category { margin-top: 3px; color: var(--rf6-red); font-size: .78rem; }
.rf6-server-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 13px;
    color: var(--rf6-secondary);
    font-size: .75rem;
}
.rf6-server-meta .online { color: #d6d9dd; }
.rf6-server-meta .online i.icon { margin: 0 6px 0 0 !important; color: var(--rf6-green); font-size: .48rem; }
.rf6-server-meta .offline i.icon { margin: 0 6px 0 0 !important; font-size: .48rem; }
.rf6-server-meta .status-unavailable { color: var(--rf6-secondary); }

.rf6-news { margin-top: 34px; }
.rf6-news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rf6-news-item { min-width: 0; padding: 9px 28px 12px 0; }
.rf6-news-item + .rf6-news-item { padding-left: 28px; border-left: 1px solid var(--rf6-border); }
.rf6-news-media {
    display: block;
    width: 100%;
    max-height: 190px;
    overflow: hidden;
    aspect-ratio: 16 / 8;
    border: 1px solid var(--rf6-border);
    border-radius: 8px;
    background: var(--rf6-surface);
}
.rf6-news-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .18s ease;
}
.rf6-news-media:hover img { transform: scale(1.015); }
.rf6-news-media-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: var(--rf6-muted);
    font-size: 1.35rem;
}
.rf6-news-media-placeholder i.icon { margin: 0 !important; }
.rf6-news-item time { display: block; margin-top: 14px; color: var(--rf6-red); font-size: .73rem; }
.rf6-news-item h3 { margin: 8px 0 7px; font-size: .96rem; font-weight: 600; line-height: 1.35; }
.rf6-news-item h3 a { color: var(--rf6-text) !important; }
.rf6-news-item h3 a:hover { color: var(--rf6-red-hover) !important; }
.rf6-news-item p {
    display: -webkit-box;
    max-width: 38ch;
    margin: 0;
    overflow: hidden;
    color: var(--rf6-secondary);
    font-size: .82rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.rf6-empty { grid-column: 1 / -1; padding: 24px; border: 1px solid var(--rf6-border); color: var(--rf6-secondary); background: var(--rf6-surface); }
.rf6-custom-content { margin-top: 36px; }

/* News page: compact live server rail. */
.rf6-news-page-layout {
    display: grid;
    width: 100%;
    max-width: 1148px;
    align-items: start;
    gap: 28px;
    grid-template-columns: minmax(0, 820px) 300px;
}
.redful-news-page > .redful-page-header {
    position: relative;
    isolation: isolate;
    width: 100%;
    max-width: 1148px;
    box-sizing: border-box;
    overflow: hidden;
    background-image:
        linear-gradient(90deg, rgba(14, 20, 29, .97), rgba(27, 15, 22, .86)),
        var(--rf-page-background-image, none) !important;
    background-position: center !important;
    background-size: cover !important;
}
.redful-news-page > .redful-page-header > h1,
.redful-news-page > .redful-page-header > p { max-width: 700px; }
.rf6-news-feed { min-width: 0; }
.redful-news-page .rf-news-grid { grid-template-columns: minmax(0, 1fr); }
.redful-news-page .redful-news-cover {
    max-height: 350px;
    aspect-ratio: 16 / 7;
}
.rf6-news-servers { min-width: 0; }
.rf6-news-servers-panel {
    position: sticky;
    top: 92px;
    overflow: hidden;
    border: 1px solid var(--rf6-border);
    border-radius: 8px;
    background: var(--rf6-surface);
}
.rf6-news-servers-head {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--rf6-border);
}
.rf6-news-servers-head h2 { margin: 0; color: var(--rf6-text); font-size: .88rem; }
.rf6-news-servers-head a { color: var(--rf6-secondary) !important; }
.rf6-news-servers-head a:hover { color: var(--rf6-text) !important; }
.rf6-news-servers-head i.icon { margin: 0 !important; color: var(--rf6-red); }
.rf6-news-server-list { padding: 6px 0; }
.rf6-news-server {
    display: grid;
    min-width: 0;
    min-height: 64px;
    align-items: center;
    gap: 11px;
    padding: 8px 12px;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    color: var(--rf6-text) !important;
    transition: background-color .18s ease;
}
.rf6-news-server:hover { background: var(--rf6-surface-3); }
.rf6-news-server-thumb {
    display: grid;
    width: 48px;
    height: 48px;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--rf6-border);
    border-radius: 6px;
    color: var(--rf6-muted);
    background: var(--rf6-bg);
}
.rf6-news-server-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rf6-news-server-thumb i.icon { margin: 0 !important; }
.rf6-news-server-copy { min-width: 0; }
.rf6-news-server-copy strong,
.rf6-news-server-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf6-news-server-copy strong { color: var(--rf6-text); font-size: .82rem; }
.rf6-news-server-copy small { margin-top: 4px; color: var(--rf6-muted); font-size: .68rem; }
.rf6-news-server-status { color: var(--rf6-secondary); font-size: .69rem; white-space: nowrap; }
.rf6-news-server-status i.icon { margin: 0 4px 0 0 !important; font-size: .48rem; }
.rf6-news-server-status.online { color: var(--rf6-green); }
.rf6-news-server-status.offline,
.rf6-news-server-status.unavailable { color: var(--rf6-muted); }
.rf6-news-server-divider { display: block; height: 1px; margin: 0 12px 0 71px; background: var(--rf6-border); }
.rf6-news-server-empty { margin: 0; padding: 16px; color: var(--rf6-secondary); font-size: .78rem; }

/* Footer */
#footer.rf6-footer {
    margin: 0 !important;
    padding: 30px 0 !important;
    border-width: 1px 0 0 !important;
    border-color: var(--rf6-border) !important;
    border-radius: 0 !important;
    background: var(--rf6-bg) !important;
    box-shadow: none !important;
}
.rf6-footer-inner {
    display: grid;
    grid-template-columns: minmax(190px, .8fr) minmax(360px, 1.5fr) minmax(170px, .7fr);
    align-items: center;
    gap: 34px;
}
.rf6-footer-brand { display: flex; align-items: center; gap: 26px; }
.rf6-footer-wordmark { color: var(--rf6-text) !important; font-size: 1.45rem; font-weight: 800; letter-spacing: -.045em; }
.rf6-footer-wordmark b { color: var(--rf6-red); }
.rf6-footer-brand p { margin: 0; color: var(--rf6-muted); font-size: .7rem; line-height: 1.55; }
.rf6-footer-links { display: flex; align-items: center; justify-content: center; gap: 34px; }
.rf6-footer-links a { color: var(--rf6-secondary) !important; font-size: .72rem; }
.rf6-footer-links a:hover { color: var(--rf6-text) !important; }
.rf6-footer-tools { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.rf6-footer-social { display: flex; align-items: center; gap: 16px; }
.rf6-footer-social a { color: var(--rf6-secondary) !important; }
.rf6-footer-social a:hover { color: var(--rf6-text) !important; }
.rf6-footer-social .icon { margin: 0 !important; font-size: 1rem; }
.rf6-page-load,
.rf6-auto-language { display: none !important; }
.redful-footer-languages { display: inline-flex; gap: 5px; color: var(--rf6-muted); font-size: .67rem; }
.redful-footer-languages a { color: var(--rf6-muted) !important; }
.redful-footer-languages a.active { color: var(--rf6-text) !important; }

:where(.rf6-button, .rf6-server-link, .rf6-section-head a, .rf6-news-item a, .rf6-header-cta, .rf6-footer a):focus-visible {
    outline: 2px solid #fff !important;
    outline-offset: 3px;
}

@media (max-width: 1180px) {
    .redful-primary-links { gap: 15px !important; }
    .redful-primary-links [href="/forum/"] { display: none !important; }
    .redful-nav-tools { gap: 9px !important; }
    .rf6-header-cta { padding-inline: 13px; }
}

@media (max-width: 992px) {
    .rf6-hero-copy h1 { font-size: clamp(2.8rem, 6vw, 3.4rem); }
    .rf6-server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rf6-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rf6-news-item:nth-child(3) { padding-left: 0; border-top: 1px solid var(--rf6-border); border-left: 0; }
    .rf6-footer-inner { grid-template-columns: 1fr; text-align: center; }
    .rf6-footer-brand,
    .rf6-footer-links,
    .rf6-footer-tools { justify-content: center; }
}

@media (max-width: 900px) {
    .redful-header-inner.ui.container {
        width: 100% !important;
        min-height: 64px !important;
        margin: 0 !important;
        padding: 0 16px !important;
        box-sizing: border-box;
    }
    .redful-site-header { min-height: 65px !important; }
    .redful-nav-toggle { display: inline-flex !important; }
    .redful-primary-navigation { background: var(--rf6-surface) !important; }
    .redful-primary-links { gap: 0 !important; }
    .redful-primary-links .redful-nav-cta,
    .redful-primary-links [href="/modpacks/"],
    .redful-primary-links [href="/p/pravila-proekta/"],
    .redful-primary-links [href="/forum/"] { display: flex !important; }
    .redful-nav-link,
    .redful-nav-group > summary { min-height: 48px !important; padding: 0 8px !important; }
    .redful-nav-link.active::after { top: 8px !important; right: auto !important; bottom: 8px !important; left: 0 !important; width: 2px !important; height: auto !important; }
    .redful-register-link { display: inline-flex !important; }
    .rf6-header-cta { width: 100%; justify-content: space-between; margin-top: 8px; }
    .rf6-news-page-layout { grid-template-columns: minmax(0, 1fr); }
    .rf6-news-servers-panel { position: static; }
    .redful-news-page .redful-news-cover { max-height: none; aspect-ratio: 16 / 9; }
}

@media (max-width: 768px) {
    .rf6-container { width: calc(100% - 32px); }
    .rf6-hero.redful-hero,
    .rf6-hero-inner { min-height: auto !important; }
    .rf6-hero-visual { background-position: 64% center; }
    .rf6-hero-overlay {
        background:
            linear-gradient(90deg, rgba(11, 13, 17, .98), rgba(11, 13, 17, .7)),
            linear-gradient(0deg, #0b0d11 0%, transparent 44%);
    }
    .rf6-hero-inner { padding: 72px 0 56px; }
    .rf6-hero-copy { max-width: 540px; }
    .rf6-hero-copy h1 { font-size: clamp(2.55rem, 9.5vw, 3.3rem); }
    .rf6-servers { margin-top: 0; }
    .rf6-server-grid { grid-template-columns: 1fr; }
    .rf6-server-link,
    .rf6-server-content { min-height: 174px; }
    .rf6-news-grid { grid-template-columns: 1fr; }
    .rf6-news-item,
    .rf6-news-item + .rf6-news-item,
    .rf6-news-item:nth-child(3) { padding: 18px 0; border-top: 1px solid var(--rf6-border); border-left: 0; }
    .rf6-news-item:first-child { padding-top: 8px; border-top: 0; }
    .rf6-footer-links { flex-wrap: wrap; gap: 14px 24px; }
}

@media (max-width: 480px) {
    .rf6-hero.redful-hero,
    .rf6-hero-inner { min-height: auto !important; }
    .rf6-hero-inner { align-items: center; padding: 56px 0 48px; }
    .rf6-eyebrow { font-size: .67rem; }
    .rf6-hero-copy h1 { font-size: clamp(2.35rem, 11.5vw, 2.9rem); line-height: 1.08; }
    .rf6-hero-copy p { font-size: .92rem; }
    .rf6-hero-actions { align-items: flex-start; flex-direction: column; gap: 13px; }
    .rf6-button-primary { width: 100%; }
    .rf6-servers { margin-top: 0; }
    .rf6-section-head { align-items: flex-start; }
    .rf6-section-head h2 { font-size: .87rem; }
    .rf6-footer-brand { align-items: center; flex-direction: column; gap: 10px; }
}

@media (hover: none) {
    .rf6-server-card:hover,
    .rf6-news-media:hover img,
    .rf6-button-primary:hover,
    .rf6-header-cta:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .rf6-server-card,
    .rf6-news-media img,
    .rf6-button,
    .rf6-header-cta { transition: none !important; }
}
