/* Round Robin — league standings + matchday tabs.
   Uses ATS brand tokens from variables.css; table→card pattern from results.css. */

.rr-page {
    max-width: var(--results-content-max);
    margin: 0 auto;
}

.event-filter {
    max-width: var(--results-content-max);
    margin: 0 auto 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-filter label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.rr-section {
    margin-bottom: 1.75rem;
}

.rr-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.6rem;
}

.rr-section-head h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-lg);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-dark);
}

.rr-table-note {
    margin: 0.6rem 0.9rem 0.8rem;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.rr-page abbr {
    text-decoration: none;
    cursor: help;
}

.rr-seg-btn:focus-visible,
.rr-tab:focus-visible,
.rr-match-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* --- Segmented control (standings table picker) --- */
.rr-seg {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--bg-muted);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.rr-seg-btn {
    padding: 0.35rem 0.85rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.rr-seg-btn:hover {
    color: var(--primary-dark);
}

.rr-seg-btn[aria-selected="true"] {
    background: var(--primary-gradient);
    color: var(--text-on-primary);
    box-shadow: var(--shadow-sm);
}

/* --- Standings table --- */
.rr-table-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.rr-standings-table {
    min-width: 0;
}

.rr-standings-table th.col-num,
.rr-standings-table td.rr-stat,
.rr-standings-table th.col-total,
.rr-standings-table td.total-cell {
    width: 4rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.rr-standings-table th.col-rank,
.rr-standings-table td.rank-cell {
    width: 4rem;
    text-align: center;
    font-weight: 700;
}

.rr-standings-table td.rr-stat-score {
    color: var(--text-secondary);
}

/* Points and set scores use the heading font, not Orbitron: its slashed 0
   reads as a "no" sign (⊘), and 0 is a common value here. */
.rr-standings-table td.total-cell strong {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.rr-standings-table .club-info {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.rr-standings-table .club-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-main);
}

/* --- Matchday tabs --- */
.rr-tabs {
    display: flex;
    align-items: stretch;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 3px 3px 0.5rem;
    margin: 0 -3px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

/* Fade the strip's edges when there are more days off-screen (js toggles
   .can-scroll-left / .can-scroll-right). */
.rr-tabs {
    --fade-l: 0px;
    --fade-r: 0px;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
}

.rr-tabs.can-scroll-left { --fade-l: 2.5rem; }
.rr-tabs.can-scroll-right { --fade-r: 2.5rem; }

.rr-tab-group-label {
    flex: 0 0 auto;
    align-self: center;
    padding: 0 0.15rem 0 0.6rem;
    border-left: 2px solid var(--border-strong);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
}

.rr-tab-group-label:first-child {
    padding-left: 0;
    border-left: 0;
}

.rr-tab {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-width: 4.25rem;
    padding: 0.45rem 0.7rem;
    background: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

/* Day colours: --md is the day's colour (tokens --day-1 … --day-10), used by
   the selected tab and its panel heading. */
.rr-day-1 { --md: var(--day-1); }
.rr-day-2 { --md: var(--day-2); }
.rr-day-3 { --md: var(--day-3); }
.rr-day-4 { --md: var(--day-4); }
.rr-day-5 { --md: var(--day-5); }
.rr-day-6 { --md: var(--day-6); }
.rr-day-7 { --md: var(--day-7); }
.rr-day-8 { --md: var(--day-8); }
.rr-day-9 { --md: var(--day-9); }
.rr-day-10 { --md: var(--day-10); }

/* Only the selected day is coloured; the other tabs keep the plain style. */
.rr-tab[class*="rr-day-"][aria-selected="true"] {
    background: var(--md);
    border-color: var(--md);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--md) 35%, transparent);
}

.rr-tab[class*="rr-day-"][aria-selected="true"] .rr-tab-round,
.rr-tab[class*="rr-day-"][aria-selected="true"] .rr-tab-date {
    color: var(--text-on-primary);
}

.rr-md-panel[class*="rr-day-"] .rr-md-head {
    padding-left: 0.6rem;
    border-left: 4px solid var(--md);
}

.rr-md-panel[class*="rr-day-"] .rr-md-title {
    color: var(--md);
}

.rr-tab:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.rr-tab-round {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-base);
    line-height: 1.1;
}

.rr-tab-date {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
}

.rr-tab--done .rr-tab-round {
    color: var(--primary-dark);
}

.rr-tab[aria-selected="true"] {
    background: var(--primary-gradient);
    border-color: transparent;
    color: var(--text-on-primary);
    box-shadow: var(--shadow-md);
}

.rr-tab[aria-selected="true"] .rr-tab-round {
    color: var(--text-on-primary);
}

.rr-tab[aria-selected="true"] .rr-tab-date {
    color: rgba(255, 255, 255, 0.8);
}

.rr-live-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 0 2px var(--bg-card);
    animation: rr-pulse 1.6s ease-in-out infinite;
}

@keyframes rr-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* --- Matchday panel --- */
.rr-md-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.75rem;
    margin: 0.6rem 0 0.65rem;
}

