/**
 * Dynasty Nerds — Mock Draft Big Board
 * Inherits visual system from .dr-widget (Dynasty Rankings plugin).
 * This file only adds big-board-specific layout: page wrapper, pick grid, writer cell, modal.
 */

/* ── Page wrap ── */
.dnbb-board-page {
    background: #f3f4f6;
    padding: 24px 16px 64px;
    min-height: 60vh;
}

/* ── Container override (max-width 1080) ── */
.dr-widget.dnbb-board {
    max-width: 1080px !important;
}

/* Rookies-Only toggle uses brand red when active to differentiate from position tabs */
.dr-widget .dnbb-rookie-toggle.dr-tab-active {
    background: #B2150D !important;
    border-color: #B2150D !important;
    color: #ffffff !important;
}

/* ── Empty state ── */
.dnbb-empty {
    padding: 56px 24px;
    text-align: center;
    color: #64748b;
    font-family: 'Inter', sans-serif;
}

/* ── Year/Version selects (different from rankings tabs) ── */
.dr-widget .dnbb-control-inline {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
}
.dr-widget .dnbb-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M5 6L0 0h10z'/%3E%3C/svg%3E") right 10px center / 10px no-repeat !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 6px !important;
    padding: 7px 30px 7px 12px !important;
    font-size: 13px !important;
    color: #1e293b !important;
    font-weight: 500 !important;
    cursor: pointer;
    height: 32px !important;
    line-height: 1 !important;
    min-width: 160px;
    font-family: 'Inter', sans-serif !important;
}
.dr-widget .dnbb-select:focus {
    outline: 2px solid #B2150D !important;
    outline-offset: 1px !important;
    border-color: #B2150D !important;
}

/* ── Picks table ──
   Uses table for column alignment, but no visible "table" chrome:
   no header, no vertical column dividers, just clean rows.
*/
.dr-widget .dnbb-table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: auto !important;
    font-family: 'Inter', sans-serif !important;
}

/* Column widths (auto layout — these are min suggestions) */
.dr-widget .dnbb-col-pick    { width: 80px; }
.dr-widget .dnbb-col-player  { width: auto; }
.dr-widget .dnbb-col-badge   { width: 130px; }
.dr-widget .dnbb-col-posrank { width: 80px; }
.dr-widget .dnbb-col-writer  { width: 200px; }

.dr-widget .dnbb-table tbody td {
    padding: 14px 16px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    vertical-align: middle !important;
    background: #ffffff !important;
}

