:root {
    --color-background: #050505;
    --color-on-background: #ffffff;
    --color-background-hover: #141414;
    --color-on-background-hover: #00ff66;
    --color-primary: #5c0099;
    --color-on-primary: #ffffff;
    --color-error: #de0000;
    --color-on-error: white;
}

main.dark,
header.dark {
    color-scheme: dark;
    --color-background: #050505;
    --color-on-background: #ffffff;
    --color-background-hover: #141414;
    --color-on-background-hover: #00ff66;
    --color-primary: #5c0099;
    --color-primary-disabled: #1f213c;
    --color-on-primary: white;
    --color-error: #de0000;
    --color-on-error: white;
}

html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
}

header,
main {
    background-color: var(--color-background);
    color: var(--color-on-background);
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) minmax(16rem, 2fr) minmax(
            16rem,
            1fr
        );
    column-gap: 2rem;
}

header {
    display: flex;
    padding-inline: calc(25vw - 10rem);
    height: 4rem;
    background-color: var(--color-primary);
    color: var(--color-on-primary);
}

@media screen and (min-width: 1366px) {
    header {
        display: grid;
        padding-inline: 0;
    }
}

header .logo {
    justify-self: end;
    align-self: center;
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}

header {
    width: 100% !important;
    height: 60px !important;
    background-color: #140f23;
}

header .nav {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}

header .nav__tab {
    padding: 0 10px !important;
    height: 60px !important;
    display: inline-flex !important;
    align-items: center !important;
    text-decoration: none !important;
}

header .nav__tab span {
    font-size: 0.85rem !important;
    white-space: nowrap !important;
}

header .nav__actions {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    height: 100% !important;
}

header .nav__underline {
    position: absolute !important;
    bottom: 0 !important;
    height: 3px !important;
    background-color: #fff !important;
}

main {
    height: 0;
    flex: 1;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    column-gap: 2rem;
}

main > div {
    overflow-y: auto;
}

.spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: span 3;
}

input[type="checkbox"] {
    height: 1.25rem;
    width: 1.25rem;
    cursor: pointer;
    margin: 0;
}


/* FULL CUSTOM SPLATTER BACKGROUND */

body,
main,
#app,
.main,
.content,
#app-container,
.main-panel {
    background-image: url('../assets/stripes-background.avif') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    background-color: #050505 !important;
    color: #ffffff !important;
}


/* TITLE SIZE & SUBMIT BUTTON */

header nav > h2:first-of-type,
header h2:first-child {
    color: #00ff66 !important;
    font-size: 22px !important;
    font-weight: bold !important;
    text-shadow: 0 0 10px rgba(0, 255, 102, 0.6) !important;
}

header nav a,
header nav button,
header nav span {
    font-size: 1rem !important;
    text-shadow: none !important;
}


/* STAFF AVATARS */

main+aside ul li:nth-child(1) img,
.editors li:nth-child(1) img,
aside ul li:nth-child(1) img {
    content: url('../assets/mybmw.webp') !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
}

main+aside ul li:nth-child(2) img,
.editors li:nth-child(2) img,
aside ul li:nth-child(2) img {
    content: url('https://cdn.discordapp.com/avatars/619710762436526090/86d787a0df112488216ffeb131ccc45b.webp?size=1280') !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
}

main+aside ul li:nth-child(3) img,
.editors li:nth-child(3) img,
aside ul li:nth-child(3) img {
    content: url('https://cdn.discordapp.com/avatars/1108998428727464008/649e98aba64bfb939c3f8bf87be37faf.webp?size=1280') !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
}

main+aside ul li:nth-child(4) img,
.editors li:nth-child(4) img,
aside ul li:nth-child(4) img {
    content: url('https://cdn.discordapp.com/avatars/1273658996611350622/09614e65f006d9dd5b85c4ab5080cd40.webp?size=1280') !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
}

