body {
    font-family: 'Funnel Display', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 0;
    background: #121212;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #f1f1f1;
}

/* Liquid glass ambient blobs (use existing accent gradient colors, very subtle) */
@keyframes floatBlob {
    0% { transform: translate(-10%, -10%) scale(1); }
    50% { transform: translate(5%, 10%) scale(1.08); }
    100% { transform: translate(-10%, -10%) scale(1); }
}
body::before,
body::after {
    content: '';
    position: fixed;
    z-index: -3;
    width: 48vw;
    height: 48vw;
    max-width: 820px;
    max-height: 820px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15; /* keep colors unchanged but extremely soft */
    pointer-events: none;
    background: radial-gradient(circle at 30% 30%, rgba(252,163,255,0.8), rgba(138,235,255,0.4) 60%, rgba(138,235,255,0.0) 70%);
    animation: floatBlob 28s ease-in-out infinite;
}
body::before { top: -10vh; left: -10vw; }
body::after { bottom: -10vh; right: -10vw; animation-delay: -8s; }

/* Global link styling */
a { text-decoration: none; font-weight: 700; color: #b0b0b0; transition: color 150ms ease; }
a:hover { color: #9a9a9a; }

/* Background crossfade layers */
.bg-layer { position: fixed; inset: 0; z-index: -2; background-size: cover; background-position: center; background-repeat: no-repeat; transition: opacity 1s ease; opacity: 0; }
#bg-layer-a { opacity: 1; }
/* Global tint over backgrounds */
.bg-tint { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: rgba(68,68,68,0.35); }

/* Sticky fading header */
.site-header { position: fixed; top: 0; left: 0; right: 0; height: 96px; background: rgba(40,40,40,0.35); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); display: grid; grid-template-columns: 10vw 10vw 40vw 10vw 20vw; align-items: center; z-index: 10; overflow: hidden; border-bottom: 1px solid rgba(255,255,255,0.06); box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}
.header-fade { position: absolute; left: 0; right: 0; bottom: -48px; height: 48px; background: linear-gradient(rgba(40,40,40,0.35), rgba(40,40,40,0)); pointer-events: none; }
.header-logo { grid-column: 2; height: 64px; width: auto; display: block; align-self: center; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25)); }
.header-title { grid-column: 3; margin: 0; font-size: 26px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-right { grid-column: 5; justify-self: end; text-align: right; padding-right: 2vw; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 100%; }
.server-ip { margin: 0; font-weight: 800; letter-spacing: 0.8px; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-version { margin: 0; opacity: 0.9; font-size: 14px; }

/* Body offset below header */
.site-body { margin-top: 120px; }
.content-wrapper { padding-left: 12vw; padding-right: 12vw; }

/* Blocks styling */
.blocky-content, .blocky-sidebar { background: rgba(68,68,68,0.42); border: 1px solid rgba(255,255,255,0.10); border-radius: 18px; box-shadow: 0 20px 40px rgba(0,0,0,0.35), inset 0 1px rgba(255,255,255,0.06); padding: 16px; backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); position: relative; }
.blocky-content::before, .blocky-sidebar::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02) 40%, rgba(255,255,255,0) 60%); opacity: 0.6; }

/* Welcome + News layout: left 3/5, right 2/5 of content area */
.welcome-news { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; margin-bottom: 16px; }
.welcome-news .blocky-content { margin: 0; }
.text-block { white-space: pre-wrap; line-height: 1.6; }
.news-head { display: flex; align-items: center; gap: 10px; }
.news-emblem { width: 32px; height: 32px; image-rendering: pixelated; }

