/* ==================== CSS Variables (ygbuff dark theme) ==================== */
:root {
    --bg-dark: #111827;
    --bg-light: #1f2937;
    --card-bg: #1e293b;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-purple: #9b59b6;
    --accent-red: #ef4444;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --border-color: rgba(255, 255, 255, 0.1);
    --hover-bg: rgba(59, 130, 246, 0.1);
    --wr-high: #22c55e;
    --wr-mid: #f59e0b;
    --wr-low: #ef4444;
}

/* ==================== Global Styles ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
}

/* ==================== Header ==================== */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.header h1 i {
    color: var(--accent-blue);
    margin-right: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.help-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* ==================== Loading & Error ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
    color: var(--accent-blue);
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-banner {
    background: var(--danger-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.error-banner i {
    font-size: 1.5rem;
}

/* ==================== Filters Section ==================== */
.filters-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.filters-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.filters-section h2 i {
    color: var(--accent-blue);
    margin-right: 0.5rem;
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.tournament-column {
    background: var(--bg-dark);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.tournament-column h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--accent-blue);
}

.date-range-group {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.date-range-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Filter Row */
.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select,
.filter-input {
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-select:hover,
.filter-input:hover {
    border-color: var(--accent-blue);
}

/* Buttons */
.btn-primary {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

/* ==================== Results Section ==================== */
.results-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.results-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.results-section h2 i {
    color: var(--accent-green);
    margin-right: 0.5rem;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--bg-dark);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.summary-card h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--accent-blue);
}

.summary-content {
    color: var(--text-secondary);
}

.summary-content p {
    margin-bottom: 0.5rem;
}

.summary-content strong {
    color: var(--text-primary);
}

/* ==================== Tabs ==================== */
.tabs-container {
    margin-top: 2rem;
}

.tabs-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 2px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.tab-panels {
    min-height: 400px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ==================== Sort Controls Bar ==================== */
.sort-controls-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.sort-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.sort-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sort-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sort-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.sort-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* ==================== Secondary Sort Bar ==================== */
.secondary-sort {
    background: rgba(31, 41, 55, 0.5);
    margin-top: -0.5rem;
    padding: 0.75rem 1rem;
}

.secondary-sort .sort-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.secondary-sort-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.secondary-sort-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--accent-purple);
}

.secondary-sort-btn.active {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.3);
}

.tab-placeholder {
    color: var(--text-muted);
    text-align: center;
    padding: 4rem 2rem;
    font-style: italic;
}

/* ==================== Three Column Grid ==================== */
.three-column-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 2rem;
}

.data-column {
    background: var(--bg-dark);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.data-column h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--accent-purple);
    font-weight: 600;
}

.comparison-column h4 {
    color: var(--accent-green);
}