/* ── Pick row ── */
.dr-widget .dnbb-pick-row {
    cursor: pointer !important;
    transition: background 0.12s !important;
}
.dr-widget .dnbb-pick-row:hover td { background: #fafafa !important; }
.dr-widget .dnbb-pick-row:hover .dnbb-player-name { color: #B2150D !important; }
.dr-widget .dnbb-pick-row:hover .dnbb-expand-icon { opacity: 0.85 !important; }
.dr-widget .dnbb-pick-row:focus { outline: 2px solid #B2150D !important; outline-offset: -2px !important; }

/* Pick cell */
.dr-widget .dnbb-cell-pick {
    text-align: center !important;
    line-height: 1 !important;
}
.dr-widget .dnbb-rank-num {
    display: block !important;
    font-family: 'Teko', 'Inter', sans-serif !important;
    font-size: 30px !important;
    font-weight: 700 !important;
    color: #1a2f4a !important;
    letter-spacing: 0.5px !important;
    line-height: 1 !important;
}
.dr-widget .dnbb-rank-overall {
    display: block !important;
    font-size: 10px !important;
    color: #94a3b8 !important;
    font-weight: 600 !important;
    margin-top: 4px !important;
    letter-spacing: 0.4px !important;
}

/* Player cell — headshot + name+college all in one block */
.dr-widget .dnbb-player-block {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    min-width: 0 !important;
}
.dr-widget .dnbb-headshot {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center top !important;
    background: #f0f0f0 !important;
    flex-shrink: 0 !important;
    display: block !important;
}
.dr-widget .dnbb-player-text {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    gap: 3px !important;
}
.dr-widget .dnbb-player-name-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
}
.dr-widget .dnbb-player-name {
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    color: #1e293b !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    transition: color 0.12s !important;
    display: inline-block !important;
    max-width: 100% !important;
}
.dr-widget .dnbb-expand-icon {
    color: #94a3b8 !important;
    opacity: 0.5 !important;
    flex-shrink: 0 !important;
    transition: opacity 0.12s !important;
}
.dr-widget .dnbb-player-secondary {
    font-size: 12px !important;
    color: #94a3b8 !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-family: 'Inter', sans-serif !important;
}

/* Badge cell */
.dr-widget .dnbb-cell-badge { text-align: center !important; }
.dr-widget .dnbb-cell-badge .dr-combo-badge { margin: 0 auto; }
.dr-widget .dnbb-combo-pos-only .dr-combo-pos {
    border-radius: 5px !important;
    min-width: 50px !important;
}
.dr-widget .dnbb-combo-pos-only .dr-combo-team,
.dr-widget .dnbb-combo-pos-only .dr-combo-divider {
    display: none !important;
}

/* Pos rank cell */
.dr-widget .dnbb-cell-posrank {
    text-align: center !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    font-size: 14px !important;
    font-variant-numeric: tabular-nums !important;
    font-family: 'Inter', sans-serif !important;
}

/* Writer cell */
.dr-widget .dnbb-cell-writer {
    white-space: nowrap !important;
}
.dr-widget .dnbb-cell-writer .dnbb-writer-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    vertical-align: middle !important;
    margin-right: 8px !important;
}
.dr-widget .dnbb-cell-writer .dnbb-writer-name {
    font-family: 'Inter', sans-serif !important;
    font-size: 13px !important;
    color: #475569 !important;
    font-weight: 600 !important;
    vertical-align: middle !important;
}

/* ── Tier (round) row ── */
.dr-widget .dnbb-tier-row td {
    background: #f8fafc !important;
    padding: 14px 24px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top: 1px solid #e2e8f0 !important;
}
.dr-widget .dnbb-tier-inner {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}
.dr-widget .dnbb-tier-row .dr-tier-accent {
    width: 4px !important;
    height: 16px !important;
    border-radius: 2px !important;
    flex-shrink: 0 !important;
}
.dr-widget .dnbb-tier-row .dr-tier-label {
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    color: #1a2f4a !important;
    line-height: 1 !important;
}
.dr-widget .dnbb-table tbody tr.dnbb-tier-row:first-child td { border-top: 0 !important; }

/* Footer */
.dr-widget .dr-footer {
    text-align: center;
    padding: 14px;
    font-size: 11px;
    color: #94a3b8;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
}

/* ── Modal (independent from rankings) ── */
.dnbb-modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}
.dnbb-modal-overlay.dnbb-modal-open { display: flex; }
.dnbb-modal {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    margin: 16px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
    animation: dnbb-modal-in 180ms ease;
}
@keyframes dnbb-modal-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.dnbb-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #0f172a;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    /* Ensure the entire button reliably receives touch/click */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.dnbb-modal-close:hover { background: #ffffff; }
/* Catch clicks on the × glyph itself */
.dnbb-modal-close * { pointer-events: none; }
.dnbb-modal-content { display: flex; flex-direction: column; min-height: 0; }

