/**
 * Big Squash - Frontend Styles
 */

/* Tournament Container */
.big-squash-tournament-container {
    max-width: 100%;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* Tournament Header */
.big-squash-tournament-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.big-squash-tournament-header h2 {
    margin: 0 0 10px 0;
    font-size: 2em;
    color: #333;
}

.tournament-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #666;
}

.tournament-info span {
    display: inline-flex;
    align-items: center;
}

.tournament-info span::before {
    content: '•';
    margin-right: 8px;
    color: #1e88e5;
}

.tournament-info span:first-child::before {
    content: '📅';
}

.tournament-info span:last-child::before {
    content: '👥';
}

/* Loading State */
.big-squash-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.big-squash-loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Error State */
.big-squash-error {
    padding: 20px;
    background: #ffebee;
    border: 1px solid #ef5350;
    border-radius: 4px;
    color: #c62828;
}

.big-squash-error p {
    margin: 5px 0;
}

.big-squash-error strong {
    color: #b71c1c;
}

/* Final Standings */
.standings-section {
    margin-top: 32px;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.standings-player {
    white-space: nowrap;
}

@media (min-width: 600px) {
    .standings-table tbody {
        columns: 2;
        column-gap: 16px;
        display: block;
    }

    .standings-row {
        display: inline-table;
        width: 100%;
        break-inside: avoid;
    }
}

@media (min-width: 960px) {
    .standings-table tbody {
        columns: 3;
    }
}

.standings-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    color: #50575e;
    font-size: 13px;
}

.standings-row td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.standings-place {
    width: 40px;
    font-weight: 600;
    color: #757575;
}

.standings-player {
    font-weight: 400;
}

.standings-top-1 .standings-place {
    color: #B10511;
    font-weight: 700;
}

.standings-top-2 .standings-place {
    color: #555;
    font-weight: 700;
}

.standings-top-3 .standings-place {
    color: #8B5E3C;
    font-weight: 700;
}

.standings-top-1 td,
.standings-top-2 td,
.standings-top-3 td {
    font-weight: 500;
}

/* Pending State */
.big-squash-pending {
    padding: 30px;
    text-align: center;
    color: #50575e;
}

.big-squash-pending h3 {
    margin: 0 0 5px 0;
    color: #1d2327;
}

.big-squash-pending__date {
    margin: 0 0 15px 0;
    font-size: 0.9em;
    color: #757575;
}

/* Info State */
.big-squash-info {
    padding: 20px;
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 4px;
    color: #1565c0;
}

.big-squash-info p {
    margin: 5px 0;
}

.big-squash-info strong {
    color: #0d47a1;
}

/* Bracket Navigation */
.big-squash-bracket-nav {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0 -20px 20px -20px;
    padding: 0;
}

/* Adjust for WordPress admin bar when logged in */
.admin-bar .big-squash-bracket-nav {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .big-squash-bracket-nav {
        top: 46px;
    }
}

.bracket-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    list-style-type: none !important;
    list-style: none !important;
    margin: 0;
    padding: 0 20px;
}

.bracket-nav-item {
    margin: 0;
    padding: 0;
    list-style: none !important;
    list-style-type: none !important;
}

.bracket-nav-item::before {
    content: none !important;
    display: none !important;
}

