/* StupidLeague — the whole UI. Global rather than component-scoped because the
   analysis panel is rendered by child components that scoped CSS would not reach. */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #0d1117;
}

/* ============================================================ shell */
.app {
    --bg: #0d1117;
    --bg2: #131922;
    --bg3: #1a2230;
    --line: #232c3b;
    --tx: #e6edf3;
    --dim: #8b98a9;
    --dim2: #5f6b7a;
    --acc: #4dd08a;
    --acc-dim: #1e4634;
    --warn: #e0a04d;
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--tx);
    font: 13px/1.45 ui-sans-serif, -apple-system, "Segoe UI", system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
}

/* ============================================================ header */
.hdr {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--bg2);
}

.brand h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

    .brand h1 span {
        color: var(--acc);
    }

.brand p {
    margin: 2px 0 0;
    color: var(--dim);
    font-size: 11.5px;
    max-width: 90ch;
}

.controls {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: none;
}

.gloss-btn {
    background: var(--bg3);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--dim);
    font: inherit;
    font-size: 12px;
    padding: 6px 11px;
    cursor: pointer;
}

    .gloss-btn:hover {
        color: var(--tx);
        border-color: var(--dim2);
    }

/* ---- centre of the header: the currently selected seat ---- */
.hdr-sel {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    min-width: 0;
    padding-top: 2px;
}

.selcard {
    width: 100%;
    max-width: 460px;
    background: var(--bg3);
    border: 1px solid var(--line);
    border-left: 3px solid var(--acc);
    border-radius: 6px;
    padding: 5px 9px;
    min-width: 0;
}

    .selcard.dead {
        border-left-color: #a35050;
    }

    .selcard.empty {
        border-left-color: var(--line);
        color: var(--dim2);
        font-size: 11px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        min-height: 46px;
        line-height: 1.4;
    }

.selcard-top {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.selcard-seat {
    font-size: 9px;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--dim2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
    flex: none;
}

.selcard-name {
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selcard-x {
    margin-left: auto;
    background: none;
    border: 0;
    color: var(--dim2);
    font: inherit;
    font-size: 11px;
    cursor: pointer;
    padding: 0 2px;
    flex: none;
}

    .selcard-x:hover {
        color: var(--tx);
    }

.selcard-rule {
    font-size: 10px;
    color: var(--dim);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selcard-nums {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    margin-top: 2px;
    font-size: 10px;
    color: var(--dim2);
}

    .selcard-nums b {
        color: var(--tx);
        font-weight: 600;
    }

    .selcard-nums .m-strong, .selcard-nums .m-weak,
    .selcard-nums .m-fit, .selcard-nums .m-dead {
        background: none;
        padding: 0;
        height: auto;
        min-width: 0;
        display: inline;
        font-weight: 400;
    }

.seg {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}

    .seg button {
        background: var(--bg3);
        color: var(--dim);
        border: 0;
        padding: 6px 12px;
        font: inherit;
        cursor: pointer;
    }

        .seg button.on {
            background: var(--acc);
            color: #07130d;
            font-weight: 600;
        }

.chk {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--dim);
    cursor: pointer;
    user-select: none;
}

    .chk.off {
        opacity: .4;
        cursor: default;
    }

/* ============================================================ body */
.body {
    flex: 1;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 360px;
    min-height: 0;
}

.rail, .panel {
    overflow-y: auto;
    background: var(--bg2);
}

.rail {
    border-right: 1px solid var(--line);
    padding: 10px;
}

.panel {
    border-left: 1px solid var(--line);
}

.rail-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 2px 4px 8px;
}

    .rail-head h2 {
        margin: 0;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: .8px;
        color: var(--dim);
    }

    .rail-head span {
        font-size: 10.5px;
        color: var(--dim2);
    }

/* ------------------------------------------------ option groups */
.opt {
    margin-bottom: 10px;
}

.opt-name {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--dim);
    padding: 0 3px 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
}

    .opt-name em {
        font-style: normal;
        font-weight: 500;
        letter-spacing: 0;
        text-transform: none;
        color: var(--dim2);
        flex: none;
    }

