/**
 * Roster page — slim identity header, underline tabs, refined tables
 * Layout rebuilt by modern.js (rebuildRosterPage).
 */

.content-card.roster-page {
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--sh-2);
}

/* ========== HEADER ========== */
.roster-header {
    padding: 26px 32px 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,.035), transparent 80%),
        rgba(0,0,0,.22);
    border-bottom: 1px solid var(--line);
    position: relative;
    z-index: 1;
}

.roster-header::before {
    content: "";
    position: absolute;
    left: 0; top: 0; right: 0;
    height: 2px;
    background: var(--team-primary, var(--red));
}

.roster-identity {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.roster-team-name {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .01em;
    color: var(--white);
    margin: 0;
    line-height: 1;
    background: none;
    -webkit-text-fill-color: initial;
}

.roster-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.roster-meta-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 14px;
    background: rgba(0,0,0,.28);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    min-width: 96px;
}

.roster-meta-chip .lab {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.roster-meta-chip .val {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: var(--white);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.roster-meta-chip.neg .val { color: var(--grade-bad); }

/* ========== UNDERLINE TABS ========== */
.roster-nav-tabs {
    display: flex;
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -32px;
    padding: 0 32px;
}
.roster-nav-tabs::-webkit-scrollbar { display: none; }

.roster-tab {
    flex: 0 0 auto;
    padding: 12px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    border-radius: 0;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: color .16s var(--ease), border-color .16s var(--ease);
    white-space: nowrap;
    box-shadow: none;
}

.roster-tab:hover {
    color: var(--white);
    background: transparent;
    border-color: transparent;
}

.roster-tab.active {
    color: var(--white);
    background: transparent;
    border-bottom-color: var(--red-hot);
    box-shadow: none;
}

/* ========== CONTENT ========== */
.roster-content-area {
    padding: 24px 32px 32px;
    position: relative;
    z-index: 1;
}

.roster-tabs-container { position: relative; z-index: 1; }

.roster-tab-content {
    display: none !important;
    animation: rosterFade .22s var(--ease);
}
.roster-tab-content.active { display: block !important; }

@keyframes rosterFade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.roster-empty-state {
    text-align: center;
    color: var(--muted);
    padding: 40px 20px;
    font-size: 14px;
}

/* Yearly stats — compact metric strip */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
}

.stat-item {
    background: rgba(0,0,0,.22);
    border: none;
    border-left: none;
    padding: 16px 18px;
    border-radius: 0;
    transition: background .16s var(--ease);
}
.stat-item:hover { background: rgba(0,0,0,.32); }

.stat-label {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--muted-2);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 4px;
}

.stat-value {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--white);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

/* ========== TABLES ========== */
.roster-table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: rgba(0,0,0,.18);
    max-width: 100%;
}

.content-card.roster-page .roster-modern-table,
.roster-modern-table {
    width: 100%;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    background: transparent !important;
    font-size: 13px;
    table-layout: fixed !important;
    min-width: 640px;
}

.content-card.roster-page .roster-modern-table td,
.content-card.roster-page .roster-modern-table th,
.content-card.roster-page .roster-modern-table td *,
.content-card.roster-page .roster-modern-table th * {
    word-break: keep-all !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
}

.roster-modern-table thead {
    background: rgba(0,0,0,.45) !important;
}
.roster-modern-table thead tr {
    background: rgba(0,0,0,.45) !important;
    border-bottom: 1px solid var(--line-strong) !important;
}

.roster-modern-table th {
    padding: 11px 12px;
    text-align: left;
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-weight: 700;
    color: var(--muted) !important;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .1em;
    white-space: nowrap;
    background: transparent !important;
    border: none !important;
    position: sticky;
    top: 0;
}

.roster-modern-table td {
    padding: 10px 12px;
    color: var(--text);
    border-bottom: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}

.roster-modern-table tbody tr:last-child td { border-bottom: none; }
.roster-modern-table tbody tr:hover td { background: var(--surface-2); }

.roster-modern-table tr.even-row td { background: transparent; }
.roster-modern-table tr.odd-row td { background: rgba(255,255,255,.02); }

.roster-modern-table a {
    color: var(--white);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted transparent;
}
.roster-modern-table a:hover {
    color: var(--red-hot);
    border-bottom-color: var(--red-hot);
}

/* Column widths */
.roster-modern-table th:nth-child(1),
.roster-modern-table td:nth-child(1) {
    width: 48px;
    min-width: 48px;
    text-align: center !important;
    color: var(--muted-2);
    padding-left: 10px !important;
    padding-right: 6px !important;
}

.roster-modern-table th:nth-child(2),
.roster-modern-table td:nth-child(2) {
    width: 180px;
    min-width: 160px;
}

.roster-modern-table th:nth-child(3),
.roster-modern-table td:nth-child(3) {
    width: 48px;
    text-align: center;
}

.roster-table-abilities th:nth-child(n+7),
.roster-table-abilities td:nth-child(n+7) {
    text-align: center;
    width: 48px;
}

.roster-table-abilities th:nth-child(4),
.roster-table-abilities td:nth-child(4),
.roster-table-abilities th:nth-child(5),
.roster-table-abilities td:nth-child(5),
.roster-table-abilities th:nth-child(6),
.roster-table-abilities td:nth-child(6) {
    text-align: center;
}

.roster-table-stats th:nth-child(n+4),
.roster-table-stats td:nth-child(n+4) {
    text-align: right;
}

