/* Reset & Base */
:root {
    --bg: #0f0d0b;
    --panel: #171411;
    --panel-2: #1f1a15;
    --border: #26201a;
    --text: #f7f1e5;
    --muted: #b8a891;
    --accent: #d4a64b;
    --accent-2: #f0d28a;
    --danger: #e0565b;
}

* { box-sizing: border-box; }
body, html { margin: 0; padding: 0; }
body.hs-body {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    background: url('/hiscores/images/byebackground.png') center/cover no-repeat fixed, 
                radial-gradient(circle at top left, rgba(50,40,30,0.35), transparent 40%), 
                var(--bg);
    color: var(--text);
    min-height: 100vh;
    position: relative;
}

body.hs-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/hiscores/images/byebackground.png') center/cover no-repeat;
    opacity: 0.3;
    z-index: -1;
}

a { color: inherit; text-decoration: none; }

/* Layout */
.hs-shell {
    max-width: 1280px;
    margin: 120px auto 40px;
    padding: 0 20px 40px;
}

.hs-top-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #1a1612;
    border: 1px solid var(--border);
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.hs-tab {
    padding: 14px 18px;
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--muted);
    background: #1a1612;
    border-right: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.hs-tab:last-child { border-right: none; }
.hs-tab.active {
    background: var(--panel);
    color: var(--accent);
}
.hs-tab:hover {
    background: rgba(255,255,255,0.03);
    color: var(--text);
}

.tab-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.hs-breadcrumb {
    background: var(--panel);
    border: 1px solid var(--border);
    border-top: none;
    padding: 14px 18px;
    display: flex;
    gap: 10px;
    color: var(--muted);
    font-weight: 600;
    align-items: center;
}
.hs-breadcrumb i { color: var(--accent); }

/* Filters */
.hs-filters {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 16px;
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.hs-search {
    display: flex;
    align-items: center;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 260px;
    flex: 1 1 260px;
    color: var(--muted);
}
.hs-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    width: 100%;
    margin-left: 8px;
    font-size: 14px;
}
.hs-search i { color: var(--accent); }

.hs-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.mode-btn {
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s ease;
}
.mode-btn.active {
    border-color: var(--accent);
    color: var(--accent-2);
    background: rgba(212,166,75,0.12);
    box-shadow: 0 0 0 1px rgba(212,166,75,0.3);
}
.mode-btn:hover { color: var(--text); border-color: var(--accent); }

/* Main layout */
.hs-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    margin-top: 16px;
}

.hs-sidebar {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    max-height: 75vh;
    overflow-y: auto;
}
.sidebar-title {
    padding: 12px 10px;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.skill-item {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.skill-item:last-child { border-bottom: none; }
.skill-item:hover { background: rgba(255,255,255,0.03); color: var(--text); }
.skill-item.active {
    background: rgba(212,166,75,0.12);
    color: var(--accent-2);
    border-left: 3px solid var(--accent);
    padding-left: 7px;
}
.skill-item i { width: 18px; text-align: center; color: var(--accent); }
.skill-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}
.skill-item span {
    flex: 1;
}

.boss-item, .subcategory-item {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.boss-item:last-child, .subcategory-item:last-child { border-bottom: none; }
.boss-item:hover, .subcategory-item:hover { 
    background: rgba(255,255,255,0.03); 
    color: var(--text); 
}
.boss-item.active, .subcategory-item.active {
    background: rgba(212,166,75,0.12);
    color: var(--accent-2);
    border-left: 3px solid var(--accent);
    padding-left: 7px;
}
.boss-icon, .subcategory-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}
.boss-item span, .subcategory-item span {
    flex: 1;
}

.hs-content {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 400px;
}

.hs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section-pill {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-2);
}
.section-sub {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}
.refresh-btn {
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}
.refresh-btn:hover { border-color: var(--accent); color: var(--text); }

.hs-loading, .hs-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
}
.hs-loading {
    background: rgba(212,166,75,0.08);
    color: var(--accent-2);
    border: 1px solid var(--border);
}
.hs-error {
    background: rgba(224,86,91,0.08);
    color: #ff9b9b;
    border: 1px solid #6a2d2f;
}
.hidden { display: none !important; }

.hs-table-wrapper {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.hs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.hs-table thead {
    background: #1c1813;
    color: var(--muted);
}
.hs-table th, .hs-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.hs-table th.center, .hs-table td.center { text-align: center; }
.hs-table th.right, .hs-table td.right { text-align: right; font-variant-numeric: tabular-nums; }
.hs-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.hs-table tbody tr td:first-child { color: var(--accent-2); font-weight: 700; }
.hs-table tbody tr td:nth-child(2) { font-weight: 700; color: var(--text); }
.hs-table tbody tr td:nth-child(2) {
    display: flex;
    align-items: center;
    gap: 4px;
}

.player-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.hs-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}
.hs-empty i { font-size: 28px; margin-bottom: 8px; display: block; }

@media (max-width: 960px) {
    .hs-layout { grid-template-columns: 1fr; }
    .hs-sidebar { max-height: none; }
    .hs-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 640px) {
    .hs-filters { flex-direction: column; }
    .hs-modes { width: 100%; }
    .mode-btn { flex: 1 1 120px; text-align: center; }
}