/* ── Two-tone team-color split header (matches player-entities + rankings) ── */
.dnbb-modal-header {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #EEF3F8 100%);
    padding: 18px 18px 18px calc(16.67% + 48px);
    min-height: 130px;
    color: #0f172a;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}
.dnbb-modal-team-strip {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 16.67%;
    z-index: 0;
}
.dnbb-modal-team-accent {
    position: absolute;
    top: 0; bottom: 0;
    left: calc(16.67% - 5px);
    width: 10px;
    z-index: 1;
}
.dnbb-modal-jersey {
    position: absolute;
    top: 4px;
    left: 0;
    width: 16.67%;
    font-size: 56px;
    font-weight: 500;
    font-family: 'Teko', sans-serif;
    text-align: center;
    letter-spacing: 0.05em;
    line-height: 1;
    z-index: 2;
    color: rgba(255,255,255,0.4);
}
.dnbb-modal-headshot {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    background: #ffffff;
    flex-shrink: 0;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(15,23,42,0.18);
    z-index: 2;
    position: absolute;
    left: calc(16.67% - 36px);
    top: 50%;
    transform: translateY(-50%);
}
.dnbb-modal-headshot-empty {
    background: #cbd5e1;
}
.dnbb-modal-info {
    position: relative;
    z-index: 2;
    min-width: 0;
}
.dnbb-modal-pick-badge {
    background: #B2150D;
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: inline-block;
    margin-bottom: 8px;
}
.dnbb-modal-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.dnbb-modal-name {
    font-family: 'Teko', 'Inter', sans-serif;
    font-size: 30px;
    font-weight: 700;
    margin: 0;
    line-height: 1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #0f172a;
}
.dnbb-modal-meta {
    font-family: 'Teko', sans-serif;
    font-size: 14px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

/* Inherit combo badge for the modal too (rankings widget rules are scoped to .dr-widget) */
.dnbb-modal-content .dr-combo-badge {
    display: inline-flex !important;
    align-items: stretch !important;
    border-radius: 5px !important;
    overflow: hidden !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    height: 22px !important;
}
.dnbb-modal-content .dr-combo-team {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 5px !important;
    font-weight: 800 !important;
    font-size: 10px !important;
    letter-spacing: 0.5px !important;
    min-width: 32px !important;
}
.dnbb-modal-content .dr-combo-divider {
    width: 3px !important;
    flex-shrink: 0 !important;
}
.dnbb-modal-content .dr-combo-pos {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 5px !important;
    background: #cbd5e1 !important;
    color: #1e293b !important;
    font-weight: 800 !important;
    font-size: 10px !important;
    letter-spacing: 0.5px !important;
    min-width: 26px !important;
}

.dnbb-modal-stats {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}
.dnbb-kpi-tile {
    text-align: center;
    padding: 16px 12px;
    border-right: 1px solid #f1f5f9;
}
.dnbb-kpi-tile:last-child { border-right: 0; }
.dnbb-kpi-value {
    font-family: 'Teko', 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #1F4E79;
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.dnbb-kpi-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b;
    line-height: 1.2;
}

.dnbb-modal-body { padding: 20px 28px; overflow-y: auto; flex: 1; min-height: 0; }
.dnbb-modal-writer {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
}
.dnbb-modal-writer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(15,23,42,0.1);
}
.dnbb-modal-writer-text { display: flex; flex-direction: column; gap: 2px; }
.dnbb-modal-writer-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
}
.dnbb-modal-writer-name {
    font-family: 'Teko', 'Inter', sans-serif;
    font-weight: 600;
    color: #0f172a;
    font-size: 20px;
    line-height: 1;
    letter-spacing: 0.3px;
}

.dnbb-modal-section-heading {
    font-family: 'Teko', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding-left: 10px;
    border-left: 3px solid #B2150D;
    line-height: 1;
    margin-bottom: 10px;
}