.roster-table-salaries th:nth-child(n+5),
.roster-table-salaries td:nth-child(n+5) {
    text-align: right;
}

/* Grade cells in abilities */
.roster-table-abilities td:nth-child(n+7) {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 14px;
}

/* Draft picks */
.draft-picks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.draft-pick-card {
    background: rgba(0,0,0,.22);
    border: 1px solid var(--line);
    border-left: 2px solid var(--team-primary, var(--red));
    border-radius: var(--r-md);
    padding: 14px;
    box-shadow: none;
}

.draft-year-section { display: flex; flex-direction: column; gap: 8px; }

.draft-year-header {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .1em;
    text-align: left;
    padding: 0 0 8px;
    background: transparent;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    border-radius: 0;
    text-transform: uppercase;
}

.draft-pick-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
}
.draft-pick-item:last-child { border-bottom: none; padding-bottom: 0; }

.draft-round {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--muted-2);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.draft-team {
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
}

.draft-year { color: var(--team-primary, var(--red-hot)); font-weight: 700; font-size: 14px; }
.draft-info { color: var(--text); font-size: 13px; }

/* Injuries */
.injuries-container { display: grid; gap: 8px; }

.injury-item {
    display: grid;
    grid-template-columns: 180px 1fr 100px;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(239,68,68,.06);
    border: 1px solid rgba(239,68,68,.18);
    border-left: 2px solid var(--bad);
    border-radius: var(--r-sm);
    align-items: center;
}

/* History / schedule pages */
.content-card.roster-page font[size="6"].roster-team-name,
.content-card.roster-page h1.roster-team-name {
    background: none !important;
    -webkit-text-fill-color: initial !important;
    color: var(--white) !important;
}

.content-card.roster-schedule-page table.roster-schedule-table,
.content-card.roster-schedule-page table.modern-table,
.content-card.roster-history-page table.roster-history-table,
.content-card.roster-history-page table.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.content-card.roster-page table td[bgcolor],
.content-card.roster-page table th[bgcolor] {
    background: rgba(0,0,0,.4) !important;
}

.content-card.roster-page table td font,
.content-card.roster-page table th font {
    color: inherit !important;
}

@media (max-width: 768px) {
    .roster-header { padding: 20px 16px 0; }
    .roster-nav-tabs {
        margin: 0 -16px;
        padding: 0 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    .roster-tab { flex-shrink: 0; }
    .roster-content-area { padding: 16px; }
    .roster-team-name { font-size: 26px; }
    .roster-meta-chip { min-width: 80px; padding: 6px 10px; }
    .roster-meta-chip .val { font-size: 15px; }
    .injury-item { grid-template-columns: 1fr; gap: 4px; }
    .roster-identity { flex-direction: column; align-items: flex-start; }
}

/* ========== DEPTH CHART EDITOR ========== */
.dc-root { min-height: 120px; }

.dc-editor { display: flex; flex-direction: column; gap: 22px; }

.dc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.dc-status {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-1);
    color: var(--muted);
}
.dc-status.ok { color: var(--grade-a); border-color: var(--status-ok-border); background: var(--status-ok-bg); }
.dc-status.warn { color: var(--status-warn); border-color: var(--status-warn-border); background: var(--status-warn-bg); }

.dc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.dc-btn {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--surface-1);
    color: var(--text);
    cursor: pointer;
    transition: background .15s var(--ease), border-color .15s var(--ease);
}
.dc-btn:hover { background: var(--surface-3); border-color: var(--line-strong); color: var(--text-strong); }
.dc-btn.primary { background: var(--red); border-color: var(--red-hot); color: var(--on-accent); }
.dc-btn.primary:hover { background: var(--red-hot); }
.dc-btn.ghost { background: transparent; }

.dc-save-msg {
    font-size: 12px;
    color: var(--muted-2);
    min-width: 64px;
}

.dc-section-title {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.dc-section-title span {
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted-2);
    margin-left: 8px;
}

.dc-hint {
    font-size: 12.5px;
    color: var(--muted-2);
    margin: -4px 0 12px;
}

.dc-ir-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dc-ir-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-1);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s var(--ease), border-color .15s var(--ease);
}
.dc-ir-chip span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted-2);
}
.dc-ir-chip:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-3); }
.dc-ir-chip.on {
    background: var(--grade-bad-bg);
    border-color: var(--grade-bad-border);
    color: var(--ir-soft);
}
.dc-ir-chip.on span { color: var(--grade-bad); }
.dc-ir-chip:disabled { opacity: .35; cursor: not-allowed; }

.dc-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
@media (max-width: 1000px) { .dc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) {
    .dc-grid { grid-template-columns: 1fr; }
    .dc-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
    .dc-actions { flex-wrap: wrap; }
}

.dc-pos-col {
    background: rgba(0,0,0,.22);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px;
    min-width: 0;
}

.dc-pos-head {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .14em;
    color: var(--red-hot);
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
}

.dc-depth-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.dc-depth-row:last-child { margin-bottom: 0; }

.dc-depth-lab {
    flex: 0 0 28px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.dc-select,
.dc-gp-field select {
    flex: 1;
    min-width: 0;
    width: 100%;
    background: rgba(0,0,0,.35);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 12.5px;
    padding: 7px 8px;
    outline: none;
}
.dc-select:focus,
.dc-gp-field select:focus {
    border-color: var(--line-strong);
}

.dc-gameplan {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 800px) { .dc-gameplan { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .dc-gameplan { grid-template-columns: 1fr; } }

.dc-gp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dc-gp-field span {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted-2);
}
