/* ============================================
   Villain Animals — Black theme, glassmorphism, purple accent
   Full-page .gradient-dots background. Logo/headings: Slackey.
   ============================================ */

/* Override combined.css body so cycling background and dark theme apply */
body {
    background: radial-gradient(ellipse 100% 70% at 50% -15%, rgba(124, 58, 237, 0.12), transparent 52%), #0c0c14 !important;
    background-attachment: scroll !important;
}

:root {
    /* Accent: purple */
    --accent: #a855f7;
    --accent-bright: #c084fc;
    --accent-dark: #7c3aed;
    --accent-dim: rgba(168, 85, 247, 0.25);
    --accent-glow: rgba(168, 85, 247, 0.35);
    /* Black theme (lifted slightly so gradient + glass read less “flat black”) */
    --bg0: #0c0c14;
    --bg1: rgba(255, 255, 255, 0.04);
    --bg2: rgba(255, 255, 255, 0.06);
    --panel: rgba(255, 255, 255, 0.06);
    --panel2: rgba(255, 255, 255, 0.08);
    --stroke: rgba(255, 255, 255, 0.12);
    --stroke-strong: rgba(255, 255, 255, 0.2);
    --text: #f0eef5;
    --muted: rgba(255, 255, 255, 0.65);
    /* Legacy names for compatibility */
    --blood: var(--accent-dark);
    --blood-bright: var(--accent-bright);
    --blood-glow: var(--accent-glow);
    --blood-dim: var(--accent-dim);
    --gold: var(--accent-bright);
    --gold2: var(--accent);
    --crimson: var(--accent);
    --crimson-dim: var(--accent-dim);
    --glow: var(--accent-dim);
    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    /* Logo & headings: Slackey (same as logo) */
    --font-heading: 'Slackey', cursive;
    --font-display: 'Slackey', cursive;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono: ui-monospace, Consolas, monospace;
    /* Glassmorphism */
    --glass-bg: rgba(0, 0, 0, 0.28);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-blur: 20px;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 72px;
    --sidebar-transition: width 0.25s ease, min-width 0.25s ease;
    /* shadcn-style alias for gradient-dots background */
    --background: var(--bg0);
}

body {
    min-height: 100vh;
    font-family: var(--font-body);
    font-feature-settings: "kern" 1, "liga" 1;
    color: var(--text);
    position: relative;
}