.bracket-nav-link {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.2;
    border-bottom: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bracket-nav-link:hover {
    background-color: #f0f6fc;
    color: #1e88e5;
}

.bracket-nav-link.active {
    color: #1e88e5;
    font-weight: 600;
}

.bracket-nav-link:focus {
    outline: 2px solid #1e88e5;
    outline-offset: -2px;
}

.bracket-nav-link:active {
    background-color: #e3f2fd;
}

/* Brackets Wrapper */
.big-squash-brackets-wrapper {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Individual Bracket */
.big-squash-bracket {
    background: #fafafa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    scroll-margin-top: 35px;
}

/* Adjust scroll margin for admin bar */
.admin-bar .big-squash-bracket {
    scroll-margin-top: 67px;
}

@media screen and (max-width: 782px) {
    .admin-bar .big-squash-bracket {
        scroll-margin-top: 81px;
    }
}

.big-squash-bracket-main {
    border-left: 4px solid #1e88e5;
}

.big-squash-bracket-placement-2 {
    border-left: 4px solid #43a047;
}

.big-squash-bracket-placement-3 {
    border-left: 4px solid #fb8c00;
}

.big-squash-bracket-placement-4 {
    border-left: 4px solid #8e24aa;
}

/* Bracket Title */
.bracket-title {
    margin: 0 0 20px 0;
    font-size: 1.5em;
    color: #333;
    font-weight: 600;
}

/* Bracket Viewer Container */
.bracket-viewer-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

/* Override brackets-viewer styles for better integration */
.brackets-viewer {
    min-width: 100%;
    padding: 10px !important;
}

.bracket {
    margin: 0;
}

/* Hide BYE text for empty future matches */
.brackets-viewer .participant:empty::after {
    content: '';
}

.brackets-viewer .participant-name:empty::after {
    content: '';
}

.brackets-viewer .participant .name:empty::after {
    content: '';
}

/* Hide BYE text specifically */
.brackets-viewer .participant-name {
    font-size: 14px;
}

.brackets-viewer .participant-name:contains("BYE") {
    display: none;
}

/* Alternative: Make BYE invisible */
.brackets-viewer .participant[title="BYE"] .name,
.brackets-viewer .participant .name:contains("BYE") {
    visibility: hidden;
}

/* Match styling enhancements */
.match {
    margin: 10px 0;
}

.participant {
    padding: 8px 12px;
    transition: background-color 0.2s;
}

.participant:hover {
    background-color: #e3f2fd;
}

.participant.win {
    background-color: #c8e6c9;
    font-weight: 600;
}

.participant.loss {
    opacity: 0.6;
}

/* Score styling */
.score {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 3px;
    background: #f5f5f5;
}

/* Responsive Design */

/* Tablet and below */
@media (max-width: 768px) {
    .big-squash-tournament-container {
        padding: 10px;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .big-squash-tournament-header h2 {
        font-size: 1.5em;
    }

    .tournament-info {
        font-size: 13px;
        gap: 15px;
    }

    /* Navigation adjustments for tablets */
    .big-squash-bracket-nav {
        margin: 0 -10px 20px -10px;
        padding: 0;
    }

    .bracket-nav-list {
        flex-wrap: wrap;
        padding: 0 4px;
    }

    .bracket-nav-link {
        padding: 6px 10px;
        font-size: 13px;
        white-space: nowrap;
    }

    .big-squash-brackets-wrapper {
        gap: 30px;
    }

    .big-squash-bracket {
        padding: 10px 0;
        border: none;
        background: none;
        border-left: 4px solid;
        border-radius: 0;
    }

    .bracket-title {
        font-size: 1.3em;
    }

    /* Ensure horizontal scroll on mobile */
    .bracket-viewer-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .big-squash-tournament-container {
        padding: 5px;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .big-squash-tournament-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .big-squash-tournament-header h2 {
        font-size: 1.3em;
    }

    .tournament-info {
        flex-direction: column;
        gap: 8px;
        font-size: 12px;
    }

    /* Navigation adjustments for mobile */
    .big-squash-bracket-nav {
        margin: 0 -5px 15px -5px;
        padding: 0;
    }

    .bracket-nav-list {
        flex-wrap: wrap;
        padding: 0 2px;
    }

    .bracket-nav-link {
        padding: 5px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    .big-squash-brackets-wrapper {
        gap: 20px;
    }

    .big-squash-bracket {
        padding: 5px 0;
        border: none;
        background: none;
        border-left: 4px solid;
        border-radius: 0;
    }

    .bracket-title {
        font-size: 1.1em;
        margin-bottom: 15px;
    }

    /* Smaller participant text on mobile */
    .participant {
        font-size: 14px;
        padding: 6px 10px;
    }

    .score {
        font-size: 13px;
        padding: 3px 6px;
    }
}

/* Print styles */
@media print {
    .big-squash-tournament-container {
        box-shadow: none;
        border: 1px solid #000;
    }

    .big-squash-brackets-wrapper {
        gap: 30px;
    }

    .big-squash-bracket {
        page-break-inside: avoid;
        border: 1px solid #000;
    }

    .bracket-viewer-container {
        overflow: visible;
    }
}

/* Accessibility */
.participant:focus {
    outline: 2px solid #1e88e5;
    outline-offset: 2px;
}

/* Walkover and Bye Styling */

/* Bye slot - empty player position */
.participant-bye {
    font-style: italic;
    color: #888;
    background-color: #f5f5f5;
    text-align: center;
}

/* Player who received a bye */
.participant-bye-winner {
    background-color: #e8f5e9;
}

/* Walkover winner - style participant background */
.participant-walkover-winner {
    background-color: #fff3e0;
}

/* Style the WO result text same as names */
.participant-walkover-winner .result {
    color: #333 !important;
}

/* Ensure match numbers are always visible on top for walkover matches */
.match-status-walkover .opponents > span {
    z-index: 100 !important;
}

/* Also ensure all match labels are on top */
.brackets-viewer .opponents > span {
    z-index: 10;
}

/* Walkover loser - style like bye (forfeited/eliminated) */
.participant-walkover-loser {
    font-style: italic;
    color: #999;
    background-color: #f5f5f5;
    opacity: 0.7;
}

/* Remove match-level badges - we use participant-level badges instead */
.match-status-walkover {
    /* No match-level badge */
}

.match-status-bye {
    /* No match-level badge */
}

/* Matches View */
.big-squash-matches-view {
    padding: 20px 0;
    scroll-margin-top: 35px;
    margin-bottom: 40px;
}

/* Adjust scroll margin for admin bar */
.admin-bar .big-squash-matches-view {
    scroll-margin-top: 67px;
}

@media screen and (max-width: 782px) {
    .admin-bar .big-squash-matches-view {
        scroll-margin-top: 81px;
    }
}

.matches-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.matches-section {
    background: #fff;
    border-radius: 6px;
    padding: 20px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.matches-section-title {
    margin: 0 0 15px 0;
    padding-left: 20px;
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

/* Section-specific colors */
.matches-need-result {
    border-left: 4px solid #f57c00;
}

.matches-need-result .matches-section-title {
    color: #f57c00;
    border-bottom-color: #f57c00;
}

.matches-pending {
}

.matches-pending .matches-section-title {
    color: #2c3e50;
    border-bottom-color: #dee2e6;
}

.matches-finished {
}

.matches-finished .matches-section-title {
    color: #2c3e50;
    border-bottom-color: #dee2e6;
}

.matches-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.match-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 12px 15px;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
}

.match-row:hover {
    background-color: #f5f5f5;
    border-color: #d0d0d0;
    cursor: pointer;
}

.match-number {
    font-weight: 700;
    font-size: 16px;
    color: #333;
    font-family: 'Courier New', monospace;
    text-align: center;
    padding: 6px 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.match-players {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
}

.match-players .player {
    font-size: 15px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-players .player:first-child {
    text-align: right;
}

.match-players .player.winner {
    font-weight: 600;
    color: #2e7d32;
}

.match-players .vs {
    color: #999;
    font-weight: 500;
    font-size: 13px;
    text-align: center;
}

.match-result {
    text-align: right;
    min-width: 150px;
    font-size: 14px;
}

.match-result-winner {
    color: #2e7d32;
    font-weight: 600;
}

.match-result-walkover {
    color: #f57c00;
    font-weight: 600;
}

.match-result-bye {
    color: #999;
    font-style: italic;
}

.match-result-pending {
    color: #1e88e5;
    font-weight: 500;
}

.match-result-needed {
    color: #d63638;
    font-weight: 600;
}

.match-result-in-progress {
    color: #007cba;
    font-weight: 600;
}

/* Court buttons grid */
.court-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.court-button {
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid #2271b1;
    background: #fff;
    color: #2271b1;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.court-button:hover {
    background: #2271b1;
    color: #fff;
}

.court-button.occupied {
    border-color: #dba617;
    color: #dba617;
}

.court-button.occupied::after {
    content: '(in use)';
    display: block;
    font-size: 10px;
    font-weight: 400;
}

.court-button.occupied:hover {
    background: #dba617;
    color: #fff;
}

.court-selection h3 {
    margin: 20px 0 5px;
    font-size: 14px;
    font-weight: 600;
}

/* Responsive adjustments for matches view */
@media (max-width: 768px) {
    .big-squash-matches-view {
        padding: 15px 0;
    }

    .matches-section {
        padding: 15px 0;
    }

    .match-row {
        grid-template-columns: 60px 1fr;
        gap: 10px;
    }

    .match-result {
        grid-column: 2;
        text-align: left;
        margin-top: 5px;
        padding-left: 0;
    }

    .match-number {
        font-size: 14px;
        padding: 4px 8px;
    }

    .match-players {
        grid-template-columns: 1fr auto 1fr;
        gap: 10px;
    }

    .match-players .player {
        font-size: 14px;
    }

    .match-players .vs {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .matches-list {
        gap: 20px;
    }

    .matches-section {
        padding: 12px 0;
    }

    .matches-section-title {
        font-size: 1.1em;
        margin-bottom: 12px;
    }

    .match-row {
        grid-template-columns: 50px 1fr;
        gap: 8px;
        padding: 10px;
    }

    .match-number {
        font-size: 13px;
        padding: 4px 6px;
    }

    .match-players {
        grid-template-columns: 1fr auto 1fr;
        gap: 8px;
    }

    .match-players .player {
        font-size: 13px;
    }

    .match-players .vs {
        font-size: 11px;
    }

    .match-result {
        font-size: 13px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .big-squash-tournament-container {
        background: #1e1e1e;
        color: #e0e0e0;
    }

    .big-squash-tournament-header {
        border-bottom-color: #424242;
    }

    .big-squash-tournament-header h2 {
        color: #e0e0e0;
    }

    .tournament-info {
        color: #b0b0b0;
    }

    /* Navigation dark mode */
    .big-squash-bracket-nav {
        background: #1e1e1e;
        border-bottom-color: #1e88e5;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .bracket-nav-link {
        color: #e0e0e0;
    }

    .bracket-nav-link:hover {
        background-color: #2a2a2a;
        color: #64b5f6;
    }

    .bracket-nav-link.active {
        color: #64b5f6;
        border-bottom-color: #64b5f6;
    }

    .big-squash-bracket {
        background: #2a2a2a;
        border-color: #424242;
    }

    .bracket-title {
        color: #e0e0e0;
    }

    .participant {
        background: #333;
        color: #e0e0e0;
    }

    .participant:hover {
        background-color: #424242;
    }

    .participant.win {
        background-color: #2e7d32;
    }

    .score {
        background: #424242;
    }

    /* Matches view dark mode */
    .big-squash-matches-view {
    }

    .matches-section {
        background: #1e1e1e;
        border-color: #424242;
    }

    .matches-section-title {
        color: #e0e0e0;
    }

    .match-row {
        border-color: #424242;
    }

    .match-row:hover {
        background-color: #2a2a2a;
        border-color: #555;
    }

    .match-number {
        color: #e0e0e0;
        background: #424242;
    }

    .match-players .player {
        color: #e0e0e0;
    }

    .match-players .player.winner {
        color: #66bb6a;
    }
}

/* Country flag icons */
.fi {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    width: 18px;
    height: 13px;
}

/* ===================================
   Finished Matches Card Layout
   =================================== */

.finished-matches-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 10px 0;
}

/* Round Section */
.round-section {
    overflow: hidden;
}

.round-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.round-header:hover {
    background: #e9ecef;
}

.round-header:focus,
.round-header:active {
    background: #e9ecef;
    outline: none;
}

.round-title {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #2c3e50;
}

.round-toggle {
    font-size: 1.2em;
    color: #6c757d;
    transition: transform 0.3s;
}

.round-section.collapsed .round-toggle {
    transform: rotate(-90deg);
}

.round-section.collapsed .round-matches {
    display: none;
}

.round-matches {
    padding: 8px 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Match Card */
.match-card {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.match-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.match-card-header {
    padding: 10px 18px;
    background: #f1f3f5;
    font-weight: 600;
    font-size: 0.9em;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
}

.match-card-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f3f5;
}

.match-card-player:last-of-type {
    border-bottom: none;
}

.match-card-player.winner {
    background: #f0f9ff;
    font-weight: 600;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.player-info .flag {
    flex-shrink: 0;
}

.player-name {
    font-size: 15px;
    color: #2c3e50;
}

.player-seed {
    font-size: 13px;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.winner-check {
    color: #28a745;
    font-size: 18px;
    margin-left: 8px;
}

.player-score {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 400;
    color: #495057;
    min-width: 80px;
    justify-content: flex-end;
}

.game-score-cell {
    display: inline-block;
    width: 28px;
    text-align: center;
}

.match-summary {
    display: none;
}

.game-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.final-score {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

.game-scores {
    font-size: 13px;
    color: #6c757d;
}

.walkover-text,
.bye-text,
.no-score-text {
    font-style: italic;
    color: #6c757d;
    font-size: 14px;
}

/* Responsive Design for Cards */
@media (max-width: 768px) {
    .finished-matches-container {
        gap: 16px;
        padding: 10px 0;
    }

    .round-header {
        padding: 12px 16px;
    }

    .round-title {
        font-size: 1.1em;
    }

    .round-matches {
        padding: 8px 0;
        grid-template-columns: 1fr;
    }

    .match-card-header {
        padding: 8px 14px;
        font-size: 0.85em;
    }

    .match-card-player {
        padding: 12px 14px;
    }

    .player-name {
        font-size: 14px;
    }

    .player-seed {
        font-size: 12px;
        padding: 2px 6px;
    }

    .player-score {
        font-size: 16px;
    }

    .match-summary {
        padding: 10px 14px;
    }
}

@media (max-width: 480px) {
    .match-card-player {
        flex-wrap: wrap;
    }

    .player-info {
        flex: 1 1 100%;
        margin-bottom: 8px;
    }

    .player-score {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Dark mode support for card layout */
@media (prefers-color-scheme: dark) {
    .finished-matches-container {
        color: #e0e0e0;
    }

    .round-section {
    }

    .round-header {
        background: #2a2a2a;
    }

    .round-header:hover {
        background: #333;
    }

    .round-title {
        color: #e0e0e0;
    }

    .round-toggle {
        color: #adb5bd;
    }

    .match-card {
        background: #2a2a2a;
        border-color: #424242;
    }

    .match-card-header {
        background: #1e1e1e;
        color: #adb5bd;
        border-color: #424242;
    }

    .match-card-player {
        border-color: #333;
    }

    .match-card-player.winner {
        background: #1a3a4a;
    }

    .player-name {
        color: #e0e0e0;
    }

    .player-seed {
        background: #424242;
        color: #adb5bd;
    }

    .player-score {
        color: #e0e0e0;
    }

    .match-summary {
        background: #1e1e1e;
        border-color: #424242;
    }

    .final-score {
        color: #e0e0e0;
    }

    .game-scores {
        color: #adb5bd;
    }

    .walkover-text,
    .bye-text,
    .no-score-text {
        color: #adb5bd;
    }
}

/* ===================================
   Players View
   =================================== */

.big-squash-players-view {
    display: none;
}

.players-list {
    max-width: 600px;
}

.players-section-title {
    margin: 0 0 20px 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.players-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.player-card {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.player-card:last-child {
    border-bottom: none;
}

.player-card-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-card-name {
    font-size: 15px;
    color: #2c3e50;
    flex: 1;
}

.player-card-seed {
    font-size: 13px;
    color: #6c757d;
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

/* Dark mode support for Players View */
@media (prefers-color-scheme: dark) {
    .players-section-title {
        color: #e0e0e0;
    }

    .player-card {
        border-bottom-color: #424242;
    }

    .player-card-name {
        color: #e0e0e0;
    }

    .player-card-seed {
        background: #424242;
        color: #adb5bd;
    }
}

/* ===================================
   Tournaments List
   =================================== */

.big-squash-tournaments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 800px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* Tournament Card */
.tournament-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.tournament-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tournament-card--completed {
    border-left: 4px solid #28a745;
}

.tournament-card--in_progress {
    border-left: 4px solid #f57c00;
}

.tournament-card--published {
    border-left: 4px solid #1e88e5;
}

.tournament-card__header {
    padding: 16px 20px;
}

.tournament-card__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.tournament-card__name {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
}

.tournament-card__name a {
    color: inherit;
    text-decoration: none;
}

.tournament-card__name a:hover {
    color: #1e88e5;
}

.tournament-card__status {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tournament-card__status--completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.tournament-card__status--in_progress {
    background: #fff3e0;
    color: #e65100;
}

.tournament-card__status--published {
    background: #e3f2fd;
    color: #1565c0;
}

.tournament-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #6c757d;
}

.tournament-card__meta span {
    display: inline-flex;
    align-items: center;
}

.tournament-card__results {
    display: flex;
    gap: 24px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.tournament-card__results--pending {
    justify-content: center;
}

.tournament-card__in-progress-text {
    font-style: italic;
    color: #6c757d;
    font-size: 14px;
}

.tournament-card__result {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tournament-card__result-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 65px;
}

.tournament-card__result--winner .tournament-card__result-label {
    color: #2e7d32;
}

.tournament-card__result--runner-up .tournament-card__result-label {
    color: #6c757d;
}

.tournament-card__result-player {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .tournament-card__header {
        padding: 14px 16px;
    }

    .tournament-card__title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .tournament-card__name {
        font-size: 1.1em;
    }

    .tournament-card__meta {
        gap: 12px;
        font-size: 12px;
    }

    .tournament-card__results {
        flex-direction: column;
        gap: 8px;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .big-squash-tournaments-list {
        gap: 12px;
    }

    .tournament-card__header {
        padding: 12px 14px;
    }

    .tournament-card__name {
        font-size: 1em;
    }

    .tournament-card__meta {
        gap: 8px;
    }

    .tournament-card__results {
        padding: 8px 14px;
    }

    .tournament-card__result-label {
        font-size: 11px;
        min-width: 55px;
    }

    .tournament-card__result-player {
        font-size: 13px;
    }
}

/* Dark mode for tournaments list */
@media (prefers-color-scheme: dark) {
    .tournament-card {
        background: #2a2a2a;
        border-color: #424242;
    }

    .tournament-card__name {
        color: #e0e0e0;
    }

    .tournament-card__name a:hover {
        color: #64b5f6;
    }

    .tournament-card__status--completed {
        background: #1b3a1b;
        color: #66bb6a;
    }

    .tournament-card__status--in_progress {
        background: #3a2a0a;
        color: #ffb74d;
    }

    .tournament-card__status--published {
        background: #0a2a3a;
        color: #64b5f6;
    }

    .tournament-card__meta {
        color: #adb5bd;
    }

    .tournament-card__results {
        background: #1e1e1e;
        border-color: #424242;
    }

    .tournament-card__in-progress-text {
        color: #adb5bd;
    }

    .tournament-card__result--winner .tournament-card__result-label {
        color: #66bb6a;
    }

    .tournament-card__result--runner-up .tournament-card__result-label {
        color: #adb5bd;
    }

    .tournament-card__result-player {
        color: #e0e0e0;
    }
}

/* ========================================
   Rankings Leaderboard
   ======================================== */

.big-squash-rankings-container {
    max-width: 700px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.bsr-leaderboard {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.bsr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.bsr-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.bsr-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #868e96;
    font-weight: 600;
    white-space: nowrap;
}

.bsr-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f3f5;
}

.bsr-col-rank { width: 45px; text-align: center; }
.bsr-col-rating { width: 90px; }
.bsr-col-matches { width: 60px; text-align: center; }
.bsr-col-trend { width: 55px; text-align: right; }

.bsr-rating-value {
    display: inline-flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
}

.bsr-rating-value .bsr-bars {
    margin-left: 6px;
}

/* Rows */
.bsr-row {
    cursor: pointer;
    transition: background 0.15s;
}

.bsr-row:hover {
    background: #f8f9fa;
}

.bsr-row--expanded {
    background: #f0f6ff;
}

.bsr-row--current-user {
    background: #fffde7;
}

.bsr-row--current-user:hover {
    background: #fff9c4;
}

.bsr-row--inactive {
    opacity: 0.5;
}

/* Top 3 medals */
.bsr-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.bsr-gold { background: linear-gradient(135deg, #f7b733, #d4a017); }
.bsr-silver { background: linear-gradient(135deg, #bdc3c7, #95a5a6); }
.bsr-bronze { background: linear-gradient(135deg, #cd7f32, #a0522d); }

/* Player name */
.bsr-name {
    font-weight: 500;
}

.bsr-inactive-label {
    display: block;
    font-size: 11px;
    color: #adb5bd;
    font-style: italic;
}

/* Confidence bars */
.bsr-bars {
    display: inline-flex;
    gap: 2px;
}

.bsr-bar {
    width: 5px;
    height: 14px;
    border-radius: 1px;
}

.bsr-bar--green { background: #28a745; }
.bsr-bar--yellow { background: #dba617; }
.bsr-bar--empty { background: #dee2e6; }

/* Detail row (expanded) */
.bsr-detail-row td {
    padding: 0;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.bsr-detail-content {
    padding: 12px 16px;
}

.bsr-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bsr-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.bsr-history-name {
    flex: 1;
    font-weight: 500;
}

.bsr-history-date {
    color: #868e96;
    font-size: 12px;
}

.bsr-history-change {
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

.bsr-change--positive { color: #28a745; }
.bsr-change--negative { color: #dc3545; }

.bsr-history-empty {
    color: #adb5bd;
    font-size: 13px;
    text-align: center;
    padding: 8px;
}

/* Toggle button */
.bsr-toggle-inactive {
    display: block;
    width: 100%;
    padding: 10px;
    background: #f8f9fa;
    border: none;
    border-top: 1px solid #e9ecef;
    color: #868e96;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.bsr-toggle-inactive:hover {
    background: #e9ecef;
    color: #495057;
}

/* Empty / Error states */
.bsr-empty, .bsr-error {
    text-align: center;
    padding: 40px 20px;
    color: #868e96;
    font-size: 15px;
}

.bsr-error {
    color: #dc3545;
}

.bsr-detail-matches {
    font-size: 12px;
    color: #868e96;
    margin-bottom: 8px;
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }

    .bsr-table {
        font-size: 13px;
    }

    .bsr-table td, .bsr-table th {
        padding: 8px 6px;
    }

    .bsr-col-rank { width: 30px; }
    .bsr-col-rating { width: auto; }

    .bsr-name {
        font-size: 13px;
    }

    .bsr-history-item {
        font-size: 12px;
    }
}
