:root {
    --bg: #07162d;
    --surface: #091d36;
    --surface-2: #0b203b;
    --border: #12578a;
    --border-soft: #1b4168;
    --text: #eaf2ff;
    --text-muted: #91abc9;
    --accent: #168cff;
    --accent-cyan: #35c5f4;
    --brand: #e85b70;
    --sidebar-w: 270px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: Arial, sans-serif;
    background-color: var(--bg);
    color: white;
    display: flex;
}
.sidebar {
    width: 270px;
    min-width: 270px;
    height: 100vh;
    background-color: hsl(225, 82%, 15%);
    color: white;
    padding: 30px 22px;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    z-index: 100;
}
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    padding: 24px 30px;
}
.logo h2 {
    font-size: 30px;
    letter-spacing: 1px;
}
.logo h2 span {
    color: #e85b70;
}
.logo p {
    font-size: 10px;
    letter-spacing: 3px;
    color: #9da8ba;
    margin-top: 5px;
}
.sidebar nav {
    margin-top: 55px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sidebar nav a {
    text-decoration: none;
    color: #b9c1cf;
    padding: 14px;
    border-radius: 7px;
    font-size: 14px;
    transition: 0.2s;
}
.sidebar nav a:hover,
.sidebar nav a.active {
    background-color: #293349;
    color: white;
}
.sidebar nav a.active {
    border-left: 3px solid #e85b70;
}
.sidebar nav a:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}
.sidebar-footer {
    margin-top: auto;
    color: #9da8ba;
    font-size: 11px;
    line-height: 2;
}

/* ===== HOME / DASHBOARD PAGE ===== */
.home-page {
    background-color: #07162d;
    color: #eaf2ff;
}
.home-page .home-main { padding: 24px 30px; min-width: 0; }
.home-page section { margin-bottom: 0; }