/* ==================== Hero Pills ==================== */
.hero-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hero-pill {
    display: flex;
    flex-direction: column;
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.hero-pill-main {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.hero-pill:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hero-pill.collapsible {
    cursor: pointer;
}

.hero-pill.collapsible .hero-pill-main {
    user-select: none;
}

.collapse-arrow {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.hero-pill.expanded .collapse-arrow {
    transform: rotate(180deg);
}

.hero-pill-breakdown {
    display: none;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-pill.expanded .hero-pill-breakdown {
    display: block;
}

.breakdown-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.breakdown-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    padding: 0.15rem 0;
}

.breakdown-team {
    flex: 1;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.breakdown-vs {
    color: var(--text-muted);
    font-size: 0.72rem;
    flex-shrink: 0;
}

.breakdown-record {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.breakdown-wr {
    min-width: 55px;
    text-align: right;
    font-weight: 600;
}

.hero-img {
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.hero-stats {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    line-height: 1.25;
    flex: 1;
    min-width: 0;
}

.hero-stats-line {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.hero-stats-line-secondary {
    font-size: 0.88rem;
}

.stats-separator {
    color: var(--text-muted);
    font-weight: 400;
}

.badge-blue {
    color: var(--accent-blue);
    font-weight: 600;
}

.rank-badge {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
}

.rank-top-pick {
    color: var(--wr-high) !important;
    font-weight: 600;
}

.rank-top-ban {
    color: var(--wr-low) !important;
    font-weight: 600;
}

/* Win Rate Colors */
.wr-high {
    color: var(--wr-high) !important;
    font-weight: 600;
}

.wr-mid {
    color: var(--wr-mid) !important;
    font-weight: 600;
}

.wr-low {
    color: var(--wr-low) !important;
    font-weight: 600;
}

/* ==================== Pair Items ==================== */
.pair-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pair-item {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.pair-item .hero-pill-main {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.pair-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.pair-item.collapsible {
    cursor: pointer;
}

.pair-item .hero-pill-breakdown {
    display: none;
}

.pair-item.expanded .hero-pill-breakdown {
    display: block;
}

.pair-item.expanded .collapse-arrow {
    transform: rotate(180deg);
}

.vs-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.arrow {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.pair-stats {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-left: auto;
    padding-left: 0.25rem;
}

/* ==================== Comparison Section ==================== */
.stats-summary {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 0.8fr;
    gap: 1rem;
}

.comparison-section {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
}

.comparison-section h5 {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.comparison-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0;
    flex-wrap: wrap;
}

.delta-positive {
    color: var(--wr-high);
    font-weight: 700;
    font-size: 0.95rem;
}

.delta-negative {
    color: var(--wr-low);
    font-weight: 700;
    font-size: 0.95rem;
}

.contest-delta {
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.pool-split {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.pool-split-muted {
    color: var(--text-muted);
    font-weight: 400;
}

.pool-debut-section {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.pool-exit-section {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.12);
}

.badge-subtle {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==================== Trends Section ==================== */
.trends-section {
    background: rgba(59, 130, 246, 0.05);
}

.trend-group {
    margin-bottom: 0.75rem;
}

.trend-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.trend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

.pair-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.trend-arrow {
    font-size: 0.9rem;
    font-weight: bold;
}

.trend-up {
    color: var(--wr-high);
}

.trend-down {
    color: var(--wr-low);
}

.trend-emerging {
    color: var(--accent-blue);
}

/* ==================== No Data State ==================== */
.no-data {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    padding: 1rem 0;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1400px) {
    .three-column-grid {
        grid-template-columns: 1fr 1fr;
    }

    .comparison-column {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1024px) {
    .comparison-grid,
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .three-column-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 1rem;
    }

    .three-column-grid .comparison-column {
        grid-column: 1 / -1;
    }

    .data-column {
        min-width: 0;
    }

    .comparison-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .filters-section,
    .results-section {
        padding: 1.5rem;
    }

    .date-inputs {
        grid-template-columns: 1fr;
    }

    .tabs-nav {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .sort-controls-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .secondary-sort-btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.75rem;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .app-container {
        padding: 0.5rem;
    }

    .results-section,
    .filters-section {
        padding: 0.75rem;
    }

    .filters-section h2 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .help-text {
        font-size: 0.78rem;
        margin-bottom: 0.75rem;
    }

    /* Two filter sets side-by-side on mobile */
    .comparison-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .tournament-column {
        padding: 0.6rem;
        min-width: 0;
    }

    .filter-group {
        min-width: 0;
    }

    .filter-select,
    .filter-input {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .tournament-column h3 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .date-range-group {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }

    .date-range-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    .date-inputs {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .filter-group label {
        font-size: 0.7rem;
        margin-bottom: 0.2rem;
        letter-spacing: 0.3px;
    }

    .filter-select,
    .filter-input {
        padding: 0.35rem 0.4rem;
        font-size: 0.75rem;
        border-radius: 6px;
        -webkit-appearance: none;
        appearance: none;
    }

    input.filter-input[type="date"] {
        font-size: 0.7rem;
        padding: 0.35rem 0.3rem;
        min-height: 32px;
    }

    /* Pack the 5 secondary filters into one row on mobile */
    .filter-row {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.35rem;
        margin-bottom: 0.75rem;
    }

    .filter-row .filter-group label {
        font-size: 0.58rem;
        letter-spacing: 0.2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .three-column-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 0.5rem;
    }

    .data-column {
        min-width: 0;
    }

    .three-column-grid .comparison-column {
        grid-column: 1 / -1;
    }

    .data-column {
        padding: 0.6rem;
    }

    .data-column h4 {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    .hero-pill {
        padding: 0.4rem 0.5rem;
    }

    .hero-pill-main {
        gap: 0.5rem;
        align-items: center;
    }

    .hero-img {
        width: 46px !important;
        height: 26px !important;
    }

    .hero-stats {
        font-size: 0.72rem;
        gap: 0.08rem;
    }

    .hero-stats-line {
        gap: 0.2rem;
    }

    .hero-stats-line-secondary {
        font-size: 0.68rem;
    }

    .rank-badge {
        font-size: 0.65rem;
    }

    /* Collapsible breakdown rows — picker/opp were getting squeezed to 0 width
       because both flex:1 children + the WR min-width + record overflowed the
       narrow column. Wrap onto two lines instead. */
    .breakdown-row {
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.25rem 0;
        font-size: 0.7rem;
    }
    .breakdown-team {
        flex: 1 1 auto;
        max-width: none;
        font-size: 0.7rem;
    }
    .breakdown-vs { font-size: 0.62rem; }
    .breakdown-record {
        font-size: 0.65rem;
        flex: 0 0 auto;
    }
    .breakdown-wr {
        min-width: 38px;
        font-size: 0.7rem;
    }
    .breakdown-label { font-size: 0.62rem; margin-bottom: 0.15rem; }
    .hero-pill-breakdown { margin-top: 0.3rem; padding-top: 0.3rem; }

    /* 8th-to-9th response pair cards: shrink fonts further */
    .pair-item { padding: 0.4rem 0.5rem; }
    .pair-item .hero-pill-main { gap: 0.3rem; }
    .vs-label, .arrow { font-size: 0.7rem; }
    .pair-item .hero-img { width: 40px !important; height: 22px !important; }
    .pair-item .hero-stats { font-size: 0.7rem; }
    .pair-item .hero-stats-line-secondary { font-size: 0.62rem; }

    .collapse-arrow {
        font-size: 0.6rem;
    }
}

/* ==================== Utility Classes ==================== */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.hidden {
    display: none !important;
}

/* ===== Mini-draftboards inside collapsible hero pills ===== */
/* The boards replace the textual picker-vs-opponent breakdown. */
.hero-pill .hero-pill-breakdown,
.pair-item .hero-pill-breakdown { display: none !important; }

.j89-pill-boards {
    display: none;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.hero-pill.expanded .j89-pill-boards,
.pair-item.expanded .j89-pill-boards { display: block; }

.j89-boards-status {
    color: var(--text-muted, #9aa0a6);
    font-size: 0.75rem;
    padding: 0.3rem 0;
}
.j89-boards-status.j89-boards-err { color: #ff6b6b; }

.j89-boards-scroll { max-width: 100%; }
.j89-boards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.j89-board {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 0.35rem 0.45rem;
    box-sizing: border-box;
}
.j89-board-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.66rem;
    color: var(--text-muted, #9aa0a6);
    margin-bottom: 0.25rem;
    gap: 0.5rem;
    overflow: hidden;
}
.j89-board-head span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.j89-board-head-right { display: flex; align-items: center; gap: 0.3rem; flex-shrink: 0; }
.j89-view-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 0.58rem;
    padding: 1px 5px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
}
.j89-view-btn:hover { background: #1d4ed8; }

.j89-draft-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 3px;
    color: #cbd5e1;
    font-size: 0.58rem;
    padding: 1px 4px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
    transition: background 0.15s, color 0.15s;
    margin-left: 2px;
}
.j89-draft-btn:hover {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

.j89-view-btn-opendota {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 1px 4px;
    font-size: 0.58rem;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 2px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
}
.j89-view-btn-opendota:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.4);
}
.j89-board-teams {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.76rem;
    margin-bottom: 0.3rem;
    color: var(--text-primary, #f9fafb);
}
.j89-board-teams .j89-team { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.j89-board-teams .j89-team.j89-r { text-align: right; }
.j89-vs { color: var(--text-muted, #9aa0a6); font-size: 0.66rem; }
.j89-badge-w, .j89-badge-l {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 2px;
    vertical-align: middle;
}
.j89-badge-w { background: #10b981; color: #fff; }
.j89-badge-l { background: #ef4444; color: #fff; }

.j89-picks-row {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 5px 0;
}

.j89-pick {
    position: relative;
    height: 26px;
    border-radius: 3px;
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex: 1 1 0;
    min-width: 0;
    max-width: 46px; /* picks: 5 cells × 46 ≈ ban row width (7 × 32) */
}
.j89-pick.j89-ban {
    filter: grayscale(0.6) brightness(0.7);
    max-width: 32px;
}
.j89-pick.j89-highlight {
    outline: 2px solid #f59e0b;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.5);
}
.j89-pick-slot-label {
    position: absolute;
    bottom: 0;
    left: 1px;
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

@media (max-width: 720px) {
    .j89-pick { height: 22px; max-width: 40px; }
    .j89-pick.j89-ban { max-width: 28px; }
    .j89-board-teams { font-size: 0.7rem; }
    .j89-board-head { font-size: 0.62rem; }
}
