/* Draft Strategist only (index.html). Loaded after css/base.css. Split from styles.css in refactor
   chunk 4A; rules keep their original relative order. */

/* --- Header: the draft picker looks and sizes like Lineup Strategist's league picker (css/base.css, HEADER PICKER;
   improvements M2), and Sync is as tall as it, at least 44px wide (the league arrows' size). --- */
#headerSyncBtn { align-self: stretch; min-width: 44px; justify-content: center; padding: 0 0.85rem; }
#headerSyncBtn > span { display: flex; align-items: center; gap: 4px; }

/* --- CARDS & LAYOUT --- */
.centered-header {
    justify-content: center;
    gap: 0.5rem;
    border-bottom: none;
    margin-bottom: 0.5rem;
    padding-bottom: 0;
}

/* --- FORMS & INPUTS --- */
/* Custom Range Slider */
.mds-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
}
.mds-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6; 
    cursor: pointer;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
    transition: transform var(--motion-spatial-fast-ms) var(--motion-spatial-fast);
}
.mds-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
.mds-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
    transition: transform var(--motion-spatial-fast-ms) var(--motion-spatial-fast);
}
.mds-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}
/* Keyboard focus: ring the thumb (the track is only 6px tall, so an outline there is hard to see) */
.mds-slider:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px #0a0e17, 0 0 0 5px var(--primary-green);
}
.mds-slider:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 3px #0a0e17, 0 0 0 5px var(--primary-green);
}

