 :root {
     --bg: #10161d;
     --bg-alt: #10161d;
     --text: #f9fafb;
     --text-alt: #f9fafb;
     --text-light: #f9fafb;
     --text-muted: #f9fafb;
     --card-bg: #121920;
     --border: #2a2e36;
     --border-row: #23272f;
     --thead-bg: #10161d;
     --thead-text: #676e7c;
     --tr-hover: #141b26;
     --shadow: 0 2px 24px 0 rgba(5, 5, 10, .19);
     --button-bg: #313641;
     --button-bg-hover: #2a2e36;
     --button-text: #f6f8fa;
     --gold: #efba3c;
     --silver: #879ea5;
     --copper: #b56329;
 }

 body {
     margin: 0;
     background: var(--bg);
     font-family: 'Inter', Arial, sans-serif;
     color: var(--text);
     user-select: none;
     overflow-y: hidden;
 }

 .main-content {
     max-width: 100%;
     margin: 48px auto 0 auto;
     padding: 24px;
     height: calc(100vh - 200px);
     /* or whatever fits your design */
 }


 .leaderboard-card {
     background: var(--bg-alt);
     border-radius: 0 0 14px 14px;
     box-shadow: var(--shadow);
     padding: 0;
     border: 2px solid var(--border);
     border-top: none;
     /* merges with View Kit row */
     margin-top: 0;
     position: relative;
     z-index: 1;
     overflow: visible;

     /* fill most of the screen */
     margin: 0 auto;
     padding: 16px 20px 20px;
     /* was probably something like 24–32px */
     height: calc(100vh - 350px);

 }

 #overall>.leaderboard-card {
     overflow-y: scroll;
 }

 #goldSword,
 #lmp,
 #door,
 #macesmp,
 #goldsword,
 #firework,
 #fireball {
     width: 100%;
     max-width: none;
 }

 .leaderboard-header {
     font-size: 2.2rem;
     font-weight: 700;
     letter-spacing: -0.03em;
     color: var(--text-alt);
     margin-bottom: 24px;
     text-align: left;
 }

 .tabs {
     display: flex;
     justify-content: flex-start;
     gap: 2px;
     border-bottom: none;
     margin-bottom: 0;
     /* remove space below tabs */
     padding: 0 8px;
 }

 /* Base tab button */
 .tab-btn {
     margin-bottom: -2px;
     display: flex;
     align-items: center;
     justify-content: center;
     flex-direction: row;
     gap: 6px;
     padding: 10px 16px;
     background: var(--bg-alt);
     border: 2px solid var(--border);
     border-bottom: none;
     border-radius: 10px 10px 0 0;
     cursor: pointer;
     color: var(--text-light);
     transition: all 0.15s ease;
     font-weight: 600;
     font-size: 0.95rem;
 }

 .tab-btn.active {
     background: var(--bg-alt);
     color: var(--text);
     z-index: 3;
 }

 .tab-label {
     display: none;
 }

 .tab-btn.active .tab-label {
     display: inline-block;
 }

 /* Hover glow */
 .tab-btn:hover {
     color: var(--text-alt);
 }

 /* The leaderboard container connects seamlessly to tabs */

 /* The leaderboard container connects seamlessly to tabs */


 table {
     border-collapse: collapse;
     width: 100%;
     background-color: var(--bg-alt);
     font-size: 1.08rem;
     overflow-y: hidden;
 }

 thead th {
     font-weight: 600;
     letter-spacing: 0.02em;
     padding: 10px 14px;
     /* was larger — this makes it shorter */
     text-align: left;
     font-size: 0.85rem;
     /* slightly smaller text */
     border: none;
     text-transform: uppercase;
     color: var(--text-light);
     vertical-align: middle;
     opacity: 0.5;
 }

 /* shift text slightly inward to align with content rows */
 thead th:first-child {
     padding-left: 22px;
     /* tweak until your first column lines up perfectly */
 }

 tbody td:first-child {
     padding-left: 22px;
     /* match the header */
 }

 /* reduce overall header height a touch */
 thead {
     line-height: 0.01;
     /* tighter vertical spacing */
 }

 tbody {
     overflow-y: visible;
 }

 tbody tr {
     transition: background .15s;
     border-radius: 2px;
     width: max-content;
     background-color: var(--card-bg);
     transition: background-color 500ms, transform 500ms;
     overflow: visible;
     border-radius: 25px;
 }

 tbody tr:hover {
     background-color: var(--button-bg-hover);
     transform: translateX(-15px);

 }

 tbody tr:last-child {
     border-bottom: none;
 }


 td {
     padding: 18px 20px;
     color: var(--text-alt);
     font-weight: 400;
     border: none;
     vertical-align: middle;
     cursor: pointer;
 }

 td:first-child,
 th:first-child {
     width: 100%;
     font-weight: 600;
 }

 td:last-child,
 th:last-child {
     text-align: right;
     width: 100%;
 }

 .tab-content {
     display: none;
     height: 100%
 }

 .tab-content.active {
     display: block;
 }


 #darkModeToggle {
     position: fixed;
     bottom: 24px;
     left: 24px;
     z-index: 9999;
     background: var(--button-bg);
     color: var(--button-text);
     border: none;
     border-radius: 12px;
     width: auto;
     height: 48px;
     font-size: 1rem;
     cursor: pointer;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
     display: flex;
     align-items: center;
     justify-content: center;
     transition: background 0.2s, color 0.2s;
 }

 #darkModeToggle:hover {
     background: var(--button-bg-hover);
 }

 .view-kit-btn {
     background: var(--button-bg);
     color: var(--button-text);
     border: none;
     border-radius: 10px;
     padding: 10px 24px;
     font-weight: 600;
     cursor: pointer;
     box-shadow: var(--shadow);
     transition: background 0.2s, color 0.2s;
     font-size: 1rem;
     margin: 5px;
     float: right;
 }

 .view-kit-btn:hover {
     background: var(--button-bg-hover);
 }

 /* Modal styles */
 .kit-modal {
     display: none;
     /* Hidden by default */
     position: fixed;
     z-index: 99999;
     left: 0;
     top: 0;
     width: 100vw;
     height: 100vh;
     background: rgba(0, 0, 0, 0.38);
     justify-content: center;
     align-items: center;
 }

 .kit-modal.active {
     display: flex;
 }

 .kit-modal-content {
     background: var(--bg-alt);
     border-radius: 18px;
     padding: 28px 32px 24px 32px;
     box-shadow: var(--shadow);
     width: 50vw;
     height: 50vh;
     overflow-y: auto;
     position: relative;
     text-align: center;
 }

 .kit-modal-close {
     position: absolute;
     top: 14px;
     right: 18px;
     font-size: 2rem;
     color: var(--text-light);
     cursor: pointer;
     user-select: none;
     transition: color 0.2s;
 }

 .kit-modal-close:hover {
     color: var(--text-alt);
 }

 .view-kit-btn-row {
     display: flex;
     justify-content: flex-end;
     /* 👈 everything hugs the right */
     align-items: center;
     gap: 10px;
     /* spacing between server-info and button */
     padding: 10px 16px;
     margin: 0;
     background: var(--bg-alt);
     border-left: 2px solid var(--border);
     border-right: 2px solid var(--border);
     border-top: 2px solid var(--border);
     border-bottom: none;
     border-top-left-radius: 12px;
     border-top-right-radius: 12px;
     position: relative;
     z-index: 2;
 }