main+aside ul li:nth-child(5) img,
.editors li:nth-child(5) img,
aside ul li:nth-child(5) img {
    content: url('https://cdn.discordapp.com/avatars/1421471791297331272/552ff00423186e98fa4e107ef8f7180d.webp?size=1280') !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
}

main+aside ul li:nth-child(6) img,
.editors li:nth-child(6) img,
aside ul li:nth-child(6) img {
    content: url('https://cdn.discordapp.com/avatars/882380867325005895/9779daa7d16a3de8a65bbf7a4ad114da.webp?size=1280') !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
}


/* =======================================================
   VUE-ROUTER DROPDOWN
   ======================================================= */

.lists-dropdown {
    position: relative;
    display: inline-block;
    align-self: center;
}

.dropdown-trigger {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: bold;
    padding: 10px 14px;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-trigger:hover {
    color: #ffffff;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1a0033;
    min-width: 150px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999 !important;
    overflow: hidden;
    padding: 4px 0;
}

.dropdown-menu .dropdown-item {
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 10px 16px !important;
    text-decoration: none !important;
    display: block !important;
    font-size: 0.95rem !important;
    text-align: left;
    font-family: "Lexend Deca", sans-serif !important;
    transition: background-color 0.15s;
}

.dropdown-menu .dropdown-item:hover {
    background-color: #5200cc !important;
    color: #ffffff !important;
}

.lists-dropdown:hover .dropdown-menu {
    display: block;
}

.lists-dropdown:hover .dropdown-trigger .arrow {
    transform: rotate(180deg);
}


/* =======================================================
   COMPLETE NAVBAR
   ======================================================= */

header,
nav,
.nav,
.nav-container,
.nav__container,
[class*="nav"] {
    background-color: #6200ea !important;
    background: #6200ea !important;
}

.dropdown-trigger {
    color: rgba(255, 255, 255, 0.7) !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 0 14px !important;
    height: 100% !important;
    transform: translateY(-8px) !important;
}

.dropdown-trigger:hover {
    color: #ffffff !important;
}

.nav_cta,
[class*="submit"],
.btn {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #4A148C !important;
    padding: 5px 14px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    height: 28px !important;
    box-sizing: border-box !important;
}

.nav__right a[href*="discord"],
.nav__right svg,
nav a svg {
    transform: translateY(2px) !important;
    display: inline-flex !important;
    align-items: center !important;
}


/* =======================================================
   WELCOME PAGE WIDGETS
   ======================================================= */

.welcome-widgets-grid {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 900px !important;
    margin: 0 auto 30px auto !important;
    padding: 0 15px !important;
    box-sizing: border-box !important;
    gap: 20px !important;
    position: relative !important;
    z-index: 1 !important;
    pointer-events: auto !important;
}

.search-widget-column,
.wayback-widget-column {
    flex: 1 !important;
    display: flex !important;
    position: relative !important;
    z-index: 1 !important;
    pointer-events: auto !important;
}

.search-widget-column {
    justify-content: flex-start !important;
}

.wayback-widget-column {
    justify-content: flex-end !important;
}

.wayback-placeholder-text {
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.3) !important;
    font-style: italic !important;
    letter-spacing: 0.5px !important;
}


/* =======================================================
   SEARCH BOX
   ======================================================= */

.search-box {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    height: 40px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    width: 40px !important;
    max-width: 40px !important;
    z-index: 2 !important;
    pointer-events: auto !important;
}

.search-box.active {
    width: 320px !important;
    max-width: 320px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 0 12px !important;
}

.search-box input {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #fff !important;

    /* Match the site's existing typography */
    font-family: "Lexend Deca", sans-serif !important;
    font-size: 17.1428571429px !important;
    line-height: 20px !important;
    font-weight: 500 !important;
    -webkit-font-smoothing: subpixel-antialiased !important;

    padding: 0 40px 0 10px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}