/* --- BUTTONS --- */
.btn-warning { background: rgba(245, 158, 11, 0.15); color: #fde047; border: 1px solid #f59e0b; }
.btn-header { 
    background-color: var(--primary-green); 
    color: #0a0e17; /* Dark text on bright button for high contrast */
    border: none; 
    padding: 0.5rem 1rem; 
    border-radius: 6px; 
    font-weight: 600; 
    font-size: 0.85rem; 
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    /* Hover and press: the shared state layer and pressed corners (css/base.css, STATE LAYERS; improvements M2). */
    transition: border-radius var(--press-morph);
}

/* MDS-namespaced small button (Tracker/Queue: Pick, Taken, Undo, Save, Cancel, reorder arrows).
   Intentionally duplicated from .btn-sm rather than reusing it, for the same reason MLS has
   its own .mls-btn-sm below: this file is shared between both apps, and an unprefixed .btn-sm
   used to be redefined twice in this same stylesheet (once here, once in the MLS-specific
   section), with source order silently deciding which rule any given page got. Both apps now
   use their own namespaced class so neither can be silently resized by the other's override.
   Do not delete this in favor of the bare .btn-sm. */
.mds-btn-sm {
    padding: 0.4rem 0.8rem; 
    border: none; 
    border-radius: 6px; 
    font-weight: 600; 
    font-size: 0.75rem; 
    cursor: pointer; 
    font-family: inherit;
    transition: color var(--motion-effects-fast-ms) var(--motion-effects-fast), background-color var(--motion-effects-fast-ms) var(--motion-effects-fast), border-color var(--motion-effects-fast-ms) var(--motion-effects-fast), box-shadow var(--motion-effects-fast-ms) var(--motion-effects-fast), opacity var(--motion-effects-default-ms) var(--motion-effects-default), border-radius var(--press-morph);
    letter-spacing: 0.3px;
}

/* 'Taken' button - Ghost style to reduce visual noise */
.btn-draft { 
    background-color: transparent; 
    color: var(--text-muted); 
    border: 1px solid var(--border); 
}

/* Hover and press for Taken and Pick: the shared state layer (css/base.css, STATE LAYERS; improvements M2). */

/* 'My Pick' button - Premium primary style with subtle glow */
.btn-mine { 
    background-color: var(--primary-green); 
    color: #0a0e17; 
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
    border: 1px solid transparent;
}


/* --- LAYOUT PRIMITIVES --- */
.text-green { color: var(--primary-green); }
.text-blue { color: #60a5fa; }
.border-none { border: none; }
.bg-dart { background: var(--dart-border); box-shadow: 0 0 8px var(--dart-border); }
.text-target { color: var(--target-border); }
.text-avoid { color: var(--avoid-border); }
.text-dart { color: var(--dart-border); }

/* --- BADGES & POSITIONAL STYLING --- */
.badge-value { background: #102a1e; color: #4ade80; border: 1px solid #34A853; }
.badge-reach { background: #3a1515; color: #fca5a5; border: 1px solid #ea4335; }
.status-badge { font-size: 0.85rem; padding: 0.5rem; border-radius: 4px; margin-bottom: 1rem; display: none; background-color: #102a1e; color: #4ade80; border: 1px solid #34A853; }
/* The shared "Processing…" / success lines (.upload-processing, .success-feedback in base.css) under a
   .status-badge (refactor 8B): spaced like the badge, rather than with base.css's top margin. */
.upload-processing.status-line, .success-feedback.status-line { margin: 0 0 1rem; }

/* --- MDS SPECIFIC STYLES (Tracker, Board, Limits) --- */
.tracker-header-actions {
    display: flex; 
    justify-content: space-between; 
    align-items: stretch; 
    gap: 0.75rem; 
    margin-bottom: 0.75rem;
}

.pick-badge {
    background: var(--primary-green);
    color: #0a0e17; /* High contrast dark text */
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* Search Bar Wrapper */
.search-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none; /* Let clicks pass through to the input */
}

.search-input {
    margin: 0;
    padding-left: 2.5rem; /* Make room for the icon */
    width: 100%;
}

/* Position Filters Grid */
.tier-grid { 
    display: grid; 
    grid-template-columns: repeat(5, 1fr); 
    gap: 0.5rem; 
    margin-bottom: 1.5rem; 
}

/* Premium Tier Dividers (Replaces heavy green block) */
.tier-divider { 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--primary-green);
    font-weight: 700;
    font-size: 0.95rem;
    margin: 2rem 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tier-divider::before,
.tier-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--primary-green), transparent);
    opacity: 0.3;
}

/* Player Cards Generated via JS */
.player-pool-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.player-card { 
    background: var(--card-bg); 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    padding: 1rem; 
    display: flex; 
    flex-direction: column;
    transition: transform var(--motion-spatial-fast-ms) var(--motion-spatial-fast), border-color var(--motion-effects-fast-ms) var(--motion-effects-fast), box-shadow var(--motion-effects-fast-ms) var(--motion-effects-fast);
}

.player-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Tracker pool render cost: renderBoard() swaps in several hundred cards on every pick. With
   content-visibility: auto the browser skips style/layout/paint for cards that are off-screen,
   which is where most of that cost went. Scoped to #playerPool only -- the queue and roster are
   short lists and gain nothing.
   contain-intrinsic-size is the placeholder height for a card that hasn't been rendered yet;
   `auto` makes the browser remember each card's real height once it has been seen. It sizes the
   CONTENT box -- the card's 1rem padding and 1px border are added on top -- so these are the
   measured card heights minus 34px: desktop 114px card -> 80px, phone 108px card (collapsed and
   uncollapsed are within ~2px) -> 74px. A wrong value only makes the scrollbar thumb drift a
   little while scrolling -- it can't clip a card. */
#playerPool .player-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 80px;
}
@media (max-width: 839.98px) {
    #playerPool .player-card { contain-intrinsic-size: auto 74px; }
}
/* content-visibility: auto implies paint containment, which clips anything that overflows the
   card -- the T-Score tooltip opens below the stats row and would be cut off at the card edge.
   Drop the containment on the one card being interacted with, and lift it above its neighbours
   (each contained card is its own stacking context, so the next card would paint over the tooltip). */
#playerPool .player-card:hover,
#playerPool .player-card:focus-within,
#playerPool .player-card:has(.tooltip-text.mobile-visible) {
    content-visibility: visible;
    position: relative;
    z-index: 2;
}