#kitImage{
    height: 90%;
    aspect-ratio: 527/499;
}
 .mc-face-img {
     vertical-align: middle;
     width: 60px;
     height: 60px;
     border-radius: 6px;
     margin-right: 8px;
     background-color: transparent;
 }

 td,
 th {
     white-space: nowrap;
 }

 td:nth-child(2),
 th:nth-child(2) {
     min-width: 160px;
     /* Adjust as needed */
     white-space: nowrap;
 }

 #discordBtn {
     height: 26px;
     width: auto;
     margin-left: auto;
     margin-right: 0;
     cursor: pointer;
     transition: transform 100ms;
 }

 #discordBtn:hover {
     transform: scale(1.05);
     transform-origin: 50%;
 }

 .mc-face-flex {
     display: inline-flex;
     align-items: center;
     height: 56px;
     overflow: hidden;
     width: 160px;
     background-image: url('other.svg');
     background-size: cover;
     margin-left: -21px;
 }

 .rank {
     margin: 20px;
     margin-right: 30px;
     font-size: 1.7rem;
     font-style: italic;
     font-weight: bolder;
 }

 p {
     display: inline-flex;
 }

 .rank-gold {
     font-weight: 700 !important;
     background-size: 300%;
     background-position-x: 100%;
     background-image: url('gold.svg');
     background-size: cover;
     text-shadow: 0px 3px 1px #232323
 }

 .rank-silver {
     background: linear-gradient(-45deg, #879ea5 40%, #9bb2b9 50%, #879ea5 60%);
     background-size: 300%;
     background-position-x: 100%;
     background-image: url('silver.svg');
     background-size: cover;
     font-weight: 700 !important;
     text-shadow: 0px 3px 1px #232323
 }

 .rank-copper {
     background: linear-gradient(-45deg, #b56329 40%, #ca7334 50%, #b56329 60%);
     background-size: 300%;
     background-position-x: 100%;
     background-image: url('copper.svg');
     background-size: cover;
     font-weight: 700 !important;
     text-shadow: 0px 3px 1px #232323
 }

 .tab-btn span+br,
 .tab-btn br+* {
     display: none;
 }

 /* Show text only on the active tab */
 .tab-btn.active span+br,
 .tab-btn.active br+* {
     display: inline;
 }

 .server-info {
     display: flex;
     align-items: center;
     gap: 10px;
     padding: 6px 12px;
     border-radius: 9999px;
     box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
 }

 .server-logo {
     height: 35px;
     width: auto;
 }

 .server-details {
     display: flex;
     flex-direction: column;
     justify-content: center;
     line-height: 1.1;
 }

 .server-label {
     font-size: 0.7rem;
     color: var(--text-light);
     font-weight: 600;
     opacity: 0.7;
 }

 .server-ip {
     font-size: 0.9rem;
     color: var(--text);
     font-weight: 600;
     background: rgba(255, 255, 255, 0.05);
     padding: 4px 10px;
     border-radius: 10px;
     cursor: pointer;
     /* 👈 show it's clickable */
     user-select: none;
     transition: background 0.2s, color 0.2s;
 }

 .server-ip:hover {
     background: rgba(255, 255, 255, 0.1);
 }

 .server-ip.copied {
     background: rgba(72, 190, 95, 0.3);
     color: #4ade80;
 }

 .discord-icon {
     height: 22px;
     width: 22px;
     transition: transform 0.1s;
 }

 .discord-icon:hover {
     transform: scale(1.1);
 }

 .mode-badge {
     display: inline-flex;
     flex-direction: column;
     align-items: center;
     gap: 2px;
     /* spacing between icon + label */
 }

 /* Circle icon */
 .mode-icon {
     width: 34px;
     height: 34px;
     border-radius: 50%;
     background: transparent;
     /* inner dark */
     border: 2px solid;
     /* gold outline */
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .mode-icon img {
     width: 60%;
     height: 60%;
     object-fit: contain;
     pointer-events: none;
 }

 /* HT1 pill label */
 .mode-label {
     /* gold-brown background */
     /* bright gold text */
     padding: 2px 8px;
     border-radius: 12px;
     font-size: 12px;
     font-weight: 700;
     line-height: 1;
     font-family: sans-serif;
     text-transform: uppercase;
 }

 .pInfo-overlay {
     position: fixed;
     inset: 0;
     z-index: 9999;
     display: none;
     /* shown by .is-open */
     background: var(--aqua-bg-2);
     backdrop-filter: blur(6px);
 }

 .pInfo-overlay.is-open {
     display: grid;
     place-items: center;
     padding: 20px;
 }

 .pInfo-card {
     width: min(560px, 92vw);
     background: var(--aqua-bg);
     color: var(--aqua-text);
     border: 1px solid var(--aqua-border);
     border-radius: var(--aqua-radius);
     box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
     overflow: hidden;
 }

 .pInfo-head {
     display: flex;
     align-items: center;
     gap: 12px;
     padding: 16px 18px;
     margin-bottom: -40px;
     background: linear-gradient(180deg, rgba(63, 194, 255, .12), transparent 70%);
 }

 .pInfo-title {
     font-size: 22px;
     font-weight: 800;
 }

 .pInfo-close {
     margin-left: auto;
     border: 0;
     background: transparent;
     color: var(--aqua-text);
     width: 36px;
     height: 36px;
     border-radius: 10px;
     cursor: pointer;
 }

 .pInfo-close:hover {
     background: rgba(255, 255, 255, .05);
 }

 .pInfo-close:focus {
     outline: 2px solid var(--aqua-accent);
     outline-offset: 2px;
 }

 .pInfo-body {
     padding: 16px 18px;
     font-size: 15px;
     line-height: 1.45;
 }

 .pInfo-body p {
     margin: 0 0 10px;
     color: var(--aqua-text);
     font-size: 20px;
 }

 .pInfo-meta {
     font-size: 12.5px;
     color: var(--aqua-text-dim);
 }

 .pInfo-actions {
     display: flex;
     gap: 10px;
     align-items: center;
     padding: 14px 18px 18px;
     border-top: 1px solid var(--aqua-border);
 }

 .pInfo-btn {
     appearance: none;
     border: 0;
     cursor: pointer;
     padding: 10px 14px;
     font-weight: 800;
     border-radius: 12px;
 }

 .pInfo-btn-primary {
     background: linear-gradient(180deg, var(--aqua-accent), var(--aqua-accent-2));
     color: #03131a;
 }

 @media (prefers-reduced-motion: no-preference) {
     .pInfo-card {
         animation: aqp-pop .16s ease-out;
     }

     @keyframes aqp-pop {
         from {
             opacity: 0;
             transform: translateY(4px) scale(.98);
         }

         to {
             opacity: 1;
             transform: translateY(0) scale(1);
         }
     }
 }

 .pInfo-Points {
     font-size: 18px;
     color: var(--aqua-text-dim);
     margin-right: -12px;
 }

 .pInfo-playerImage {
     background-color: rgba(255, 255, 255, 0.03);
     border-radius: 100%;
     width: 150px;
     height: 150px;
 }

 .pInfo-player {
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 8px;
 }

 footer {
     text-align: center;
     margin-top: 50px;
 }

 .region-pill {
     display: inline-block;
     padding: 2px 7px;
     border-radius: 999px;
     font-size: 11px;
     font-weight: 600;
     background: #1f2933;
     color: #e5f4ff;
 }

 .region_eu {
     background-color: rgb(71, 122, 71);
 }

 .region_na {
     background-color: rgb(179, 67, 85);
 }

 .region_sa {
     background-color: rgb(175, 67, 179);
 }

 .region_au {
     background-color: rgb(226, 182, 87);
 }

 .region_as {
     background-color: rgb(87, 131, 226);
 }

 #navigator {
     display: flex;
     flex-wrap: wrap;
     margin: 5px;
     margin-bottom: -50px;
     align-content: center;
     align-items: center;
     justify-content: center;
     background: var(--bg-alt);
     border: 2px solid var(--border);
     border-radius: 10px;
     height: auto;
     padding: 5px;
 }

 .navigator-image {
     width: 25px;
     height: 25px;
     margin-left: 15px;
     margin-right: 5px;
     margin-bottom: -6px;
 }

 a {
     color: rgb(103, 187, 235);
     text-decoration: none;
     opacity: 0.6
 }

 a:hover {
     opacity: 1;
 }

 .break {
     flex-basis: 100%;
     flex-grow: 1;
     margin-bottom: 10px;
 }

 /* ===== Multi-column tier layout (gamemode tabs) ===== */

 .tier-columns {
     display: grid;
     /* 5 equal columns, but with a smaller minimum width */
     grid-template-columns: repeat(5, minmax(200px, 1fr));
     gap: 16px;
     width: 100%;
     height: calc(100vh - 350px);

 }

 .tier-column {
     border-radius: 18px;
     padding: 10px 10px 12px;
     background: #111827;
     border: 1px solid #1f2933;
     box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
     display: flex;
     flex-direction: column;
     min-height: 140px;
     overflow-y: scroll;
     display: inline-block;
     vertical-align: top;
     white-space: normal;
     max-height: calc(80vh - 150px);
 }

 .leaderboard-content {
     overflow-y: hidden;
     white-space: nowrap;
 }

 /* tier header strips – gold / silver / bronze-ish etc */
 .tier-column-header {
     font-weight: 700;
     font-size: 12px;
     letter-spacing: 0.08em;
     text-transform: uppercase;
     padding: 6px 10px;
     border-radius: 12px;
     margin-bottom: 8px;
     color: #0b1020;
 }

 /* per-tier gradients */
 .tier-column-1 .tier-column-header {
     background: linear-gradient(90deg, #fbd367, #f5c242);
 }

 .tier-column-2 .tier-column-header {
     background: linear-gradient(90deg, #e5e7eb, #cbd5f5);
 }

 .tier-column-3 .tier-column-header {
     background: linear-gradient(90deg, #f59e86, #ed6c5c);
 }

 .tier-column-4 .tier-column-header {
     background: linear-gradient(90deg, #c7f5e9, #aecec6);
 }

 .tier-column-5 .tier-column-header {
     background: linear-gradient(90deg, #bfc3c9, #6c737e);
 }

 .tier-list {
     list-style: none;
     margin: 0;
     padding: 0;
     display: flex;
     flex-direction: column;
     gap: 4px;
 }

 .tier-row {
     display: flex;
     align-items: center;
     gap: 6px;
     padding: 4px 4px;
     border-radius: 10px;
     background: rgba(15, 23, 42, 0.85);
     cursor: pointer;
 }

 .tier-row-left {
     flex: 0 0 auto;
 }

 .tier-avatar {
     width: 32px;
     height: 32px;
     border-radius: 6px;
     display: block;
 }

 .tier-row-main {
     flex: 1 1 auto;
     min-width: 0;
 }

 .tier-username {
     font-size: 13px;
     font-weight: 600;
     color: #f9fafb;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
 }

 .tier-row-right {
     flex: 0 0 auto;
     display: flex;
     align-items: center;
     gap: 4px;
     font-size: 11px;
 }

 .tier-arrow {
     font-size: 11px;
     color: #e5e7eb;
 }

 /* region pills (reuse if you already have similar styles) */

 .tier-empty {
     font-size: 12px;
     color: #9ca3af;
     padding: 4px 4px;
 }

 .tier-columns-loading {
     padding: 12px;
     font-size: 13px;
     color: #9ca3af;
 }

 /* optional: make it stack on mobile */
 @media (max-width: 1100px) {
     .tier-columns {
         grid-template-columns: repeat(3, minmax(200px, 1fr));
     }
 }

 @media (max-width: 800px) {
     .tier-columns {
         grid-template-columns: repeat(2, minmax(200px, 1fr));
     }
 }

 @media (max-width: 600px) {
     .tier-columns {
         grid-template-columns: 1fr;
     }
 }

 .tier-column::-webkit-scrollbar-track {
     -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
     background-color: transparent;
     border-radius: 10px;
     border-radius: 20px;
 }

 .tier-column::-webkit-scrollbar {
     width: 10px;
     background-color: transparent;
 }

 .tier-column::-webkit-scrollbar-thumb {
     border-radius: 10px;
     background-image: -webkit-gradient(linear,
             left bottom,
             left top,
             color-stop(0.44, var(--aqua-accent)),
             color-stop(0.86, var(--aqua-accent-2)));
 }
.leaderboard-card::-webkit-scrollbar-track {
     -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
     background-color: transparent;
     border-radius: 10px;
     border-radius: 20px;
 }

 .leaderboard-card::-webkit-scrollbar {
     width: 10px;
     background-color: transparent;
 }

 .leaderboard-card::-webkit-scrollbar-thumb {
     border-radius: 10px;
     background-image: -webkit-gradient(linear,
             left bottom,
             left top,
             color-stop(0.44, var(--aqua-accent)),
             color-stop(0.86, var(--aqua-accent-2)));
 }