/* Stats row */
.stats { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 4px 0 12px 0; color: rgba(241,241,241,0.6); font-weight: 600; font-size: 14px; }
.stat-left, .stat-right { background: transparent; border: 0; border-radius: 0; padding: 0 6px; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.stat-icon { width: 24px; height: 24px; vertical-align: middle; margin-right: 6px; }

/* Content heading */
.content-heading { text-align: center; margin: 12px 0; font-size: 32px; font-weight: 900; }

/* Categories grid */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin: 0 0 32px 0; position: relative; z-index: 1; }
.category-card { background: rgba(68,68,68,0.40); border: 1px solid rgba(255,255,255,0.10); border-radius: 16px; padding: 10px; text-align: center; cursor: pointer; transition: transform 140ms ease, box-shadow 180ms ease, background 220ms ease; backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); box-shadow: 0 16px 36px rgba(0,0,0,0.34), inset 0 1px rgba(255,255,255,0.06); }
.category-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0,0,0,0.28); }
.category-card img { width: 100%; height: auto; border-radius: 8px; image-rendering: pixelated; }
.category-card .name { margin-top: 6px; font-weight: 800; }

/* Wiki area (existing) */
.wiki-area { display: grid; grid-template-columns: 280px 1fr; gap: 12px; margin-top: 32px; }
/* Remove inner margins so grid gap controls spacing */
.wiki-area .blocky-sidebar,
.wiki-area .blocky-content { margin: 0; }
/* Ensure sidebar fits its grid column and doesn't overflow */
.wiki-area .wiki-sidebar { width: 100%; min-width: 0; }
/* Make wiki content slightly narrower and pull it a bit away from sidebar */
.wiki-area .wiki-content { width: calc(100% - 64px); justify-self: end; box-sizing: border-box; }

/* Dark, translucent cards using #444 */
.blocky-header,
.blocky-sidebar,
.blocky-content {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.35), inset 0 1px rgba(255,255,255,0.06);
    padding: 18px;
    margin: 12px;
    background-color: rgba(68,68,68,0.40);
    position: relative;
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.blocky-header::before,
.blocky-sidebar::before,
.blocky-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02) 40%, rgba(255,255,255,0) 60%);
    pointer-events: none;
}

/* Top bar: same color, a bit more opaque */
.blocky-header {
    background: rgba(68,68,68,0.42);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-left { display: flex; align-items: center; gap: 14px; }
.header-right { display: flex; align-items: center; }

.blocky-header .logo {
    height: 72px;
    width: auto;
    image-rendering: auto;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
}

.blocky-header h1 { margin: 0; font-size: 32px; letter-spacing: .3px; }
.server-ip { margin: 0; font-weight: 700; letter-spacing: 1px; opacity: 0.98; }

.container { display: flex; flex-grow: 1; gap: 8px; }

.wiki-sidebar { width: 280px; min-width: 240px; background-color: rgba(68,68,68,0.38); backdrop-filter: blur(14px) saturate(135%); -webkit-backdrop-filter: blur(14px) saturate(135%); }

.wiki-sidebar h2 { color: #ffffff; text-align: center; margin-top: 0; letter-spacing: 0.3px; }

/* Modern dark buttons */
#wiki-links button {
    display: block;
    width: 100%;
    padding: 14px 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.06);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 18px;
    color: #f3f3f3;
    position: relative;
    transition: transform 160ms ease, box-shadow 180ms ease, background 220ms ease, color 200ms ease, border-color 180ms ease;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.30), inset 0 1px rgba(255,255,255,0.06);
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
}

#wiki-links button:hover {
    background: linear-gradient(90deg, rgba(252,163,255,0.35), rgba(138,235,255,0.35));
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(0,0,0,0.35), 0 0 0 2px rgba(255,255,255,0.06) inset;
    border-color: rgba(255,255,255,0.22);
}

#wiki-links button:active { transform: translateY(0); box-shadow: 0 6px 16px rgba(0,0,0,0.28); }

#wiki-links button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(138,235,255,0.9), 0 10px 24px rgba(0,0,0,0.3); }

.wiki-content { flex-grow: 1; background-color: rgba(68,68,68,0.38); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); }

.wiki-images { display: flex; justify-content: space-around; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }

.wiki-images img {
    max-width: 48%;
    height: auto;
    border: 1px solid rgba(255,255,255,0.10);
    image-rendering: auto;
    box-shadow: 0 12px 26px rgba(0,0,0,0.34);
    background: linear-gradient(180deg, #fca3ff22, #8aebff22);
    border-radius: 16px;
}

#wiki-title { color: #ffffff; text-align: center; }

#wiki-text {
    line-height: 1.6;
    color: #f1f1f1;
    background: rgba(68,68,68,0.32);
    border-radius: 14px;
    padding: 12px;
    white-space: pre-wrap;
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    box-shadow: inset 0 1px rgba(255,255,255,0.06), 0 10px 24px rgba(0,0,0,0.28);
}

/* Links inside wiki text: darker and bold, no underline (inherit from global) */
#wiki-text a { color: #b0b0b0; font-weight: 700; }
#wiki-text a:hover { color: #9a9a9a; }

.title-row,
.body-row {
    display: grid;
    grid-template-columns: 1fr minmax(180px, 320px);
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.title-text { display: flex; flex-direction: column; grid-column: 1 / -1; }
.title-text h2 {
    font-size: 42px;
    font-weight: 800;
    margin: 0 0 8px 0;
    line-height: 1.1;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.title-caption {
    margin: 4px 0 8px 0;
    font-size: 16px;
    line-height: 1.6;
    color: #f1f1f1;
    background: rgba(68,68,68,0.32);
    border-radius: 14px;
    padding: 12px;
    white-space: pre-wrap;
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    box-shadow: inset 0 1px rgba(255,255,255,0.06), 0 10px 24px rgba(0,0,0,0.28);
    grid-column: 1;
    align-self: center;
}

.title-main-image,
.secondary-image {
    width: 100%;
    height: auto;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 12px 26px rgba(0,0,0,0.34);
    background: linear-gradient(180deg, #fca3ff22, #8aebff22);
    align-self: center;
    image-rendering: pixelated;
    image-rendering: crisp-edges; /* fallback */
}

/* Stack on narrow screens */
@media (max-width: 900px) {
    .title-row,
    .body-row {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .title-text { grid-column: 1; }
    .title-caption { grid-column: 1; }
    .title-main-image,
    .secondary-image { max-width: 480px; justify-self: center; }
}

.category { margin-bottom: 10px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; overflow: hidden; backdrop-filter: blur(10px) saturate(130%); -webkit-backdrop-filter: blur(10px) saturate(130%); box-shadow: 0 10px 24px rgba(0,0,0,0.28); }
.category-header {
    width: 100%;
    padding: 12px 12px;
    border: none;
    background: transparent;
    color: #fff;
    font-weight: 800;
    border-radius: 0;
    cursor: pointer;
    transition: background 200ms ease, box-shadow 200ms ease;
    text-align: left;
}
.category-header:hover { background: rgba(255,255,255,0.08); box-shadow: inset 0 -1px 0 rgba(255,255,255,0.06); }
.category-header.open { background: linear-gradient(90deg, rgba(252,163,255,0.18), rgba(138,235,255,0.18)); }
.category-content { overflow: hidden; transition: max-height 320ms ease, padding 220ms ease; padding: 0 10px 0 22px; margin: 0; border-top: 1px solid rgba(255,255,255,0.08); position: relative; }
.category-content::before { content: ''; position: absolute; left: 12px; top: 8px; bottom: 12px; width: 2px; background: linear-gradient(#fca3ff80, #8aebff80); border-radius: 2px; pointer-events: none; opacity: 0; transition: opacity 220ms ease; }
.category-content.open { padding: 8px 10px 12px 22px; }
.category-content.open::before { opacity: 1; }
.category-content .wiki-btn { display: block; width: 100%; margin: 6px 0 0 0; border-radius: 8px; padding: 10px; }

/* Scope wiki button styles to sidebar only */
.wiki-sidebar .wiki-btn { display: block; width: 100%; margin: 6px 0 0 0; border-radius: 8px; padding: 10px; }