/* Skip link: keep for keyboard users, but fully off-screen until Tab focus (no peek above logo) */
.skip-link {
    position: absolute;
    left: var(--space-md);
    top: 0;
    z-index: 10050;
    transform: translateY(calc(-100% - 12px));
    transition: transform 0.15s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(var(--space-sm));
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---- Full-page background: gradient dots (CSS port of gradient-dots.tsx + framer-motion) ---- */
.bg-cycle {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.gradient-dots {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* Match GradientDots props: dotSize, spacing, duration, colorCycleDuration */
    --gd-dot: 8px;
    --gd-space: 10px;
    --gd-hex: calc(var(--gd-space) * 1.732);
    --gradient-dots-duration: 30s;
    --gradient-dots-hue-duration: 6s;
    background-color: var(--background);
    background-image:
        radial-gradient(circle at 50% 50%, transparent 1.5px, var(--background) 0 var(--gd-dot), transparent var(--gd-dot)),
        radial-gradient(circle at 50% 50%, transparent 1.5px, var(--background) 0 var(--gd-dot), transparent var(--gd-dot)),
        radial-gradient(circle at 50% 50%, #f00, transparent 60%),
        radial-gradient(circle at 50% 50%, #ff0, transparent 60%),
        radial-gradient(circle at 50% 50%, #0f0, transparent 60%),
        radial-gradient(ellipse at 50% 50%, #00f, transparent 60%);
    background-size:
        var(--gd-space) var(--gd-hex),
        var(--gd-space) var(--gd-hex),
        200% 200%,
        200% 200%,
        200% 200%,
        200% var(--gd-hex);
    background-position:
        0 0,
        calc(var(--gd-space) / 2) calc(var(--gd-hex) / 2),
        0% 0%,
        0% 0%,
        0% 0%,
        0% 0%;
    background-repeat: repeat;
    animation:
        gradient-dots-shift var(--gradient-dots-duration) linear infinite,
        gradient-dots-hue var(--gradient-dots-hue-duration) linear infinite;
}

@keyframes gradient-dots-shift {
    0% {
        background-position:
            0 0,
            calc(var(--gd-space) / 2) calc(var(--gd-hex) / 2),
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%;
    }
    100% {
        background-position:
            0 0,
            calc(var(--gd-space) / 2) calc(var(--gd-hex) / 2),
            800% 400%,
            1000% -400%,
            -1200% -600%,
            400% var(--gd-hex);
    }
}

@keyframes gradient-dots-hue {
    from {
        filter: hue-rotate(0deg);
    }
    to {
        filter: hue-rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gradient-dots {
        animation: none;
        filter: none;
    }
}

.app-wrap ~ .navbar,
body:has(.app-wrap) .navbar {
    display: none !important;
}

.app-wrap {
    display: flex;
    flex: 1;
    min-height: 100vh;
    position: relative;
}

.main-wrap {
    position: relative;
    background: transparent;
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

.main-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 0;
    pointer-events: none;
}

.main-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 90% 80% at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.18) 100%);
    z-index: 0;
    pointer-events: none;
}

.sidebar-collapsed .main-wrap {
    margin-left: var(--sidebar-width-collapsed);
}

body #main-content,
main#main-content {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: var(--space-xl) 0;
}

/* ---- Sidebar: glassmorphism ---- */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid var(--glass-border);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    transition: var(--sidebar-transition);
}

.sidebar-header {
    flex-shrink: 0;
    padding: var(--space-md);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--text);
    min-width: 0;
}

.sidebar-brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sidebar-brand-text,
.footer-brand span,
.mobile-menu-title,
.navbar-title {
    font-family: var(--font-heading);
    color: var(--accent-bright);
    text-shadow: 0 0 12px var(--accent-dim);
}

.sidebar-brand-text {
    transition: opacity 0.2s ease, width 0.2s ease;
    overflow: hidden;
}

.sidebar-toggle {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.sidebar-toggle:hover {
    color: var(--accent-bright);
    background: var(--accent-dim);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 var(--space-sm);
    scrollbar-width: thin;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--accent-dim);
    border-radius: 4px;
}

.sidebar-group { margin-bottom: var(--space-md); }

.sidebar-group-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    padding: var(--space-xs) var(--space-md);
    margin-bottom: var(--space-xs);
    transition: opacity 0.2s ease;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: 2px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: background 0.2s, color 0.2s;
    min-height: 44px;
    position: relative;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.sidebar-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-item.active {
    color: var(--accent-bright);
    background: var(--accent-dim);
}

.sidebar-item svg { flex-shrink: 0; width: 22px; height: 22px; }
.sidebar-label { flex: 1; min-width: 0; transition: opacity 0.2s ease; }

.sidebar-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

.sidebar-item-accent { color: var(--accent-bright); }
.sidebar-item-accent:hover { background: var(--accent-dim); }

.sidebar-item-join {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    font-weight: 600;
}

.sidebar-item-join:hover {
    filter: brightness(1.1);
    color: #fff;
}

.sidebar-logout-form { margin: 0; }
.sidebar-item-logout { color: var(--muted); }

.sidebar-footer {
    flex-shrink: 0;
    padding: var(--space-md);
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
}

.sidebar-user:hover { background: rgba(255, 255, 255, 0.06); }

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-user-avatar-img {
    display: block;
    background: var(--accent-dim);
}

.sidebar-user-initial,
.sidebar-user-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    color: var(--accent-bright);
    font-weight: 700;
    font-size: 1rem;
}

