/* They Play Where - tpw-style.css v4.0.9 */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* ── Base ─────────────────────────────────────────────────────────────── */
#tpw-wrap {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    color: #1a1a1a;
    background: #F5F4F0;
    padding: 24px;
}
#tpw-wrap * { box-sizing: border-box; }

/* ── Swatches ─────────────────────────────────────────────────────────── */
.tpw-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}
.tpw-swatch-a { background: #1A3A6B; }
.tpw-swatch-b { background: #2D6B3C; }

/* ── Selections ───────────────────────────────────────────────────────── */
.tpw-selection {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.tpw-sel-label {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-top: 26px;
    flex-shrink: 0;
    width: 24px;
}

.tpw-compare-active .tpw-sel-label,
#tpw-sel-b .tpw-sel-label {
    display: flex;
}

.tpw-sel-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

/* ── Filters ──────────────────────────────────────────────────────────── */
.tpw-filters {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.tpw-filter-group label {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
    color: #1a1a1a;
}

.tpw-filter-group .select2-container { width: 100% !important; }

.tpw-filter-group .select2-container--default .select2-selection--single {
    border: 2px solid #1a1a1a;
    border-radius: 4px;
    height: 38px;
    display: flex;
    align-items: center;
    background: #F5F4F0;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.tpw-filter-group .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #1a1a1a;
    line-height: 34px;
    padding-left: 10px;
    font-family: 'Inter', sans-serif;
}

.tpw-filter-group .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.tpw-filter-group .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #1a1a1a;
}

.tpw-filter-group .select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #E0DDD8;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
}

.select2-dropdown {
    border: 2px solid #1a1a1a;
    border-radius: 4px;
    background: #F5F4F0;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
}

.select2-results__option {
    padding: 6px 10px;
    color: #1a1a1a;
}

.select2-results__option--highlighted {
    background: #1A3A6B !important;
    color: #fff !important;
}

/* All option pinned styling */
.select2-results__option[data-select2-id*="All"],
.select2-results__option:first-child {
    font-weight: 600;
    border-bottom: 1px solid #E0DDD8;
    margin-bottom: 2px;
}

/* ── Add comparison ───────────────────────────────────────────────────── */
#tpw-add-compare-wrap { margin-bottom: 10px; padding-left: 34px; }

#tpw-add-compare {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 6px 14px;
    background: #F5F4F0;
    border: 2px solid #1a1a1a;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
#tpw-add-compare:hover { background: #1a1a1a; color: #fff; }

/* ── Row 2 ────────────────────────────────────────────────────────────── */
#tpw-filters-row2 {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 12px;
}

#tpw-reset {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 8px 20px;
    background: #F5F4F0;
    border: 2px solid #1a1a1a;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
#tpw-reset:hover { background: #1a1a1a; color: #fff; }

/* ── Scale badge ──────────────────────────────────────────────────────── */
#tpw-scale-wrap { text-align: right; margin-bottom: 8px; }

.tpw-bar-scale {
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #444;
    background: #EDECEA;
    border: 1px solid #E0DDD8;
    border-radius: 20px;
    padding: 4px 12px;
    letter-spacing: 0.06em;
}

/* ── Chart ────────────────────────────────────────────────────────────── */
#tpw-chart-wrap { margin-bottom: 24px; }

.tpw-empty {
    font-family: 'Inter', sans-serif;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 15px;
}

.tpw-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    max-width: 100%;
    gap: 12px;
}

/* Prevent single card stretching full width */
.tpw-chart > .tpw-card:only-child,
.tpw-chart > .tpw-card-tbd:only-child {
    max-width: 220px;
}

/* ── Card base ────────────────────────────────────────────────────────── */
.tpw-card {
    border: 1px solid #E0DDD8;
    border-radius: 6px;
    overflow: hidden;
    background: #F5F4F0;
    display: flex;
    flex-direction: column;
}

.tpw-card-stage {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #999;
    text-align: center;
    padding: 10px 6px 4px;
}

/* ── Explore card ─────────────────────────────────────────────────────── */
.tpw-card-pct {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(20px, 2.2vw, 30px);
    font-weight: 800;
    color: #1a1a1a;
    padding: 14px 8px 10px;
    text-align: center;
}