.var {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--bg3);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: 5px;
    padding: 6px 8px;
    margin-bottom: 4px;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

    .var:hover {
        border-color: #33405a;
        border-left-color: var(--dim);
    }

    .var.on {
        background: var(--acc-dim);
        border-color: var(--acc);
        border-left-color: var(--acc);
    }

    .var.dead {
        opacity: .55;
        border-left-color: #7d3b3b;
    }

        .var.dead.on {
            opacity: 1;
            background: #2a1a1a;
            border-color: #a35050;
            border-left-color: #a35050;
        }

.var-top {
    display: flex;
    align-items: center;
    gap: 5px;
}

.var-label {
    font-weight: 650;
    font-size: 12.5px;
}

.badge {
    font-size: 10px;
    color: var(--acc);
    flex: none;
}

    .badge.dead {
        color: #d08a8a;
    }

.var-rule {
    color: var(--dim);
    font-size: 10.5px;
    line-height: 1.35;
    margin: 1px 0 4px;
}

.var-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 9px;
    font-size: 10px;
    color: var(--dim2);
}

    .var-stats b {
        color: var(--dim);
        font-weight: 600;
    }

.var.on .var-stats b {
    color: var(--tx);
}

/* ------------------------------------------------ constraint cards */
.team {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--bg3);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

    .team:hover {
        border-color: #33405a;
        border-left-color: var(--dim);
    }

    .team.on {
        background: var(--acc-dim);
        border-color: var(--acc);
        border-left-color: var(--acc);
    }

.team-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.team-name {
    font-weight: 650;
    font-size: 13px;
}

.cat {
    font-size: 9px;
    letter-spacing: .6px;
    color: var(--dim2);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 1px 4px;
    flex: none;
}

.team.on .cat {
    color: var(--acc);
    border-color: var(--acc);
}

.team-rule {
    color: var(--dim);
    font-size: 11px;
    margin: 2px 0 6px;
}

.team-bar {
    height: 3px;
    background: #0a0e14;
    border-radius: 2px;
    overflow: hidden;
}

    .team-bar i {
        display: block;
        height: 100%;
        background: var(--acc);
        opacity: .75;
    }

.team-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 6px;
    font-size: 10.5px;
    color: var(--dim2);
}

    .team-stats b {
        color: var(--dim);
        font-weight: 600;
    }

.team.on .team-stats b {
    color: var(--tx);
}

.ghost {
    width: 100%;
    background: none;
    border: 1px dashed var(--line);
    border-radius: 6px;
    color: var(--dim2);
    font: inherit;
    font-size: 11px;
    padding: 7px;
    margin-top: 6px;
    cursor: pointer;
}

    .ghost:hover {
        color: var(--tx);
        border-color: var(--dim2);
    }

.rejects {
    margin-top: 8px;
    font-size: 11px;
}

    .rejects > p {
        color: var(--dim2);
        margin: 0 0 8px;
    }

.reject {
    padding: 6px 8px;
    border-left: 2px solid #4a2b2b;
    background: #17121280;
    margin-bottom: 4px;
    border-radius: 0 4px 4px 0;
}

    .reject b {
        display: block;
    }

    .reject em {
        display: block;
        color: var(--dim);
        font-style: normal;
        font-size: 10.5px;
    }

    .reject span {
        display: block;
        color: #c98c8c;
        font-size: 10px;
        margin-top: 2px;
    }