.rr-md-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-base);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-dark);
}

.rr-md-date {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.rr-md-progress {
    margin-left: auto;
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.rr-match-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
    align-items: start;
    gap: 0.65rem;
}

/* --- Match card --- */
.rr-match {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}

.rr-match:hover {
    box-shadow: var(--shadow-md);
}

.rr-match--live {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color), var(--shadow-sm);
}

.rr-match--hidden {
    border-style: dashed;
    opacity: 0.65;
}

.rr-match-toggle {
    position: relative;
    display: grid;
    gap: 0.4rem;
    width: 100%;
    padding: 0.75rem 0.9rem;
    margin: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.rr-match-head--static {
    cursor: default;
}

.rr-match-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.6rem;
    padding-right: 1.5rem;
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.rr-status {
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--bg-muted);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rr-status--final {
    background: var(--bg-accent-tint);
    color: var(--primary-dark);
}

.rr-status--live {
    background: var(--accent-color);
    color: var(--text-on-primary);
}

.rr-status--draw {
    background: var(--gold-soft);
    color: #92400e;
}

.rr-status--hidden {
    background: var(--text-muted);
    color: var(--text-on-primary);
}

.rr-side {
    display: grid;
    grid-template-columns: 2.6rem minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.6rem;
}

/* Team logo in the match card header (ianseo Flags). Fixed box so the card
   doesn't shift while it loads. */
.rr-logo {
    display: block;
    width: 2.6rem;
    height: 2.2rem;
    object-fit: contain;
}

.rr-side .club-code {
    text-align: center;
}

.rr-side-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-main);
}

.rr-side-score {
    grid-column: 4;
    min-width: 1.75rem;
    text-align: right;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.rr-side.is-winner .rr-side-name {
    font-weight: 700;
}

.rr-side.is-winner .rr-side-score {
    color: var(--accent-color);
}

.rr-match-chevron {
    position: absolute;
    top: 0.65rem;
    right: 0.9rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.rr-match-chevron::before {
    content: '▾';
}

.rr-match.is-open .rr-match-chevron {
    transform: rotate(180deg);
}

/* --- Match detail (end-by-end) --- */
.rr-match-detail {
    padding: 0.75rem 0.9rem 0.9rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-muted);
}

.rr-ends-wrap {
    overflow-x: auto;
}

.rr-ends-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.rr-ends-table th,
.rr-ends-table td {
    padding: 0.3rem 0.35rem;
    text-align: center;
    vertical-align: top;
}

.rr-ends-table thead th {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.rr-ends-table tbody tr + tr {
    border-top: 1px solid var(--border-subtle);
}

.rr-ends-table .rr-ends-team {
    text-align: left;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--primary-dark);
    white-space: nowrap;
}

.rr-end-total {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-main);
}

.rr-end-sp {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.rr-end-sp[data-sp="2"] {
    color: var(--primary-color);
    font-weight: 700;
}

.rr-ends-sum {
    font-weight: 700;
    font-size: var(--text-sm);
}

.rr-ends-sets {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-secondary);
}

.rr-ends-table tr.is-winner .rr-ends-sets {
    color: var(--accent-color);
}

/* --- Match detail: every arrow, end by end --- */
.rr-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.rr-arrows-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: var(--bg-card);
    font-variant-numeric: tabular-nums;
}

/* Scorecard grid (matches scorecard.css): every arrow in its own cell. */
.rr-arrows-table th,
.rr-arrows-table td {
    padding: 0.3rem 0;
    text-align: center;
    vertical-align: middle;
    border: 1px solid var(--border-subtle);
}

.rr-arrows-table thead th {
    background: var(--bg-muted);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-strong);
}

.rr-arrows-table thead .rr-arrows-endno { width: 1.7rem; }
.rr-arrows-table thead .rr-ends-team { width: 2.5rem; }
.rr-arrows-table thead .rr-ends-sum-head { width: 2.2rem; }
.rr-arrows-table thead .rr-ends-pts-head { width: 1.8rem; }