.sidebar-user-name {
    font-size: 0.9375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-mobile-toggle {
    display: none;
    position: fixed;
    bottom: var(--space-lg);
    left: var(--space-md);
    z-index: 1001;
    min-width: 48px;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    color: var(--accent-bright);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-dim);
    transition: transform 0.2s;
}

.sidebar-mobile-toggle span {
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    display: block;
}

.sidebar-mobile-toggle:hover { transform: scale(1.05); }

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
        z-index: 1000;
    }
    .main-wrap { margin-left: 0; }
    .sidebar-overlay[aria-hidden="false"] {
        display: block;
        z-index: 999;
    }
    .sidebar-mobile-toggle { display: flex; }
    body.sidebar-open .sidebar-mobile-toggle {
        left: calc(var(--sidebar-width) + var(--space-md));
        z-index: 1001;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: min(var(--sidebar-width), 85vw);
        min-width: min(var(--sidebar-width), 85vw);
    }
}

/* ---- Glassmorphism cards & panels ---- */
.panel,
.card,
.panel--raised,
.status-panel,
.splash-content,
.discord-card,
.department-card,
.dashboard-link-card,
.timeline-card,
.calendar,
.calendar-header,
.calendar-day,
.home-intro-card {
    background: rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel:hover,
.card:hover,
.timeline-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 24px var(--accent-dim), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Member dashboard link cards: same frosting as cards */
.dashboard-link-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 24px var(--accent-dim), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
}

.panel,
.card,
.department-card,
.panel--raised,
.dashboard-link-card,
.timeline-card,
.calendar,
.calendar-header,
.calendar-day,
.home-intro-card {
    background: rgba(0, 0, 0, 0.38) !important;
    backdrop-filter: blur(var(--glass-blur)) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur)) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04) !important;
}

.panel:hover,
.card:hover,
.timeline-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 24px var(--accent-dim) !important;
}

.dashboard-link-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 24px var(--accent-dim) !important;
    border-color: var(--accent) !important;
}

/* Calendar: keep today/other-month emphasis on top of glass */
.calendar-day-today {
    background: rgba(168, 85, 247, 0.25) !important;
    border-color: var(--accent) !important;
}
.calendar-day-other {
    background: rgba(0, 0, 0, 0.28) !important;
    opacity: 0.85;
}

.panel__header,
.card__header {
    border-bottom: 1px solid var(--stroke-strong);
}

.main-wrap .page-header {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.app-wrap .footer {
    margin-top: auto;
}

/* ---- Typography: Slackey for headings (same as logo) ---- */
body h1, body h2, body h3, body h4, body h5, body h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    letter-spacing: 0.04em;
}

body h1 {
    color: var(--accent-bright);
    text-shadow: 0 0 20px var(--accent-glow), 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.02em;
}

body h1.glitched,
body .page-header h1,
body .hero-content h1,
body .splash-content h1 {
    color: var(--accent-bright);
    text-shadow: 0 0 24px var(--accent-glow), 0 0 40px var(--accent-dim), 0 2px 6px rgba(0, 0, 0, 0.9);
}

body h2, body h3, body h4, body h5, body h6 {
    color: var(--muted);
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.03em;
}

body .panel__header h2,
body .card__header h2,
body .section-header h2,
body .page-header h2 {
    color: var(--accent-bright);
    font-family: var(--font-heading);
    text-shadow: 0 0 12px var(--accent-dim);
}

@keyframes pulse-accent {
    0%, 100% { opacity: 0.4; box-shadow: 0 0 12px var(--accent-dim); }
    50% { opacity: 0.8; box-shadow: 0 0 24px var(--accent-glow); }
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.85; }
    94% { opacity: 1; }
    97% { opacity: 0.9; }
    98% { opacity: 1; }
}