/* NOTE: .player-stats and .actions rules for the player-card layout live further down,
   in the "PLAYER CARD GRID LAYOUT" section -- removed the older, now-superseded duplicates
   that used to live here to avoid two competing definitions in this file. */

/* Inline Editor (Replaces dashed border) */
.inline-editor { 
    display: none; 
    background: rgba(0, 0, 0, 0.2); 
    padding: 1rem; 
    margin-top: 1rem; 
    border-radius: 6px; 
    border: 1px solid rgba(16, 185, 129, 0.3); 
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}

/* Roster Limits Table (Team Tab) */
.limits-table { 
    width: 100%; 
    text-align: center; 
    border-collapse: collapse; 
    margin-bottom: 1.5rem; 
}

.limits-table th { 
    padding: 0.75rem 0.5rem; 
    border-bottom: 1px solid var(--border); 
    font-size: 0.8rem; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted); 
}

.limits-table td { 
    padding: 0.75rem 0.5rem; 
    font-weight: 600; 
    font-size: 1rem; 
    color: var(--text-main);
    white-space: nowrap;
}

/* Roster Slots (Team Tab) */
.roster-slot { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1rem 0; 
    border-bottom: 1px solid var(--border); 
}

.roster-slot:last-child { 
    border-bottom: none; 
}

.roster-label { 
    font-weight: 700; 
    width: 45px; 
    font-size: 0.85rem; 
    color: var(--text-muted);
}

/* Team tab labels for flex-type slots (FLX, SFLX, W/T, W/R): the text runs through the colors of the
   positions the slot takes (--flex-blend etc. in css/base.css), first letter to last. The gradient goes on
   the inner .roster-label-text, an inline span as wide as the letters, so it isn't spread over the label's
   45px box (which left the letters only the first half of it). An empty slot's label keeps the muted color
   (js/mds/team.js only adds these when filled). Export Team redraws them on canvases (js/mds/export.js). */
.roster-label.flex-blend-text > .roster-label-text, .roster-label.sflex-blend-text > .roster-label-text, .roster-label.wt-blend-text > .roster-label-text, .roster-label.wr-blend-text > .roster-label-text { -webkit-background-clip: text; background-clip: text; color: transparent; }
.roster-label.flex-blend-text > .roster-label-text { background-image: var(--flex-blend); }
.roster-label.sflex-blend-text > .roster-label-text { background-image: var(--sflex-blend); }
.roster-label.wt-blend-text > .roster-label-text { background-image: var(--wt-blend); }
.roster-label.wr-blend-text > .roster-label-text { background-image: var(--wr-blend); }

.roster-slot.empty { 
    opacity: 0.5; 
}

/* Bye Warning Banner */
.bye-warning-banner { 
    background-color: rgba(239, 68, 68, 0.1); 
    border: 1px solid rgba(239, 68, 68, 0.3); 
    color: #fca5a5; 
    padding: 1rem; 
    border-radius: 8px; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600; 
    font-size: 0.9rem; 
    margin-bottom: 1.25rem; 
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

/* --- TEAM TAB UTILITIES --- */
/* Roster list container spacing */
.roster-list, 
.other-drafted-list {
    display: flex;
    flex-direction: column;
}
/* --- DRAFT BOARD GRID --- */
.board-header-group {
    margin-bottom: 1.25rem;
}

.board-header-group h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    color: var(--text-main);
    margin: 0;
}

.draft-board-container { 
    width: 100%; 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
    padding-bottom: 1.5rem;
    
    /* Adds explicit padding space on the right edge so the last column can fully scroll into view */
    padding-right: 1.5rem; 
    
    /* Ensures the container respects the screen width properly */
    max-width: 100%;
}

/* Premium Empty State */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 1rem;
    /* Plain text and its button, not a dashed box (improvements M17, round 5): inside the Team tab's card it was a box in
       a box, and on the page it read as a placeholder card. */
}

.empty-state-icon {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 50%;
    margin-bottom: 1rem;
    color: var(--text-muted); /* was var(--border): nearly invisible against this badge's own background */
}