.search-box.active input {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.search-btn {
    position: absolute !important;
    right: 0 !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 3 !important;
    pointer-events: auto !important;
}


/* SEARCH RESULTS */

.search-suggestions-dropdown {
    position: absolute !important;
    top: 45px !important;
    left: 0 !important;
    width: 100% !important;
    min-width: 280px !important;
    background: #14141c !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.9) !important;
    z-index: 4 !important;
    max-height: 250px !important;
    overflow-y: auto !important;
}

.suggestion-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 16px !important;
    cursor: pointer !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    background: #14141c !important;
    pointer-events: auto !important;
    text-align: left !important;
}

.suggestion-row:hover {
    background: rgba(0, 230, 118, 0.2) !important;
}

.suggestion-name {
    color: #ffffff !important;
    font-family: "Lexend Deca", sans-serif !important;
    font-size: 17.1428571429px !important;
    line-height: 20px !important;
    font-weight: 500 !important;
    -webkit-font-smoothing: subpixel-antialiased !important;
}

.suggestion-type {
    font-family: "Lexend Deca", sans-serif !important;
    font-size: 11.4285714286px !important;
    line-height: 12px !important;
    font-weight: 500 !important;
    -webkit-font-smoothing: subpixel-antialiased !important;

    text-transform: uppercase !important;
    background: rgba(255, 255, 255, 0.15) !important;
    color: #00e676 !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
}


.difficulty-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    margin-left: 4px;
}


/* =======================================================
   NARROW DESKTOP / DEVTOOLS FIX
   769px - 1100px
   ======================================================= */