.tpw-card-track {
    width: 100%;
    flex: 1;
    min-height: 140px;
    background: rgba(26, 58, 107, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.tpw-bar-fill {
    width: 100%;
    transition: height 0.3s ease;
}

.tpw-fill-a { background: #1A3A6B; }
.tpw-fill-b { background: #2D6B3C; }

.tpw-card-count {
    font-family: 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #333;
    text-align: center;
    padding-top: 8px;
}

.tpw-card-label {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    text-align: center;
    padding-bottom: 12px;
    letter-spacing: 0.06em;
}

/* ── Clickable card states ────────────────────────────────────────────── */
.tpw-card-clickable {
    cursor: pointer;
    transition: box-shadow 0.15s, opacity 0.15s, border-color 0.15s;
}

.tpw-card-clickable:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.tpw-card-active {
    border-color: #8B5E3C;
    box-shadow: 0 0 0 2px #8B5E3C;
}

.tpw-card-dimmed {
    opacity: 0.35;
}

/* ── Compare card ─────────────────────────────────────────────────────── */
.tpw-card-bars {
    display: flex;
    flex: 1;
    min-height: 160px;
    gap: 6px;
    padding: 8px 8px 0;
}

.tpw-bars-single {
    justify-content: center;
}

.tpw-bars-single .tpw-bar-col {
    max-width: 60%;
}

.tpw-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tpw-bar-track {
    width: 100%;
    flex: 1;
    background: rgba(26, 58, 107, 0.05);
    border-radius: 3px 3px 0 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.tpw-bar-pct {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(13px, 1.4vw, 18px);
    font-weight: 800;
    margin-top: 4px;
    text-align: center;
}

.tpw-pct-a { color: #1A3A6B; }
.tpw-pct-b { color: #2D6B3C; }

.tpw-bar-count {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.tpw-bar-label {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 600;
    color: #555;
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 0.06em;
}

/* ── Legend ───────────────────────────────────────────────────────────── */
#tpw-legend { margin-bottom: 24px; }

.tpw-legend-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tpw-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #333;
}

.tpw-legend-label {
    word-break: break-word;
}

/* ── Players ──────────────────────────────────────────────────────────── */
/* ── Mobile ───────────────────────────────────────────────────────────── */
#tpw-players-header {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    margin-bottom: 24px;
}

.tpw-nation-group { margin-bottom: 40px; }

#tpw-wrap .tpw-nation-header {
    display: flex !important;
    align-items: flex-end !important;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 2px solid #1a1a1a;
}

#tpw-wrap .tpw-nation-flag {
    width: 28px;
    height: auto;
    border-radius: 2px;
    flex-shrink: 0;
    display: block;
    margin-bottom: 2px;
}

.tpw-nation-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1a1a1a;
    margin: 0;
}

.tpw-nation-stage {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #888;
}

.tpw-nation-section { margin-bottom: 16px; }

.tpw-nation-sublabel {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 4px;
    background: #f8f8f8;
}

.tpw-sublabel-a { border-left: 3px solid #1A3A6B; }
.tpw-sublabel-b { border-left: 3px solid #2D6B3C; }

.tpw-stage-tag { font-weight: 400; color: #888; }

.tpw-no-players {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #999;
    font-style: italic;
    padding: 6px 0;
    margin: 0;
}

.tpw-nation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.tpw-player-card {
    padding: 10px 14px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    background: #F5F4F0;
}

.tpw-player-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 2px 0;
}

.tpw-player-position {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #333;
    margin: 0 0 2px 0;
}

.tpw-player-club {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: #444;
    margin: 0 0 1px 0;
}

.tpw-player-meta {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: #555;
    margin: 0;
}

.tpw-legend-remove {
    background: none;
    border: none;
    font-size: 12px;
    color: #999;
    cursor: pointer;
    padding: 0 0 0 6px;
    line-height: 1;
    flex-shrink: 0;
    vertical-align: middle;
}
.tpw-legend-remove:hover { color: #333; }
@media (max-width: 700px) {
    .tpw-filters { grid-template-columns: repeat(2, 1fr); }
    .tpw-chart { grid-template-columns: repeat(2, 1fr); }
    #tpw-filters-row2 { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ── Compare player header ────────────────────────────────────────────── */
.tpw-compare-header {
    margin-bottom: 20px;
}

.tpw-compare-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.tpw-compare-header-main {
    color: #1a1a1a;
}

.tpw-compare-header-sub {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #888;
    padding-left: 22px;
    margin-bottom: 10px;
}

/* ── Label X button ───────────────────────────────────────────────────── */
#tpw-remove-compare-label {
    background: none;
    border: none;
    font-size: 12px;
    color: #C13B2A;
    cursor: pointer;
    padding: 0 0 0 4px;
    line-height: 1;
    flex-shrink: 0;
}
#tpw-remove-compare-label:hover { color: #8B2519; }

.tpw-header-remove {
    background: none;
    border: none;
    font-size: 12px;
    color: #C13B2A;
    cursor: pointer;
    padding: 0 0 0 6px;
    line-height: 1;
    flex-shrink: 0;
}
.tpw-header-remove:hover { color: #8B2519; }

.tpw-legend-remove {
    background: none;
    border: none;
    font-size: 12px;
    color: #C13B2A;
    cursor: pointer;
    padding: 0 0 0 6px;
    line-height: 1;
    flex-shrink: 0;
    vertical-align: middle;
}
.tpw-legend-remove:hover { color: #8B2519; }

/* ── TBD cards ────────────────────────────────────────────────────────── */
.tpw-card-tbd {
    border: 2px dashed #C8C4BC;
    opacity: 0.6;
    cursor: default;
}

.tpw-card-tbd-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #999;
    text-align: center;
    padding: 40px 8px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpw-bar-tbd {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #bbb;
    text-align: center;
    padding: 8px 4px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Stage format note ────────────────────────────────────────────────── */
.tpw-stage-note {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-style: italic;
    color: #777;
    margin-top: 12px;
    text-align: left;
}

/* ── Select2 All option ───────────────────────────────────────────────── */
.tpw-select2-all {
    font-weight: 600;
    color: #1a1a1a;
    display: block;
    padding-bottom: 4px;
    border-bottom: 1px solid #E0DDD8;
    margin-bottom: 2px;
}
