.discovery-header {
    margin-bottom: 20px;
}

/* .skeleton / @keyframes skeleton-pulse now live in style.css (sitewide). */

.p-card-skeleton {
    flex: 0 0 240px;
    scroll-snap-align: start;
    background: white;
    border: 1px solid var(--black-10);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.p-card-skeleton .p-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.p-card-skeleton .p-card-info {
    flex: 1;
    min-width: 0;
}

.discovery-search-input:focus {
    outline: none;
    border-color: var(--plum) !important;
}

.discovery-tray {
    margin-bottom: 24px;
    min-height: 52px; /* Prevent layout jump */
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.tray-empty-hint {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px dashed var(--black-20);
    border-radius: 8px;
    color: var(--black-60);
    text-align: center;
    font-size: 14px;
    background: rgba(0,0,0,0.02);
}

.tray-chip {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--black-20);
    padding: 6px 6px 6px 12px;
    border-radius: 100px;
    gap: 8px;
    animation: chipIn 0.2s ease-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

@keyframes chipIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.chip-avatar {
    width: 24px;
    height: 24px;
    background: var(--plum);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.chip-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--charcoal);
    white-space: nowrap;
}

.chip-remove {
    cursor: pointer;
    color: var(--black-40);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 18px;
    transition: all 0.1s ease;
}

.chip-remove:hover {
    color: var(--plum);
    background: var(--offwhite);
}

/* Toast for 2-player cap */
.tray-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--charcoal);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    width: max-content;
    max-width: 90vw;
    text-align: center;
}

.tray-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.discovery-categories {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Search Results Styles (Ticket 04.2) */
.search-results-list {
    background: white;
    border: 1.5px solid var(--black-20);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-result-row {
    padding: 12px 16px;
    border-bottom: 1px solid var(--black-10);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.1s ease;
}

.search-result-row:last-child {
    border-bottom: none;
}

.search-result-row:hover {
    background: var(--offwhite);
}

.result-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--charcoal);
}

.result-meta {
    font-size: 12px;
    color: var(--black-60);
    margin-top: 2px;
}

.result-action {
    color: var(--plum);
    font-size: 18px;
    opacity: 0.6;
}

.search-result-row:hover .result-action {
    opacity: 1;
}

.search-no-results {
    padding: 24px 16px;
    text-align: center;
    color: var(--black-60);
    font-size: 14px;
    font-style: italic;
}

/* Category Carousel & Cards (Ticket 04.4) */
.category-section {
    margin-bottom: 8px;
}

.category-header {
    margin-bottom: 12px;
}

.category-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--charcoal);
    margin: 0 0 2px 0;
}

.category-subtitle {
    font-size: 13px;
    color: var(--black-60);
    margin: 0;
}

.category-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding: 4px 4px 16px 4px; /* Space for box shadow and scrollbar */
    margin: 0 -18px; /* Negative margin to bleed to edges */
    padding-left: 18px;
    padding-right: 18px;
    -webkit-overflow-scrolling: touch;
}

.category-scroll::-webkit-scrollbar {
    display: none; /* Hide scrollbar for cleaner look */
}

.p-card {
    flex: 0 0 240px; /* Fixed width for cards */
    scroll-snap-align: start;
    background: white;
    border: 1px solid var(--black-10);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(75, 20, 91, .05);
    position: relative;
}

.p-card:hover {
    border-color: var(--black-20);
    transform: translateY(-2px);
}

.p-card.selected {
    border-color: var(--plum);
    background: rgba(75, 20, 91, 0.02);
}

.p-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.p-card-avatar {
    width: 32px;
    height: 32px;
    background: var(--black-10);
    color: var(--black-60);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.p-card.selected .p-card-avatar {
    background: var(--plum);
    color: white;
}

.p-card-info {
    flex: 1;
    min-width: 0;
}

.p-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p-card-meta {
    font-size: 11px;
    color: var(--black-60);
}

.p-card-check {
    color: var(--plum);
    font-size: 16px;
    margin-left: auto;
}

.p-card-visual {
    height: 40px;
    background: var(--offwhite);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sparkline-placeholder {
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, var(--black-10) 0%, var(--black-20) 50%, var(--black-10) 100%);
    position: relative;
}

.p-card-why {
    font-size: 12px;
    color: var(--black-80);
    line-height: 1.4;
    font-style: italic;
    border-top: 1px solid var(--black-10);
    padding-top: 10px;
}

/* Mode Panel Styles (Ticket 04.13) */
.mode-panel-container {
    background: white;
    border: 1px solid var(--black-10);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(75, 20, 91, .05);
    animation: panelIn 0.3s ease-out;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mp-header {
    text-align: center;
    margin-bottom: 20px;
}

.mp-player-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--plum);
    margin: 0;
}

