/* Shared presentation for the D2R ladder and Diablo IV leaderboard. */
/* ── title ── */
.title h1 {
    font-family: 'exocet blizzard ot', serif;
    font-weight: normal;
    isolation: isolate;
    padding: 6px 20px 6px 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    letter-spacing: 3px;
    text-transform: uppercase;
    box-sizing: border-box;
    overflow: hidden;
    background-color: #2a2a2a;
    background-image:
        linear-gradient(90deg,
            transparent 0%, transparent 10%,
            rgba(40,40,40,0.97) 15%, rgba(40,40,40,0.97) 85%,
            transparent 90%, transparent 100%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.15'/%3E%3C/svg%3E"),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(60,60,60,0.3) 2px, rgba(60,60,60,0.3) 3px),
        url('../images/header-space.png');
    background-size: 100% 100%, 200px 200px, 100% 100%, cover;
    background-position: center;
    border: 1px solid #1a1210;
    border-top-color: #4a4a4a;
    border-left-color: #3a3a3a;
    border-bottom-color: #1a1a1a;
    border-radius: 2px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        inset 0 -1px 0 rgba(0,0,0,0.5),
        inset 0 0 10px rgba(0,0,0,0.3),
        0 2px 6px rgba(0,0,0,0.6);
    color: #f0e6c0;
    font-size: 1.98em;
    margin-bottom: 10px;
}
.title h1 b {
    color: #f0e6c0;
}

/* ── table ── */
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    background: #800000;
    color: white;
    font-weight: bold;
}
td, th {
    padding: 10px;
    text-align: left;
    font-size: 1.4rem;
}
thead {
    isolation: isolate;
}
tbody tr:nth-child(odd) {
    background: #e8e8e8;
}
tbody tr:nth-child(even) {
    background: #f6f6f6;
}

/* ── pagination ── */
.pagination-container {
    display: flex;
    align-items: center;
    gap: 16px;
}
.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Roboto', sans-serif;
}
.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.pagination a:hover {
    background-color: #f2f2f2;
}
.pagination .active {
    background-color: #800000;
    color: #fff;
    font-weight: bold;
    border: none;
}
.pagination .disabled {
    color: #ccc;
    cursor: default;
}
.pagination .dots {
    border: none;
    cursor: default;
}

/* ── page size ── */
.page-size {
    display: flex;
    align-items: center;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    margin-left: auto;
}
.page-size label {
    margin-right: 8px;
}
.page-size select {
    padding: 4px 8px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

/* ── links / misc ── */
.link-div {
    display: inline-block;
    cursor: pointer;
    padding: 5px;
}
.link-div:hover {
    outline: 2px solid #2e3a47;
}
.pagination a.link-div,
.pagination a.link-div:visited,
.pagination a.link-div:hover,
.pagination a.link-div:active {
    display: inline-block;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
    transition: none;
}
.special-link, .special-link:visited, .special-link:hover, .special-link:active {
    color: rgb(41, 41, 219);
    text-decoration: none;
}

/* ── buttons ── */
.ladder-btn {
    background-color: #800000;
    color: #fff;
    padding: .375rem .375rem;
    font-size: 1.4rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.ladder-btn:hover {
    background-color: #9a0000;
}

/* ── compare checkbox ── */
.compare-checkbox {
    appearance: none;
    width: 1.4rem;
    height: 1.4rem;
    border: 2px solid #aaa;
    border-radius: 3px;
    background-color: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    vertical-align: middle;
    isolation: isolate;
}
.compare-checkbox:hover {
    border-color: #C7B377;
}
.compare-checkbox:checked {
    background-color: #C7B377;
    border-color: #C7B377;
}
.compare-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid #111;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}
#comparison-wrapper {
    display: none;
}

/* ── search bar ── */
.ld-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    flex-wrap: wrap;
}
.ld-search-row .icon-input {
    flex: 2;
    min-width: 200px;
}
.ld-search-field {
    background: #333;
    color: #C7B377;
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 1.32em;
    font-family: 'Source Sans 3', sans-serif;
    min-width: 175px;
}
.ld-search-field[hidden] {
    display: none;
}
.last-played-sort-button {
    appearance: none;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: inherit;
    padding: 0;
}
.last-played-sort-button:hover,
.last-played-sort-button:focus-visible {
    color: #C7B377;
}

/* ── dropdown system ── */
.ld-dd {
    position: relative;
    flex: 1;
    min-width: 140px;
}
.ld-dd-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #333;
    color: #C7B377;
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    min-width: 140px;
    font-size: 1.32em;
    font-family: 'Source Sans 3', sans-serif;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.ld-dd-toggle:hover {
    border-color: #C7B377;
    background: #3a3a3a;
}
.ld-dd.open .ld-dd-toggle {
    border-color: #C7B377;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.ld-dd-toggle .ld-arrow {
    margin-left: 10px;
    font-size: .6em;
    color: #C7B377;
    transition: transform 0.2s ease;
}
.ld-dd.open .ld-dd-toggle .ld-arrow {
    transform: rotate(180deg);
}
.ld-dd-menu {
    display: none;
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    background: #333;
    border: 1px solid #C7B377;
    border-top: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
    z-index: 10;
    max-height: 400px;
    overflow: auto;
    font-size: 1.32em;
    font-family: 'Source Sans 3', sans-serif;
}
.ld-dd.open .ld-dd-menu {
    display: block;
}
.ld-dd-menu span {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    color: #ddd;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-left: 3px solid transparent;
}
.ld-dd-menu span:hover {
    background-color: rgba(199, 179, 119, 0.12);
    border-left-color: #C7B377;
    color: #C7B377;
}
.ld-dd-menu span.ld-selected {
    background-color: rgba(199, 179, 119, 0.18);
    color: #C7B377;
    border-left-color: #C7B377;
    font-weight: 600;
}
.ld-dd-menu span + span {
    border-top: 1px solid #333;
}
.ld-dd-menu span svg {
    margin-left: auto;
}
.ld-dd-menu span img.ld-portrait {
    width: 26px;
    height: 26px;
    margin-right: 8px;
}

@media (max-width: 899px) {
    .title h1 {
        background-image: none;
        background-color: #2a2a2a;
        font-size: 1.3em;
        gap: 8px;
        padding: 6px 10px;
        letter-spacing: 1px;
    }
    .ld-search-row {
        flex-direction: column;
        gap: 8px;
    }
    .ld-dd {
        width: 100%;
    }
    .ld-search-row .icon-input {
        width: 100%;
    }
    .ld-search-field {
        width: 100%;
    }
    thead {
        visibility: collapse;
    }
}