/* ---- Navbar: glass, purple ---- */
body .navbar,
body .navbar-member,
body .navbar-admin {
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--stroke-strong);
    box-shadow: 0 0 20px var(--accent-dim), 0 4px 24px rgba(0, 0, 0, 0.5);
}

.navbar-brand a {
    color: var(--accent-bright);
    text-shadow: 0 0 12px var(--accent-dim);
}

body .navbar-menu a {
    color: var(--muted);
    letter-spacing: 0.02em;
    font-family: var(--font-display);
}

body .navbar-menu a:hover {
    color: var(--accent-bright);
    text-shadow: 0 0 8px var(--accent-dim);
}

body .navbar-menu a.active {
    color: var(--accent-bright);
    border-bottom: 1px solid var(--accent);
    text-shadow: 0 0 10px var(--accent-dim);
}

body .nav-dropdown-menu {
    background: rgba(5, 5, 8, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid var(--stroke-strong);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 24px var(--accent-dim);
}

body .nav-dropdown-menu a { color: var(--text); border-left: 2px solid transparent; }
body .nav-dropdown-menu a:hover { border-left-color: var(--accent); color: var(--accent-bright); }

/* ---- Buttons: purple accent ---- */
body .btn {
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body .btn--primary {
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
    color: #fff;
    border: 1px solid rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 16px var(--accent-dim), 0 2px 8px rgba(0, 0, 0, 0.4);
}

body .btn--primary:hover {
    box-shadow: 0 0 24px var(--accent-glow), 0 4px 12px rgba(0, 0, 0, 0.5);
    animation: pulse-accent 1.5s ease-in-out infinite;
}

body .btn--secondary {
    border: 1px solid var(--accent);
    color: var(--accent-bright);
    background: transparent;
}

body .btn--secondary:hover {
    background: var(--accent-dim);
    box-shadow: 0 0 16px var(--accent-dim);
}

body .btn-accent,
body .btn--danger {
    border: 1px solid var(--accent-bright);
    color: var(--accent-bright);
    background: var(--accent-dim);
}

body .btn-accent:hover,
body .btn--danger:hover {
    background: rgba(168, 85, 247, 0.35);
    box-shadow: 0 0 20px var(--accent-dim);
}

/* ---- Forms ---- */
body .form-group label {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.03em;
}

body .form-group input,
body .form-group select,
body .form-group textarea {
    background: var(--panel2);
    border: 1px solid var(--stroke-strong);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
}

body .form-group input:focus,
body .form-group select:focus,
body .form-group textarea:focus {
    border-color: var(--accent-bright);
    box-shadow: 0 0 0 2px var(--accent-dim);
}

/* Native <select>: closed + open list need solid colors or Windows/Chrome shows white bg + light text */
body .form-group select {
    background-color: rgba(12, 12, 18, 0.98);
    color: var(--text);
    color-scheme: dark;
}

body .form-group select option {
    background-color: #14141c;
    color: #f0eef5;
}

/* ---- Tables ---- */
body table {
    border-collapse: collapse;
    border: 1px solid var(--stroke-strong);
}

body th, body td {
    border: 1px solid var(--stroke);
    padding: var(--space-sm) var(--space-md);
}

body th {
    font-family: var(--font-display);
    font-weight: 600;
    background: var(--accent-dim);
    color: var(--accent-bright);
    letter-spacing: 0.04em;
}

/* ---- Hero / overlay ---- */
body .hero-overlay,
body .page-backdrop .hero-overlay,
body .page-backdrop .backdrop-overlay {
    background: linear-gradient(180deg, rgba(3, 3, 4, 0.9) 0%, rgba(5, 5, 8, 0.85) 100%);
}

body .status-panel__title {
    font-family: var(--font-heading);
    color: var(--accent-bright);
    letter-spacing: 0.06em;
    text-shadow: 0 0 10px var(--accent-dim);
}

body .status-item { border-bottom: 1px solid var(--stroke); }
body .card__body { color: var(--text); font-family: var(--font-body); }

/* ---- Footer ---- */
body .footer {
    background: rgba(3, 3, 4, 0.98);
    border-top: 2px solid var(--stroke-strong);
    color: var(--muted);
    box-shadow: 0 -4px 24px var(--accent-dim);
}

body .text-gold,
body .badge--gold { color: var(--accent-bright); }
body .badge,
body .chip { border-radius: var(--radius-sm); border: 1px solid var(--stroke-strong); }

/* ---- Alerts ---- */
body .alert { border-radius: var(--radius-md); border: 1px solid var(--stroke-strong); }
body .alert--success { border-left: 4px solid var(--accent); }
body .alert--error { border-left: 4px solid var(--accent-bright); box-shadow: 0 0 16px var(--accent-dim); }

/* ---- Glitch (logo) ---- */
body .glitched,
body .glitch { position: relative; }
body .glitch::before,
body .glitch::after { color: var(--accent-bright); opacity: 0.6; }

body .home-intro-card h1,
body .case-file h1 {
    color: var(--accent-bright);
    font-family: var(--font-heading);
    text-shadow: 0 0 24px var(--accent-glow), 0 2px 6px rgba(0, 0, 0, 0.8);
}

body .home-intro-subtitle {
    font-family: var(--font-display);
    letter-spacing: 0.12em;
    color: var(--muted);
}

body .gold-stars { color: var(--accent-bright); text-shadow: 0 0 8px var(--accent-dim); }

body .section-header,
body .page-header { border-bottom: 1px solid var(--stroke-strong); }

body .empty-state {
    color: var(--muted);
    border: 1px dashed var(--stroke-strong);
    border-radius: var(--radius-md);
}

body .divider-slab {
    font-family: var(--font-display);
    color: var(--accent-bright);
    letter-spacing: 0.15em;
    text-shadow: 0 0 12px var(--accent-dim);
}

body .danger-control {
    font-family: var(--font-display);
    color: var(--accent-bright);
    border: 1px solid var(--accent);
    background: var(--accent-dim);
    text-shadow: 0 0 10px var(--accent-dim);
}

body .danger-control:hover {
    box-shadow: 0 0 24px var(--accent-glow);
    animation: pulse-accent 1.2s ease-in-out infinite;
}

body .chaos-dial-wrap .chaos-theme-btn {
    font-family: var(--font-display);
    border: 1px solid var(--stroke-strong);
    color: var(--muted);
    background: var(--panel2);
}

body .chaos-dial-wrap .chaos-theme-btn[aria-pressed="true"] {
    color: var(--accent-bright);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-dim);
}

body .rabbithole-bottle:hover { filter: drop-shadow(0 0 12px var(--accent-dim)); }

body .navbar-toggle span { background: var(--text); }
body .navbar-toggle:hover span,
body .navbar-toggle[aria-expanded="true"] span {
    background: var(--accent-bright);
    box-shadow: 0 0 8px var(--accent-dim);
}

.nav-notifications { margin-right: var(--space-sm); }

.nav-notification-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--stroke-strong);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.nav-notification-toggle:hover {
    color: var(--accent-bright);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-dim);
}

