@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Montserrat:wght@300;400;600&display=swap');

:root {
    --bg-onyx: #050505;
    --text-silver: #E0E0E0;
    --accent-ruby: #8B0000;
    /* Deep Wine Red */
    --accent-ruby-bright: #FF0033;
    /* Glowing Red */
    --glass-bg: rgba(20, 20, 20, 0.65);
    --glass-border: rgba(229, 229, 229, 0.15);
    --metallic-silver: linear-gradient(135deg, #444 0%, #aaa 50%, #444 100%);
}

body {
    background-color: var(--bg-onyx);
    color: var(--text-silver);
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    /* Background restored to single layer with Dark Overlay */
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../img/bg_obsidian_web.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center top;
    background-repeat: no-repeat;
}

/* Fog Animation Layer - kept subtle */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.05"/></svg>');
    animation: fogMove 120s linear infinite;
    /* Slower */
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
}

@keyframes fogMove {
    0% {
        transform: translate(-5%, -5%);
    }

    50% {
        transform: translate(-2%, -2%);
    }

    100% {
        transform: translate(-5%, -5%);
    }
}

h1,
h2,
h3,
h4,
.brand-title,
.nav-tabs .nav-link,
.hero-title {
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 60vh;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Lighter overlay since body is now globally dark */
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.4) 80%, var(--bg-onyx) 100%);
    border-bottom: 1px solid var(--accent-ruby);
    margin-bottom: 0;
    /* Ensure z-index context for layers */
    z-index: 1;
}

/* --- Visual Effects Layers --- */
/* --- Visual Effects Layers --- */
.hero-bg-parallax {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* The Spiderweb Overlay */
    background-image: url('../img/web_overlay_silver.png');

    /* Screen blending for transparent web effect */
    mix-blend-mode: screen;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -3;
    /* Static layout, no movement */
}

/* Animations removed per user request */

@keyframes shine-sweep {
    0% {
        background-position: 200% 0;
    }

    20% {
        background-position: -200% 0;
    }

    100% {
        background-position: -200% 0;
        /* Stay dormant for rest of cycle */
    }
}

.web-layer {
    display: none;
}

.hero-content {
    z-index: 10;
    text-align: center;
    position: relative;
    padding: 20px;
    /* Glass backdrop for text readability if needed */
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.spider-main-logo {
    display: block;
    margin-bottom: 20px;
}

.spider-main-logo-img {
    width: 280px;
    max-width: 80vw;
    height: auto;
    /* Normal blending for transparent PNG */
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    transition: transform 0.5s ease-in-out;
}

.spider-main-logo-img:hover {
    transform: scale(1.05) translateY(-5px);
    filter: drop-shadow(0 0 15px rgba(255, 0, 51, 0.6));
}

/* Removed old .spider-eyes and .eye classes as they are now part of the 3D render */

.hero-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin: 10px 0;
    text-transform: uppercase;

    /* Metallic / Carved Stone Gradient */
    background: linear-gradient(180deg,
            #ffffff 0%,
            #d0d0d0 25%,
            #8a8a8a 50%,
            #d0d0d0 75%,
            #ffffff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    /* Deep Shadow to simulate it being carved OUT of the dark background */
    filter: drop-shadow(0 2px 0px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));

    font-weight: 700;
    letter-spacing: 2px;
}

.hero-subtitle {
    font-family: 'Montserrat', sans-serif;
    color: var(--accent-ruby);
    font-size: 1rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

/* --- Navigation & Menu --- */
.brand-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-silver);
    text-shadow: 0 0 10px rgba(229, 229, 229, 0.3);
    background: none;
    -webkit-text-fill-color: initial;
}

/* --- Thin Top Header --- */
.thin-header {
    background: rgba(5, 5, 5, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(139, 0, 0, 0.3);
    padding: 8px 20px;
    font-family: 'Montserrat', sans-serif;
}

.thin-header-content {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.thin-header-left .upd-text {
    color: #999;
    font-size: 0.85rem;
    font-weight: 400;
}

.thin-header-right .guest-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.guest-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(139, 0, 0, 0.5);
}

.guest-name {
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 500;
}

.guest-menu-btn {
    background: transparent;
    border: none;
    color: #999;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.guest-menu-btn:hover {
    color: var(--accent-ruby);
}

.top-nav {
    position: relative;
    z-index: 100;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--glass-border);
    padding: 5px 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* --- Epic Cinematic Tabs --- */
.header-tabs {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px;
    /* Wider gap for epic feel */
    height: 100%;
    align-items: center;
}

.header-tab {
    background: transparent;
    border: none;
    color: #888;
    /* Dim Silver */
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.1rem;
    /* 16px+ */
    text-transform: uppercase;
    letter-spacing: 3px;
    /* Wide stance */
    padding: 15px 0;
}

/* --- Toggle Switch (My Chars) --- */
.toggle-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    width: 44px;
    /* Slightly wider */
    height: 24px;
    /* Slightly taller */
    background: #333;
    /* Solid Dark Grey - High Visibility */
    border-radius: 20px;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid #666;
    /* Visible Border */
    flex-shrink: 0;
    /* Prevent squashing */
}