.rr-arrows-table .rr-ends-team {
    padding-left: 0.3rem;
    text-align: left;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--primary-dark);
    white-space: nowrap;
    overflow: hidden;
}

/* A heavier rule between ends so each end reads as one block. */
.rr-arrows-end + .rr-arrows-end tr:first-child > * {
    border-top: 2px solid var(--border-strong);
}

/* The end being shot in a live match. */
.rr-arrows-end.is-current-end .rr-arrows-endno {
    background: var(--accent-color);
    color: var(--text-on-primary);
}

.rr-current-end {
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--accent-color);
    color: var(--accent-color);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rr-arrows-endno {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--text-muted);
    background: var(--bg-muted);
}

.rr-arrow {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.rr-arrow.score-x {
    font-weight: 800;
    color: var(--accent-color);
}

.rr-arrow.score-m {
    font-style: italic;
    color: var(--text-muted);
    background: var(--bg-muted);
}

/* Arrow cells filled with the ring they hit. Text colour is picked per ring
   for contrast (dark on gold/red/blue/white, white on black). */
.rr-arrow.rr-ring-gold  { background: var(--ring-gold);  color: var(--text-main); }
.rr-arrow.rr-ring-red   { background: var(--ring-red);   color: var(--text-main); }
.rr-arrow.rr-ring-blue  { background: var(--ring-blue);  color: var(--text-main); }
.rr-arrow.rr-ring-black { background: var(--ring-black); color: var(--text-on-primary); }
.rr-arrow.rr-ring-white { background: var(--ring-white); color: var(--text-main); }
.rr-arrow.rr-ring-miss  { background: var(--ring-miss);  color: var(--text-main); font-style: italic; }

/* X keeps its emphasis inside the gold ring. */
.rr-arrow.score-x.rr-ring-gold {
    color: var(--accent-hover);
}

.rr-arrows-table .rr-ends-sum {
    background: var(--bg-muted);
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--text-main);
}

.rr-arrows-table .rr-ends-sets {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-base);
    color: var(--text-muted);
}

.rr-arrows-table tr.is-end-winner .rr-ends-team,
.rr-arrows-table tr.is-end-winner .rr-ends-sum {
    color: var(--primary-dark);
}

.rr-arrows-table tr.is-end-winner .rr-ends-sets {
    color: var(--accent-color);
}

.rr-arrows-table tr:not(.is-end-winner) .rr-ends-team {
    color: var(--text-secondary);
    font-weight: 600;
}

.rr-so-marks {
    text-align: left !important;
    letter-spacing: 0.1em;
}

.rr-so-mark {
    display: inline-block;
    width: 1.35rem;
    text-align: center;
    font-weight: 800;
    font-size: var(--text-sm);
}

.rr-so-hit {
    color: var(--primary-color);
}

.rr-so-miss {
    color: var(--accent-color);
}

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

.rr-so-closest {
    margin-left: 0.1rem;
    text-decoration: none;
    color: var(--accent-color);
}

.rr-arrows-legend {
    margin: 0.4rem 0 0;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* --- Awards of the day (APL daily awards, picked in ianseo) --- */
.rr-awards {
    margin-top: 1rem;
}

.rr-awards-title {
    margin: 0 0 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-base);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-dark);
}

.rr-awards-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Four categories: 2 x 2 from tablet width up (four across wraps the labels). */
@media (min-width: 640px) {
    .rr-awards-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.rr-award {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--gold-accent);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.rr-award-photo {
    flex: 0 0 auto;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    background: var(--bg-muted);
}

.rr-award-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.rr-award-cat {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #92400e;
}

.rr-award-name {
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--text-main);
}

.rr-award-team {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.rr-award-logo {
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2rem;
    object-fit: contain;
}

/* --- Team panel (tap a team name in the standings) --- */
.rr-team-link {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.rr-team-link .club-name {
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
    text-underline-offset: 3px;
}

.rr-team-link:hover .club-name {
    color: var(--primary-color);
    text-decoration-color: var(--primary-color);
}

.rr-team-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.rr-team-dialog {
    width: min(26rem, calc(100vw - 2rem));
    max-height: min(40rem, calc(100vh - 3rem));
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: var(--shadow-hover);
    overflow: hidden;
}

.rr-team-dialog[open] {
    display: flex;
    flex-direction: column;
}

.rr-team-dialog::backdrop {
    background: rgba(15, 43, 25, 0.55);
}

.rr-team-dialog-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.rr-team-dialog-head h3 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-lg);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary-dark);
}