/* ============================================================ board */
.board {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 10px 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg2);
}

    .tabs button {
        background: none;
        border: 1px solid transparent;
        border-bottom: 0;
        border-radius: 6px 6px 0 0;
        color: var(--dim);
        font: inherit;
        font-weight: 600;
        padding: 7px 14px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .tabs button:hover {
            color: var(--tx);
        }

        .tabs button.on {
            background: var(--bg);
            border-color: var(--line);
            color: var(--tx);
            margin-bottom: -1px;
            padding-bottom: 8px;
        }

.tab-n {
    font-size: 10px;
    font-weight: 500;
    color: var(--dim2);
    background: var(--bg3);
    border-radius: 8px;
    padding: 1px 6px;
}

.legend {
    margin-left: auto;
    padding-right: 6px;
    font-size: 11px;
    color: var(--dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.swatch {
    width: 20px;
    height: 10px;
    border-radius: 2px;
    background: var(--acc-dim);
    border-left: 2px solid var(--acc);
}

/* ------------------------------------------------------- data grid */
.grid-head, .row {
    display: grid;
    grid-template-columns:
        44px minmax(120px, 1.7fr) 52px 40px 38px 38px 42px 38px 30px
        minmax(76px, 1fr) 88px 38px 32px 42px 44px 36px;
    gap: 7px;
    align-items: center;
    padding: 0 12px;
}

.grid-head {
    height: 28px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--dim2);
    border-bottom: 1px solid var(--line);
    background: var(--bg2);
    /* match the row's highlight border and the scroll container's gutter so the
       header labels sit exactly over their columns */
    border-left: 2px solid transparent;
    padding-right: 22px;
}

.rows {
    flex: 1;
    overflow-y: scroll;          /* always reserve the gutter, so nothing shifts */
    scrollbar-width: thin;
    scrollbar-color: #2c3646 transparent;
}

    .rows::-webkit-scrollbar {
        width: 10px;
    }

    .rows::-webkit-scrollbar-thumb {
        background: #2c3646;
        border-radius: 5px;
    }

    .rows::-webkit-scrollbar-track {
        background: transparent;
    }

.row {
    height: 27px;
    border-bottom: 1px solid #171e29;
    border-left: 2px solid transparent;
    white-space: nowrap;
}

    .row:hover {
        background: var(--bg2);
    }

    .row.miss {
        opacity: .26;
    }

    .row.hit {
        border-left-color: var(--acc);
        background: #12261c66;
    }

        .row.hit:hover {
            background: #16321f;
        }

.c-adp b {
    font-weight: 650;
}

.c-adp i {
    color: var(--dim2);
    font-style: normal;
    font-size: 10px;
    margin-left: 4px;
}

.c-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.c-col, .c-draft {
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--dim);
    font-size: 11px;
}

.c-team {
    color: var(--dim);
}

.c-num {
    text-align: right;
    color: var(--dim);
}

.c-elig {
    text-align: right;
}

    .c-elig i {
        font-style: normal;
        font-size: 10px;
        padding: 1px 5px;
        border-radius: 8px;
    }

.e-hi {
    background: #2a3f31;
    color: #7fd6a4;
}

.e-md {
    background: #2b3243;
    color: #97a6bd;
}

.e-lo {
    background: #3e2a2a;
    color: #d69a9a;
}

em.p-QB, em.p-RB, em.p-WR, em.p-TE, .t-pos {
    font-style: normal;
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
}

.p-QB {
    background: #3a2a44;
    color: #c69ade;
}

.p-RB {
    background: #143a30;
    color: #6fd4ac;
}

.p-WR {
    background: #13314a;
    color: #7cb8e8;
}

.p-TE {
    background: #45351b;
    color: #e0b96a;
}

/* ---------------------------------------------- seat summary page */
.summary {
    flex: 1;
    overflow-y: scroll;
    scrollbar-width: thin;
    scrollbar-color: #2c3646 transparent;
    padding: 12px 14px 40px;
}

    .summary::-webkit-scrollbar {
        width: 10px;
    }

    .summary::-webkit-scrollbar-thumb {
        background: #2c3646;
        border-radius: 5px;
    }

.sum-intro p {
    margin: 0 0 6px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--dim);
    max-width: 110ch;
}

.legend-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 8px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0 !important;
}

    .legend-row .sep {
        color: var(--line);
    }

    .legend-row b {
        color: var(--tx);
    }

/* the +/star/- marks */
.m {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    flex: none;
}

.m-fit {
    background: #3a3413;
    color: #e8cc55;
}

.m-strong {
    background: #143a24;
    color: #56d98a;
}