.toggle-knob {
    width: 18px;
    height: 18px;
    background: #AAA;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Active State */
.toggle-switch.checked {
    background: rgba(209, 0, 31, 0.4);
    /* Ruby Tint */
    border-color: #D1001F;
    box-shadow: 0 0 12px rgba(209, 0, 31, 0.6);
}

.toggle-switch.checked .toggle-knob {
    background: #FFF;
    left: 22px;
    /* Slide right */
    box-shadow: 0 0 8px #FFF;
}

.header-tab:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.header-tab.active {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Glowing Ruby Underline */
.header-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    /* Align to bottom of nav bar */
    left: -5px;
    /* Wider than text */
    right: -5px;
    height: 3px;
    background: #D1001F;
    /* Ruby Red */
    box-shadow: 0 4px 10px rgba(209, 0, 31, 0.8);
    border-radius: 2px 2px 0 0;
    animation: glowPulse 2s infinite alternate;
}

@keyframes glowPulse {
    from {
        box-shadow: 0 2px 5px rgba(209, 0, 31, 0.5);
    }

    to {
        box-shadow: 0 5px 15px rgba(209, 0, 31, 0.9);
    }
}

/* --- Buttons: Ruby Gem Style --- */
.btn-gold-outline,
.btn-primary,
.btn-secondary {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--text-silver);
    color: var(--text-silver);
    box-shadow: 0 0 5px rgba(229, 229, 229, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.btn-gold-outline:hover,
.btn-primary:hover {
    background: rgba(209, 0, 31, 0.15);
    /* Ruby tint */
    border-color: var(--accent-ruby);
    color: #fff;
    box-shadow: 0 0 15px rgba(209, 0, 31, 0.4);
}

/* Special "Join Us" / Action Button Style */
.btn-ruby-action {
    background: radial-gradient(circle at 30% 30%, #ff4d6d, var(--accent-ruby));
    border: 1px solid #ff4d6d;
    color: white;
    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.5),
        0 0 15px var(--accent-ruby);
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.btn-ruby-action:hover {
    box-shadow:
        inset 0 0 5px rgba(0, 0, 0, 0.5),
        0 0 25px var(--accent-ruby);
    transform: scale(1.05);
    color: #fff;
}

/* --- Glassmorphism Cards --- */
.filter-card,
.table-card,
.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    /* Sharper edges for gothic feel */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* --- Content Blocks / Tiles --- */
.table-responsive {
    border-radius: 4px;
}

/* --- Tables: Dark Matte Tiles --- */
table.dataTable {
    background: transparent !important;
    border-collapse: separate !important;
    border-spacing: 0 4px !important;
    width: 100% !important;
}

table.dataTable thead th {
    background: rgba(0, 0, 0, 0.9) !important;
    color: var(--text-silver) !important;
    font-family: 'Cinzel', serif;
    border-bottom: 2px solid var(--accent-ruby) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    padding: 12px 8px !important;
    /* Matched to tbody td padding */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    text-align: center !important;
    vertical-align: middle !important;
}

/* Force Dark Backgrounds on Rows and Cells to override Bootstrap/User Agent */
table.dataTable tbody,
table.dataTable tbody tr {
    background-color: transparent !important;
}

/* The actual "Tile" effect applies to the cells */
table.dataTable tbody tr td {
    background-color: #1a1a1a !important;
    /* Fallback */
    background: linear-gradient(145deg, #1a1a1a, #111) !important;
    /* Subtle matte gradient */
    color: var(--text-silver) !important;
    border: none !important;
    border-top: 1px solid #333 !important;
    border-bottom: 1px solid #000 !important;
    padding: 12px 8px !important;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    vertical-align: middle;
}

/* First and Last Cells form the rounded edges */
table.dataTable tbody tr td:first-child {
    border-left: 1px solid #333 !important;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

table.dataTable tbody tr td:last-child {
    border-right: 1px solid #333 !important;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* Hover Effect */
table.dataTable tbody tr:hover td {
    background: linear-gradient(145deg, #222, #1a1a1a) !important;
    color: #fff !important;
    border-top-color: var(--accent-ruby) !important;
    border-bottom-color: var(--accent-ruby) !important;
}

table.dataTable tbody tr:hover td:first-child {
    border-left-color: var(--accent-ruby) !important;
}

table.dataTable tbody tr:hover td:last-child {
    border-right-color: var(--accent-ruby) !important;
}

/* Zebra striping removal */
.table-striped>tbody>tr:nth-of-type(odd)>* {
    --bs-table-accent-bg: transparent !important;
    box-shadow: none !important;
}

.table> :not(caption)>*>* {
    background-color: transparent !important;
    /* Bootstrap 5 override */
}

table.dataTable tbody td:first-child {
    border-left: 1px solid var(--glass-border);
    border-radius: 4px 0 0 4px;
}

table.dataTable tbody td:last-child {
    border-right: 1px solid var(--glass-border);
    border-radius: 0 4px 4px 0;
}

/* Name/Avatar Frame */
.class-icon {
    filter: drop-shadow(0 0 2px var(--text-silver));
    margin-right: 5px;
}

/* Status Dots (Ruby) */
.status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-ruby);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-ruby);
    display: inline-block;
    vertical-align: middle;
}

/* --- Spider Scroll Indicator --- */
.spider-scroll-track {
    position: fixed;
    right: 2px;
    top: 0;
    width: 1px;
    height: 100vh;
    background: rgba(229, 229, 229, 0.2);
    z-index: 9999;
}

.spider-scroll-thumb {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    transition: top 0.1s linear;
    filter: drop-shadow(0 0 2px var(--text-silver));
    pointer-events: none;
}

/* --- Scrollbar (Standard Webkit) --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #050505;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
    border: 1px solid #111;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-ruby);
}

/* --- Footer --- */
.footer-spider {
    text-align: center;
    padding: 40px 0;
    background: #000;
    border-top: 1px solid #222;
    position: relative;
    margin-top: 60px;
}

.footer-spider::before {
    /* Thread */
    content: "";
    position: absolute;
    top: -60px;
    left: 50%;
    width: 1px;
    height: 110px;
    background: linear-gradient(to bottom, transparent, var(--text-silver));
    opacity: 0.5;
}

.spider-hanging {
    position: absolute;
    top: 40px;
    /* End of thread */
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    animation: swingSpider 3s ease-in-out infinite alternate;
}

@keyframes swingSpider {
    from {
        transform: translateX(-50%) rotate(-5deg);
    }

    to {
        transform: translateX(-50%) rotate(5deg);
    }
}

/* --- Misc Overrides --- */
.nav-tabs {
    border-bottom: 1px solid var(--glass-border);
}

.nav-tabs .nav-link {
    color: #666;
    border: none;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.nav-tabs .nav-link.active {
    background: transparent;
    color: var(--accent-ruby);
    border-bottom: 2px solid var(--accent-ruby);
    font-weight: bold;
}

.gold-text-icon,
.text-gold {
    color: var(--accent-ruby) !important;
}

.stage-cell {
    color: #888;
    text-align: center;
}

.done {
    color: var(--text-silver);
    text-shadow: 0 0 5px var(--text-silver);
}

/* Inputs: Cleaner, Bottom Border Only */
.form-control,
.form-select {
    background: transparent;
    border: none;
    border-bottom: 2px solid #555;
    color: var(--text-silver);
    border-radius: 0;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
}

.form-control:focus,
.form-select:focus {
    background: rgba(139, 0, 0, 0.05);
    border-bottom-color: var(--accent-ruby-bright);
    box-shadow: 0 5px 10px -5px rgba(255, 0, 51, 0.3);
    color: #fff;
}

/* DataTables Global Search Override */
.dataTables_wrapper .dataTables_filter input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #555;
    color: #fff;
    border-radius: 0;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-bottom-color: var(--accent-ruby-bright);
    outline: none;
    box-shadow: none;
}

.text-silver {
    color: var(--text-silver) !important;
}

/* Modals */
.btn-close-white {
    filter: invert(1);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {

    /* Shrink the Hero Section significantly */
    .hero-section {
        height: 25vh;
        min-height: 200px;
    }

    .hero-title {
        font-size: 1.5rem;
        margin: 5px 0;
    }

    .hero-subtitle {
        font-size: 0.8rem;
        letter-spacing: 2px;
    }

    .spider-main-logo {
        font-size: 50px;
        margin-bottom: 5px;
    }

    .spider-eyes {
        width: 16px;
        height: 8px;
        top: 45%;
    }

    .eye {
        width: 5px;
        height: 5px;
    }

    /* Hide the sidebar scroll tracker on mobile to prevent overlap */
    .spider-scroll-track {
        display: none;
    }

    /* Compact Navigation */
    .brand-title {
        font-size: 18px;
    }

    .top-nav {
        padding: 8px 10px;
    }

    /* Compact & SCROLLABLE Tables */
    table.dataTable thead th {
        font-size: 0.7rem;
        padding: 8px 4px !important;
        white-space: nowrap;
        /* Prevent headers from breaking awkwardly */
    }

    table.dataTable tbody td {
        font-size: 0.8rem;
        padding: 8px 4px !important;
    }

    /* Allow horizontal scroll for tables without breaking layout */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Adjust container padding */
    .app-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* --- Control Deck (Filter Bar) --- */
.control-deck-container {
    display: flex;
    justify-content: center;
    padding: 0 15px;
    margin-bottom: 25px;
    margin-top: 20px;
    /* Separated from header */
    position: relative;
    z-index: 50;
}

.control-deck {
    width: 100%;
    max-width: 1600px;
    /* Increased to accommodate all filters */
    margin: 0 auto;
    /* Center on large screens */
    /* Richer Background: Dark Gradient + Glass */
    background: linear-gradient(145deg, rgba(25, 25, 25, 0.9), rgba(10, 10, 10, 0.95));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    /* Thin, "Premium" Border */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    /* Highlight on top */

    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    padding: 16px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Groups */
.deck-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.deck-group.center {
    flex-grow: 1;
    justify-content: center;
}

/* Inputs & Selects */
.deck-input {
    background: rgba(0, 0, 0, 0.4) !important;
    /* Ultra-thin glass border */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-silver) !important;
    height: 48px;
    /* Slightly taller for modern feel */
    border-radius: 8px !important;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    padding: 0 16px;
    min-width: 150px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.deck-input:focus {
    background: rgba(20, 0, 0, 0.6) !important;
    border-color: var(--accent-ruby) !important;
    box-shadow: 0 0 15px rgba(209, 0, 31, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.5);
    color: #fff !important;
}

.deck-input:focus {
    border-color: var(--text-silver) !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1) !important;
}

/* Buttons */
.btn-deck {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    height: 44px;
    padding: 0 16px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.btn-deck:hover {
    border-color: var(--text-silver);
    color: var(--text-silver);
    background: rgba(255, 255, 255, 0.05);
}

.btn-deck.active,
.btn-deck:active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}

.btn-deck-action {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    color: var(--text-silver);
    height: 44px;
    padding: 0 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-deck-action.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-silver);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Ruby Glow Button (Apply) */
.btn-ruby-glow {
    background: linear-gradient(135deg, #a00018, #d1001f);
    border: 1px solid #ff4d6d;
    color: #fff;
    height: 44px;
    padding: 0 24px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(209, 0, 31, 0.4);
    transition: all 0.3s ease;
}

.btn-ruby-glow:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(255, 0, 51, 0.6);
    color: #fff;
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .control-deck {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }

    .deck-group {
        width: 100%;
        justify-content: center;
    }

    .deck-group.center {
        flex-direction: column;
        /* Stack inputs on small screens */
    }

    .deck-input,
    .btn-ruby-glow,
    .btn-deck-action {
        width: 100%;
    }
}

/* --- Header Navigation Refactor --- */
/* Tabs */
.header-tab {
    background: transparent;
    border: none;
    color: #888;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    font-weight: 600;
    padding: 10px 0;
    position: relative;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.header-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-ruby);
    box-shadow: 0 0 10px var(--accent-ruby);
    transition: width 0.3s ease;
}

.header-tab:hover {
    color: var(--text-silver);
}

.header-tab:hover::after {
    width: 50%;
}

.header-tab.active {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 0, 51, 0.5);
}

.header-tab.active::after {
    width: 100%;
}

/* User Profile */
.user-avatar-ring {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--text-silver);
    padding: 2px;
    box-shadow: 0 0 10px rgba(229, 229, 229, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.btn-icon-only {
    color: var(--text-silver);
    font-size: 1.2rem;
    padding: 5px;
    border: none;
    background: transparent;
    transition: transform 0.2s;
}

.btn-icon-only:hover {
    transform: rotate(180deg);
    color: #fff;
}

/* --- AAA Dark Luxury Table Design --- */
/* --- Sleek Dark Luxury Table Design (Brute Force Override) --- */
/* v=144 Force Update */

/* Global Table Reset */
body table.dataTable.luxury-table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    margin-top: 10px !important;
    border: none !important;
    width: 100% !important;
    background: transparent !important;
}

/* Remove DataTables Borders & Shadows */
body table.dataTable.luxury-table thead th,
body table.dataTable.luxury-table tbody td,
body table.dataTable.luxury-table tbody tr {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
}

/* Header */
body table.dataTable.luxury-table thead th {
    border-bottom: 2px solid var(--accent-ruby) !important;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--text-silver) !important;
    padding: 20px 10px !important;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    background-color: rgba(0, 0, 0, 0.6) !important;
    /* Dark header */
}

/* Rows: Transparency & Continuity */
body table.dataTable.luxury-table tbody tr {
    transition: background-color 0.2s ease;
    background-color: rgba(0, 0, 0, 0.2) !important;
    /* Semi-transparent 20% */
}

/* Row Hover */
body table.dataTable.luxury-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    transform: none !important;
    box-shadow: none !important;
    position: static !important;
}

/* Cells: Dividers */
body table.dataTable.luxury-table tbody td {
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    /* Visible divider */
    padding: 16px 8px !important;
    vertical-align: middle !important;
}

body table.dataTable.luxury-table tbody tr:last-child td {
    border-bottom: none !important;
}

/* --- Columns - Minimal Clean Styling --- */
/* Remove Gaps! */
table.dataTable.luxury-table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

/* Remove ALL vertical borders for clean look */
body table.dataTable.luxury-table th,
body table.dataTable.luxury-table td {
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
    background-clip: padding-box !important;
    /* Ensure bg doesn't bleed */
}

/* First Column (Player) - Consistent Width, Right Border Separator */
body table.dataTable.luxury-table td:first-child {
    width: 220px !important;
    max-width: 220px !important;
    min-width: 220px !important;
    background: transparent !important;
    position: relative !important;
    border-right: none !important;
}

body table.dataTable.luxury-table th:first-child {
    width: 220px !important;
    max-width: 220px !important;
    min-width: 220px !important;
    background: #0a0a0a !important;
    position: relative !important;
    border-right: none !important;
}

/* Restore Right Border */

/* Remove the pseudo-element separator from 1st col */
body table.dataTable.luxury-table td:first-child::after,
body table.dataTable.luxury-table th:first-child::after {
    content: none !important;
}

/* Reset 2nd Column Border */
body table.dataTable.luxury-table td:nth-child(2),
body table.dataTable.luxury-table th:nth-child(2) {
    border-left: none !important;
}

/* Ensure Header Sort Icon doesn't break alignment */
body table.dataTable.luxury-table th:first-child {
    padding-right: 20px !important;
    /* Space for sorting icon */
}

/* Early Columns Background only */
body table.dataTable.luxury-table td:nth-child(2),
body table.dataTable.luxury-table td:nth-child(3) {
    background: rgba(0, 0, 0, 0.12) !important;
}

body table.dataTable.luxury-table td:nth-child(2) .count-badge,
body table.dataTable.luxury-table td:nth-child(3) .count-badge {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}

/* Mid Columns (III, IV) */
body table.dataTable.luxury-table td:nth-child(4),
body table.dataTable.luxury-table td:nth-child(5) {
    background: transparent !important;
}

body table.dataTable.luxury-table td:nth-child(4) .count-badge,
body table.dataTable.luxury-table td:nth-child(5) .count-badge {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: none !important;
}

/* Late Columns (V, VI, VII) */
body table.dataTable.luxury-table td:nth-child(6),
body table.dataTable.luxury-table td:nth-child(7) {
    background: transparent !important;
}

body table.dataTable.luxury-table td:nth-child(6) .count-badge,
body table.dataTable.luxury-table td:nth-child(7) .count-badge {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2) !important;
}

/* New Columns: Adepts (9) & Dances (10) */
body table.dataTable.luxury-table td:nth-child(9),
body table.dataTable.luxury-table td:nth-child(10) {
    background: transparent !important;
}

body table.dataTable.luxury-table td:nth-child(9) .count-badge {
    /* Adepts - maybe Purple/Necro vibe? Or just standard Hot */
    color: #fff !important;
    background: rgba(153, 50, 204, 0.4) !important;
    /* DarkOrchid-ish */
    box-shadow: 0 0 8px rgba(153, 50, 204, 0.3) !important;
}

body table.dataTable.luxury-table td:nth-child(10) .count-badge {
    /* Dances - maybe Blue/Mystic vibe? */
    color: #fff !important;
    background: rgba(0, 191, 255, 0.25) !important;
    /* DeepSkyBlue */
    box-shadow: 0 0 8px rgba(0, 191, 255, 0.2) !important;
}

/* Boss Header (VII) - Now Column 8 */
body table.dataTable.luxury-table th:nth-child(8) {
    color: var(--accent-ruby-bright) !important;
    text-shadow: 0 0 12px var(--accent-ruby-bright) !important;
}

body table.dataTable.luxury-table td:nth-child(8) {
    background: linear-gradient(to top, rgba(139, 0, 0, 0.1), transparent) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.05) !important;
}

