/* PotatoServer.Live shared Resources design system */
:root {
    --resource-ink: #24113f;
    --resource-purple: #491d8b;
    --resource-violet: #7138c8;
    --resource-gold: #ffb700;
    --resource-orange: #ff6b35;
    --resource-paper: #f7f4fc;
    --resource-line: rgba(73, 29, 139, .13);
    --resource-shadow: 0 18px 48px rgba(49, 20, 91, .11);
}

html { scroll-behavior: smooth; }
body.resource-page {
    padding-top: 0;
    color: var(--resource-ink);
    background:
        radial-gradient(circle at 8% 24%, rgba(113, 56, 200, .07), transparent 25rem),
        var(--resource-paper);
}
body.resource-page #home { margin-bottom: 0 !important; }
body.resource-page #home > nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1100;
    background: linear-gradient(90deg, rgba(35, 13, 69, .97), rgba(73, 29, 139, .96));
    border-bottom: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 8px 28px rgba(24, 7, 49, .18);
}
body.resource-page #home > nav .dropdown-menu { z-index: 1150; }
body.resource-page .navbar-brand img { filter: drop-shadow(0 4px 10px rgba(0,0,0,.24)); }

/* Standalone resource heroes */
body.resource-page .resource-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 350px !important;
    margin: 0 !important;
    padding: clamp(4rem, 8vw, 6.5rem) 0 !important;
    display: grid;
    place-items: center;
    color: #fff;
    text-align: center;
    background:
        radial-gradient(circle at 78% 20%, rgba(255, 183, 0, .22), transparent 19rem),
        radial-gradient(circle at 14% 84%, rgba(96, 165, 250, .19), transparent 22rem),
        linear-gradient(135deg, #251044 0%, #491d8b 52%, #7138c8 100%) !important;
}
body.resource-page .resource-hero::before,
body.resource-page .resource-hero::after {
    content: '';
    position: absolute;
    z-index: -1;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 42% 58% 63% 37%;
    transform: rotate(24deg);
}
body.resource-page .resource-hero::before { left: -110px; top: -130px; }
body.resource-page .resource-hero::after { right: -100px; bottom: -150px; transform: rotate(-18deg); }
body.resource-page .resource-hero > .container,
body.resource-page .resource-hero .game-hero-content,
body.resource-page .resource-hero .gallery-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}
body.resource-page .resource-hero h1,
body.resource-page .resource-hero .game-title {
    max-width: 920px;
    margin: .45rem auto .8rem !important;
    color: #fff !important;
    font-size: clamp(2.35rem, 6vw, 4.75rem) !important;
    line-height: 1.02;
    font-weight: 900 !important;
    letter-spacing: -.035em;
    text-wrap: balance;
    text-shadow: 0 10px 34px rgba(0,0,0,.28) !important;
}
body.resource-page .resource-hero p,
body.resource-page .resource-hero .game-subtitle {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255,255,255,.84) !important;
    font-size: clamp(1rem, 2vw, 1.22rem) !important;
    line-height: 1.65;
}
.resource-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .42rem .8rem;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    color: #ffdd8a;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

/* Discord and TeamSpeak already use #home as their hero. */
body.resource-discord #home,
body.resource-teamspeak #home {
    min-height: auto !important;
    background:
        radial-gradient(circle at 82% 18%, rgba(255, 183, 0, .18), transparent 22rem),
        linear-gradient(145deg, #251044 0%, #491d8b 58%, #6428ae 100%) !important;
}
body.resource-discord #home > .content,
body.resource-teamspeak #home > .content {
    position: relative;
    min-height: clamp(560px, 74vh, 760px) !important;
    padding: clamp(3.5rem, 8vw, 7rem) 18px !important;
    display: grid;
    align-items: center;
}
body.resource-discord #home h1 span,
body.resource-teamspeak #home h1 span {
    background: none !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: clamp(2.7rem, 7vw, 5.2rem) !important;
    line-height: 1 !important;
    letter-spacing: -.04em;
    text-wrap: balance;
}
body.resource-discord #home .content p,
body.resource-teamspeak #home .content p { color: rgba(255,255,255,.84); }