/* header + filters */
.home-page .hm-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}
.home-page .hm-top h1 { font-size: 26px; margin-bottom: 12px; color: #f1f6ff; }
.home-page .hm-top p { font-size: 12px; color: #91abc9; }
.home-page .hm-top > div:first-child { flex: 1 1 auto; min-width: 240px; }
.home-page .hm-filters { display: flex; gap: 14px; align-items: flex-end; flex-wrap: nowrap; justify-content: flex-end; }
.home-page .hm-filter { display: flex; flex-direction: column; gap: 8px; }
.home-page .hm-filter span { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; }
.home-page .hm-filter select,
.home-page .hm-search input {
    height: 38px;
    background-color: #0b203b;
    border: 1px solid #1b4168;
    border-radius: 6px;
    color: #eaf2ff;
    font-size: 12px;
    outline: none;
}
.home-page .hm-filter select { width: 140px; padding: 0 10px; }
.home-page .hm-filter option { background: #0b203b; }
.home-page .hm-search input {
    width: 220px;
    padding: 0 12px 0 38px;
    background: #0b203b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2391abc9' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center;
}
.home-page .hm-search input::placeholder { color: #91abc9; }
.home-page .hm-filter select:focus,
.home-page .hm-search input:focus { border-color: #168ceb; }

/* stat cards */
.home-page .hm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.home-page .hm-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    min-width: 0;
    background: #091d36;
    border: 1px solid #12578a;
    border-radius: 18px;
}
.home-page .hm-ico {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 26px;
    border-radius: 8px;
}
.home-page .ico-blue { background: linear-gradient(135deg, #2f7bff, #168cff); }
.home-page .ico-teal { background: linear-gradient(135deg, #00cba4, #00b08a); }
.home-page .ico-purple { background: linear-gradient(135deg, #943cff, #7a4dff); }
.home-page .ico-orange { background: linear-gradient(135deg, #ff981f, #f59e0b); }
.home-page .hm-stat .lab { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; color: #dcecff; }
.home-page .hm-stat strong { display: block; font-size: 30px; line-height: 1.1; }
.home-page .hm-stat em { display: block; font-style: normal; font-size: 10px; margin-top: 8px; color: #19d27f; }
.home-page .hm-stat em.muted { color: #91abc9; }

/* cards + rows */
.home-page .hm-card {
    background: #091d36;
    border: 1px solid #12578a;
    border-radius: 18px;
    padding: 18px;
    min-width: 0;
}
.home-page .hm-card h2 { font-size: 16px; margin-bottom: 6px; color: #eaf2ff; }
.home-page .hm-sub { font-size: 11px; color: #91abc9; margin-bottom: 8px; }
.home-page .hm-row { display: grid; gap: 16px; margin-bottom: 16px; }
.home-page .r-a,
.home-page .r-b { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-page .hm-chart { position: relative; height: 210px; }
.home-page .hm-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.home-page .hm-head h2 { margin-bottom: 0; }
.home-page .hm-pill {
    padding: 6px 10px;
    background: #0b203b;
    border: 1px solid #1b4168;
    border-radius: 5px;
    color: #eaf2ff;
    font-size: 10px;
    text-decoration: none;
}
.home-page .hm-pill:hover { border-color: #168ceb; }
.home-page .hm-link { color: #35c5f4; font-size: 11px; text-decoration: underline; }
.home-page .hm-empty { color: #91abc9; font-size: 11px; padding: 12px; text-align: center; }

/* mini comparison cards */
.home-page .hm-cmp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-page .hm-mini {
    min-width: 0;
    padding: 12px;
    background: #0b203b;
    border: 1px solid #1b4168;
    border-left: 4px solid #168cff;
    border-radius: 10px;
}
.home-page a.hm-mini {
    display: block;
    color: inherit;
    text-decoration: none;
}
.home-page a.hm-mini:hover { background: #12385c; }
.home-page .hm-mhead { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; min-height: 52px; }
.home-page .hm-av {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #15558a;
    border: 2px solid #35c5f4;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}
.home-page .hm-mhead b {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 11px;
    margin-bottom: 4px;
    color: #eaf2ff;
}
.home-page .hm-mhead small { font-size: 9px; color: #91abc9; }
.home-page .hm-line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 10px; color: #91abc9; }
.home-page .hm-line b { color: #eaf2ff; }

/* recent table */
.home-page .hm-tablewrap { overflow-x: auto; }
.home-page .hm-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.home-page .hm-table th,
.home-page .hm-table td { padding: 11px 8px; text-align: center; border: 0; }
.home-page .hm-table th { color: #dcecff; background: #0b2a4d; }
.home-page .hm-table td { color: #d9e8f7; border-bottom: 1px solid #173858; }
.home-page .hm-table th:nth-child(2),
.home-page .hm-table td.nm { text-align: left; font-weight: 700; color: #eaf2ff; }
.home-page .hm-table td.tm { color: #35c5f4; }
.home-page .hm-table tbody tr:hover { background: #12385c; }

/* insights */
.home-page .hm-insights { padding: 20px; border-color: #1b4168; border-radius: 16px; }
.home-page .hm-insights h2 { font-size: 17px; margin-bottom: 16px; }
.home-page .hm-ins-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.home-page .hm-ins {
    display: flex;
    gap: 12px;
    padding: 14px;
    min-width: 0;
    background: #0b203b;
    border: 1px solid #1b4168;
    border-radius: 8px;
}
.home-page .hm-iic {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 22px;
    background: #123b60;
    border: 1px solid #35c5f4;
    border-radius: 6px;
}
.home-page .hm-ititle { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.home-page .hm-ititle b { font-size: 12px; color: #dcecff; }
.home-page .hm-tag {
    padding: 1px 6px;
    font-size: 7px;
    letter-spacing: 0.3px;
    color: #6fb7ff;
    border: 1px solid #168ceb;
    border-radius: 8px;
}
.home-page .hm-ins p { font-size: 9px; line-height: 1.5; color: #91abc9; margin-bottom: 8px; }
.home-page .hm-ins strong { display: block; font-size: 9px; line-height: 1.5; color: #eaf2ff; }

.home-page footer {
    margin-top: 16px;
    text-align: center;
    border-top: 1px solid #1b4168;
    color: #91abc9;
}

.home-page .hm-pill:focus-visible,
.home-page .hm-link:focus-visible,
.home-page a.hm-mini:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

@media (max-width: 1250px) {
    .home-page .hm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-page .hm-top { flex-direction: column; }
    .home-page .hm-filters { justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 1100px) {
    .home-page .r-a, .home-page .r-b { grid-template-columns: 1fr; }
    .home-page .hm-ins-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-page .hm-cmp { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    body { flex-direction: column; }
    .sidebar {
        position: static;
        width: 100%;
        min-width: 0;
        height: auto;
        padding: 18px;
    }
    .sidebar nav { margin-top: 20px; flex-direction: row; flex-wrap: wrap; gap: 8px; }
    .sidebar-footer { display: none; }
    .main-content { margin-left: 0; }
}
@media (max-width: 650px) {
    .home-page .home-main { padding: 20px 14px; }
    .home-page .hm-stats, .home-page .hm-ins-grid { grid-template-columns: 1fr; }
    .home-page .hm-search input, .home-page .hm-filter select { width: 100%; }
    .home-page .hm-filter, .home-page .hm-search { flex: 1 1 140px; }
}




/* ===== PLAYER STATS PAGE ===== */
.player-stats-page {
    background-color:#07162d;
    color:#eaf2ff;
}
.player-stats-content {
    margin-left: 270px;
    width: calc(100% - 270px);
    padding: 28px 30px;
    min-width: 0;
}
.stats-header {
    margin-bottom: 22px;
}
.stats-header h1 {
    font-size: 25px;
    margin-bottom: 7px;
    color:#f1f6ff;
}
.stats-header p {
    color:#91abc9;
    font-size: 13px;
}
.player-filters {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 22px;
}
.player-filters input,
.player-filters select {
    width: 100%;
    min-width: 0;
    padding: 12px;
    background:#0b203b;
    color:#eaf2ff;
    border: 1px solid#1b4168;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
}
.player-filters input::placeholder {
    color:#91abc9;
}
.player-filters input:focus,
.player-filters select:focus {
    border-color:#168ceB;
}
.player-stats-layout {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 16px;
    align-items: stretch;
}
.player-table-card,
.player-profile-card,
.shooting-card,
.vorp-card {
    background:#091d36;
    border: 1px solid#12578a;
    border-radius: 18px;
    padding: 18px;
    min-width: 0;
}
.player-table-card h3,
.player-profile-card h3,
.shooting-card h3,
.vorp-card h3 {
    font-size: 15px;
    margin-bottom: 16px;
    color:#eaf2ff;
}
.player-table-card {
    grid-column: 1;
    grid-row: 1 / 4;
    overflow: hidden;
}
.table-scroll {
    overflow-x: auto;
    width: 100%;
}
.player-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    white-space: nowrap;
}
.player-stats-table th {
    color:#8fb2d3;
    padding: 13px 10px;
    border-bottom: 1px solid#17618e;
    text-align: left;
}
.player-stats-table td {
    padding: 12px 10px;
    border-bottom: 1px solid#173858;
    color:#d9e8f7;
}
.player-stats-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}
.player-stats-table tbody tr:hover {
    background:#12385c;
}
.player-stats-table tbody tr.selected-player {
    background:#164574;
    outline: 1px solid#35c5f4;
}
.player-stats-table td:nth-child(3) {
    color:#35c5f4;
}
.table-result {
    margin-top: 15px;
    color:#8fb2d3;
    font-size: 11px;
}
.player-profile-card {
    grid-column: 2;
    grid-row: 1;
}
.profile-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 18px;
}
.profile-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background:#15558a;
    border: 2px solid#35c5f4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: bold;
}
.profile-info h3 {
    margin-bottom: 5px;
    font-size: 15px;
}
.profile-info p {
    font-size: 11px;
    color:#91abc9;
}
.profile-tabs {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    margin-bottom: 15px;

    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.profile-tab {
    flex: 0 0 auto;
    white-space: nowrap;

    border: none;
    background: #123b60;
    color: #dcecff;
    padding: 7px 10px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
}

.profile-tab.active,
.profile-tab:hover {
    background: #168ceb;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
}
.profile-stats div {
    background:#0b203b;
    border: 1px solid#1a4165;
    padding: 12px;
    border-radius: 7px;
}
.profile-stats span {
    display: block;
    font-size: 10px;
    color:#91abc9;
    margin-bottom: 7px;
}
.profile-stats strong {
    font-size: 14px;
    color:#35c5f4;
}
.shooting-card {
    grid-column: 2;
    grid-row: 2;
}
.efficiency-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    text-align: center;
}
.efficiency-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.donut {
    --percentage: 50%;
    width: clamp(45px, 5vw, 75px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(
        #168cff var(--percentage),
        #123b5c 0
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.donut::before {
    content: "";
    position: absolute;
    width: 65%;
    height: 65%;
    border-radius: 50%;
    background:#091d36;
}
.donut span {
    position: relative;
    z-index: 1;
    font-size: clamp(8px, 0.8vw, 10px);
    color: white;
}
.donut.cyan {
    background: conic-gradient(#00d8ed var(--percentage),#123b5c 0);
}
.donut.purple {
    background: conic-gradient(#943cff var(--percentage),#123b5c 0);
}
.donut.green {
    background: conic-gradient(#00cba4 var(--percentage),#123b5c 0);
}
.donut.orange {
    background: conic-gradient(#ff981f var(--percentage),#123b5c 0);
}
.efficiency-item strong {
    font-size: 11px;
}
.vorp-card {
    grid-column: 2;
    grid-row: 3;
}
.vorp-row {
    display: grid;
    grid-template-columns: 20px minmax(90px, 1fr) 1.2fr 30px;
    align-items: center;
    gap: 9px;
    margin-bottom: 13px;
    font-size: 10px;
    color:#d9e8f7;
}
.vorp-bar {
    height: 11px;
    background:#123b5c;
    border-radius: 3px;
    overflow: hidden;
}
.vorp-bar div {
    height: 100%;
    background:#168cff;
    border-radius: 3px;
}
.vorp-row strong {
    color:#8fb2d3;
}
.insights-section {
    margin-top: 20px;
    padding: 20px;
    background:#091d36;
    border: 1px solid#1b4168;
    border-radius: 16px;
}
.insights-section h2 {
    font-size: 17px;
    margin-bottom: 18px;
}
.insights-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.insight-card {
    background:#0b203b;
    border: 1px solid#1b4168;
    padding: 15px;
    border-radius: 8px;
}
.insight-card h4 {
    font-size: 12px;
    margin-bottom: 12px;
    color:#dcecff;
}
.insight-card p {
    font-size: 10px;
    line-height: 1.6;
    color:#91abc9;
    margin-bottom: 10px;
}
.insight-card strong {
    display: block;
    color:#35c5f4;
    font-size: 10px;
    margin-bottom: 5px;
}
.player-stats-content footer {
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid#1b4168;
    color:#91abc9;
}
@media (max-width: 1100px) {
    .player-stats-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .player-table-card,
    .player-profile-card,
    .shooting-card,
    .vorp-card {
        grid-column: 1;
        grid-row: auto;
    }
    .insights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 750px) {
    .player-filters {
        grid-template-columns: 1fr 1fr;
    }
    .efficiency-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    .insights-grid {
        grid-template-columns: 1fr;
    }
    .player-stats-content {
        padding: 20px 15px;
    }
}
@media (max-width: 450px) {
    .player-filters {
        grid-template-columns: 1fr;
    }
    .profile-stats {
        grid-template-columns: 1fr 1fr;
    }
}
.player-stats-page .player-stats-content {
    padding: 24px 22px;
}
.player-stats-page .stats-header {
    margin-bottom: 18px;
}
.player-stats-page .stats-header h1 {
    font-size: 26px;
    font-weight: 700;
}
.player-stats-page .player-filters {
    gap: 16px;
    margin-bottom: 20px;
}
.player-stats-page .player-filters input,
.player-stats-page .player-filters select {
    height: 38px;
    padding: 9px 12px;
    border-radius: 6px;
}
.player-stats-page .player-stats-layout {
    grid-template-columns: 1.35fr 1fr;
    gap: 12px;
    align-items: stretch;
}
.player-stats-page .player-table-card {
    min-height: 555px;
    padding: 17px 14px;
    border-radius: 20px;
}
.player-stats-page .player-table-card h3 {
    margin-bottom: 12px;
}
.player-stats-page .player-stats-table {
    font-size: 11px;
}
.player-stats-page .player-stats-table th {
    padding: 13px 9px;
}
.player-stats-page .player-stats-table td {
    padding: 13px 9px;
}
.player-stats-page .player-stats-table tbody tr:nth-child(even) {
    background-color:#0b2945;
}
.player-stats-page .player-stats-table tbody tr:nth-child(odd) {
    background-color:#082039;
}
.player-stats-page .player-stats-table tbody tr.selected-player {
    background-color:#174b78;
    outline: 2px solid#48c9ff;
    outline-offset: -2px;
}
.player-stats-page .player-profile-card {
    padding: 17px;
    border-radius: 20px;
}
.player-stats-page .profile-avatar {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
}
.player-stats-page .profile-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}
.player-stats-page .profile-stats div {
    padding: 11px 9px;
    min-width: 0;
}
.player-stats-page .profile-stats span {
    font-size: 10px;
}
.player-stats-page .profile-stats strong {
    font-size: 13px;
}
.player-stats-page .shooting-card {
    padding: 19px;
    border-radius: 20px;
}
.player-stats-page .donut {
    width: clamp(55px, 5vw, 80px);
}
.player-stats-page .donut::before {
    width: 62%;
    height: 62%;
}
.player-stats-page .efficiency-grid {
    gap: 12px;
}
.player-stats-page .vorp-card {
    padding: 19px;
    border-radius: 20px;
}
.player-stats-page .vorp-row {
    grid-template-columns: 22px minmax(100px, 1fr) 1.5fr 30px;
    gap: 10px;
    margin-bottom: 15px;
}
.player-stats-page .vorp-bar {
    height: 12px;
}
.player-stats-page .insights-section {
    margin-top: 18px;
    padding: 19px;
    border-radius: 16px;
}
.player-stats-page .insights-grid {
    gap: 12px;
}
.player-stats-page .insight-card {
    padding: 16px;
    min-height: 110px;
}
@media (max-width: 1100px) {
    .player-stats-page .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .player-stats-page .player-table-card {
        min-height: auto;
    }
}
@media (max-width: 650px) {
    .player-stats-page .player-stats-content {
        padding: 20px 14px;
    }
    .player-stats-page .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
.player-stats-page .sidebar {
    box-sizing: border-box;
    width: 270px;
    min-width: 270px;
    padding: 22px 24px;
}
.player-stats-page .main-content {
    margin-left: 270px;
    width: calc(100% - 270px);
}
.player-stats-page .sidebar .logo h2 {
    font-size: 28px;
    letter-spacing: 1px;
}
.player-stats-page .sidebar .logo h2 span {
    color:#ff586d;
}
.player-stats-page .sidebar .logo p {
    font-size: 10px;
    letter-spacing: 3px;
}
.player-stats-page .sidebar nav {
    margin-top: 42px;
    gap: 10px;
}
.player-stats-page .sidebar nav a {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 17px;
    font-size: 14px;
    border-radius: 7px;
}
.player-stats-page .sidebar nav a.active {
    background-color:#214e91;
    border-left: 3px solid#ff586d;
}
.player-stats-page .sidebar-footer {
    font-size: 11px;
    line-height: 2;
}
.player-stats-page .stats-header h1 {
    display: none;
}
.player-stats-page .stats-header {
    margin-bottom: 18px;
}
@media (max-width: 650px) {
    .player-stats-page .sidebar {
        width: 100%;
        min-width: 0;
    }
    .player-stats-page .main-content {
        margin-left: 0;
        width: 100%;
    }
}
.player-stats-page .data-note {
    color:#91abc9;
    font-size: 10px;
    line-height: 1.5;
    margin: -7px 0 12px;
}
.player-stats-page .insight-card {
    min-width: 0;
}
.player-stats-page .player-stats-table tbody tr[style*="display: none"] {
    display: none !important;
}
@media (min-width: 651px) {
    .player-stats-page .sidebar {
        width: 270px;
        min-width: 270px;
    }
    .player-stats-page .main-content {
        margin-left: 270px;
        width: calc(100% - 270px);
    }
}
@media (min-width: 651px) {
    .sidebar {
        width: 270px;
        min-width: 270px;
        box-sizing: border-box;
    }
    .main-content {
        margin-left: 270px;
        width: calc(100% - 270px);
    }
}
@media (min-width: 651px) {
    .sidebar {
        width: 270px;
        min-width: 270px;
        padding: 22px 24px;
        box-sizing: border-box;
    }
    .sidebar .logo h2 {
        font-size: 28px;
        letter-spacing: 1px;
    }
    .sidebar .logo h2 span {
        color: #ff586d;
    }
    .sidebar .logo p {
        font-size: 10px;
        letter-spacing: 3px;
    }
    .sidebar nav {
        margin-top: 42px;
        gap: 10px;
    }
    .sidebar nav a {
        width: 100%;
        box-sizing: border-box;
        padding: 14px 17px;
        font-size: 14px;
        border-radius: 7px;
    }
    .sidebar nav a.active {
        background-color: #214e91;
        border-left: 3px solid #ff586d;
    }
    .sidebar-footer {
        font-size: 11px;
        line-height: 2;
    }
    .main-content,
    .teams-main {
        margin-left: 270px;
        width: calc(100% - 270px);
        box-sizing: border-box;
    }
}
.insight-card p {
    margin: 0 0 10px;
    line-height: 1.5;
}
.insight-card h4 {
    margin: 0 0 16px;
}
.insight-card .recommendation-label {
    display: block;
    margin: 0 0 6px;
    line-height: 1.4;
}
.insight-card .recommendation-text {
    margin: 0;
    line-height: 1.5;
}

/* ===== TEAMS PAGE ===== */

.teams-page {
    --team-bg: #07172d;
    --team-panel: #0b203a;
    --team-border: #1b4165;
    --team-blue: #168fe8;
    --team-cyan: #35c7ef;
    --team-muted: #91abc7;
    background: var(--team-bg);
    color: #e7f0ff;
}
.teams-page .teams-main {
    margin-left: 270px;
    padding: 28px 30px 22px;
    min-width: 0;
}
.teams-page .teams-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 220px 250px minmax(260px, 1.1fr);
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
    min-width: 0;
}
.teams-page .teams-toolbar p {
    margin: 0;
    color: var(--team-muted);
    font-size: 14px;
    line-height: 1.45;
    white-space: normal;
}
.teams-page .teams-toolbar select,
.teams-page .teams-toolbar input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 44px;
    box-sizing: border-box;
    background: #0b203a;
    color: #e7f0ff;
    border: 1px solid var(--team-border);
    border-radius: 9px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: normal;
}
.teams-page .teams-toolbar select {
    cursor: pointer;
    padding-right: 30px;
    white-space: nowrap;
}
.teams-page .teams-toolbar input {
    padding-right: 12px;
}
.teams-page .teams-toolbar input::placeholder {
    color: var(--team-muted);
    font-size: 13px;
    opacity: 1;
}
.teams-page .teams-toolbar select:focus,
.teams-page .teams-toolbar input:focus {
    outline: 2px solid var(--team-blue);
    outline-offset: 2px;
}
.teams-page .team-hero-row {
    display: grid;
    grid-template-columns: 1.3fr 0.8fr;
    gap: 12px;
}
.teams-page .team-panel {
    background: var(--team-panel);
    border: 1px solid var(--team-border);
    border-radius: 22px;
    padding: 20px;
    min-width: 0;
}
.teams-page .team-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 86px;
}
.teams-page .team-mark {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 2px solid #dceaff;
    display: grid;
    place-items: center;
    font-size: 25px;
    font-weight: 800;
    background: #102e4d;
    flex: none;
}
.teams-page .team-hero h2 {
    margin: 0 0 5px;
    font-size: 20px;
}
.teams-page .team-hero p {
    margin: 0;
    color: #c4d5e9;
}
.teams-page .hero-metrics {
    margin-left: auto;
    display: flex;
    gap: 8px;
}
.teams-page .mini-metric {
    border: 1px solid var(--team-border);
    border-radius: 7px;
    padding: 10px 13px;
    min-width: 76px;
    text-align: center;
    font-size: 12px;
    color: #dce9fa;
}
.teams-page .mini-metric strong {
    display: block;
    color: var(--team-cyan);
    font-size: 14px;
    margin-top: 3px;
}
.teams-page .summary h3,
.teams-page .team-panel h3 {
    margin: 0 0 12px;
    font-size: 17px;
}
.teams-page .summary-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 8px;
}
.teams-page .summary-grid div {
    background: #0a1c34;
    border: 1px solid var(--team-border);
    border-radius: 6px;
    padding: 11px;
    font-size: 12px;
}
.teams-page .summary-grid strong {
    display: block;
    color: var(--team-cyan);
    font-size: 14px;
    margin-top: 4px;
}
.teams-page .team-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}
.teams-page .team-tab {
    background: #0b203a;
    border: 1px solid var(--team-border);
    color: #dce9fa;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
}
.teams-page .team-tab.active {
    background: #123d63;
    border-color: #168fe8;
    box-shadow: inset 0 -2px #35c7ef;
}
.teams-page .team-content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
.teams-page .left-stack,
.teams-page .middle-stack,
.teams-page .right-stack {
    display: contents;
}
.teams-page .team-content-grid > section,
.teams-page .team-content-grid > .left-stack > section,
.teams-page .team-content-grid > .middle-stack > section,
.teams-page .team-content-grid > .right-stack > section {
    min-width: 0;
}
.teams-page .roster-table-wrap {
    overflow: auto;
}
.teams-page table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.teams-page th,
.teams-page td {
    padding: 8px 9px;
    text-align: left;
    white-space: nowrap;
}
.teams-page th {
    color: var(--team-muted);
    border-bottom: 1px solid var(--team-border);
}
.teams-page tbody tr:nth-child(odd) {
    background: #0a2a49;
}
.teams-page .coach-note {
    color: var(--team-muted);
    font-size: 11px;
    margin: 9px 0 0;
}
.teams-page .scorer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
}
.teams-page .scorer-avatar {
    width: 52px;
    height: 52px;
    border: 2px solid #168fe8;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #173b5e;
    font-weight: 700;
}
.teams-page .scorer strong {
    display: block;
}
.teams-page .scorer span {
    color: var(--team-cyan);
    font-size: 13px;
}
.teams-page .heatmap {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2px;
    font-size: 11px;
    text-align: center;
}
.teams-page .heatmap div {
    padding: 10px 4px;
    background: #126c7c;
    min-width: 0;
}
.teams-page .heatmap .heat-head {
    background: transparent;
    color: var(--team-muted);
    font-weight: 700;
}
.teams-page .heatmap .heat-label {
    background: #0a1c34;
    color: #dce9fa;
    font-weight: 700;
}
.teams-page .chart-box {
    min-height: 300px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}
.teams-page .chart-box > div[id] {
    width: 100%;
    flex: 1;
    min-height: 0;
}
.teams-page .chart-box svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 230px;
    overflow: visible;
}
.teams-page .chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
    color: var(--team-muted);
    font-size: 11px;
    margin: 2px 0 12px;
}
.teams-page .chart-legend span {
    white-space: nowrap;
}
.teams-page .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}
.teams-page .insights {
    margin-top: 18px;
}
.teams-page .insight-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.teams-page .insight {
    border: 1px solid var(--team-border);
    background: #0a1c34;
    border-radius: 10px;
    padding: 13px;
    font-size: 12px;
    color: var(--team-muted);
}
.teams-page .insight strong {
    display: block;
    color: #e7f0ff;
    margin-bottom: 7px;
    font-size: 13px;
}
.teams-page .insight b {
    display: block;
    color: var(--team-cyan);
    margin-top: 8px;
}
.teams-page .tab-panel[hidden] {
    display: none !important;
}
.teams-page .team-footer {
    color: #718ba8;
    text-align: center;
    font-size: 10px;
    padding: 14px 0 0;
}
@media (max-width: 1250px) {
    .teams-page .teams-main {
    padding: 22px 18px;
    }
    .teams-page .teams-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .teams-page .teams-toolbar p {
    grid-column: 1 / -1;
    }
    .teams-page .team-hero-row {
    grid-template-columns: 1fr;
    }
    .teams-page .insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .teams-page .team-content-grid {
    grid-template-columns: 1fr;
    }
    .teams-page .team-hero {
    flex-wrap: wrap;
    }
    .teams-page .hero-metrics {
    margin-left: 0;
    width: 100%;
    }
    .teams-page .mini-metric {
    flex: 1;
    }
}
@media (max-width: 650px) {
    .teams-page .teams-main {
    margin-left: 0;
    width: 100%;
    padding: 20px 14px;
    }
    .teams-page .teams-toolbar {
    grid-template-columns: 1fr;
    }
    .teams-page .insight-grid {
    grid-template-columns: 1fr;
    }
    .teams-page .summary-grid {
    grid-template-columns: 1fr;
    }
}
.teams-page .tab-panel:not([hidden]) {
    display: block;
}
.teams-page .team-content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
.teams-page .team-content-grid > * {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    align-self: start;
}
.teams-page .team-panel {
    height: auto;
    min-height: 0;
    box-sizing: border-box;
}
.teams-page .chart-box {
    min-width: 0;
    width: 100%;
    min-height: 0;
    height: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}
.teams-page .chart-box h3 {
    margin-bottom: 16px;
    flex-shrink: 0;
}
.teams-page .chart-box > div[id] {
    width: 100%;
    min-width: 0;
    flex: 1;
    box-sizing: border-box;
}
.teams-page .chart-box svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    overflow: visible;
}
.teams-page .chart-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    width: 100%;
    margin: 4px 0 16px;
    box-sizing: border-box;
}
.teams-page .chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #9bb0c7;
    font-size: 12px;
    white-space: nowrap;
}
.teams-page .chart-legend .dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 50%;
    display: inline-block;
    margin: 0;
}
.teams-page .insights {
    width: 100%;
    margin-top: 20px;
}
.teams-page .insight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.teams-page .insight {
    padding: 16px;
    border: 1px solid var(--team-border);
    border-radius: 8px;
    background: #0a1c34;
    color: var(--team-muted);
    font-size: 10px;
    line-height: 1.6;
    box-sizing: border-box;
}
.teams-page .insight strong {
    display: block;
    margin-bottom: 7px;
    color: #e7f0ff;
    font-size: 12px;
}
.teams-page .insight p {
    margin: 0 0 8px;
    font-size: 10px;
    line-height: 1.6;
}
.teams-page .insight b {
    display: block;
    margin: 8px 0 4px;
    color: var(--team-cyan);
    font-size: 10px;
}
.teams-page .tab-panel[hidden] {
    display: none !important;
}
@media (max-width: 900px) {
    .teams-page .team-content-grid {
    grid-template-columns: minmax(0, 1fr);
    }
}
@media (max-width: 650px) {
    .teams-page .insight-grid {
    grid-template-columns: 1fr;
    }
    .teams-page .chart-box {
    padding: 16px;
    }
    .teams-page .chart-legend {
    justify-content: flex-start;
    gap: 8px 14px;
    }
    .teams-page .chart-legend span {
    font-size: 11px;
    }
}
.teams-page #panel-roster {
    width: 100%;
    max-width: none;
}
.teams-page #panel-roster > .team-content-grid {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
}
.teams-page #panel-roster .team-panel {
    display: block;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}
.teams-page #panel-roster .roster-table-wrap {
    width: 100%;
    overflow-x: auto;
}
.teams-page #panel-roster table {
    width: 100%;
    table-layout: auto;
}

.quarter-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.quarter-compare {
    height: 30px;
    padding: 0 10px;
    background: var(--surface-2, #0b203b);
    border: 1px solid var(--border-soft, #1b4168);
    border-radius: 6px;
    color: var(--text, #eaf2ff);
    font-size: 11px;
    outline: none;
}
.quarter-compare:focus { border-color: var(--accent, #168cff); }
.quarter-compare:disabled { opacity: 0.5; }
.quarter-compare option { background: #0b203b; }
.compare-chip {
    height: 30px;
    padding: 0 10px;
    background: var(--surface-2, #0b203b);
    border: 1px solid var(--border-soft, #1b4168);
    border-radius: 15px;
    color: var(--text, #eaf2ff);
    font-size: 11px;
    cursor: pointer;
}
.compare-chip:hover { border-color: var(--accent, #168cff); }

/* ===== PLAYER COMPARISON PAGE (replaces the previous comparison block) ===== */
.comparison-page {
    background-color: #07162d;
    color: #eaf2ff;
}
.comparison-page .comparison-main {
    padding: 28px 30px;
    min-width: 0;
}
.comparison-page section { margin-bottom: 0; }
.comparison-page .topbar {
    align-items: flex-start;
    margin-bottom: 22px;
}
.comparison-page .topbar .sub {
    color: #91abc9;
    font-size: 13px;
    margin-bottom: 14px;
}
.comparison-page .topbar h3 {
    font-size: 15px;
    color: #eaf2ff;
}
.comparison-page .filters { display: flex; gap: 14px; }
.comparison-page .filter {
    width: 190px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: #0b203b;
    border: 1px solid #1b4168;
    border-radius: 6px;
    color: #91abc9;
    font-size: 12px;
}
.comparison-page .filter:focus-within { border-color: #168ceb; }
.comparison-page .filter select {
    flex: 1;
    min-width: 0;
    background: none;
    border: 0;
    outline: none;
    color: #eaf2ff;
    font-size: 12px;
}
.comparison-page .filter option { background: #0b203b; }

/* player chips */
.comparison-page .chips { display: flex; gap: 16px; margin-bottom: 16px; }
.comparison-page .chip {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    position: relative;
    background: #091d36;
    border: 1px solid #12578a;
    border-radius: 18px;
}
.comparison-page .chip b {
    display: block;
    font-size: 15px;
    margin-bottom: 5px;
    color: #eaf2ff;
}
.comparison-page .chip small { color: #91abc9; font-size: 11px; }
.comparison-page .chip .x {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    color: #91abc9;
    font-size: 13px;
    cursor: pointer;
}
.comparison-page .chip .x:hover { color: #35c5f4; }
.comparison-page .av {
    width: 55px;
    height: 55px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #15558a;
    border: 2px solid #35c5f4;
    font-size: 17px;
    font-weight: bold;
}
.comparison-page .add {
    width: 170px;
    border: none;
    border-radius: 6px;
    background: #168ceb;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.comparison-page .add:hover { background: #35c5f4; }

/* cards + rows */
.comparison-page .card {
    background: #091d36;
    border: 1px solid #12578a;
    border-radius: 18px;
    padding: 18px;
    min-width: 0;
}
.comparison-page .card h2 {
    font-size: 15px;
    line-height: 1.2;
    margin-bottom: 16px;
    color: #eaf2ff;
}
.comparison-page .row { display: grid; gap: 16px; margin-bottom: 16px; }
.comparison-page .r1 { grid-template-columns: 1fr 1.22fr 1.2fr; height: 330px; }
.comparison-page .r2 { grid-template-columns: 1fr 1fr 1fr; height: 310px; }
.comparison-page .cv { position: relative; height: calc(100% - 36px); }

/* player overview */
.comparison-page .ov-head { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; }
.comparison-page .ov-head .av { width: 80px; height: 80px; font-size: 24px; }
.comparison-page .ov-head b { display: block; font-size: 15px; margin-bottom: 5px; color: #eaf2ff; }
.comparison-page .ov-head small { color: #91abc9; font-size: 11px; }
.comparison-page .ov-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 4px;
    border-bottom: 1px solid #173858;
    font-size: 11px;
    color: #91abc9;
}
.comparison-page .ov-row b { width: auto; font-size: 11px; color: #35c5f4; }

/* key stats table */
.comparison-page .ks { display: grid; gap: 7px; margin-top: 6px; }
.comparison-page .ks .lab {
    height: 37px;
    display: grid;
    place-items: center;
    background: #123b60;
    color: #dcecff;
    font-weight: 700;
    font-size: 10px;
    border-radius: 4px;
}
.comparison-page .ks .val {
    height: 37px;
    display: grid;
    place-items: center;
    background: #0b203b;
    border: 1px solid #1a4165;
    color: #d9e8f7;
    font-size: 13px;
    border-radius: 7px;
}
.comparison-page .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* insights */
.comparison-page .insights {
    padding: 20px;
    background: #091d36;
    border: 1px solid #1b4168;
    border-radius: 16px;
}
.comparison-page .insights h2 { font-size: 17px; margin-bottom: 18px; }
.comparison-page .bulb { margin-right: 10px; }
.comparison-page .ins-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.comparison-page .ins {
    display: flex;
    gap: 12px;
    padding: 15px;
    min-width: 0;
    background: #0b203b;
    border: 1px solid #1b4168;
    border-radius: 8px;
}
.comparison-page .ins .ic {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 20px;
    border-radius: 6px;
    background: #123b60;
    border: 1px solid #35c5f4;
}
.comparison-page .ins b { display: block; font-size: 12px; margin-bottom: 8px; color: #dcecff; }
.comparison-page .ins p { font-size: 10px; line-height: 1.6; color: #91abc9; margin: 0; }

@media (max-width: 1100px) {
    .comparison-page .r1, .comparison-page .r2 { grid-template-columns: 1fr; height: auto; }
    .comparison-page .card .cv { height: 280px; }
    .comparison-page .ins-grid { grid-template-columns: repeat(2, 1fr); }
    .comparison-page .chips { flex-wrap: wrap; }
    .comparison-page .chip { flex: 1 1 220px; }
    .comparison-page .add { height: 48px; }
}
@media (max-width: 650px) {
    .comparison-page .comparison-main { padding: 20px 14px; }
    .comparison-page .filters { flex-wrap: wrap; }
    .comparison-page .ins-grid { grid-template-columns: 1fr; }
}

/* ===== PLAYER COMPARISON: SEARCH BAR (append below the comparison block) ===== */
.comparison-page .search-wrap {
    position: relative;
    width: 380px;
    max-width: 100%;
    margin-top: 12px;
}
.comparison-page .search-wrap input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    background: #0b203b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2391abc9' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
    border: 1px solid #1b4168;
    border-radius: 6px;
    color: #eaf2ff;
    font-size: 12px;
    outline: none;
}
.comparison-page .search-wrap input::placeholder { color: #91abc9; }
.comparison-page .search-wrap input:focus { border-color: #168ceb; }
.comparison-page .search-results {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 340px;
    overflow-y: auto;
    list-style: none;
    background: #091d36;
    border: 1px solid #12578a;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.comparison-page .search-results li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #173858;
}
.comparison-page .search-results li:last-child { border-bottom: 0; }
.comparison-page .search-results li:hover,
.comparison-page .search-results li.active { background: #12385c; }
.comparison-page .search-results .av { width: 32px; height: 32px; font-size: 11px; border-width: 1px; }
.comparison-page .search-results b { display: block; font-size: 12px; color: #eaf2ff; }
.comparison-page .search-results small { font-size: 10px; color: #91abc9; }
.comparison-page .search-results .tag { margin-left: auto; font-size: 10px; color: #35c5f4; }
.comparison-page .search-results li.added { opacity: 0.5; cursor: default; }
.comparison-page .search-results li.empty { color: #91abc9; font-size: 11px; cursor: default; }

/* clickable chips + leader highlight */
.comparison-page .chip { cursor: pointer; }
.comparison-page .chip.focus { border-color: #35c5f4; }
.comparison-page .ks .val.top { color: #35c5f4; font-weight: 700; }