.m-weak {
    background: #3d1c1c;
    color: #e07777;
}

.m-dead {
    background: #2b2b2b;
    color: #8b8b8b;
}

/* ---- one row per seat, variants laid out across ---- */
.stable-head, .srow {
    display: grid;
    grid-template-columns: 58px 168px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.stable-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg);
    padding: 8px 2px 5px;
    border-bottom: 1px solid var(--line);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--dim2);
}

.srow {
    padding: 7px 2px;
    border-bottom: 1px solid #171e29;
}

    .srow:hover {
        background: #10151d;
    }

.srow-score {
    text-align: right;
    line-height: 1;
    padding-top: 2px;
}

    .srow-score b {
        font-size: 17px;
        font-weight: 700;
        color: var(--acc);
    }

    .srow-score i {
        font-style: normal;
        font-size: 10px;
        color: var(--dim2);
    }

.scorebar {
    display: block;
    height: 3px;
    background: #0a0e14;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

    .scorebar i {
        display: block;
        height: 100%;
        background: var(--acc);
        opacity: .8;
    }

.srow-name h3 {
    margin: 0;
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1.25;
}

.srow-name p {
    margin: 2px 0 0;
    font-size: 9.5px;
    line-height: 1.35;
    color: var(--dim2);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.srow-vars {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.vchip {
    flex: 1 1 150px;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    background: var(--bg2);
    border: 1px solid var(--line);
    border-left: 3px solid transparent;
    border-radius: 5px;
    padding: 5px 8px;
    color: inherit;
    font: inherit;
    cursor: pointer;
    min-width: 0;
}

    .vchip:hover {
        border-color: #33405a;
        background: var(--bg3);
    }

    .vchip.rec {
        border-left-color: var(--acc);
    }

    .vchip.on {
        background: var(--acc-dim);
        border-color: var(--acc);
    }

.vchip-top {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.vchip-label {
    font-size: 11.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .vchip-label.best {
        font-weight: 750;
    }

.vchip-rule {
    font-size: 9.5px;
    line-height: 1.35;
    color: var(--dim);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vchip-nums {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 9.5px;
    color: var(--dim2);
    margin-top: 1px;
}

    .vchip-nums b {
        color: var(--dim);
    }

    .vchip-nums .m-strong {
        background: none;
        padding: 0;
        color: #56d98a;
    }

    .vchip-nums .m-weak {
        background: none;
        padding: 0;
        color: #e07777;
    }

    .vchip-nums .m-fit {
        background: none;
        padding: 0;
        color: #e8cc55;
    }

    .vchip-nums .m-dead {
        background: none;
        padding: 0;
        color: #8b8b8b;
    }

/* ------------------------------------- four positions side by side */
.grid4 {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    min-height: 0;
}

.col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--bg);
}

.col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 8px;
    background: var(--bg2);
    border-bottom: 1px solid var(--line);
    flex: none;
}

    .col-head span {
        font-size: 10px;
        color: var(--dim2);
    }

.col-rows {
    flex: 1;
    overflow-y: scroll;
    scrollbar-width: thin;
    scrollbar-color: #2c3646 transparent;
}

    .col-rows::-webkit-scrollbar {
        width: 8px;
    }

    .col-rows::-webkit-scrollbar-thumb {
        background: #2c3646;
        border-radius: 4px;
    }

/* round divider inside a position column */
.ctier {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 8px 3px;
    background: linear-gradient(to right, var(--bg3), transparent 80%);
    border-top: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 1;
    backdrop-filter: blur(3px);
}

    .ctier span {
        font-size: 9.5px;
        font-weight: 700;
        letter-spacing: .6px;
        color: var(--acc);
    }

    .ctier i {
        font-style: normal;
        font-size: 9.5px;
        color: var(--dim2);
    }

.crow {
    display: grid;
    /* posRank · name · team · proj · eligible-variants chip */
    grid-template-columns: 20px minmax(0, 1fr) 26px 24px 20px;
    gap: 4px;
    align-items: center;
    width: 100%;
    height: 22px;
    padding: 0 6px;
    border: 0;
    border-bottom: 1px solid #171e29;
    border-left: 2px solid transparent;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 11.5px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

    .crow:hover {
        background: var(--bg2);
    }

.c-pj {
    font-size: 9.5px;
    color: var(--dim);
    text-align: right;
}

.c-el {
    text-align: right;
}

    .c-el i {
        font-style: normal;
        font-size: 8.5px;
        padding: 1px 3px;
        border-radius: 6px;
    }

    .crow.miss {
        opacity: .24;
    }

    .crow.hit {
        border-left-color: var(--acc);
        background: #12261c66;
    }

.c-pr {
    font-size: 9.5px;
    color: var(--dim2);
}

.c-nm {
    overflow: hidden;
    text-overflow: ellipsis;
}

.c-tm {
    font-size: 9.5px;
    color: var(--dim);
    text-align: right;
}

/* --------------------------------------------------- round divider */
.tier {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 12px 5px;
    background: linear-gradient(to right, var(--bg3), transparent 70%);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid #171e29;
    position: sticky;
    top: 0;
    z-index: 1;
    backdrop-filter: blur(3px);
}

.tier-r {
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--acc);
}

.tier-meta {
    font-size: 10.5px;
    color: var(--dim2);
}

    .tier-meta b {
        color: var(--acc);
    }

/* ============================================================ panel */
.pan {
    padding: 14px;
}

.pan-head {
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
    margin-bottom: 4px;
}

    .pan-head h2 {
        margin: 4px 0 2px;
        font-size: 17px;
        letter-spacing: -0.3px;
    }

    .pan-head .rule {
        margin: 0;
        color: var(--dim);
        font-size: 12px;
    }

.pan section {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

    .pan section:last-child {
        border-bottom: 0;
    }

    .pan section h3 {
        margin: 0 0 8px;
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: .9px;
        color: var(--dim);
    }

        .pan section h3 em {
            font-style: normal;
            color: var(--dim2);
            text-transform: none;
            letter-spacing: 0;
        }

.note {
    margin: 8px 0 0;
    font-size: 11px;
    line-height: 1.5;
    color: var(--dim);
}

    .note b {
        color: var(--tx);
        font-weight: 600;
    }

.recbox {
    border-left: 2px solid var(--acc);
    background: #12261c;
    padding: 7px 9px;
    border-radius: 0 4px 4px 0;
}

    .recbox b {
        color: var(--acc);
    }

.optnote {
    margin-top: 6px;
    font-size: 10.5px;
    font-style: italic;
}

.warnbox {
    border-left: 2px solid var(--warn);
    background: #221a0d80;
    padding: 7px 9px;
    border-radius: 0 4px 4px 0;
}

    .warnbox b {
        color: var(--warn);
    }

.kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.kpi {
    background: var(--bg3);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

    .kpi b {
        display: block;
        font-size: 19px;
        font-weight: 700;
        color: var(--acc);
        line-height: 1.1;
    }

    .kpi span {
        display: block;
        font-size: 10px;
        color: var(--dim);
        text-transform: uppercase;
        letter-spacing: .5px;
    }

    .kpi i {
        display: block;
        font-style: normal;
        font-size: 9.5px;
        color: var(--dim2);
        margin-top: 3px;
    }

/* --------------------------------------------------- round bars */
.rounds {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rnd {
    display: grid;
    grid-template-columns: 26px 1fr 46px;
    gap: 8px;
    align-items: center;
    font-size: 10.5px;
}

.rnd-n {
    color: var(--dim2);
}

.rnd-bar {
    height: 11px;
    background: #0a0e14;
    border-radius: 2px;
    overflow: hidden;
}

    .rnd-bar i {
        display: block;
        height: 100%;
        background: var(--acc);
        opacity: .8;
    }

.rnd-v {
    text-align: right;
    color: var(--tx);
}

    .rnd-v em {
        font-style: normal;
        color: var(--dim2);
    }

.rnd.empty .rnd-v {
    color: #d08a8a;
}

/* --------------------------------------------------- tables */
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

    .tbl th {
        text-align: left;
        font-weight: 600;
        color: var(--dim2);
        font-size: 9.5px;
        text-transform: uppercase;
        letter-spacing: .5px;
        padding: 0 6px 4px 0;
        border-bottom: 1px solid var(--line);
    }

    .tbl td {
        padding: 4px 6px 4px 0;
        border-bottom: 1px solid #171e29;
        color: var(--dim);
    }

        .tbl td b {
            color: var(--tx);
        }

    .tbl .tot td {
        border-bottom: 0;
        color: var(--dim2);
        padding-top: 6px;
    }

    .tbl .ok {
        color: var(--acc);
    }

    .tbl .warn {
        color: var(--warn);
    }

    .tbl.rank .nm {
        color: var(--tx);
    }

.mini {
    display: inline-block;
    width: 46px;
    height: 6px;
    background: #0a0e14;
    border-radius: 2px;
    overflow: hidden;
    margin-right: 5px;
    vertical-align: middle;
}

    .mini i {
        display: block;
        height: 100%;
        background: var(--acc);
        opacity: .8;
    }

/* --------------------------------------------------- tier ladder */
.tiers {
    display: flex;
    align-items: stretch;
    gap: 3px;
    margin-bottom: 5px;
}

.t-pos {
    flex: none;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.t-cell {
    flex: 1;
    background: var(--bg3);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 3px 2px 4px;
    text-align: center;
    min-width: 0;
}

    .t-cell.zero {
        border-color: #4a2b2b;
    }

.t-lab {
    display: block;
    font-size: 8.5px;
    color: var(--dim2);
}

.t-val {
    display: block;
    font-size: 12px;
    font-weight: 650;
}

.t-cell.zero .t-val {
    color: #d08a8a;
}

.t-bar {
    height: 2px;
    background: #0a0e14;
    margin-top: 3px;
    border-radius: 1px;
    overflow: hidden;
}

    .t-bar i {
        display: block;
        height: 100%;
        background: var(--acc);
    }

/* --------------------------------------------------- definitions */
.defs {
    margin: 0;
    font-size: 11px;
}

    .defs dt {
        font-weight: 650;
        color: var(--tx);
        margin-top: 8px;
    }

        .defs dt:first-child {
            margin-top: 0;
        }

    .defs dd {
        margin: 2px 0 0;
        color: var(--dim);
        line-height: 1.5;
    }

/* ============================================================ modals */
.modal-back {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: #04070bcc;
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.modal {
    background: var(--bg2);
    border: 1px solid #33405a;
    border-radius: 10px;
    box-shadow: 0 20px 60px #000a;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    width: 100%;
    max-width: 620px;
    min-height: 0;
}

    .modal.wide {
        max-width: 860px;
    }

.modal-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--line);
    flex: none;
}

    .modal-head h2 {
        margin: 0;
        font-size: 17px;
        letter-spacing: -0.3px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .modal-head p {
        margin: 3px 0 0;
        font-size: 11px;
        color: var(--dim);
        line-height: 1.45;
    }

.x {
    margin-left: auto;
    background: var(--bg3);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--dim);
    font: inherit;
    font-size: 12px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    flex: none;
}

    .x:hover {
        color: var(--tx);
        border-color: var(--dim2);
    }

.modal-body {
    padding: 14px 16px 18px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #2c3646 transparent;
    min-height: 0;
}

    .modal-body::-webkit-scrollbar {
        width: 10px;
    }

    .modal-body::-webkit-scrollbar-thumb {
        background: #2c3646;
        border-radius: 5px;
    }

/* ---- player modal ---- */
.pm-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.pm-stat {
    background: var(--bg3);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 7px;
    text-align: center;
}

    .pm-stat b {
        display: block;
        font-size: 18px;
        font-weight: 700;
        color: var(--acc);
        line-height: 1.1;
    }

    .pm-stat span {
        display: block;
        font-size: 9.5px;
        text-transform: uppercase;
        letter-spacing: .5px;
        color: var(--dim);
    }

    .pm-stat i {
        display: block;
        font-style: normal;
        font-size: 9.5px;
        color: var(--dim2);
        margin-top: 2px;
    }

.pm-h {
    margin: 14px 0 6px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: var(--dim);
}

.pm-seats {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pm-seat {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 4px 2px;
    border-bottom: 1px solid #171e29;
}

    .pm-seat.none {
        opacity: .45;
    }

.pm-seat-name {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 11.5px;
    min-width: 0;
}

    .pm-seat-name b {
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pm-seat-name i {
        font-style: normal;
        font-size: 9.5px;
        color: var(--dim2);
        flex: none;
    }

.pm-seat-vars {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.pm-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg3);
    border: 1px solid var(--line);
    border-left: 3px solid transparent;
    border-radius: 5px;
    color: inherit;
    font: inherit;
    font-size: 11px;
    padding: 3px 7px;
    cursor: pointer;
}

    .pm-chip:hover {
        border-color: #33405a;
    }

    .pm-chip.rec {
        border-left-color: var(--acc);
    }

    .pm-chip.on {
        background: var(--acc-dim);
        border-color: var(--acc);
    }

    .pm-chip.off {
        opacity: .38;
        cursor: default;
        text-decoration: line-through;
    }

.pm-no {
    font-size: 10.5px;
    color: var(--dim2);
    font-style: italic;
}

/* ---- glossary ---- */
.gloss section {
    padding: 0 0 14px;
}

    .gloss section h3 {
        margin: 0 0 8px;
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: .9px;
        color: var(--acc);
        border-bottom: 1px solid var(--line);
        padding-bottom: 5px;
    }

.gloss dl {
    margin: 0;
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 6px 14px;
    font-size: 11.5px;
}

.gloss dt {
    font-weight: 650;
    color: var(--tx);
    text-align: right;
}

.gloss dd {
    margin: 0;
    color: var(--dim);
    line-height: 1.55;
}

    .gloss dd em {
        color: var(--tx);
        font-style: italic;
    }

/* ============================================================ narrow */

/* drawer scrim and bottom bar exist only below the breakpoints */
.scrim {
    display: none;
}

.mobile-bar {
    display: none;
}

@media (max-width: 1460px) {
    .body {
        grid-template-columns: 268px minmax(0, 1fr) 330px;
    }

    /* drop College first — it is the widest column carrying the least signal */
    .grid-head, .row {
        grid-template-columns:
            42px minmax(110px, 1.7fr) 48px 38px 36px 36px 40px 36px 28px
            0 84px 36px 30px 40px 42px 34px;
        gap: 6px;
    }

    .c-col {
        display: none;
    }

    /* four position columns get cramped before the single-position tabs do */
    .crow {
        grid-template-columns: 18px minmax(0, 1fr) 24px 20px;
    }

    .c-tm {
        display: none;
    }

    .stable-head, .srow {
        grid-template-columns: 52px 148px minmax(0, 1fr);
        gap: 10px;
    }
}

/* ---- the analysis panel becomes a slide-in drawer; a bottom bar opens it ---- */
@media (max-width: 1100px) {
    .body {
        grid-template-columns: 240px minmax(0, 1fr);
        position: relative;
        overflow: hidden;
    }

    .panel {
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        z-index: 40;
        width: min(88vw, 360px);
        transform: translateX(105%);
        visibility: hidden;
        transition: transform .22s ease, visibility 0s .22s;
        box-shadow: -14px 0 34px #000a;
    }

        .panel.open {
            transform: none;
            visibility: visible;
            transition: transform .22s ease;
        }

    .scrim {
        display: block;
        position: absolute;
        inset: 0;
        z-index: 30;
        background: #04070b99;
    }

    .mobile-bar {
        display: flex;
        flex: none;
        border-top: 1px solid var(--line);
        background: var(--bg2);
        padding-bottom: env(safe-area-inset-bottom);
    }

        .mobile-bar button {
            flex: 1;
            min-width: 0;
            background: none;
            border: 0;
            color: var(--dim);
            font: inherit;
            font-size: 12px;
            font-weight: 600;
            padding: 12px 8px;
            cursor: pointer;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

            .mobile-bar button.on {
                color: var(--acc);
                background: var(--bg3);
            }

        /* the rail is still inline at this width, so its toggle stays hidden */
        .mobile-bar .mb-seats {
            display: none;
            border-right: 1px solid var(--line);
        }

    /* thin the grid: drop the measurables, college, and draft-capital columns */
    .grid-head, .row {
        grid-template-columns:
            40px minmax(100px, 1.7fr) 48px 38px 36px 36px 30px 40px 42px 34px;
        gap: 6px;
    }

        .grid-head span:nth-child(n+7):nth-child(-n+12),
        .row span:nth-child(n+7):nth-child(-n+12) {
            display: none;
        }
}

/* ---- the rail becomes a drawer too; the header stacks ---- */
@media (max-width: 900px) {
    .body {
        grid-template-columns: minmax(0, 1fr);
    }

    .rail {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 40;
        width: min(85vw, 320px);
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform .22s ease, visibility 0s .22s;
        box-shadow: 14px 0 34px #000a;
    }

        .rail.open {
            transform: none;
            visibility: visible;
            transition: transform .22s ease;
        }

    .mobile-bar .mb-seats {
        display: block;
    }

    .hdr {
        flex-wrap: wrap;
        gap: 8px 14px;
        padding: 10px 12px;
    }

    .brand p {
        display: none;
    }

    /* the selected-seat card drops to its own full-width row */
    .hdr-sel {
        order: 3;
        flex-basis: 100%;
        padding-top: 0;
    }

    .selcard {
        max-width: none;
    }

    .selcard.empty {
        min-height: 34px;
    }

    .controls {
        /* base .controls is flex:none, which keeps the single-line width and
           overflows a phone — give it its own row so the items can wrap */
        flex: 0 0 100%;
        order: 2;
        flex-wrap: wrap;
        gap: 8px 14px;
    }

    .tabs {
        overflow-x: auto;
        scrollbar-width: none;
    }

        .tabs::-webkit-scrollbar {
            display: none;
        }

        .tabs button {
            flex: none;
            white-space: nowrap;
        }

    .legend {
        display: none;
    }
}

/* ---- phones ---- */
@media (max-width: 700px) {
    /* the board keeps only what a phone can use: slot, player, pos, proj, elig */
    .grid-head, .row {
        grid-template-columns: 36px minmax(0, 1fr) 46px 40px 34px;
        gap: 5px;
        padding: 0 10px;
    }

    .grid-head {
        padding-right: 10px;
    }

        .grid-head span:nth-child(n+4):nth-child(-n+13),
        .row span:nth-child(n+4):nth-child(-n+13),
        .grid-head span:nth-child(15),
        .row span:nth-child(15) {
            display: none;
        }

    /* comfortable tap targets — rows open the player modal */
    .row {
        height: 34px;
    }

    .rows {
        overflow-y: auto;
    }

    /* four position columns become a 2×2 grid */
    .grid4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: minmax(0, 1fr);
    }

    .crow {
        height: 30px;
    }

    /* seat summary rows stack: score + name, variants below */
    .stable-head {
        display: none;
    }

    .srow {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 4px 10px;
    }

    .srow-vars {
        grid-column: 1 / -1;
    }

    .vchip {
        max-width: none;
    }

    /* modals become bottom sheets */
    .modal-back {
        padding: 0;
        align-items: flex-end;
    }

    .modal, .modal.wide {
        max-width: none;
        max-height: 94%;
        border-radius: 12px 12px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }

    .pm-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .pm-seat {
        grid-template-columns: 1fr;
        gap: 2px;
        padding: 6px 2px;
    }

    .gloss dl {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .gloss dt {
        text-align: left;
        margin-top: 6px;
    }

        .gloss dt:first-of-type {
            margin-top: 0;
        }
}