/* Shared horizontal resource directory */
.resource-directory {
    position: sticky;
    top: 66px;
    z-index: 1025;
    margin: 0 !important;
    padding: 11px 0;
    background: rgba(255,255,255,.93);
    border-bottom: 1px solid var(--resource-line);
    box-shadow: 0 10px 30px rgba(37, 16, 68, .08);
    backdrop-filter: blur(14px);
}
.resource-directory-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.resource-directory-label {
    flex: 0 0 auto;
    margin-right: 5px;
    color: #746885;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.resource-directory a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .58rem .75rem;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #554666;
    font-size: .8rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s ease, background .2s ease, transform .2s ease, border-color .2s ease;
}
.resource-directory a:hover {
    color: var(--resource-purple);
    background: #f3edfc;
    border-color: #dfd2f4;
    transform: translateY(-1px);
}
.resource-directory a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--resource-purple), var(--resource-violet));
    box-shadow: 0 7px 18px rgba(73, 29, 139, .23);
}
.resource-directory a.resource-gated { color: #7a4900; background: #fff6dd; border-color: #f5daa0; }
.resource-directory a.resource-gated.active { color: #30134f; background: linear-gradient(135deg, #ffd36a, #ffb700); }

/* Content rhythm and cards */
body.resource-page section:not(#home):not(.resource-hero):not(.resource-directory) { margin-bottom: 0 !important; }
body.resource-page .page-content-section,
body.resource-page .game-info-section,
body.resource-page .featured-section,
body.resource-page section[style*="padding: 5rem"] {
    padding-top: clamp(3.5rem, 7vw, 6rem) !important;
    padding-bottom: clamp(3.5rem, 7vw, 6rem) !important;
}
body.resource-page section[style*="background: #f8f9fa"],
body.resource-page section[style*="background:#f8f9fa"] { background: transparent !important; }
body.resource-page section[style*="background: white"] { background: #fff !important; }
body.resource-page .page-content-section > .container,
body.resource-page .game-info-section > .container { max-width: 1080px; }
body.resource-page h2 {
    color: var(--resource-purple);
    font-weight: 900;
    letter-spacing: -.025em;
    text-wrap: balance;
}
body.resource-page .info-card,
body.resource-page .conduct-section,
body.resource-page .intro-box,
body.resource-page .flow-step,
body.resource-page .server-details,
body.resource-page .rules-section,
body.resource-page .gallery-item,
body.resource-page .stat-box {
    border: 1px solid var(--resource-line) !important;
    border-radius: 18px !important;
    box-shadow: var(--resource-shadow) !important;
}
body.resource-page .info-card,
body.resource-page .flow-step,
body.resource-page .conduct-section {
    height: 100%;
    background: rgba(255,255,255,.92) !important;
    transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
body.resource-page .info-card:hover,
body.resource-page .flow-step:hover,
body.resource-page .conduct-section:hover {
    transform: translateY(-5px);
    border-color: rgba(113, 56, 200, .32) !important;
    box-shadow: 0 22px 50px rgba(49, 20, 91, .16) !important;
}
body.resource-page .info-card-icon {
    background: linear-gradient(145deg, #f2eafe, #fff7e2) !important;
    color: var(--resource-purple) !important;
    border: 1px solid #e4d7f7;
}
body.resource-page .intro-box {
    position: relative;
    overflow: hidden;
    padding: clamp(1.35rem, 3vw, 2rem) !important;
    background: linear-gradient(135deg, #fff, #f6f0ff) !important;
}
body.resource-page .intro-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(var(--resource-purple), var(--resource-gold));
}
body.resource-page .conduct-section { padding: clamp(1.4rem, 3vw, 2.1rem) !important; scroll-margin-top: 92px; }
body.resource-page .conduct-section h2 { font-size: clamp(1.2rem, 2.7vw, 1.65rem) !important; }
body.resource-page .conduct-section li { margin-bottom: .48rem; line-height: 1.6; }
body.resource-page .utility-toc {
    position: sticky;
    top: 72px;
    z-index: 20;
    padding: .72rem !important;
    border-radius: 15px !important;
    background: rgba(255,255,255,.94) !important;
    box-shadow: 0 10px 28px rgba(49,20,91,.09);
    backdrop-filter: blur(12px);
}
body.resource-page .cta-box,
body.resource-page .connect-section,
body.resource-page .upload-cta {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16) !important;
    border-radius: 22px !important;
    background:
        radial-gradient(circle at 82% 18%, rgba(255, 183, 0, .2), transparent 16rem),
        linear-gradient(135deg, #2d1157, #5c279f) !important;
    box-shadow: 0 22px 56px rgba(42, 13, 84, .24) !important;
}
body.resource-page .cta-box h3,
body.resource-page .connect-section h2,
body.resource-page .upload-cta h2 { color: #fff !important; }
body.resource-page .cta-box p,
body.resource-page .connect-section p,
body.resource-page .upload-cta p { color: rgba(255,255,255,.83) !important; }

/* Gallery-specific polish */
body.resource-gallery .gallery-hero .gallery-stats { gap: .8rem; }
body.resource-gallery .stat-box { background: rgba(255,255,255,.12) !important; box-shadow: none !important; backdrop-filter: blur(10px); }
body.resource-gallery .featured-carousel { overflow: hidden; border-radius: 22px; box-shadow: 0 24px 60px rgba(33,12,64,.2); }
body.resource-gallery .featured-carousel img { max-height: 520px; object-fit: cover; }
body.resource-gallery .gallery-grid { gap: 18px; }
body.resource-gallery .gallery-item { overflow: hidden; background: #1e0c39; }
body.resource-gallery .gallery-item img { transition: transform .5s ease, filter .4s ease; }
body.resource-gallery .gallery-item:hover img { transform: scale(1.055); filter: saturate(1.1); }
body.resource-gallery .category-tabs { gap: 8px; }
body.resource-gallery .category-tab {
    border: 1px solid #dfd2f4;
    border-radius: 999px;
    background: #fff;
    color: var(--resource-purple);
    font-weight: 800;
    transition: transform .2s ease, background .2s ease, color .2s ease;
}
body.resource-gallery .category-tab.active { color: #fff; background: linear-gradient(135deg, var(--resource-purple), var(--resource-violet)); }
body.resource-gallery .category-tab:focus-visible { outline: 3px solid var(--resource-gold); outline-offset: 3px; }

/* Mod Loader membership gate */
.loader-access-note {
    max-width: 680px;
    margin: 1rem auto 0;
    padding: .8rem 1rem;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 12px;
    background: rgba(255,255,255,.09);
    color: #fff;
    font-size: .9rem;
}
.loader-access-note i { color: #ffd36a; margin-right: .35rem; }

/* Shared reveal is progressive enhancement: content remains visible without JS. */
.resource-reveal { opacity: 0; transform: translateY(20px); transition: opacity .58s ease, transform .58s ease; }
.resource-reveal.resource-visible { opacity: 1; transform: none; }
.resource-skip-link {
    position: fixed;
    left: 16px;
    top: 12px;
    z-index: 2147483647;
    transform: translateY(-160%);
    padding: .72rem 1rem;
    border-radius: 10px;
    background: #fff;
    color: var(--resource-purple);
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 8px 28px rgba(0,0,0,.3);
    transition: transform .18s ease;
}
.resource-skip-link:focus { transform: translateY(0); }

@media (max-width: 768px) {
    .resource-directory { top: 64px; }
    .resource-directory-inner { padding-bottom: 3px; }
    .resource-directory-label { display: none; }
    body.resource-page .resource-hero { min-height: 300px !important; }
    body.resource-page .utility-toc { top: 68px; overflow-x: auto; flex-wrap: nowrap; }
    body.resource-discord #home > .content,
    body.resource-teamspeak #home > .content { min-height: 580px !important; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .resource-reveal { opacity: 1; transform: none; transition: none; }
    body.resource-page .info-card,
    body.resource-page .flow-step,
    body.resource-page .conduct-section,
    .resource-directory a { transition: none; }
}