body table.dataTable.luxury-table td:nth-child(8) .count-badge {
    color: #fff !important;
    background: var(--accent-ruby) !important;
    box-shadow: 0 0 12px var(--accent-ruby-bright) !important;
    border: 1px solid var(--accent-ruby-bright) !important;
}

/* --- Badges --- */
.count-badge {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    margin: 0 auto !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border: none !important;
}

.count-cold,
.count-silver,
.count-hot {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* --- Data Monolith (Centered Table) --- */
#tablesWrapper {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 50px;
    position: relative;
    /* Context for loader */
    min-height: 200px;
    /* Prevent collapse */
}

/* Loader Overlay */
#tableLoader {
    position: absolute;
    top: 50px;
    /* Start below filters roughly, orcover everything? User said "on table", covering whole area is safer */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    /* Dim background */
    backdrop-filter: blur(4px);
    z-index: 50;
    /* Above tables */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

/* --- Elegant Player Names (Dark Luxury Style) --- */
/* Column Separator & Transparent BG */
body table.dataTable.luxury-table td:nth-child(1),
body table.dataTable.luxury-table th:nth-child(1) {
    width: 240px !important;
    background: transparent !important;
    border-right: none !important;
}

/* Player Cell Wrapper (TD) - Strict Left */
.player-cell {
    display: flex !important;
    justify-content: flex-start !important;
    /* Left Aligned */
    align-items: center !important;
    padding-left: 24px !important;
    gap: 8px !important;
    /* Elegant breathing room */
    color: #fff !important;
}

