/* ─────────────────────────────────────
   Chiefs Roster & Depth Chart — CSS
   Colors: #E31837 (red), #FFB81C (gold),
           #000 (black), #fff (white)
   ───────────────────────────────────── */

.cr-wrap,
.cr-wrap *,
.cr-wrap *::before,
.cr-wrap *::after {
    box-sizing: border-box;
}

.cr-wrap {
    max-width: 1060px;
    width: 100%;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a1a2e;
    line-height: 1.5;
    overflow: hidden;
}

/* WordPress theme resets — prevent theme CSS from breaking tables */
.cr-wrap table {
    border: none;
    border-spacing: 0;
    border-collapse: collapse;
    margin: 0;
    table-layout: auto;
}

.cr-wrap th,
.cr-wrap td {
    border: none;
    background: transparent;
}

.cr-wrap img {
    max-width: none;
    height: auto;
}

/* ── Banner ── */
.cr-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #E31837 0%, #b5102b 100%);
    padding: 1.25rem 1.5rem;
    border-radius: 12px 12px 0 0;
    color: #fff;
}

.cr-team-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.cr-banner-text {
    flex: 1;
    min-width: 0;
}

.cr-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #fff;
    line-height: 1.2;
}

.cr-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.cr-record-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    flex-shrink: 0;
}

.cr-record-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: #FFB81C;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.cr-record-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

/* ── Main Tabs ── */
.cr-main-tabs {
    display: flex;
    background: #1a1a2e;
    border-bottom: 3px solid #E31837;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cr-main-tab {
    background: none;
    border: none;
    padding: 0.75rem 1.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.cr-main-tab:hover {
    color: #FFB81C;
    background: rgba(255, 255, 255, 0.05);
}

.cr-main-tab.cr-main-tab-active {
    color: #FFB81C;
    border-bottom-color: #FFB81C;
}

/* ── Content Area ── */
.cr-content {
    background: #fff;
    border: 1px solid #e2e6ec;
    border-top: none;
    border-radius: 0 0 12px 12px;
    min-height: 300px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.cr-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
    font-size: 0.88rem;
}

/* ── Tab Pane ── */
.cr-pane {
    display: none;
    padding: 1.25rem;
    animation: cr-fadeIn 0.25s ease;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cr-pane.cr-pane-active {
    display: block;
}

@keyframes cr-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Footer ── */
.cr-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 0.5rem;
}

/* ── Error ── */
.cr-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    color: #991b1b;
    font-weight: 500;
    max-width: 1060px;
    margin: 2rem auto;
}

/* ═══════════════════════════════════════
   ROSTER TAB
   ═══════════════════════════════════════ */

/* ── Position Group Header ── */
.cr-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0 0.5rem;
    margin-top: 1rem;
    border-bottom: 2px solid #E31837;
}

.cr-group-header:first-child {
    margin-top: 0;
}

.cr-group-name {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #E31837;
}

.cr-group-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    background: #f0f1f4;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
}

/* ── Column widths (CSS classes, not inline styles) ── */
.cr-th-jersey  { width: 44px; text-align: center; }
.cr-th-pos     { width: 48px; text-align: center; }
.cr-th-age     { width: 44px; text-align: center; }
.cr-th-ht      { width: 52px; }
.cr-th-wt      { width: 52px; }
.cr-th-exp     { width: 44px; text-align: center; }
.cr-th-status  { width: 100px; }
.cr-th-date    { width: 90px; }
.cr-th-depth-pos { width: 70px; }

/* ── Roster Table ── */
.cr-roster-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
}

.cr-roster-table thead {
    background: #f8f9fb;
}

.cr-roster-table thead th {
    padding: 0.5rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    text-align: left;
    border-bottom: 1px solid #e2e6ec;
    white-space: nowrap;
}

.cr-roster-table tbody tr {
    border-bottom: 1px solid #f0f1f4;
    transition: background 0.12s;
}

.cr-roster-table tbody tr:hover {
    background: #fff8e6;
}