.mp-track-container {
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.mp-track {
    display: flex;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mp-card {
    flex: 0 0 100%;
    min-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mp-metric-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--black-60);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.mp-visual {
    width: 100%;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.mp-note {
    font-size: 13px;
    color: var(--charcoal);
    line-height: 1.5;
    max-width: 280px;
}

.mp-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mp-btn {
    background: var(--offwhite);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--plum);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mp-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mp-btn:not(:disabled):hover {
    background: var(--black-10);
}

.mp-dots {
    display: flex;
    gap: 8px;
}

.mp-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--black-20);
    transition: all 0.2s ease;
}

.mp-dot.active {
    background: var(--plum);
    transform: scale(1.3);
}

/* Comparison Mode Styles (Ticket 04.14, generalised to up to 3 players) */

/* Colour-key legend under the shared Form/Ownership charts: one dot+name
   per player plus a dashed swatch for the average line. */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
    margin-top: 4px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--black-70);
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.chart-legend-dot.dashed {
    width: 14px;
    height: 0;
    border-radius: 0;
    border-top: 2px dashed var(--grey-mid);
}

.mp-player-name .chart-legend-dot,
.mp-note .chart-legend-dot {
    margin-right: 4px;
    vertical-align: middle;
}

.mp-comparison-note-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    width: 100%;
    margin-top: 8px;
    justify-content: center;
}

.mp-comparison-note-row .mp-note {
    flex: 0 1 auto;
    font-size: 11px;
    max-width: none;
    text-align: center;
}

/* Next 5 Fixtures comparison (mobile-first): one full-width row per player,
   stacked vertically, rather than side-by-side columns squeezed onto a
   narrow screen. */
.mp-fixture-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
}

.mp-fixture-player {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid var(--black-10);
}

.mp-fixture-player:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mp-fixture-player .mp-player-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--charcoal);
    text-align: left;
    margin-bottom: 8px;
}

.mp-fixture-player .fixture-chip-row {
    justify-content: flex-start;
}

.mp-fixture-player .mp-note {
    text-align: left;
    max-width: none;
    margin-top: 6px;
    font-size: 12px;
}

/* Season Numbers / Summary comparison (mobile-first): one metric block per
   row, each player's own value stacked full-width underneath rather than
   in side-by-side columns. */
.mp-stat-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
}

.mp-stat-block {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid var(--black-10);
}

.mp-stat-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mp-stat-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--black-60);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

/* Comparison bar: neutral track, one coloured dot per player with its value
   labelled directly above it, plus a dotted average marker - the same
   "bar + marker" visual language as the single-player Summary card,
   generalised to N points instead of one bar + one marker. 10px of side
   padding on the wrap keeps a dot/label at 0% or 100% from clipping against
   the card edge; extra top padding leaves room for the value labels. */
.mp-stat-bar-wrap {
    padding: 22px 10px 26px;
}

.mp-stat-bar-track {
    position: relative;
    height: 8px;
    background: var(--black-10);
    border-radius: 100px;
}

.mp-stat-dot {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transform: translate(-50%, -50%);
}

.mp-stat-dot-value {
    position: absolute;
    top: -8px;
    transform: translate(-50%, -100%);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

/* Collision avoidance: when two players' values sit close enough together
   that their labels would overlap, the closer one drops below the track
   instead of also sitting above it. */
.mp-stat-dot-value.below {
    top: 14px;
    bottom: auto;
    transform: translate(-50%, 0);
}

.mp-stat-avg-marker {
    position: absolute;
    top: -4px;
    bottom: -4px;
    border-left: 2px dotted var(--grey-mid);
    transform: translateX(-1px);
}

.mp-stat-avg-tick {
    position: absolute;
    top: -3px;
    bottom: -3px;
    border-left: 2px dotted;
    opacity: 0.7;
    transform: translateX(-1px);
}

.mp-stat-axis-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    font-size: 10px;
    color: var(--black-50);
    margin-top: 2px;
}

.mp-stat-compare {
    font-size: 11px;
    color: var(--black-50);
    margin-top: 4px;
}

/* Shared legend for the whole Season Numbers / Summary comparison card - one
   name/colour key for all metric blocks, not repeated under every one. */
.mp-stat-list + .chart-legend {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--black-10);
}

/* Fixture Chip overrides for discovery panel */
.fixture-chip-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.fixture-chip {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--charcoal);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 45px;
}

.fixture-chip span:first-child {
    opacity: 0.9;
}

.fixture-chip span:last-child {
    font-size: 9px;
    opacity: 0.7;
}

.fixture-chip-blank {
    background: var(--black-10) !important;
    color: var(--charcoal); /* black-40 was ~2.3:1 against this background - fails WCAG AA */
}

/* Season Numbers / Summary, single-player mode: these are block/list content,
   not a chart, so they need to fill .mp-visual's width rather than shrink to
   content size and end up centred as a narrow column. */
.mp-visual .season-grid,
.mp-visual .mp-summary-rows {
    width: 100%;
}

.mp-summary-rows {
    display: flex;
    flex-direction: column;
    text-align: left;
}