/* Ensure Icon has no extra space */
.player-cell .class-icon {
    margin: 0 !important;
    padding: 0 !important;
}

/* Player Name Typography - Cormorant Garamond */
.player-name {
    font-family: 'Cormorant Garamond', serif !important;
    /* Aristocratic Font */
    text-transform: none !important;
    letter-spacing: 1px !important;
    /* Slight air */
    font-weight: 600 !important;
    /* SemiBold, not heavy */
    font-size: 19px !important;
    /* Larger serif size */
    color: #F0F0F0 !important;
    /* Silvery White */
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5) !important;
    /* Soft shadow */
    padding-left: 0 !important;
    display: block !important;
}

/* Hover: White with subtle glow */
body table.dataTable.luxury-table tbody tr:hover .player-name {
    color: #fff !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6) !important;
}

/* --- Compact Filter Deck (Redux) --- */
.control-deck {
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
}

/* Compact Date Inputs */
.date-compact {
    width: 110px !important;
    min-width: 110px;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    height: 32px;
}

/* Expandable Search Input (Ultra Flat) */
.search-compact {
    width: 40px !important;
    min-width: 40px;
    height: 32px;
    /* Match height */
    padding: 0 !important;
    /* No padding default */
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent !important;
    border: 1px solid transparent !important;
    /* Force transparent border */
    box-shadow: none !important;
    /* No shadow */
    cursor: pointer;
    color: #FFF !important;
    border-radius: 4px;
    /* Optional rounded */
}