.empty-state-cta {
    margin-top: 1rem;
    width: auto;
}

.recap-grade-box {
    background: rgba(0,0,0,0.2);
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    text-align: center;
}

.recap-label {
    font-size: 0.75rem;
    color: #93c5fd;
    text-transform: uppercase;
    font-weight: 700;
}

.roster-slot-label-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.roster-slot-pos-caption {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.recap-callout-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* The actual Grid generated by JS */
.draft-grid { 
    display: grid;
    grid-template-columns: repeat(var(--num-teams, 12), minmax(0, 1fr)); 
    gap: 2px; 
    background-color: var(--border); 
    border: 2px solid var(--border); 
    border-radius: 6px; 
    width: 100%; /* Replaced rigid min-width with full container width */
    max-width: 100%;
    overflow-x: auto;
}

.draft-col-header { 
    background: var(--card-bg); 
    color: var(--text-muted); 
    text-align: center; 
    font-weight: 700; 
    padding: 0.5rem 0.25rem; 
    font-size: 0.8rem; 
    letter-spacing: 0.5px;
    
    /* --- CRITICAL GRID TRUNCATION RULES --- */
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    min-width: 0; /* Forces grid children to shrink and truncate text */
    width: 100%;
    box-sizing: border-box;
}

.draft-col-header.mine { 
    background: rgba(255, 255, 255, 0.15); 
    color: #ffffff; 
    border-bottom: 3px solid #ffffff; 
}

.draft-cell { 
    background: var(--bg-color); 
    padding: 0.35rem 0.3rem; 
    min-height: 48px; /* Gives player names more breathing room */
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    transition: filter var(--motion-effects-fast-ms) var(--motion-effects-fast);
    gap: 2px;
    overflow: hidden;
    position: relative;
    max-width: 100%;
}

.draft-cell:hover {
    filter: brightness(1.2); /* Slight hover effect on grid cells */
}

.draft-cell.picked { 
    border: 1px solid transparent; 
}

.draft-cell.mine { 
    /* Soft white outer border and inner glow to highlight the cell without clashing */
    border: 1px solid rgba(255, 255, 255, 0.3); 
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.08); 
    position: relative; 
    z-index: 1;
}

.draft-cell-first { 
    font-size: 0.7rem; 
    color: var(--text-muted); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: 100%; 
    line-height: 1.2;
}

.draft-cell-last { 
    font-size: 0.85rem; 
    font-weight: 700; 
    color: var(--text-main); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: 100%; 
    line-height: 1.2;
}

/* Position Colors using CSS Variables from :root */
.draft-cell.QB { background-color: var(--pos-qb); border-left: 3px solid var(--pos-qb-border); }
.draft-cell.RB { background-color: var(--pos-rb); border-left: 3px solid var(--pos-rb-border); }
.draft-cell.WR { background-color: var(--pos-wr); border-left: 3px solid var(--pos-wr-border); }
.draft-cell.TE { background-color: var(--pos-te); border-left: 3px solid var(--pos-te-border); }
.draft-cell.K { background-color: var(--pos-k); border-left: 3px solid var(--pos-k-border); }
.draft-cell.DEF { background-color: var(--pos-def); border-left: 3px solid var(--pos-def-border); }

@media (min-width: 840px) {
    .draft-cell-first {
        font-size: 0.65rem;
    }
    .draft-cell-last {
        font-size: 0.72rem;
        font-weight: 700;
    }
}

/* --- LIVE INDICATOR --- */
/* The animated dot */
.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

/* Reduced motion: stop the live-sync dot's pulse (split from the shared block in css/base.css in 4D). */
@media (prefers-reduced-motion: reduce) {
    .pulse-dot {
        animation: none;
    }
}

/* goToSetupStep (js/mds/setupGuide.js, 8A) scrolls these into view; clear the sticky .header so the
   card title shows. Lineup Strategist's own cards have the same rule in css/mls.css. */
#setupRankingsCard,
#setupDraftCard,
#setupAdpCard {
    scroll-margin-top: 5.5rem;
}