@media screen and (max-width: 1100px) and (min-width: 769px) {

    header {
        padding-inline: 10px !important;
        box-sizing: border-box !important;
    }

    header .nav {
        padding: 0 8px !important;
        gap: 4px !important;
        overflow: visible !important;
    }

    /* Keep the site title on one line */
    header nav > h2:first-of-type,
    header h2:first-child {
        white-space: nowrap !important;
        font-size: 17px !important;
        line-height: 1 !important;
        flex-shrink: 1 !important;
    }

    /* Keep navigation buttons separate rather than overlapping */
    header .nav__tab,
    .lists-dropdown {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    header .nav__tab {
        padding-inline: 5px !important;
    }

    header .nav__tab span {
        font-size: 0.72rem !important;
        white-space: nowrap !important;
    }

    .dropdown-trigger {
        padding-inline: 5px !important;
        font-size: 0.72rem !important;
        white-space: nowrap !important;
        transform: translateY(-8px) !important;
    }

    /* Keep right-side controls visible */
    header .nav__actions {
        gap: 5px !important;
        flex-shrink: 0 !important;
    }

    header .nav__actions > * {
        white-space: nowrap !important;
    }

    /* Compact submit button */
    .nav_cta,
    [class*="submit"],
    .btn {
        padding: 4px 9px !important;
        font-size: 0.72rem !important;
    }


    /* ===================================================
       NARROW DESKTOP LEVEL LIST
       =================================================== */

    .page-list .list-container {
        padding-inline: 0.5rem !important;
    }

    .page-list .list tr {
        min-height: 3rem !important;
        height: auto !important;
        align-items: center !important;
        overflow: visible !important;
    }

    .page-list .list .rank {
        padding-right: 0.5rem !important;
        flex-shrink: 0 !important;
        line-height: 1.4 !important;
    }

    .page-list .list .level {
    min-width: 0 !important;
    overflow: visible !important;
    flex: 1 1 auto !important;
}

    .page-list .list .level button {
        min-width: 0 !important;
        min-height: 2.75rem !important;
        height: auto !important;
        padding: 0.75rem 1rem !important;
        line-height: 1.4 !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    
.page-list .list .level button > span:first-child {
    min-width: 0 !important;
    line-height: 1.4 !important;
    overflow: visible !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    text-overflow: clip !important;
}



    .page-list .list .level button .type-label-sm {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
}







/* =======================================================
   SEARCH RESULTS — MATCH SEARCH FONT
   ======================================================= */

/* Creator / Collaborator dropdown results */
.search-suggestions-dropdown .creator-level-row,
.search-suggestions-dropdown .creator-level-row span {
    font-family: "Lexend Deca", sans-serif !important;
    -webkit-font-smoothing: subpixel-antialiased !important;
}

/* Creator / Collaborator dropdown result name */
.search-suggestions-dropdown .creator-level-row > span:first-child {
    font-size: 0.82rem !important;
    line-height: 20px !important;
}

/* W / A / R secondary tags */
.search-suggestions-dropdown .search-weekly-player-label,
.search-suggestions-dropdown .search-anomalies-label,
.search-suggestions-dropdown .search-removed-label {
    font-family: "Lexend Deca", sans-serif !important;
    -webkit-font-smoothing: subpixel-antialiased !important;
}







/* =======================================================
   SEARCH RESULTS — COMPACT PRIMARY LABEL ALIGNMENT
   ======================================================= */

/*
 * The right-hand label area starts at one fixed position,
 * but the individual coloured badges stay compact.
 */

.search-suggestions-dropdown .suggestion-row > span:last-child {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;

    width: auto !important;
    min-width: 105px !important;
    flex: 0 0 auto !important;

    white-space: nowrap !important;
}




/*
 * Primary labels remain only as wide as necessary.
 *
 * This removes the oversized 72px/92px badge boxes.
 */
.search-suggestions-dropdown .suggestion-type {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: auto !important;
    min-width: 0 !important;

    box-sizing: border-box !important;
    white-space: nowrap !important;
}


/*
 * Creator / Collaborator triangle.
 *
 * It gets its own small space and therefore cannot move the
 * Creator badge's starting position.
 */
.search-suggestions-dropdown .creator-dropdown-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 12px !important;
    min-width: 12px !important;

    padding: 2px 0 !important;
    margin: 0 !important;

    box-sizing: border-box !important;
    flex: 0 0 12px !important;

    transform: translateX(15px) !important;
}

/*
 * Secondary labels (W, A, R, Legacy, Weekly) remain compact.
 */
.search-suggestions-dropdown .search-secondary-label {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
}













/* =======================================================
   MASTER DEMONLIST MOBILE RESPONSIVENESS
   ======================================================= */

@media (max-width: 768px) {

    /* Layout */

    .root,
    #app,
    main,
    .page-list {
        display: flex !important;
        flex-direction: column !important;
        padding: 5px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .g-layout,
    .panel,
    .surface,
    .main-content,
    div[style*="max-width: 1000px"] {
        width: 100% !important;
        max-width: 100% !important;
        margin: 10px 0 !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }


    /* Navigation */

    .nav,
    nav,
    .header,
    .nav-bar,
    .nav__actions,
    .nav-content,
    [class*="nav"] {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
        padding: 10px 5px !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        float: none !important;
    }

    .nav__title,
    .nav__logo,
    [class*="logo"],
    [class*="title"] {
        position: relative !important;
        margin: 5px auto !important;
        text-align: center !important;
        width: 100% !important;
        display: block !important;
    }

    .nav a,
    nav a,
    .nav__link,
    .button,
    .submit-record-btn,
    [class*="link"],
    [class*="btn"] {
        font-size: 0.7rem !important;
        padding: 5px 8px !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 2px !important;
        border-radius: 4px !important;
        height: auto !important;
        width: auto !important;
        position: relative !important;
        transform: none !important;
    }

    .nav nav,
    .nav__sub,
    div[style*="grid"],
    .nav-bar ul {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 10px 0 !important;
        padding: 0 !important;
        position: relative !important;
        height: auto !important;
    }

    .nav nav a,
    .nav__sub a {
        margin: 4px !important;
        font-size: 0.75rem !important;
        z-index: 5 !important;
    }

    header,
    .header,
    nav,
    .nav,
    .nav-bar,
    .nav-container {
        position: static !important;
        height: auto !important;
        max-height: unset !important;
        min-height: unset !important;
        pointer-events: auto !important;
    }


    /* Main content */

    .root,
    #app,
    main,
    .page-list,
    .main-content,
    .content,
    .g-layout {
        position: relative !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: visible !important;
    }


    /* Remove full-screen overlays */

    div[style*="position: fixed"],
    div[style*="position: absolute"] {
        position: relative !important;
        height: auto !important;
    }


    /* ===================================================
       LEADERBOARD MOBILE
       =================================================== */

    .page-leaderboard,
    div[v-if="selected !== null"],
    .player-container {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: unset !important;
        margin: 15px 0 !important;
        box-sizing: border-box !important;
    }

    .player-details,
    .right-panel,
    div[style*="flex-grow"] {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        margin-top: 25px !important;
        padding: 15px !important;
        box-sizing: border-box !important;
        height: auto !important;
    }


    /* ===================================================
       ROULETTE MOBILE
       =================================================== */

    .page-roulette,
    div[v-if="view == 'roulette'"],
    div[style*="grid-template-columns"],
    .roulette-container {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }

    .roulette-card,
    .level-card,
    div[v-if="started"] {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 30px !important;
        padding: 15px !important;
        box-sizing: border-box !important;
        height: auto !important;
    }

    .roulette-buttons,
    .roulette-inputs {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center !important;
        width: 100% !important;
    }


    /* ===================================================
       MOBILE OVERFLOW PROTECTION
       =================================================== */

    body,
    html {
        overflow-x: hidden !important;
        width: 100% !important;
    }


    /* ===================================================
       MOBILE LIST CONTAINER
       =================================================== */

    .g-layout > div:first-child,
    .list-container,
    .list {
        max-height: 35vh !important;
        overflow-y: auto !important;
        border-bottom: 2px solid rgba(255, 255, 255, 0.1);
        padding-right: 5px !important;
    }

    .g-layout > div:first-child::-webkit-scrollbar,
    .list-container::-webkit-scrollbar,
    .list::-webkit-scrollbar {
        width: 6px;
    }

    .g-layout > div:first-child::-webkit-scrollbar-thumb,
    .list-container::-webkit-scrollbar-thumb,
    .list::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 4px;
    }


    /* ===================================================
       MOBILE SEARCH
       =================================================== */

    /* Remove the faint collapsed search background */
    .search-box:not(.active) {
        background: transparent !important;
        border: none !important;
        width: 40px !important;
        max-width: 40px !important;
        padding: 0 !important;
    }

    /* Hide the invisible input while collapsed */
    .search-box:not(.active) input {
        display: none !important;
    }

    /* Keep only the magnifying glass visible */
    .search-box:not(.active) .search-btn {
        background: transparent !important;
        width: 40px !important;
        height: 40px !important;
        right: 0 !important;
    }

    /* Expanded search remains responsive */
    .search-box.active {
        width: min(320px, calc(100vw - 30px)) !important;
        max-width: calc(100vw - 30px) !important;
        box-sizing: border-box !important;
    }

    .search-box.active input {
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
}


@media screen and (min-width: 769px) and (max-width: 1365px) {

    header {
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        padding-inline: 6px !important;
    }

    header .nav {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 6px !important;
        gap: 4px !important;
        overflow: visible !important;
    }

    /* Keep navigation items from ever overlapping */
    header .nav__tab,
    header .lists-dropdown,
    header .nav__actions {
        flex-shrink: 0 !important;
    }

    /* Slightly reduce spacing rather than squeezing buttons */
    header .nav__tab {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    header .nav__tab span {
        font-size: 0.78rem !important;
        white-space: nowrap !important;
    }

    .dropdown-trigger {
        padding-left: 6px !important;
        padding-right: 6px !important;
        white-space: nowrap !important;
    }

    header .nav__actions {
        gap: 7px !important;
    }

    header .nav__actions > * {
        flex-shrink: 0 !important;
    }
}


@media screen and (min-width: 769px) {

    /* =====================================================
       NAVBAR: PREVENT CLIPPING
       ===================================================== */

    header {
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    header .nav {
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    /*
     * Make the navigation itself sit above page content.
     * This also gives the dropdown a clean stacking context.
     */
    header,
    header .nav {
        position: relative !important;
        z-index: 10000 !important;
    }


    /* =====================================================
       LISTS DROPDOWN: RESTORE CLICKABILITY
       ===================================================== */

    header .lists-dropdown {
        position: relative !important;
        z-index: 10001 !important;
        pointer-events: auto !important;
    }

    header .dropdown-trigger {
        position: relative !important;
        z-index: 10002 !important;
        pointer-events: auto !important;
    }

    header .dropdown-menu {
        position: absolute !important;
        z-index: 10003 !important;
        pointer-events: auto !important;
    }

    header .lists-dropdown:hover .dropdown-menu {
        display: block !important;
        pointer-events: auto !important;
    }


    /* =====================================================
       KEEP THE WELCOME SEARCH BELOW THE NAVBAR
       ===================================================== */

    .welcome-widgets-grid {
        z-index: 1 !important;
    }

    .search-box {
        z-index: 2 !important;
    }

    .search-suggestions-dropdown {
        z-index: 4 !important;
    }
}





 /* =======================================================
    FINAL DESKTOP LEVEL ROW BALANCE
    ======================================================= */

@media screen and (min-width: 769px) and (max-width: 1100px) {

    /*
     * Give the middle section a TINY bit more room.
     * This is deliberately a very small adjustment.
     */
    main {
        grid-template-columns:
            minmax(20.75rem, 1.05fr)
            minmax(20.15rem, 2fr)
            minmax(16rem, 1fr) !important;

        column-gap: 1rem !important;
    }

    /*
     * Left list must be allowed to use its entire column.
     */
    main > div:first-child,
    .page-list,
    .page-list .list-container,
    .page-list .list {
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /*
     * Normal level row.
     *
     * Keep the row itself on one horizontal axis.
     * The NAME is the part that is allowed to become two lines.
     */
    .page-list .list .level button {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;

        width: 100% !important;
        min-width: 0 !important;
        min-height: 2.75rem !important;
        height: auto !important;

        box-sizing: border-box !important;
        overflow: visible !important;

        padding-top: 0.65rem !important;
        padding-bottom: 0.65rem !important;
    }

    /*
     * LEVEL NAME
     *
     * This is the ONLY part that should wrap.
     *
     * Short name:
     *     Countershock
     *
     * Long multi-word name:
     *     Rhythmical Scream
     *     [can occupy a second line]
     *
     * Individual words are not broken.
     */
    .page-list .list .level button > .type-label-lg {
        display: block !important;

        flex: 1 1 auto !important;
        min-width: 0 !important;

        max-width: none !important;

        white-space: normal !important;

        overflow: visible !important;
        text-overflow: clip !important;

        overflow-wrap: normal !important;
        word-break: normal !important;
        hyphens: none !important;

        line-height: 1.35 !important;
    }

    /*
     * REMOVED / LEGACY METADATA
     *
     * THIS MUST NEVER WRAP.
     *
     * "Removed: 08/09/2026" stays together.
     */
    .page-list .list .level button > .type-label-sm {
        display: block !important;

        flex: 0 0 auto !important;
        min-width: max-content !important;

        white-space: nowrap !important;

        overflow: visible !important;
        text-overflow: clip !important;

        margin-left: 0.75rem !important;

        line-height: 1.35 !important;
    }
}


@media screen and (min-width: 769px) and (max-width: 1100px) {

    /*
     * REMOVED ROWS ONLY:
     * Put "Removed: 08/09/2026" underneath the level name.
     */
    .page-list .list .level button:has(> .type-label-sm) {
        flex-wrap: wrap !important;
    }

    .page-list .list .level button:has(> .type-label-sm) > .type-label-lg {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .page-list .list .level button:has(> .type-label-sm) > .type-label-sm {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-top: 2px !important;

        white-space: nowrap !important;
        text-align: left !important;
    }
}