﻿:root {
    --cp-offset-top: 64px;
}

/* Backdrop + drawer container (start below fixed navbar) */
.cp-backdrop {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: var(--cp-offset-top);
    background: rgba(0,0,0,.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease-out;
    z-index: 999;
}

    .cp-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

.cp-drawer {
    position: fixed;
    right: 0;
    top: var(--cp-offset-top);
    height: calc(100vh - var(--cp-offset-top));
    width: min(92vw, 420px);
    background: #fff;
    box-shadow: -24px 0 60px rgba(0,0,0,.25);
    transform: translateX(100%);
    transition: transform .22s ease-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

    .cp-drawer.is-open {
        transform: translateX(0);
    }

/* Topbar: static title + badge + X */
.cp-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.cp-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cp-title {
    margin: 0;
    font-size: 18px;
    color: #181D27;
}

.cp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    border: 1px solid #e6e8ec;
    background: #f6f7f9;
    color: #111;
}

.cp-badge--ts {
    border-color: #bbf7d0;
    background: #ecfdf5;
    color: #065f46;
}

.cp-close {
    font-size: 28px;
    line-height: 24px;
    border: none;
    background: transparent;
    color: #535862;
    cursor: pointer;
    padding: 4px 6px;
}

/* Identity section (two columns within same row) */
.cp-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.cp-id {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cp-id-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.cp-id-right {
    display: flex;
    align-items: center;
    gap: 16px;
    white-space: nowrap;
}

.cp-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent; /* dynamic via JS */
}

.cp-name {
    margin: 0 0 4px;
    font-size: 20px;
    line-height: 1.2;
    color: #181D27;
}

.cp-total {
    font-size: 12px;
    color: #535862;
}

.cp-total-points {
    font-weight: 700;
    margin-left: 6px;
    color: #181D27;
}

/* TS-only alive flag that reuses the "Season Total" line's style */
#cp-alive-flag {
    display: none;
    font-weight: 700;
    margin-left: 6px;
    align-items: center;
    line-height: 1;
}

.cp-alive-yes {
    color: #047857;
}
/* emerald-700 */
.cp-alive-no {
    color: #B91C1C;
}
/* red-700 */

/* Placement + exits */
.cp-placement, .cp-exits {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.cp-placement-label, .cp-exits-label {
    font-size: 11px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.cp-placement-value {
    font-weight: 700;
    font-size: 16px;
    color: #181D27;
}

.cp-exits-value {
    font-weight: 700;
    font-size: 14px;
    color: #A14949;
}

/* Toolbar */
.cp-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
}

.cp-season-label {
    font-size: 13px;
    color: #535862;
}

.cp-season {
    flex: 0 1 auto;
    max-width: 180px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
}

/* Detailed toggle */
.cp-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.cp-toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cp-toggle-slider {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: #d1d5db;
    position: relative;
    transition: background .15s ease;
}

    .cp-toggle-slider::after {
        content: "";
        position: absolute;
        left: 2px;
        top: 2px;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: #fff;
        transition: transform .15s ease;
        box-shadow: 0 1px 2px rgba(0,0,0,.2);
    }

.cp-toggle-input:checked + .cp-toggle-slider {
    background: #2563eb;
}

    .cp-toggle-input:checked + .cp-toggle-slider::after {
        transform: translateX(16px);
    }

.cp-toggle-label {
    font-size: 13px;
    color: #374151;
}

/* Points/Counts mini switch */
.cp-mini-switch {
    display: inline-flex;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.cp-mini-btn {
    font-size: 12px;
    padding: 6px 8px;
    border: 0;
    background: #f9fafb;
    cursor: pointer;
}

    .cp-mini-btn + .cp-mini-btn {
        border-left: 1px solid #ddd;
    }

    .cp-mini-btn.cp-mini-active {
        background: #fff;
        font-weight: 700;
    }

/* Episodes table */
.cp-table-wrap {
    overflow: auto;
    padding: 8px 16px 16px;
}

.cp-table {
    width: 100%;
    border-collapse: collapse;
}

    .cp-table th, .cp-table td {
        padding: 10px 10px;
        border-bottom: 1px solid #f0f0f0;
        text-align: left;
    }

    .cp-table th {
        font-size: 12px;
        color: #6B7280;
        letter-spacing: .02em;
        text-transform: uppercase;
    }

    .cp-table td {
        font-size: 14px;
        color: #181D27;
    }

.cp-empty {
    text-align: center;
    color: #6B7280;
    padding: 24px 0;
}

.stat-cell {
    white-space: nowrap;
}

@media (min-width: 900px) {
    .cp-table thead th {
        position: sticky;
        top: 0;
        background: #fff;
    }
}

/* ===== Optional TS color accents (kept) ===== */
.cp-drawer.cp--ts .cp-title {
    color: #14532d;
}

.cp-drawer.cp--ts .cp-header {
    border-bottom-color: #e6f7ed;
}

.cp-drawer.cp--ts .cp-toolbar {
    border-bottom-color: #e6f7ed;
}

/* ===== TS mode trims ===== */
.cp-drawer[data-mode="ts"] #cp-mode-badge {
    display: none !important; /* Remove the pill */
}

/* In TS mode, reuse the total line: change label via JS, hide FT points, show alive flag */
.cp-drawer[data-mode="ts"] #cp-total {
    display: none !important;
}

.cp-drawer[data-mode="ts"] #cp-alive-flag {
    display: inline-flex !important;
}

/* Hide FT-only controls in TS mode */
.cp-drawer[data-mode="ts"] .cp-toggle,
.cp-drawer[data-mode="ts"] .cp-mini-switch {
    display: none !important;
}


/* =========================================================
   Most Picked box – "Eliminated Castaways" (NEW)
   Safe to include here; used on TS stats page.
   ========================================================= */
.mp-section {
    margin-top: 14px;
}

.mp-section-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6B7280; /* gray-500 */
}

.mp-elim-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mp-elim-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #e5e7eb; /* gray-200 */
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    line-height: 1.1;
}

    .mp-elim-chip:hover {
        background: #f9fafb;
    }
    /* gray-50 */
    .mp-elim-chip:focus-visible {
        outline: 2px solid #2563eb; /* blue-600 */
        outline-offset: 2px;
    }

    .mp-elim-chip .name {
        font-weight: 600;
        color: #111827; /* gray-900 */
    }

    .mp-elim-chip .meta {
        font-size: 12px;
        color: #6B7280; /* gray-500 */
    }