/* --- MODERNIZED FILE UPLOAD BUTTON --- */
@media (max-width: 480px) {
    .limits-table th, 
    .limits-table td {
        /* Reduces the left/right padding to free up horizontal space */
        padding: 0.5rem 0.2rem; 
    }
    
    .limits-table th {
        font-size: 0.7rem;
        letter-spacing: 0; /* Removes extra spacing between header letters */
    }
    
    .limits-table td {
        font-size: 0.85rem; /* Shrinks the numbers just enough to fit */
    }
}
/* Premium Live State for the Sync Button */
.btn-header.is-live {
    background-color: rgba(239, 68, 68, 0.15); 
    color: #ef4444; 
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.4); 
}

.btn-header.is-live:hover {
    background-color: rgba(239, 68, 68, 0.25);
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.6), 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Stalled Live Sync: the 3s poll has missed enough ticks in a row that the board may no
   longer match the draft. Amber rather than red so it reads as "still trying, but don't
   trust this yet" instead of a hard failure -- the poll is deliberately still running. */
.btn-header.is-live.is-stalled {
    background-color: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.45);
}

.btn-header.is-live.is-stalled:hover {
    background-color: rgba(245, 158, 11, 0.25);
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.65), 0 4px 12px rgba(245, 158, 11, 0.2);
}

/* The dot stops pulsing when stalled: the pulse is what sells "picks are arriving", and
   that's exactly the claim we can no longer make. Keyed on the class, not #liveIconWrap, so the Guide's
   badge legend (improvements S10) draws the stalled pill from the same rule. */
.is-stalled .pulse-dot {
    background-color: #f59e0b;
    animation: none;
    box-shadow: none;
}

.live-sync-stamp {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    opacity: 0.85;
    white-space: nowrap;
}

/* Nothing to show while the poll is healthy -- collapse the gap the flex row would
   otherwise leave for an empty span. */
.live-sync-stamp:empty {
    display: none;
}
/* Mobile-specific adjustments for Draft Board edge-to-edge bleed */
@media (max-width: 839.98px) {
    .draft-board-container {
        /* Pull container out to the absolute edges. Must match .container's MOBILE padding
           (0.5rem, not its 1.5rem desktop padding) or this overshoots and causes real
           horizontal page overflow -- that overflow is what caused the Board tab to appear
           "zoomed in" on mobile, with the bottom nav cut off until scrolling/zooming out. */
        margin-left: -0.5rem; 
        margin-right: -0.5rem;
        width: calc(100% + 1rem);
        max-width: none;
        
        /* Start grid cleanly with padding, but let it scroll fully to the edge */
        padding-left: 0.5rem;
        padding-right: 0.5rem; 
        
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .draft-grid {
        /* REMOVE the 100% width trap and nested scroll */
        max-width: none;
        width: max-content; 
        overflow-x: visible;
        min-width: 100%;
        
        /* THE FIX: Hardcode columns to 80px so they NEVER stretch to fit long team names */
        grid-template-columns: repeat(var(--num-teams, 12), 80px) !important;
    }

    .draft-col-header {
        padding: 0.5rem 0.2rem !important;
    }

    /* Ensures long names truncate elegantly in the narrower columns */
    .draft-cell-first, 
    .draft-cell-last {
        font-size: 0.75rem !important; 
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        padding: 0 1px;
        line-height: 1.2;
    }
}
.draft-cell-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--card-bg);
}
/* --- ACCESSIBILITY & MICRO-INTERACTIONS --- */
.player-card {
  transition: transform var(--motion-spatial-fast-ms) var(--motion-spatial-fast), border-color var(--motion-effects-fast-ms) var(--motion-effects-fast), box-shadow var(--motion-effects-fast-ms) var(--motion-effects-fast);
}

/* The card itself is no longer a tab stop (its buttons are), so this marks which card a
   keyboard user is on while tabbing through its buttons. :focus-visible keeps it from
   lighting up on a mouse click or tap. */