.cr-roster-table tbody td {
    padding: 0.5rem 0.6rem;
    vertical-align: middle;
}

/* Player name cell with headshot */
.cr-player-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cr-player-headshot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #eef0f4;
    flex-shrink: 0;
}

.cr-player-name-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

a.cr-player-link {
    color: #E31837;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.84rem;
    transition: color 0.15s;
    line-height: 1.2;
}

a.cr-player-link:hover {
    color: #b5102b;
    text-decoration: underline;
}

/* Photo link wrapper */
a.cr-photo-link {
    flex-shrink: 0;
    display: inline-flex;
    transition: transform 0.15s;
}

a.cr-photo-link:hover {
    transform: scale(1.1);
}

a.cr-photo-link:hover .cr-player-headshot {
    box-shadow: 0 0 0 2px #E31837;
}

.cr-player-jersey {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 500;
}

.cr-td-center {
    text-align: center;
}

.cr-td-pos {
    font-weight: 700;
    color: #555;
    font-size: 0.78rem;
}

.cr-td-muted {
    color: #6b7280;
    font-size: 0.8rem;
}

.cr-td-jersey {
    font-weight: 800;
    color: #1a1a2e;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
}

/* Injury indicator in roster */
.cr-injury-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.cr-injury-badge-q {
    background: #fef9c3;
    color: #a16207;
}

.cr-injury-badge-d {
    background: #ffedd5;
    color: #c2410c;
}

.cr-injury-badge-o {
    background: #fef2f2;
    color: #dc2626;
}

.cr-injury-badge-ir {
    background: #fef2f2;
    color: #991b1b;
}

/* ═══════════════════════════════════════
   DEPTH CHART TAB
   ═══════════════════════════════════════ */
.cr-depth-scheme {
    margin-bottom: 1.5rem;
}

.cr-depth-scheme-name {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1a1a2e;
    padding-bottom: 0.5rem;
    margin-bottom: 0;
}

/* Side sub-tabs within depth chart */
.cr-depth-side-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e6ec;
}

.cr-depth-side-tab {
    background: none;
    border: none;
    padding: 0.5rem 1.1rem;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.cr-depth-side-tab:hover {
    color: #E31837;
}

.cr-depth-side-tab.cr-depth-side-active {
    color: #E31837;
    border-bottom-color: #E31837;
}

.cr-depth-side-pane {
    display: none;
}

.cr-depth-side-pane.cr-depth-side-visible {
    display: block;
}

/* Depth chart table */
.cr-depth-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.cr-depth-table thead {
    background: #1a1a2e;
}

.cr-depth-table thead th {
    padding: 0.5rem 0.7rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #FFB81C;
    text-align: left;
    border-bottom: none;
    white-space: nowrap;
}

.cr-depth-table tbody tr {
    border-bottom: 1px solid #f0f1f4;
}

.cr-depth-table tbody tr:hover {
    background: #fff8e6;
}

.cr-depth-table tbody td {
    padding: 0.5rem 0.7rem;
    vertical-align: middle;
}

.cr-depth-pos {
    font-weight: 800;
    color: #E31837;
    font-size: 0.78rem;
    white-space: nowrap;
}

.cr-depth-starter {
    font-weight: 700;
    color: #1a1a2e;
}

.cr-depth-backup {
    color: #6b7280;
    font-size: 0.8rem;
}

a.cr-depth-link {
    color: #E31837;
    text-decoration: none;
    transition: color 0.15s;
}

a.cr-depth-link:hover {
    color: #b5102b;
    text-decoration: underline;
}

a.cr-depth-link.cr-depth-starter-link {
    font-weight: 700;
}

/* ═══════════════════════════════════════
   COACHING STAFF TAB
   ═══════════════════════════════════════ */
.cr-coaches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.cr-coach-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.cr-coach-card:hover {
    border-color: #E31837;
    box-shadow: 0 2px 8px rgba(227, 24, 55, 0.08);
}

.cr-coach-card:first-child {
    border-color: #FFB81C;
    background: linear-gradient(135deg, #fffef5 0%, #fff 100%);
    grid-column: 1 / -1;
}

.cr-coach-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E31837 0%, #b5102b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
}

.cr-coach-card:first-child .cr-coach-icon {
    width: 56px;
    height: 56px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #FFB81C 0%, #e6a50f 100%);
    color: #1a1a2e;
}

.cr-coach-info {
    min-width: 0;
}

.cr-coach-name {
    font-weight: 700;
    color: #1a1a2e;
    font-size: 0.88rem;
    line-height: 1.2;
}

.cr-coach-title {
    font-size: 0.75rem;
    color: #E31837;
    font-weight: 600;
}

.cr-coach-exp {
    font-size: 0.7rem;
    color: #9ca3af;
}

/* ═══════════════════════════════════════
   INJURY REPORT TAB
   ═══════════════════════════════════════ */
.cr-injury-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.cr-injury-table thead {
    background: #1a1a2e;
}

.cr-injury-table thead th {
    padding: 0.55rem 0.7rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #FFB81C;
    text-align: left;
    border-bottom: none;
    white-space: nowrap;
}

.cr-injury-table tbody tr {
    border-bottom: 1px solid #f0f1f4;
}

.cr-injury-table tbody tr:hover {
    background: #fff8e6;
}

.cr-injury-table tbody td {
    padding: 0.55rem 0.7rem;
    vertical-align: middle;
}

.cr-inj-player-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cr-inj-headshot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: #eef0f4;
    flex-shrink: 0;
}