.search-compact::placeholder {
    opacity: 1;
    font-size: 1.2rem;
    color: #FFF;
    /* Ensure icon is white */
}

/* Focus/Hover State */
.search-compact:hover,
.search-compact:focus,
.search-compact:not(:placeholder-shown) {
    width: 160px !important;
    background: rgba(10, 10, 10, 0.95) !important;
    border: 1px solid var(--glass-border) !important;
    text-align: left;
    padding: 0.25rem 0.5rem !important;
    cursor: text;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5) !important;
}

.search-compact:focus::placeholder {
    opacity: 0.5;
    font-size: 0.9rem;
}

/* Small Segment Control (Newcomers) */
.btn-group .btn-deck {
    font-size: 11px !important;
    padding: 4px 8px !important;
    letter-spacing: 0.5px;
}

/* --- Integrated Date Inputs (User Spec) --- */
.date-input-wrapper {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 10px !important;
    gap: 8px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.date-label {
    color: #888;
    font-size: 11px;
    font-weight: 700;
    margin-right: 8px;
    text-transform: uppercase;
}

/* IMPORTANT: Target the input inside the wrapper specifically */
.date-input-wrapper input[type="date"],
.date-integrated {
    background: transparent !important;
    border: none !important;
    color: #FFF !important;
    outline: none;
    font-family: inherit;
    width: auto;
    padding: 0;
}

/* Fix Calendar Icon */
.date-input-wrapper input[type="date"]::-webkit-calendar-picker-indicator,
.date-integrated::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.6;
}