.player-card:has(:focus-visible) {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* The edit pencil used to be a <span> and is now a <button>: strip the browser's button font and
   chrome so it looks exactly as before. (The position filters' half of this rule moved to the end
   of css/base.css in improvements S1, when Lineup Strategist's Waiver Wire Assistant started using them.) */
button.edit-link {
  font-family: inherit;
  line-height: inherit;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  padding: 0;
}
.edit-link:focus-visible { opacity: 1; }

/* --- MOBILE COLLAPSIBLE CARDS --- */
.btn-expand {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.4rem;
}

.queue-header {
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    width: 100%; /* <button> since Chunk 3; buttons don't stretch like the old <div> did */
}

.queue-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.queue-header .chevron {
    color: #f59e0b;
    flex-shrink: 0;
}

/* Mobile Default: Details hidden only if setting is enabled.
   (Consolidated from what used to be two overlapping @media(max-width: 599.98px) blocks here plus
   a third small one further down -- see the single block near the PLAYER CARD GRID LAYOUT
   section below for the live rules.) */

/* Desktop Default: Details always visible, expand button hidden.
   (Previously declared 3 times near-identically across this file -- consolidated to one.) */
@media (min-width: 840px) {
    .card-details {
        display: block !important; /* Force visible */
        margin-top: 0.25rem;
    }
    
    .hide-on-desktop {
        display: none !important;
    }
}
/* --- PLAYER CARD GRID LAYOUT --- */
.card-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    /* Default: Actions span both rows, vertically centering them */
    grid-template-areas:
        "name actions"
        "stats actions";
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.2rem;
    width: 100%;
}

.card-details {
    grid-area: stats;
    min-width: 0;
}

.player-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.edit-link {
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.75;
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-left: 0; 
}

.edit-link:hover {
    opacity: 1;
    color: var(--primary-green);
}

/* --- SHARED CARD SUB-LAYOUT CLASSES ---
   Extracted from repeated inline styles in buildPlayerCardHTML() / buildQueueCardHTML()
   (js/mds/tracker.js). Each of these appeared identically in both card templates. */
.card-top-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.card-name {
    margin: 0;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.card-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.card-badges-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.card-field-label {
    font-size: 0.75rem;
    font-weight: bold;
    display: block;
}

.queue-arrow-btn {
    padding: 2px 8px;
    background: var(--bg-card);
    border-color: var(--border);
}

.queue-arrow-btn:disabled {
    opacity: 0.3;
}

/* --- MOBILE COLLAPSIBLE CARDS CONDITIONAL LAYOUT --- */
@media (max-width: 839.98px) {
    body.enable-mobile-collapse .card-grid {
        /* When enabled: Actions stay on top row, Stats span full width below */
        grid-template-areas:
            "name actions"
            "stats stats";
    }
    
    body.enable-mobile-collapse .card-details {
        display: none;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        padding-right: 0; /* allow full width when collapsed -- merged in from a separate block that used to live here */
        border-top: 1px dashed rgba(255, 255, 255, 0.1);
    }
    
    body.enable-mobile-collapse .player-card.is-expanded .card-details {
        display: block;
    }

    body:not(.enable-mobile-collapse) .btn-expand {
        display: none !important;
    }
}

.methodology-link {
    margin-left: 4px;
    display: inline-block;
}

@media (max-width: 839.98px) {
    .methodology-link {
        display: block; /* Forces it to its own line */
        margin-left: 0;
        margin-top: 4px;
    }
}
/* Instantly hides headshots when the body class is present */
body.hide-headshots .draft-cell-img {
    display: none !important;
}
/* --- ROSTER AVATARS --- */
.roster-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.roster-avatar.placeholder {
    background-color: transparent;
    border: none;
}
/* Player headshots (.draft-cell-img on the board, .roster-avatar on the Team tab) -- see headshotHTML in
   js/mds/headshots.js. The circle holds the player's initials; the Sleeper photo sits on top with the circle's
   background, so no letters show behind it, and removes itself if it fails to load (improvements F3). */
.mds-headshot {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
}
.mds-headshot-initials {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    line-height: 1;
}
.draft-cell-img .mds-headshot-initials { font-size: 0.45rem; }
.mds-headshot-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: var(--card-bg);
}

/* --- FULL-WIDTH DRAFT BOARD FOR DESKTOP --- */
@media (min-width: 1024px) {
    /* THE FIX: Break #boardTab out of the 1200px .container trap to fill the monitor -- the part of it beside the
       navigation rail (--rail-inset, css/base.css, improvements S26), where the page is centred. */
    #boardTab {
        width: calc(100vw - var(--rail-inset)) !important;
        max-width: calc(100vw - var(--rail-inset)) !important;
        margin-left: calc(50% - 50vw + var(--rail-inset) / 2) !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
        box-sizing: border-box;
    }

    #draftMatrixContainer {
        width: 100%;
        max-width: 100%;
    }

    .draft-grid {
        width: 100%;
        /* Force all columns to distribute evenly across the full width */
        grid-template-columns: repeat(var(--num-teams, 12), minmax(0, 1fr)) !important;
        gap: 4px; 
    }

    /* Scale up cell heights, font sizes, and headshots on large monitors */
    .draft-cell {
        min-height: 80px;
        padding: 6px 4px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        overflow: hidden; /* Stop inner text from pushing cell boundaries */
    }

    .draft-cell-img {
        width: 38px;  
        height: 38px;
        margin-bottom: 2px;
    }
    .draft-cell-img .mds-headshot-initials { font-size: 0.75rem; }

    .draft-cell-first {
        font-size: 0.8rem;
    }

    .draft-cell-last {
        font-size: 0.85rem;
        font-weight: 700;
    }

    .draft-col-header {
        font-size: 0.9rem;
        padding: 0.75rem 0.4rem;
        overflow: hidden; 
        text-overflow: ellipsis; 
        white-space: nowrap;
    }
}