a.cr-inj-link {
    color: #E31837;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.84rem;
    transition: color 0.15s;
}

a.cr-inj-link:hover {
    color: #b5102b;
    text-decoration: underline;
}

/* Status badges in injury table */
.cr-status-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cr-status-q {
    background: #fef9c3;
    color: #a16207;
}

.cr-status-doubtful {
    background: #ffedd5;
    color: #c2410c;
}

.cr-status-out {
    background: #fef2f2;
    color: #dc2626;
}

.cr-status-ir {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.cr-status-dtd {
    background: #ecfdf5;
    color: #047857;
}

.cr-inj-detail {
    color: #6b7280;
    font-size: 0.8rem;
}

.cr-inj-date {
    color: #9ca3af;
    font-size: 0.75rem;
}

.cr-no-injuries {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #16a34a;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════
   RESPONSIVE — Tablet (≤768px)
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
    .cr-wrap {
        margin: 1.5rem 0.5rem;
    }

    .cr-banner {
        flex-wrap: wrap;
        padding: 1rem;
        gap: 0.75rem;
    }

    .cr-team-logo {
        width: 48px;
        height: 48px;
    }

    .cr-title {
        font-size: 1.2rem;
    }

    .cr-record-box {
        padding: 0.4rem 0.8rem;
    }

    .cr-record-num {
        font-size: 1.2rem;
    }

    .cr-main-tab {
        padding: 0.6rem 0.9rem;
        font-size: 0.7rem;
    }

    .cr-pane {
        padding: 0.85rem;
    }

    /* Hide less-important columns */
    .cr-hide-mobile {
        display: none;
    }

    /* Shrink column widths */
    .cr-th-jersey  { width: 36px; }
    .cr-th-pos     { width: 40px; }
    .cr-th-status  { width: 80px; }
    .cr-th-depth-pos { width: 55px; }

    .cr-roster-table {
        font-size: 0.78rem;
        table-layout: auto;
        width: 100%;
    }

    .cr-player-headshot {
        width: 26px;
        height: 26px;
    }

    /* Coaches grid */
    .cr-coaches-grid {
        grid-template-columns: 1fr;
    }

    .cr-coach-card:first-child {
        grid-column: auto;
    }

    /* Depth chart */
    .cr-depth-side-tab {
        padding: 0.4rem 0.7rem;
        font-size: 0.68rem;
    }

    .cr-depth-table {
        font-size: 0.78rem;
        table-layout: auto;
        width: 100%;
    }

    /* Injury table */
    .cr-injury-table {
        font-size: 0.78rem;
        table-layout: auto;
        width: 100%;
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE — Mobile (≤480px)
   ═══════════════════════════════════════ */
@media (max-width: 480px) {
    .cr-wrap {
        margin: 0.5rem 0;
        border-radius: 0;
    }

    .cr-banner {
        border-radius: 8px 8px 0 0;
        padding: 0.75rem 0.75rem;
        gap: 0.5rem;
    }

    .cr-team-logo {
        width: 40px;
        height: 40px;
    }

    .cr-title {
        font-size: 1.05rem;
    }

    .cr-subtitle {
        font-size: 0.75rem;
    }

    .cr-record-box {
        padding: 0.35rem 0.6rem;
    }

    .cr-record-num {
        font-size: 1rem;
    }

    .cr-record-label {
        font-size: 0.58rem;
    }

    .cr-content {
        border-radius: 0 0 8px 8px;
    }

    .cr-main-tab {
        padding: 0.5rem 0.6rem;
        font-size: 0.62rem;
    }

    .cr-pane {
        padding: 0.5rem;
    }

    /* Roster table — compact */
    .cr-roster-table {
        font-size: 0.74rem;
    }

    .cr-roster-table thead th {
        padding: 0.35rem 0.3rem;
        font-size: 0.56rem;
    }

    .cr-roster-table tbody td {
        padding: 0.35rem 0.3rem;
    }

    .cr-player-headshot {
        width: 22px;
        height: 22px;
    }

    .cr-player-cell {
        gap: 0.35rem;
    }

    a.cr-player-link {
        font-size: 0.76rem;
    }

    .cr-td-jersey {
        font-size: 0.76rem;
    }

    .cr-td-pos {
        font-size: 0.72rem;
    }

    /* Depth table — compact */
    .cr-depth-table {
        font-size: 0.74rem;
    }

    .cr-depth-table thead th {
        padding: 0.35rem 0.3rem;
        font-size: 0.56rem;
    }

    .cr-depth-table tbody td {
        padding: 0.35rem 0.3rem;
    }

    .cr-depth-pos {
        font-size: 0.72rem;
        min-width: 40px;
    }

    .cr-depth-side-tab {
        padding: 0.35rem 0.55rem;
        font-size: 0.62rem;
    }

    /* Column widths at mobile */
    .cr-th-jersey  { width: 30px; }
    .cr-th-pos     { width: 32px; }
    .cr-th-status  { width: 70px; }
    .cr-th-depth-pos { width: 42px; }

    /* Injury table — compact */
    .cr-injury-table {
        font-size: 0.74rem;
    }

    .cr-injury-table thead th {
        padding: 0.35rem 0.25rem;
        font-size: 0.56rem;
    }

    .cr-injury-table tbody td {
        padding: 0.35rem 0.25rem;
    }

    .cr-inj-headshot {
        width: 22px;
        height: 22px;
    }

    .cr-inj-player-cell {
        gap: 0.3rem;
    }

    a.cr-inj-link {
        font-size: 0.76rem;
    }

    .cr-status-badge {
        font-size: 0.55rem;
        padding: 0.1rem 0.3rem;
        letter-spacing: 0;
    }

    /* Coaches — compact */
    .cr-coaches-grid {
        gap: 0.6rem;
    }

    .cr-coach-card {
        padding: 0.65rem;
        gap: 0.5rem;
    }

    .cr-coach-icon {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .cr-coach-card:first-child .cr-coach-icon {
        width: 44px;
        height: 44px;
        font-size: 0.9rem;
    }

    .cr-coach-name {
        font-size: 0.82rem;
    }

    .cr-coach-title {
        font-size: 0.7rem;
    }

    /* Group headers */
    .cr-group-name {
        font-size: 0.75rem;
    }

    .cr-group-count {
        font-size: 0.65rem;
    }

    /* Footer */
    .cr-footer {
        flex-direction: column;
        align-items: flex-start;
        font-size: 0.65rem;
    }
}
