/* ============================================
   RESULTS UI — Professional CSS for public pages
   ============================================
   Components: match cards, standings table,
   form badges, sport detail, player stats,
   match popup modal, live detail.

   Prefix: rui-
   Depends on: base.css (tokens), design-system.css
   v3.0 — Professional broadcast-quality design
   ============================================ */


/* ══════════════════════════════════════════
   0.  ANIMATIONS
   ══════════════════════════════════════════ */

@keyframes rui-fade-in {
    from { opacity: 0 }
    to   { opacity: 1 }
}
@keyframes rui-scale-in {
    from { transform: scale(.96); opacity: 0 }
    to   { transform: scale(1);   opacity: 1 }
}
@keyframes rui-pulse-live {
    0%, 100% { opacity: 1 }
    50%      { opacity: .4 }
}
@keyframes rui-shimmer {
    0%   { background-position: 200% 0 }
    100% { background-position: -200% 0 }
}


/* ══════════════════════════════════════════
   1.  MATCH CARD
   ══════════════════════════════════════════ */

.rui-match {
    border: 1px solid var(--color-gray-200, #e5e7eb);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 8px;
    background: var(--surface-card, #fff);
    transition: border-color .15s ease, transform .15s ease;
}

/* ── States ── */
.rui-match-sched {
    padding: 10px 18px;
}

.rui-match-live {
    border-color: #fca5a5;
    border-left: 3px solid #ef4444;
}

.rui-match-fin {
    /* finished: normal card, no extra bg */
}

.rui-match-clickable {
    cursor: pointer;
}

@media (hover: hover) {
    .rui-match:hover {
        border-color: var(--color-gray-400, #9ca3af);
    }
    .rui-match-clickable:hover {
        transform: translateY(-1px);
    }
}

/* ── Top meta bar ── */
.rui-match-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.rui-match-when {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--color-gray-700, #374151);
}

.rui-match-badge {
    font-size: .62rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
}

.rui-match-court {
    background: rgba(59, 130, 246, .08);
    color: #2563eb;
}

.rui-match-stage {
    background: rgba(124, 58, 237, .08);
    color: #7c3aed;
}

.rui-match-detail-hint {
    font-size: .68rem;
    color: var(--color-gray-400, #9ca3af);
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ── Match body grid ── */
.rui-match-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

/* ── Inline layout for scheduled ── */
.rui-match-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Teams ── */
.rui-match-team {
    font-size: .95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rui-match-team-home {
    text-align: right;
}
.rui-match-team-away {
    text-align: left;
}

.rui-match-winner {
    font-weight: 600;
    color: var(--color-gray-900, #111);
}
.rui-match-loser {
    font-weight: 400;
    color: var(--color-gray-400, #9ca3af);
}

/* ── Score block ── */
.rui-match-score {
    text-align: center;
    min-width: 90px;
    background: var(--color-gray-50, #f9fafb);
    border-radius: 10px;
    padding: 6px 14px;
}

.rui-score {
    font-family: 'Bebas Neue', 'DM Sans', sans-serif;
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: .06em;
    line-height: 1;
    color: var(--color-gray-900, #111);
}

.rui-score-live {
    color: #dc2626;
}

.rui-match-live .rui-match-score {
    background: #fef2f2;
}

.rui-score-label {
    display: block;
    font-size: .62rem;
    font-weight: 600;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.rui-score-label-done { color: var(--color-gray-400, #9ca3af); }
.rui-score-label-live {
    color: #dc2626;
    font-weight: 700;
    animation: rui-pulse-live 1.5s infinite;
}

.rui-match-vs {
    font-size: .85rem;
    color: var(--color-gray-300, #d1d5db);
    flex-shrink: 0;
}


/* ── Scheduled match time ── */
.rui-match-time {
    font-size: .85rem;
    font-weight: 700;
    color: var(--color-gray-700);
}


/* ══════════════════════════════════════════
   1b. RESULT CARD (team-profile style)
   ══════════════════════════════════════════ */

.rui-match-result {
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 6px;
    border: 1px solid var(--color-gray-200, #e5e7eb);
    transition: background .12s ease;
}
.rui-match-result-win  {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
}
.rui-match-result-loss {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
}
.rui-match-result-draw {
    background: #f8fafc;
    border-left: 4px solid #94a3b8;
}

.rui-result-score {
    font-family: 'Bebas Neue', 'DM Sans', sans-serif;
    font-size: 1.7rem;
    min-width: 70px;
    text-align: center;
    line-height: 1;
    letter-spacing: .03em;
}
.rui-result-score-win  { color: #15803d; }
.rui-result-score-loss { color: #b91c1c; }
.rui-result-score-draw { color: var(--color-gray-600); }

.rui-result-info { flex: 1; min-width: 0; }
.rui-result-label {
    font-size: .75rem;
    font-weight: 600;
}
.rui-result-label-win  { color: #15803d; }
.rui-result-label-loss { color: #b91c1c; }
.rui-result-label-draw { color: var(--color-gray-600); }

.rui-result-opponent {
    font-size: .9rem;
    font-weight: 600;
    margin-top: 2px;
}

.rui-result-meta {
    font-size: .68rem;
    color: var(--color-gray-400);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rui-result-arrow {
    color: var(--color-gray-400);
    font-size: 1rem;
}


/* ══════════════════════════════════════════
   2.  TEAM LINK
   ══════════════════════════════════════════ */

.rui-team-link {
    color: inherit;
    text-decoration: none;
    transition: color .12s ease;
}
@media (hover: hover) {
    .rui-team-link:hover {
        color: var(--color-primary, #f97316) !important;
        text-decoration: underline;
    }
}


/* ══════════════════════════════════════════
   3.  STANDINGS TABLE
   ══════════════════════════════════════════ */

.rui-standings-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--color-gray-200, #e5e7eb);
    background: var(--surface-card, #fff);
}

.rui-standings {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
    table-layout: fixed;
}

/* Header */
.rui-standings thead th {
    padding: 11px 8px;
    text-align: center;
    font-weight: 500;
    color: var(--color-gray-400, #9ca3af);
    font-size: .62rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 2px solid var(--color-gray-200, #e5e7eb);
    white-space: nowrap;
}

/* Cells */
.rui-standings td {
    padding: 13px 8px;
    border-bottom: 1px solid var(--color-gray-100, #f3f4f6);
    transition: background .12s;
    font-variant-numeric: tabular-nums;
}

.rui-standings tbody tr:last-child td {
    border-bottom: none;
}

@media (hover: hover) {
    .rui-standings tbody tr:hover td {
        background: var(--color-gray-50, #f9fafb);
    }
}

/* Column types */
.rui-col-pos {
    text-align: center;
    width: 44px;
}

.rui-col-team {
    text-align: left;
    font-weight: 500;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rui-col-stat {
    text-align: center;
    white-space: nowrap;
}

.rui-col-pts {
    text-align: center;
    font-family: 'Bebas Neue', 'DM Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: .02em;
}

/* Position badges */
.rui-pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: .72rem;
    font-weight: 600;
}
.rui-pos-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rui-pos-2 { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #fff; }
.rui-pos-3 { background: linear-gradient(135deg, #fdba74, #f97316); color: #fff; }
.rui-pos-rest {
    color: var(--color-gray-400, #9ca3af);
    font-size: .82rem;
    font-weight: 500;
}

/* City subtitle */
.rui-team-city {
    display: block;
    font-size: .62rem;
    font-weight: 400;
    color: var(--color-gray-400);
}

/* Zone indicators via inset box-shadow */
.rui-zone-promo td:first-child { box-shadow: inset 3px 0 0 #059669; }
.rui-zone-baraz td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.rui-zone-releg td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
.rui-zone-advance td:first-child { box-shadow: inset 3px 0 0 transparent; }

/* Highlighted team row */
.rui-row-me {
    outline: 2px solid var(--color-primary, #6366f1);
    background: rgba(99, 102, 241, .04);
}

/* Stat color modifiers */
.rui-stat-win   { color: #059669; font-weight: 500; }
.rui-stat-draw  { color: inherit; }
.rui-stat-loss  { color: #ef4444; }
.rui-stat-diff-pos { color: #059669; font-weight: 500; font-size: .75rem; }
.rui-stat-diff-neg { color: #ef4444; font-weight: 500; font-size: .75rem; }

/* DS mode columns */
.rui-stat-v3 { color: #059669; font-weight: 600; }
.rui-stat-v2 { color: #22c55e; font-weight: 500; }
.rui-stat-p1 { color: #f97316; font-weight: 500; }
.rui-stat-p0 { color: #ef4444; }

/* Relegated team dimming */
.rui-team-relegated { color: var(--color-gray-400); }

/* Zone legend */
.rui-zone-legend {
    display: flex;
    gap: 16px;
    padding: 10px 14px;
    font-size: .68rem;
    color: var(--color-gray-500);
    flex-wrap: wrap;
    border-top: 1px solid var(--color-gray-100, #f3f4f6);
}
.rui-zone-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
    vertical-align: -1px;
    margin-right: 5px;
}
.rui-zone-dot-promo { background: #16a34a; }
.rui-zone-dot-baraz { background: #f59e0b; }
.rui-zone-dot-releg { background: #dc2626; }

/* Zone icons */
.rui-zone-icon {
    font-size: .62rem;
    font-weight: 700;
    margin-left: 2px;
}
.rui-zone-icon-up   { color: #059669; }
.rui-zone-icon-bar  { color: #d97706; }
.rui-zone-icon-down { color: #ef4444; }


/* ══════════════════════════════════════════
   4.  FORM BADGES (V / P / R)
   ══════════════════════════════════════════ */

.rui-form {
    display: flex;
    gap: 3px;
    justify-content: flex-end;
}

.rui-form-badge {
    width: 19px;
    height: 19px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .56rem;
    font-weight: 600;
    color: white;
    line-height: 1;
}
.rui-form-W { background: #16a34a; }
.rui-form-L { background: #dc2626; }
.rui-form-D { background: #9ca3af; }
.rui-form-WD { background: #f59e0b; }
.rui-form-LD { background: #e87964; }


/* ══════════════════════════════════════════
   5.  SPORT DETAIL (bowling duels, darts,
       period scores)
   ══════════════════════════════════════════ */

/* ── Pin/Leg totals header ── */
.rui-detail-header {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 12px 16px;
    background: var(--color-gray-50, #f9fafb);
    border-radius: 10px;
    margin-bottom: 12px;
}
.rui-detail-team-total {
    text-align: center;
}
.rui-detail-team-label {
    font-size: .62rem;
    color: var(--color-gray-400);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.rui-detail-team-value {
    font-family: 'Bebas Neue', 'DM Sans', sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: .02em;
}
.rui-detail-team-value-lead { color: #059669; }
.rui-detail-team-value-trail { color: var(--color-gray-500); }

.rui-detail-sep {
    align-self: center;
    color: var(--color-gray-400);
    font-size: .72rem;
}

/* ── Duel grid ── */
.rui-duel-grid {
    display: grid;
    gap: 2px;
}

.rui-duel-row {
    display: grid;
    grid-template-columns: 1fr 24px 1fr;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 6px;
    align-items: center;
}
.rui-duel-row-alt {
    background: var(--color-gray-50, #f9fafb);
}

.rui-duel-home { text-align: right; }
.rui-duel-away { text-align: left; }
.rui-duel-center {
    text-align: center;
    font-size: .62rem;
    color: var(--color-gray-300);
}

.rui-duel-player { font-size: .82rem; }
.rui-duel-player-win  { font-weight: 700; color: #059669; }
.rui-duel-player-lose { font-weight: 400; color: var(--color-gray-400); }

.rui-duel-score { font-weight: 700; font-size: .95rem; }
.rui-duel-score-win  { color: #059669; }
.rui-duel-score-lose { color: var(--color-gray-400); }

.rui-duel-hcp { font-size: .62rem; opacity: .5; }

.rui-duel-games {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 2px;
    font-size: .62rem;
    color: var(--color-gray-400);
}

.rui-detail-penalties {
    margin-top: 8px;
    text-align: center;
    font-size: .72rem;
    color: #d97706;
}

/* ── Period / Set scores ── */
.rui-sets {
    padding: 10px 14px;
    margin-bottom: 12px;
    background: var(--color-gray-50, #f9fafb);
    border-radius: 10px;
}

.rui-sets-title {
    font-size: .62rem;
    color: var(--color-gray-400);
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: .06em;
}

.rui-sets-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rui-set-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
    padding: 6px 8px;
    background: var(--surface-card, #fff);
    border-radius: 8px;
    border: 1px solid var(--color-gray-200, #e5e7eb);
}

.rui-set-num {
    font-size: .62rem;
    color: var(--color-gray-400);
    margin-bottom: 3px;
}

.rui-set-scores {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.rui-set-score { font-size: 1.05rem; }
.rui-set-score-win  { font-weight: 800; color: #059669; }
.rui-set-score-lose { font-weight: 400; color: var(--color-gray-400); }

.rui-set-colon {
    font-size: .62rem;
    color: var(--color-gray-300);
    margin: 0 1px;
}


/* ══════════════════════════════════════════
   6.  PLAYER STATS TABLE
   ══════════════════════════════════════════ */

.rui-stats-wrap {
    margin-bottom: 16px;
}

/* Team header bar with color dot + score */
.rui-stats-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-gray-200, #e5e7eb);
}
.rui-stats-team-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rui-stats-team-name {
    font-weight: 600;
    font-size: .82rem;
}
.rui-stats-team-score {
    font-family: 'Bebas Neue', 'DM Sans', sans-serif;
    font-size: 1.25rem;
    margin-left: auto;
    letter-spacing: .02em;
}

/* Compact header (label only) */
.rui-stats-header-compact {
    font-size: .72rem;
    font-weight: 600;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 8px;
    padding: 0 2px;
}

/* Shooting summary bar */
.rui-stats-shooting {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 0;
    background: var(--color-gray-50, #f9fafb);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}
.rui-stats-shooting-col {
    text-align: center;
    padding: 8px 6px;
    border-right: 1px solid var(--color-gray-200, #e5e7eb);
}
.rui-stats-shooting-col:last-child {
    border-right: none;
}
.rui-stats-shooting-label {
    font-size: .62rem;
    color: var(--color-gray-400);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.rui-stats-shooting-val {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 2px;
}
.rui-stats-shooting-sub {
    font-size: .62rem;
    color: var(--color-gray-400);
}

/* Stats table */
.rui-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .75rem;
    table-layout: auto;
}

.rui-stats-table thead th {
    padding: 6px 6px;
    text-align: center;
    font-size: .62rem;
    color: var(--color-gray-400);
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 1px solid var(--color-gray-200, #e5e7eb);
    white-space: nowrap;
}
.rui-stats-table thead th:first-child {
    text-align: left;
    padding-left: 2px;
}

.rui-stats-table td {
    padding: 7px 6px;
    text-align: center;
    border-bottom: 1px solid var(--color-gray-100, #f3f4f6);
    font-variant-numeric: tabular-nums;
}
.rui-stats-table td:first-child {
    text-align: left;
    padding-left: 2px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}
.rui-stats-table tbody tr:last-child td {
    border-bottom: none;
}

/* Top scorer highlight */
.rui-stats-top-scorer td {
    background: #fefce8;
}

.rui-stats-star {
    margin-left: 3px;
    font-size: .62rem;
    color: #d97706;
}

.rui-stats-pts-col {
    font-weight: 600;
    font-size: .9rem;
}

.rui-stats-foul-danger {
    color: #dc2626;
    font-weight: 700;
}

/* Totals row */
.rui-stats-totals td {
    font-weight: 600;
    font-size: .75rem;
    padding: 8px 6px;
    background: var(--color-gray-50, #f9fafb);
    border-top: 2px solid var(--color-gray-200, #e5e7eb);
}
.rui-stats-totals td:first-child {
    color: var(--color-gray-500);
    text-transform: uppercase;
    font-size: .62rem;
    letter-spacing: .04em;
}


/* ══════════════════════════════════════════
   6b. LIVE SCORING DETAIL
   ══════════════════════════════════════════ */

.rui-live-scorers {
    margin-bottom: 16px;
}

.rui-live-scorers-title {
    font-size: .62rem;
    font-weight: 600;
    color: var(--color-gray-400);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.rui-live-scorers-title::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    animation: rui-pulse-live 1.5s infinite;
    flex-shrink: 0;
}

.rui-live-scorer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background .12s;
}
.rui-live-scorer:nth-child(odd) {
    background: var(--color-gray-50, #f9fafb);
}

.rui-live-scorer-rank {
    font-size: .68rem;
    font-weight: 700;
    color: var(--color-gray-400);
    min-width: 18px;
    text-align: center;
}

.rui-live-scorer-name {
    flex: 1;
    font-weight: 500;
    font-size: .85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rui-live-scorer-team {
    font-size: .62rem;
    color: var(--color-gray-400);
    font-weight: 500;
}

.rui-live-scorer-pts {
    font-family: 'Bebas Neue', 'DM Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: .02em;
    line-height: 1;
    min-width: 36px;
    text-align: right;
}

.rui-live-scorer-detail {
    font-size: .62rem;
    color: var(--color-gray-400);
    min-width: 80px;
    text-align: right;
}

.rui-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .62rem;
    font-weight: 700;
    background: #dc2626;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
}
.rui-live-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
    animation: rui-pulse-live 1.5s infinite;
}


/* ══════════════════════════════════════════
   7.  MATCH POPUP MODAL
   ══════════════════════════════════════════ */

.rui-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: var(--z-modal-backdrop, 9990);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: rui-fade-in .2s ease;
}

.rui-modal {
    background: var(--surface-card, #fff);
    border-radius: 16px;
    max-width: 840px;
    width: 100%;
    max-height: 88vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: rui-scale-in .2s ease;
    display: flex;
    flex-direction: column;
}

/* Hero header */
.rui-modal-hero {
    color: #fff;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    flex-shrink: 0;
}

.rui-modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 0;
}

.rui-modal-context {
    font-size: .68rem;
    font-weight: 600;
    background: rgba(255, 255, 255, .15);
    padding: 4px 12px;
    border-radius: 20px;
}

.rui-modal-court {
    font-size: .68rem;
    font-weight: 500;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    padding: 3px 10px;
    border-radius: 8px;
    margin-left: 6px;
}

.rui-close {
    background: rgba(255, 255, 255, .15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: background .12s ease;
    flex-shrink: 0;
}
.rui-close:hover {
    background: rgba(255, 255, 255, .3);
}

.rui-modal-date {
    text-align: center;
    font-size: .78rem;
    opacity: .7;
    padding: 6px 20px;
}

/* Score area */
.rui-modal-score-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 16px 24px 20px;
}

.rui-modal-team-block {
    flex: 1;
}
.rui-modal-team-block-home {
    text-align: right;
    padding-right: 20px;
}
.rui-modal-team-block-away {
    text-align: left;
    padding-left: 20px;
}

.rui-modal-team-name {
    font-weight: 700;
    font-size: 1.1rem;
}
.rui-modal-team-name-hl {
    font-weight: 800;
    text-shadow: 0 0 20px rgba(255, 255, 255, .5);
}
.rui-modal-team-name-dim {
    opacity: .65;
}

.rui-modal-team-badge {
    font-size: .62rem;
    opacity: .7;
    margin-top: 2px;
}

.rui-modal-score-block {
    text-align: center;
    min-width: 140px;
}
.rui-modal-score-big {
    font-family: 'Bebas Neue', 'DM Sans', sans-serif;
    font-size: 3.2rem;
    font-weight: 400;
    letter-spacing: .04em;
    line-height: 1;
}

.rui-modal-result-badge {
    font-size: .75rem;
    font-weight: 600;
    margin-top: 6px;
    opacity: .85;
}

.rui-modal-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .68rem;
    font-weight: 700;
    background: #dc2626;
    color: #fff;
    padding: 3px 10px;
    border-radius: 6px;
    margin-top: 6px;
}
.rui-modal-live-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: rui-pulse-live 1.5s infinite;
}

/* Body */
.rui-modal-body {
    max-height: 68vh;
    overflow-y: auto;
    padding: 20px;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.rui-modal-body::-webkit-scrollbar { width: 5px; }
.rui-modal-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.rui-modal-body::-webkit-scrollbar-track { background: transparent; }

.rui-modal-section {
    margin-top: 16px;
    padding-top: 12px;
}

.rui-modal-section-label {
    font-size: .62rem;
    color: var(--color-gray-400);
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.rui-modal-empty {
    text-align: center;
    color: var(--color-gray-400);
    padding: 24px 0;
    font-size: .82rem;
}

.rui-modal-loading {
    text-align: center;
    padding: 24px;
    color: var(--color-gray-400);
    font-size: .82rem;
    min-height: 80px;
}

.rui-modal-error {
    text-align: center;
    padding: 16px;
    color: #dc2626;
    font-size: .82rem;
}

/* Smooth stats appearance */
.rui-stats-fadein {
    animation: rui-fade-in .25s ease;
}


/* ══════════════════════════════════════════
   7b. H2H CROSS TABLE
   ══════════════════════════════════════════ */

.rui-h2h-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    margin-bottom: 4px;
    padding: 6px 14px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--color-gray-500, #6b7280);
    cursor: pointer;
    border-radius: 8px;
    transition: background .12s ease, color .12s ease;
    user-select: none;
}
.rui-h2h-toggle:hover {
    background: var(--color-gray-100, #f3f4f6);
    color: var(--color-gray-700, #374151);
}
.rui-h2h-chevron {
    font-size: .68rem;
    transition: transform .15s ease;
}

.rui-h2h-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 16px;
    border-radius: 12px;
    border: 1px solid var(--color-gray-200, #e5e7eb);
    background: var(--surface-card, #fff);
}

.rui-h2h {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}

.rui-h2h thead th {
    padding: 10px 8px;
    font-size: .62rem;
    font-weight: 600;
    color: var(--color-gray-400, #9ca3af);
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid var(--color-gray-200, #e5e7eb);
    white-space: nowrap;
}

.rui-h2h td {
    border-bottom: 1px solid var(--color-gray-100, #f3f4f6);
}

.rui-h2h tbody tr:last-child td {
    border-bottom: none;
}

.rui-h2h-pos {
    text-align: center;
    padding: 8px 8px;
    font-weight: 600;
    color: var(--color-gray-400);
    width: 32px;
}

.rui-h2h-team {
    text-align: left;
    padding: 8px 10px;
    font-weight: 600;
    white-space: nowrap;
    min-width: 90px;
}

.rui-h2h-num {
    text-align: center;
    min-width: 52px;
    padding: 10px 4px;
}

.rui-h2h-pts {
    text-align: center;
    padding: 8px 10px;
    font-family: 'Bebas Neue', 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: .02em;
}

thead .rui-h2h-pts {
    font-family: inherit;
    font-size: .62rem;
    font-weight: 600;
}

.rui-h2h-cell {
    text-align: center;
    padding: 6px 6px;
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    transition: transform .1s ease;
    border-radius: 0;
}

.rui-h2h-self {
    text-align: center;
    padding: 6px 6px;
    background: var(--color-gray-50, #f9fafb);
    color: var(--color-gray-300);
    font-size: .68rem;
}

.rui-h2h-win {
    background: #f0fdf4;
    color: #15803d;
    font-weight: 700;
}

.rui-h2h-loss {
    background: #fef2f2;
    color: #b91c1c;
    font-weight: 500;
}

.rui-h2h-draw {
    background: #fefce8;
    color: #854d0e;
    font-weight: 600;
}

.rui-h2h-live {
    background: #fef2f2;
    color: #dc2626;
    font-weight: 700;
    animation: rui-pulse-live 2s infinite;
}

.rui-h2h-empty {
    color: var(--color-gray-300);
}

@media (hover: hover) {
    .rui-h2h-cell[data-match-id]:hover {
        transform: scale(1.08);
        box-shadow: 0 2px 8px rgba(0,0,0,.1);
        border-radius: 4px;
        z-index: 1;
        position: relative;
    }
    .rui-h2h tbody tr:hover td {
        background: var(--color-gray-50, #f9fafb);
    }
    .rui-h2h tbody tr:hover .rui-h2h-win { background: #dcfce7; }
    .rui-h2h tbody tr:hover .rui-h2h-loss { background: #fee2e2; }
    .rui-h2h tbody tr:hover .rui-h2h-draw { background: #fef9c3; }
}


/* ══════════════════════════════════════════
   8.  DARK MODE
   ══════════════════════════════════════════ */

body.dark-mode .rui-match,
body.dark-mode .rui-match-result {
    background: #1a1a2e;
    border-color: #2a2a3a;
}
body.dark-mode .rui-match-score {
    background: #151525;
}
body.dark-mode .rui-standings-wrap {
    background: #1a1a2e;
    border-color: #2a2a3a;
}
body.dark-mode .rui-standings td {
    border-color: #222235;
}
body.dark-mode .rui-set-pill {
    background: #1a1a2e;
    border-color: #2a2a3a;
}
body.dark-mode .rui-detail-header,
body.dark-mode .rui-sets,
body.dark-mode .rui-stats-shooting,
body.dark-mode .rui-stats-totals td {
    background: #151525;
}
body.dark-mode .rui-modal {
    background: #1e1e30;
}
body.dark-mode .rui-stats-top-scorer td {
    background: #2a2a1e;
}
body.dark-mode .rui-match-result-win {
    background: #0a2e1a;
}
body.dark-mode .rui-match-result-loss {
    background: #2e0a0a;
}
body.dark-mode .rui-match-live .rui-match-score {
    background: #2e0a0a;
}


/* ══════════════════════════════════════════
   9.  RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 640px) {
    .rui-match {
        padding: 10px 12px;
    }
    .rui-match-team {
        font-size: .82rem;
    }
    .rui-score {
        font-size: 1.5rem;
    }
    .rui-match-score {
        min-width: 70px;
        padding: 4px 10px;
    }

    .rui-standings {
        font-size: .72rem;
        table-layout: auto;
        min-width: 500px;
    }
    .rui-standings thead th,
    .rui-standings td {
        padding: 9px 5px;
    }
    .rui-col-team {
        max-width: 110px;
        min-width: 80px;
    }
    .rui-col-pos {
        width: 34px;
    }
    .rui-pos-badge {
        width: 22px;
        height: 22px;
        font-size: .62rem;
    }

    .rui-modal-score-big {
        font-size: 2.2rem;
    }
    .rui-modal-team-name {
        font-size: .92rem;
    }
    .rui-modal-score-area {
        padding: 12px 12px 16px;
    }
    .rui-modal-team-block-home { padding-right: 12px; }
    .rui-modal-team-block-away { padding-left: 12px; }
    .rui-modal-score-block { min-width: 110px; }

    .rui-detail-header {
        gap: 16px;
        padding: 10px 12px;
    }

    .rui-set-pill {
        min-width: 38px;
        padding: 4px 6px;
    }
    .rui-set-score {
        font-size: .95rem;
    }

    .rui-duel-row {
        padding: 6px 6px;
    }
    .rui-duel-player {
        font-size: .72rem;
    }
    .rui-duel-score {
        font-size: .82rem;
    }

    .rui-live-scorer-pts {
        font-size: 1.2rem;
    }
    .rui-live-scorer-detail {
        display: none;
    }

    .rui-stats-table td:first-child {
        max-width: 120px;
    }
    .rui-stats-table {
        font-size: .7rem;
    }
}