/* Accessibility: minimum touch target for the Tracker card expand button (split from the shared block in css/base.css in 4D). */
.btn-expand {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

/* --- RANKINGS UPLOAD PREVIEW (MDS) --- */
/* Refactor 8C. The window itself is the shared .preview-* (css/base.css); this is the position and
   team after each top player's name (js/mds/uploadPreview.js), which MLS's list doesn't show. */
.preview-list .preview-meta {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Room on phones (improvements M17, css/base.css's ROOM ON PHONES): under 600px the Tracker's player cards are list rows
   across the screen with 16px of padding and a divider, not cards with gaps. The lift on hover goes with the card. */
@media (max-width: 599.98px) {
    .player-pool-container { gap: 0; }
    .player-card {
        border: 0;
        border-radius: 0;
        padding-left: 16px;
        padding-right: 16px;
    }
    .player-card + .player-card { border-top: 1px solid var(--divider); }
    .player-card:hover, .player-card:has(:focus-visible) { transform: none; box-shadow: none; }
    /* Denser on phones (round 5): 12px above and below a player (16px before; the content's placeholder height for
       content-visibility is unchanged, it measures the content box), and less air round the tier headings, the first
       one most (it followed the chips' 1.5rem and its own 2rem). */
    .player-card { padding-top: 12px; padding-bottom: 12px; }
    .tier-divider { margin: 1.25rem 0 0.5rem; }
    .player-pool-container > .tier-divider:first-child { margin-top: 0.25rem; }
}

/* The Draft Board's grid runs to the screen's edges on phones (the bleed above). Under 600px the page has no side
   padding any more (css/base.css, ROOM ON PHONES), so the bleed's -0.5rem would overshoot and scroll the page sideways:
   the grid sits at the edges and starts at the 16px margin instead, scrolling all the way to the edge
   (improvements M17). */
@media (max-width: 599.98px) {
    .draft-board-container {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Team tab: the part Export Team captures, its cards in a column (was an inline style). Under 600px the gap is the 8px
   band between sections (css/base.css, ROOM ON PHONES). */
.team-export-stack { display: flex; flex-direction: column; gap: 1rem; }