.nav-notification-toggle[aria-expanded="true"] {
    color: var(--accent-bright);
    border-color: var(--accent);
    background: var(--accent-dim);
}

.nav-notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: #fff;
    background: var(--accent);
    border-radius: 10px;
    box-shadow: 0 0 8px var(--accent-dim);
}

body .page-header h1,
body .splash-content h1 {
    animation: flicker 8s ease-in-out infinite;
}

body a { color: var(--accent-bright); }
body a:hover { color: var(--text); text-shadow: 0 0 8px var(--accent-dim); }

.rabbithole-tunnel-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    display: none;
    background: var(--bg0);
    overflow: hidden;
}

.rabbithole-tunnel-overlay.rabbithole-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    display: block;
}

/* ---- Home page ---- */
.page-home { position: relative; z-index: 1; }

.home-intro-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-2xl);
    align-items: start;
    margin-bottom: var(--space-2xl);
}

@media (max-width: 968px) {
    .home-intro-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
}

.home-intro-card { padding: var(--space-xl); }

.home-intro-blurb {
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: var(--space-lg);
}

.home-intro-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.home-intro-actions .btn { min-width: 10rem; }

.page-home .status-panel__title { color: var(--accent-bright); font-family: var(--font-heading); }
.page-home .status-item__label { font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.25rem; }
.page-home .status-item__value { font-size: 1.0625rem; font-weight: 600; color: var(--text); }
.page-home .status-item__link { color: var(--accent-bright); font-size: 0.875rem; }
.page-home .status-item__link:hover { color: var(--text); }

