/* =========================================
   RUNESPIN MODERN OBSIDIAN HISCORES THEME
   ========================================= */

/* --- LAYOUT & CONTAINER --- */
.layout-wrapper {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    width: 100%;
    align-items: flex-start; /* Prevents sidebar stretching height on desktop */
    box-sizing: border-box; /* Ensures padding doesn't break width */
}

/* --- SIDEBAR PANEL --- */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.menu-panel {
    background: #0a0a0a; /* Obsidian Dark */
    border: 1px solid #222;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    position: relative;
}

/* Decorative Gold Top Border for Panels */
.menu-panel::after {
    content: '';
    position: absolute;
    top: -1px; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, #cbb26a, transparent);
    opacity: 0.5;
}

.menu-title {
    font-family: 'Cinzel', serif;
    color: #888;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #1a1a1a;
    text-align: center;
}

/* --- NAVIGATION LINKS --- */
.category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    color: #888;
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.category-link:hover {
    background: rgba(203, 178, 106, 0.05);
    color: #fff;
    border-color: rgba(203, 178, 106, 0.2);
    transform: translateX(3px);
}

.category-link.active {
    background: linear-gradient(90deg, rgba(203, 178, 106, 0.1), transparent);
    border-left: 3px solid #cbb26a;
    color: #cbb26a;
    font-weight: 700;
}

/* --- SEARCH BAR --- */
.search-form { display: flex; flex-direction: column; gap: 12px; }

.search-input {
    padding: 12px;
    background: #050505;
    border: 1px solid #333;
    color: #e0e0e0;
    font-family: 'Lato', sans-serif;
    border-radius: 2px;
    transition: border 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #cbb26a;
    box-shadow: 0 0 8px rgba(203, 178, 106, 0.1);
}

.search-btn {
    padding: 10px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    text-transform: uppercase;
    background: #151515;
    color: #cbb26a;
    border: 1px solid #333;
    cursor: pointer;
    font-size: 11px;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.search-btn:hover {
    background: #cbb26a;
    color: #000;
    border-color: #cbb26a;
}

/* --- MAIN CONTENT AREA --- */
.hiscore-content {
    flex: 1;
    background: #0a0a0a; /* Obsidian Panel */
    border: 1px solid #222;
    padding: 30px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    min-height: 600px;
    box-sizing: border-box; /* Critical for padding/width calculation */
}

/* Corner Decorations */
.hiscore-content::before {
    content: ""; position: absolute; top: 0; left: 0; width: 20px; height: 20px;
    border-top: 2px solid #cbb26a; border-left: 2px solid #cbb26a; opacity: 0.6;
}
.hiscore-content::after {
    content: ""; position: absolute; bottom: 0; right: 0; width: 20px; height: 20px;
    border-bottom: 2px solid #cbb26a; border-right: 2px solid #cbb26a; opacity: 0.6;
}

/* Header */
.lb-header-main {
    text-align: center;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.lb-title-main {
    font-family: 'Cinzel', serif;
    color: #fff;
    font-size: 32px;
    background: linear-gradient(180deg, #fff, #cbb26a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.lb-subtitle-main {
    color: #666;
    font-size: 12px;
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* --- TABLE STYLING --- */
table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Lato', sans-serif;
    table-layout: auto; /* Allow auto sizing */
}

th {
    text-align: left;
    color: #666;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 15px;
    border-bottom: 1px solid #333;
}

td {
    padding: 15px;
    border-bottom: 1px solid #141414;
    color: #ccc;
    font-size: 15px;
    vertical-align: middle;
}

/* Zebra Striping & Hover */
tbody tr:nth-child(even) { background: rgba(255,255,255,0.01); }
tbody tr:hover { background: rgba(203, 178, 106, 0.05); }

/* Column Specifics */
.col-rank {
    width: 60px;
    text-align: center;
    font-weight: bold;
    color: #444;
    font-family: 'Cinzel', serif;
    font-size: 16px;
}

.col-player { font-weight: 400; }
.col-player a {
    color: #cbb26a !important;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}
.col-player a:hover { color: #fff !important; text-shadow: 0 0 8px rgba(203, 178, 106, 0.4); }

.col-score {
    text-align: right;
    width: 140px;
}

.lvl-val {
    font-family: 'Cinzel', serif;
    color: #f1d592;
    font-size: 16px;
    font-weight: 700;
}

.xp-sub {
    font-family: 'Consolas', monospace;
    font-size: 10px;
    color: #555;
    margin-top: 4px;
}

.col-date {
    text-align: right;
    color: #555;
    font-size: 12px;
    width: 120px;
}

/* Highlighted Row (Search Result) */
tr.highlighted-row {
    background: rgba(203, 178, 106, 0.15) !important;
    border-left: 2px solid #cbb26a;
}
tr.highlighted-row td { color: #fff; }

/* --- PAGINATION --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #1a1a1a;
}

.page-btn {
    padding: 8px 18px;
    background: transparent;
    border: 1px solid #333;
    color: #888;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.2s;
}

.page-btn:hover:not(.disabled) {
    border-color: #cbb26a;
    color: #cbb26a;
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: transparent;
}

.page-info {
    font-family: 'Lato', sans-serif;
    color: #444;
    font-size: 12px;
    letter-spacing: 1px;
}

.no-data {
    text-align: center;
    padding: 60px;
    font-style: italic;
    color: #444;
}

/* --- RESPONSIVE FIXES --- */
@media (max-width: 800px) {
    .layout-wrapper {
        flex-direction: column;
        gap: 20px; /* Reduced gap */
        /* FIX: Stretch items to full width on mobile */
        align-items: stretch; 
        padding: 0 15px; /* Less side padding on mobile */
    }
    
    .sidebar { 
        width: 100%; 
        margin-bottom: 0; 
    }
    
    .hiscore-content { 
        padding: 15px; 
        /* FIX: Ensure it spans 100% */
        width: 100%; 
    }
    
    /* Hide Date on Mobile to save space */
    .col-date { display: none; } 
    
    th, td { 
        padding: 10px 5px; /* Tighter table cells */
        font-size: 13px; 
    }
    
    .col-score { 
        width: auto; /* Let score take natural width */
    }
}