.dnbb-modal-analysis { color: #1f2937; line-height: 1.6; font-size: 14px; }
.dnbb-modal-analysis p { margin: 0 0 12px; }
.dnbb-modal-analysis p:last-child { margin-bottom: 0; }
.dnbb-modal-analysis-blurred { filter: blur(5px); pointer-events: none; user-select: none; }
.dnbb-modal-paywall {
    margin-top: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
    border: 1px solid #fecaca;
    border-radius: 12px;
    text-align: center;
}
.dnbb-modal-paywall p { margin: 0 0 10px; color: #7f1d1d; font-weight: 600; font-size: 13px; }
.dnbb-modal-footer {
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    padding: 14px 28px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.dnbb-modal-cta {
    background: #B2150D;
    color: #ffffff !important;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    transition: background 0.15s;
    display: inline-block;
    line-height: 1;
}
.dnbb-modal-cta:hover { background: #8b1009; }
.dnbb-modal-cta-secondary {
    background: #ffffff;
    color: #1a2f4a !important;
    border: 1px solid #cbd5e1;
}
.dnbb-modal-cta-secondary:hover { background: #f1f5f9; }

/* ── Tablet + Mobile ── */
@media (max-width: 900px) {
    .dnbb-board-page { padding: 16px 8px 48px; }

    /* Hide pos rank + writer columns (writer shows in modal) */
    .dr-widget .dnbb-col-posrank,
    .dr-widget .dnbb-col-writer { display: none; }
    .dr-widget .dnbb-cell-posrank,
    .dr-widget .dnbb-cell-writer { display: none !important; }

    /* Tighten remaining columns hard */
    .dr-widget .dnbb-col-pick  { width: 48px; }
    .dr-widget .dnbb-col-badge { width: 92px; }

    .dr-widget .dnbb-table tbody td { padding: 10px 8px !important; }
    .dr-widget .dnbb-rank-num   { font-size: 22px !important; }
    .dr-widget .dnbb-headshot   { width: 36px !important; height: 36px !important; }
    .dr-widget .dnbb-player-block { gap: 8px !important; }

    /* Allow player name to wrap to 2 lines, ditch the expand icon */
    .dr-widget .dnbb-player-name {
        font-size: 13px !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        line-height: 1.2 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        word-break: break-word !important;
    }
    .dr-widget .dnbb-expand-icon { display: none !important; }
    .dr-widget .dnbb-player-secondary { font-size: 10px !important; }

    /* Combo badge – shrink slot widths */
    .dr-widget .dnbb-cell-badge .dr-combo-team,
    .dr-widget .dnbb-cell-badge .dr-combo-pos {
        min-width: 32px !important;
        padding: 0 4px !important;
        font-size: 10px !important;
    }
    .dr-widget .dnbb-cell-badge .dr-combo-badge { height: 20px !important; }

    /* Pick column padding tight */
    .dr-widget .dnbb-cell-pick { padding: 10px 4px !important; }
    .dr-widget .dnbb-rank-overall { font-size: 9px !important; margin-top: 2px !important; }

    .dr-widget .dnbb-tier-row td { padding: 12px 14px !important; }

    /* Modal stays centered (not full-screen) on mobile */
    .dnbb-modal { margin: 16px; max-width: 100%; max-height: 88vh; border-radius: 14px; }

    /* Header — keep desktop strip ratio, just push content past the headshot */
    .dnbb-modal-header { padding: 14px 14px 14px calc(16.67% + 48px); min-height: 100px; }
    .dnbb-modal-jersey { font-size: 42px; }
    .dnbb-modal-headshot { width: 56px; height: 56px; left: calc(16.67% - 28px); }
    .dnbb-modal-name { font-size: 22px; line-height: 1.05; }
    .dnbb-modal-name-row { gap: 8px; }
    .dnbb-modal-pick-badge { font-size: 9px; padding: 3px 8px; margin-bottom: 6px; }
    .dnbb-modal-meta { font-size: 12px; line-height: 1.3; }

    .dnbb-modal-body { padding: 16px 18px; }
    .dnbb-modal-footer { padding: 12px 18px; flex-wrap: wrap; }
    .dnbb-modal-cta { flex: 1; text-align: center; }
    .dnbb-modal-close { top: 8px; right: 10px; }

    /* Heading scales down so it doesn't force horizontal overflow */
    .dr-widget .dr-heading { font-size: 24px !important; line-height: 1.05 !important; }
}

@media (max-width: 380px) {
    .dr-widget .dnbb-col-pick  { width: 42px; }
    .dr-widget .dnbb-col-badge { width: 84px; }
    .dr-widget .dnbb-rank-num  { font-size: 20px !important; }
    .dr-widget .dnbb-headshot  { width: 32px !important; height: 32px !important; }
    .dr-widget .dnbb-player-name { font-size: 12px !important; }
}

/* ── Big Board grade badge ── */
.dr-widget .dnbb-grade {
    display: inline-block;
    min-width: 38px;
    padding: 3px 8px;
    border-radius: 6px;
    background: #B2150D;
    color: #fff !important;
    font-weight: 800;
    font-size: 14px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ── Writer avatar cards (Big Board picker) ── */
.dr-widget .dnbb-writer-strip {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.dr-widget .dnbb-writer-card {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: none;
    width: 112px;
    padding: 14px 10px 12px !important;
    background: #f8f9fb !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    text-decoration: none !important;
    text-align: center;
    transition: border-color .12s, transform .12s, box-shadow .12s;
}
.dr-widget .dnbb-writer-card:hover {
    border-color: #cbd5e1 !important;
    transform: translateY(-2px);
}
.dr-widget .dnbb-writer-card-active,
.dr-widget .dnbb-writer-card-active:hover {
    border-color: #B2150D !important;
    background: #fff !important;
    box-shadow: 0 6px 18px rgba(178, 21, 13, 0.12);
}
.dr-widget .dnbb-writer-card-avatar {
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    object-fit: cover;
    background: #e5e7eb;
    max-width: none !important;
}
.dr-widget .dnbb-writer-card-name {
    font-size: 12.5px !important;
    font-weight: 800 !important;
    color: #1a1a2e !important;
    line-height: 1.15;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dr-widget .dnbb-writer-card-active .dnbb-writer-card-name { color: #B2150D !important; }
.dr-widget .dnbb-writer-card-meta {
    font-size: 10px !important;
    font-weight: 600;
    color: #94a3b8 !important;
    text-transform: uppercase;
    letter-spacing: .04em;
}
@media (max-width: 640px) {
    .dr-widget .dnbb-writer-strip { padding: 12px 14px; gap: 8px; }
    .dr-widget .dnbb-writer-card { width: 96px; }
    .dr-widget .dnbb-writer-card-avatar { width: 44px !important; height: 44px !important; }
}