.navbar-menu a,
.navbar-menu .btn { color: var(--muted); }
.navbar-menu a:hover,
.navbar-menu .btn:hover { color: var(--text); }
.navbar-menu a.btn--primary,
.navbar-menu .btn.btn--primary { color: #fff; }

.page-home .home-about-text { margin-bottom: var(--space-lg); }
.page-home .home-about-text p { margin-bottom: var(--space-md); }
.page-home .home-about-text p:last-child { margin-bottom: 0; }
.page-home .home-about-img-wrap { margin: var(--space-xl) 0; width: 100%; overflow: hidden; }
.page-home .home-about-img {
    width: 100%;
    display: block;
    height: auto;
    object-fit: cover;
    vertical-align: middle;
}

.page-home .panel__body p { color: var(--text); font-family: var(--font-body); }

.page-home .two-column {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

@media (max-width: 768px) {
    .page-home .two-column { grid-template-columns: 1fr; }
}

.rabbithole-easter-egg { padding: var(--space-md) 0; min-height: 0; }
.rabbithole-bottle { max-height: 48px; opacity: 0.7; }
.rabbithole-bottle:hover { opacity: 1; }

/* ---- Stats (member/stats): tables use light purple throughout ---- */
#main-content .stats-content .players-page table,
#main-content .stats-content .players-page th,
#main-content .stats-content .players-page td,
#main-content .stats-content .leaderboard table,
#main-content .stats-content .leaderboard th,
#main-content .stats-content .leaderboard td,
#main-content .stats-content .dkp-page .table-wrap table,
#main-content .stats-content .dkp-page .table-wrap th,
#main-content .stats-content .dkp-page .table-wrap td,
#main-content .stats-content .uploads-page table,
#main-content .stats-content .uploads-page th,
#main-content .stats-content .uploads-page td {
    background: rgba(88, 28, 135, 0.5) !important;
    border-color: rgba(139, 92, 246, 0.45);
}
#main-content .stats-content .players-page table,
#main-content .stats-content .leaderboard table,
#main-content .stats-content .dkp-page .table-wrap table,
#main-content .stats-content .uploads-page table {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
#main-content .stats-content .players-page th,
#main-content .stats-content .leaderboard th,
#main-content .stats-content .dkp-page .table-wrap th,
#main-content .stats-content .uploads-page th {
    border-bottom: 1px solid rgba(139, 92, 246, 0.6);
}

/* Player stats: data page — use body font, not Slackey/glow on headings (readable numbers) */
#main-content .stats-content.player-page h1.player-username {
    font-family: var(--font-body), system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(1.35rem, 2.8vw, 1.85rem);
    color: var(--text);
    text-shadow: none;
    letter-spacing: normal;
}
#main-content .stats-content.player-page .player-charts h2,
#main-content .stats-content.player-page .player-recent-scans h2 {
    font-family: var(--font-body), system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.72);
    text-shadow: none;
    letter-spacing: normal;
}
#main-content .stats-content.player-page .chart-main-card .chart-header h3 {
    font-family: var(--font-body), system-ui, sans-serif;
    text-shadow: none;
}