.rr-dialog-close {
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 50%;
    background: var(--bg-muted);
    color: var(--text-secondary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.rr-dialog-close:hover {
    background: var(--border-subtle);
    color: var(--text-main);
}

.rr-team-dialog-body {
    padding: 0.25rem 1rem 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.rr-squad-div {
    margin: 0.9rem 0 0.4rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.rr-squad {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rr-archer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rr-archer-photo {
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;   /* portrait photos: keep the face */
    background: var(--bg-muted);
}

.rr-archer-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-dark);
}

.rr-archer-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.rr-archer-name {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-main);
}

.rr-archer-style {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

/* Phones: slide-up bottom sheet. */
@media (max-width: 768px) {
    .rr-team-dialog {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        margin: auto 0 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
}

/* --- Phone: standings stay a compact league table ---
   results.css turns ranking rows into cards under 768px. For a 6–8 team
   league that's a screen of cards before the matches, so here the table is
   kept and tightened instead: one 40px row per team, every column visible. */
@media (max-width: 768px) {
    .rr-table-panel .table-wrapper {
        padding: 0;
        overflow: hidden;
    }

    .results-table.rr-standings-table {
        display: table;
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
        background: var(--bg-card);
    }

    .results-table.rr-standings-table thead {
        display: table-header-group;
    }

    .results-table.rr-standings-table tbody {
        display: table-row-group;
    }

    .results-table.rr-standings-table tbody tr.athlete-row {
        display: table-row;
        padding: 0;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .results-table.rr-standings-table th,
    .results-table.rr-standings-table td {
        display: table-cell;
        position: static;
        padding: 0.55rem 0.2rem;
        margin: 0;
        border: 0;
        border-bottom: 1px solid var(--border-subtle);
        vertical-align: middle;
        text-align: center;
        font-size: var(--text-sm);
    }

    .results-table.rr-standings-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .results-table.rr-standings-table thead th {
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
        font-family: var(--font-heading);
        font-size: var(--text-xs);
        letter-spacing: 0.04em;
    }

    .results-table.rr-standings-table th.col-rank { width: 2rem; }
    .results-table.rr-standings-table th.col-num { width: 1.85rem; }
    .results-table.rr-standings-table th.col-total { width: 2.4rem; }

    .results-table.rr-standings-table td.rank-cell {
        width: auto;
        font-weight: 700;
        color: var(--text-secondary);
    }

    .results-table.rr-standings-table th.col-team,
    .results-table.rr-standings-table td.team-cell {
        text-align: left;
        padding-left: 0.1rem;
    }

    .results-table.rr-standings-table td.rr-stat,
    .results-table.rr-standings-table td.total-cell {
        width: auto;
        font-weight: 600;
        color: var(--text-main);
    }

    .results-table.rr-standings-table .club-info {
        flex-wrap: nowrap;
        gap: 0.4rem;
    }

    .results-table.rr-standings-table .club-code {
        flex: 0 0 auto;
        padding: 1px 4px;
        font-size: 0.68rem;
    }

    .rr-standings-table .club-code::after {
        content: none;
    }

    .results-table.rr-standings-table .club-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: var(--text-sm);
    }

    .results-table.rr-standings-table td.total-cell strong {
        font-size: var(--text-lg);
    }

    .rr-md-progress {
        margin-left: 0;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rr-live-dot {
        animation: none;
    }

    .rr-tab,
    .rr-match-chevron {
        transition: none;
    }
}

/* --- Admin: match visibility --- */

.admin-match-control {
    background: var(--gold-soft);
    border: 2px solid #fcd34d;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.admin-match-control h3 {
    margin-top: 0;
    color: #92400e;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: var(--text-sm);
}

.admin-match-control p {
    color: #92400e;
    margin-bottom: 1rem;
    font-size: var(--text-sm);
}

.match-visibility-grid {
    margin-bottom: 1.5rem;
}

.match-visibility-item {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.match-visibility-label {
    cursor: pointer;
    margin: 0;
}

.match-visibility-cb {
    margin-right: 0.75rem;
    transform: scale(1.2);
    accent-color: var(--primary-color);
}

.match-title {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.match-details {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.admin-actions {
    margin-top: 1rem;
}

.admin-button {
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: var(--text-on-primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background-color 0.2s, transform 0.15s;
    box-shadow: var(--shadow-sm);
}

.admin-button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

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

.match-visibility-label {
    display: flex;
    align-items: flex-start;
}

.match-title,
.match-details {
    display: block;
}
