/* ===========================================================================
   Snooker Tournament Detail Page Styles
   =========================================================================== */

/* ── Page Container ── */
.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

/* ── Tournament Info Card ── */
.tournament-info-card {
    background: var(--card-bg, #0a1512);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 24px 28px;
    margin-top: 24px;
    margin-bottom: 24px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.tournament-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--color-foreground, #e8eceb);
}

.tournament-meta {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-muted, #8a9c96);
}

.meta-value {
    font-size: 0.95rem;
    color: var(--color-foreground, #e8eceb);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tournament-flag {
    border-radius: 2px;
    vertical-align: middle;
}

/* ── Round Sections ── */
.round-section {
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.round-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-accent, #22e07a);
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    width: 100%;
    max-width: 800px;
}

/* ── Match Table ── */
.match-table {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-collapse: separate;
    border-spacing: 0 8px;
    table-layout: auto;
}

.match-row {
    border-radius: 8px;
    overflow: hidden;
}

.match-row:hover .match-summary {
    border-color: var(--color-accent, #22e07a);
}

.match-summary-cell {
    padding: 0;
    border-radius: 8px;
}

.match-summary {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 16px;
    cursor: pointer;
    background: var(--color-surface, #0a1512);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    transition: border-color 0.15s;
}

.match-players {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    min-width: 0;
}

.player-name {
    color: var(--color-foreground, #e8eceb);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-vs {
    color: var(--color-muted, #8a9c96);
    font-size: 0.8rem;
    text-transform: uppercase;
    flex-shrink: 0;
}

.match-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.match-score {
    font-weight: 700;
    color: var(--color-accent, #22e07a);
    background: var(--color-accent-subtle, rgba(34, 224, 122, 0.12));
    padding: 2px 8px;
    border-radius: 4px;
}

.match-time {
    color: var(--color-muted, #8a9c96);
}

.match-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.status-upcoming {
    background: rgba(79, 156, 217, 0.15);
    color: #4f9cd9;
}

.status-completed {
    background: rgba(34, 224, 122, 0.15);
    color: #22e07a;
}

.status-in_progress {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.match-arrow {
    color: var(--color-muted, #8a9c96);
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: color 0.15s;
    user-select: none;
}

.match-summary:hover .match-arrow {
    color: var(--color-foreground, #e8eceb);
}

/* ── Match Details (expanded) ── */
.match-details {
    border-top: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    padding: 16px;
    background: var(--color-surface, #0a1512);
    border-radius: 0 0 8px 8px;
    margin: 0;
}

.player-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .player-cards-row {
        grid-template-columns: 1fr;
    }
}

.empty-msg {
    color: var(--color-muted, #8a9c96);
    font-style: italic;
    text-align: center;
    padding: 12px;
}

/* ── Player Card ── */
.player-card {
    background: var(--color-brown-surface, #0b1813);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    padding: 16px;
}

.player-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
}

.player-card-header .player-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.player-card--tbd {
    opacity: 0.55;
    border-style: dashed;
}

.player-card--tbd .player-card-header {
    border-bottom-color: var(--color-muted, #8a9c96);
}

.player-flag-img {
    border-radius: 2px;
    vertical-align: middle;
}

.card-section h4 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-muted, #8a9c96);
    margin: 0 0 6px;
}

.stat-sub {
    font-size: 0.75rem;
    color: var(--color-muted, #8a9c96);
    font-weight: 400;
}

.rolling-avg-value {
    cursor: help;
    border-bottom: 1px dotted var(--color-muted, #8a9c96);
}

.card-section {
    margin-bottom: 32px;
}

.stat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.stat-table td {
    padding: 3px 0;
}

.stat-table td:first-child {
    color: var(--color-muted, #8a9c96);
}

.stat-table td:last-child {
    text-align: right;
    color: var(--color-foreground, #e8eceb);
    font-weight: 500;
}

.form-results {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.form-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.form-w {
    background: rgba(34, 224, 122, 0.2);
    color: #22e07a;
}

.form-l {
    background: rgba(217, 79, 79, 0.2);
    color: #d94f4f;
}

.form-stats {
    font-size: 0.8rem;
    color: var(--color-muted, #8a9c96);
}

.trend-increasing {
    color: #22e07a;
}

.trend-decreasing {
    color: #d94f4f;
}

.trend-stable {
    color: var(--color-muted, #8a9c96);
}

/* ── Career Trajectory ── */
.trajectory-ascending {
    color: #22e07a;
    font-weight: 600;
}

.trajectory-plateaued {
    color: #f59e0b;
    font-weight: 600;
}

.trajectory-declining {
    color: #d94f4f;
    font-weight: 600;
}

.trajectory-insufficient-data {
    color: var(--color-muted, #8a9c96);
    font-style: italic;
}

/* ── Responsive: narrow screens ── */
@media (max-width: 600px) {
    .match-summary {
        gap: 8px;
        padding: 8px 12px;
    }

    .match-players {
        gap: 4px;
        font-size: 0.85rem;
    }

    .match-meta {
        gap: 6px;
        font-size: 0.78rem;
    }

    .match-score {
        padding: 1px 6px;
    }

    .match-status {
        font-size: 0.7rem;
        padding: 1px 6px;
    }

    .match-arrow {
        font-size: 1rem;
    }
}


/* ===========================================================================
   Snooker Home Page (sport toggle & tournament list)
   =========================================================================== */

.snooker-home-section {
    margin-top: 24px;
}

.section-heading {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-foreground, #e8eceb);
    margin: 0 0 16px;
}

.tournament-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tournament-card {
    background: var(--card-bg, #0a1512);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    padding: 14px 18px;
}

.tournament-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tournament-location {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tournament-name {
    font-weight: 600;
    color: var(--color-foreground, #e8eceb);
}

.tournament-dates {
    font-size: 0.85rem;
    color: var(--color-muted, #8a9c96);
}

.tournament-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
}

.tournament-location-info {
    font-size: 0.85rem;
    color: var(--color-muted, #8a9c96);
}

.tournament-stats {
    font-size: 0.8rem;
    color: var(--color-muted-2, #5e716b);
}

.tournament-link {
    flex-shrink: 0;
}

.tournament-btn {
    display: inline-block;
    background: var(--color-accent, #22e07a);
    color: var(--color-bg, #060d0b);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s;
    white-space: nowrap;
}

.tournament-btn:hover {
    background: #2eef88;
}