.date-input-wrapper input[type="date"]::-webkit-calendar-picker-indicator:hover,
.date-integrated::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}


/* --- Absolute Search Overlay --- */
.control-deck {
    position: relative;
    /* Context */
    overflow: visible !important;
    /* Allow overlay */
    padding-right: 50px;
    /* Reserve space for collapsed icon */
}

/* Ensure the right group acts as the anchor point */
.deck-group.right {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    z-index: 20;
    width: auto;
    display: flex;
    align-items: center;
}

/* Redefine Search Compact for Overlay */
.search-compact {
    width: 40px !important;
    height: 36px !important;
    /* Match filters */
    background: transparent !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    color: #FFF !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-compact:hover,
.search-compact:focus,
.search-compact:not(:placeholder-shown) {
    width: 280px !important;
    /* Wide overlay */
    background: #0a0a0a !important;
    /* Solid dark */
    border: 1px solid #444 !important;
    z-index: 30;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.8) !important;
}

/* --- Header Search (Stealth Capsule) - Moved to Global Scope --- */
.header-search-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.header-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    z-index: 10;
    pointer-events: none;
    font-size: 14px;
}

.header-search-input {
    width: 200px;
    /* Fixed width per request */
    height: 36px;
    padding: 8px 15px 8px 35px;
    /* Left padding for icon */
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    background: rgba(0, 0, 0, 0.5) !important;
    color: #FFF !important;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.header-search-input:focus {
    background: rgba(0, 0, 0, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.header-search-input::placeholder {
    color: #AAA;
}

/* Remove old button styles if any remain */
.header-search-btn {
    display: none !important;
}

/* --- Filter Deck Spacing Fix --- */
/* --- Filter Deck Spacing Fix --- */
.control-deck {
    box-sizing: border-box !important;
    /* Ensure padding doesn't overflow width */
    padding-right: 24px !important;
    /* Visual breathing room */
    position: relative !important;
    /* top: 56px; REMOVED */
    /* Approx navbar height - adjust if needed */
    z-index: 1030 !important;
    /* Higher than table headers (usually 1020) */
    background: #0a0a0a !important;
    /* Solid background to obscure scrolling content */
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    /* Fix Wrapping & Layout */
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    overflow: visible !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    /* Tighten gap */
}

/* Explicitly push the last element (APPLY button or its container) away from the edge */
.deck-group.right {
    margin-right: 24px !important;
    /* Force space from edge */
    margin-left: auto !important;
    /* Push to right */
    white-space: nowrap !important;
}

/* Compact Icon Label */
.toggle-label-icon {
    font-size: 18px;
    margin-right: 6px;
    color: #888;
    line-height: 1;
}

/* Resize Apply Button to Match Date Inputs - High Specificity Override */
.btn.btn-ruby-glow.btn-sm,
button.btn-ruby-glow {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    line-height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 18px !important;
    font-size: 0.8rem !important;
    margin: 0 !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

/* --- Final Polish: Button Centering & Active States --- */
/* --- Final Polish: Button Centering & Active States --- */
.btn-deck {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: normal !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: 32px !important;
    /* Force all filter buttons to 32px (presets, classes, newcomers) */
    font-size: 0.8rem !important;
    /* Slightly smaller text for compact look */
}

/* Active Filter Highlight (Newcomers) */
.btn-check:checked+.btn-deck {
    background: var(--accent-ruby) !important;
    color: #FFF !important;
    box-shadow: 0 0 10px var(--accent-ruby) !important;
    border-color: var(--accent-ruby) !important;
}

/* My Chars Toggle Wrapper Adjustment for Right Group */
.deck-group.right .toggle-wrapper {
    z-index: 25;
    /* Below expanded search (30) but above base */
    position: relative;
    margin-right: 15px;
    /* Spacing from search icon */
}

/* Active Preset Button */
.btn-deck.active-preset {
    background: var(--accent-ruby) !important;
    color: #FFF !important;
    box-shadow: 0 0 10px var(--accent-ruby) !important;
    border-color: var(--accent-ruby) !important;
}

/* --- Class Filter Dropdown Customization --- */
/* Target the Dropdown Wrapper (Anchor) */
.control-deck .dropdown {
    position: relative !important;
    /* Create anchor point */
}

/* Target the Menu (Positioning) */
/* Target the Menu (Positioning) */
.control-deck .dropdown-menu {
    position: absolute !important;
    inset: auto auto auto auto !important;
    /* Reset Popper insets */
    top: 100% !important;
    /* Forces it below */
    left: 0 !important;
    margin-top: 0 !important;
    z-index: 99999 !important;
    /* Max Z-Index */
    background-color: #111 !important;
    border: 1px solid #333 !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.9) !important;
    transform: none !important;
    /* Kill Popper transforms */
    /* Ensure it doesn't get hidden */
    display: none;
    /* Let bootstrap toggle this */
}

/* Ensure Bootstrap can toggle display */
.control-deck .dropdown-menu.show {
    display: block !important;
}

/* Custom Red Checkboxes */
.class-checkbox:checked {
    background-color: var(--accent-ruby) !important;
    border-color: var(--accent-ruby) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
}

.class-checkbox:focus {
    box-shadow: 0 0 0 0.25rem rgba(139, 0, 0, 0.25) !important;
    border-color: var(--accent-ruby-bright) !important;
}

/* Red Hover for Select/Clear Buttons */
.btn-outline-light.custom-hover:hover {
    color: #fff !important;
    background-color: var(--accent-ruby) !important;
    border-color: var(--accent-ruby) !important;
    box-shadow: 0 0 8px var(--accent-ruby) !important;
}

/* Ensure full menu visibility */
.control-deck .dropdown-menu {
    max-height: 80vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 0 !important;
}

/* Sticky Apply Button at bottom */
.dropdown-menu li.text-center {
    position: sticky;
    bottom: 0;
    background: #0b0b0b !important;
    /* Match solid menu bg */
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0 !important;
    /* Highest internal layer */
}

/* --- Luxury Input Groups (Tribute Tab) --- */
.luxury-input-group {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    padding: 0;
    overflow: hidden;
    /* Ensure border radius holds */
    margin-right: 8px;
    /* Spacing from next element */
}

.luxury-input-group .input-group-text {
    background: transparent !important;
    border: none !important;
    color: #aaa !important;
    /* Silver/Grey text */
    font-size: 0.8rem;
    padding: 0 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.luxury-input-group select,
.luxury-input-group input {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 0.9rem;
    padding: 4px 8px;
    height: 32px;
    outline: none;
    box-shadow: none !important;
}

.luxury-input-group select:focus,
.luxury-input-group input:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

/* Fix dropdown arrow color in select */
.luxury-input-group select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
    padding-right: 2rem !important;
    /* Make room for arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.luxury-input-group input[type=number] {
    -moz-appearance: textfield;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    /* Separator */
}

/* Style Options for Dropdown */
.luxury-input-group select option {
    background-color: #0b0b0b;
    color: #fff;
    padding: 10px;
}

/* Custom Checkbox Color */
.form-check-input:checked {
    background-color: var(--accent-ruby) !important;
    border-color: var(--accent-ruby) !important;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(201, 42, 42, 0.25);
    border-color: var(--accent-ruby);
}

/* --- Heatmap Chips --- */
.heatmap-chip {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
    transition: all 0.2s ease;
}

/* --- History Timeline Feed --- */
.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 10px;
}

.history-entry {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid rgba(139, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.history-entry:hover {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: var(--accent-ruby);
}

.history-entry-date {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 90px;
    gap: 2px;
}

.history-date-day {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ccc;
}

.history-date-time {
    font-size: 0.75rem;
    color: #888;
    font-family: 'Consolas', 'Monaco', monospace;
}

.history-entry-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.history-player {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    color: #ccc;
    font-weight: 500;
}

.history-event {
    flex: 1;
}

.history-event-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.history-event-badge.event-join {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.history-event-badge.event-leave {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.history-event-badge.event-kick {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.history-event-badge.event-change {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.history-event-badge.event-valor {
    background: rgba(217, 0, 34, 0.15);
    color: var(--accent-ruby);
    border: 1px solid rgba(217, 0, 34, 0.3);
}

.history-event-badge.event-gold {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.history-id {
    font-family: 'Consolas', 'Monaco', monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #a0a0a0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Scroll To Top Button --- */
.btn-scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-ruby), #5a0000);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.6), inset 0 0 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.btn-scroll-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-scroll-top:hover {
    background: linear-gradient(135deg, #ff1a1a, var(--accent-ruby));
    box-shadow: 0 0 20px rgba(255, 0, 51, 0.8), inset 0 0 5px rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}