/* New results.css - Styled with green theme and accordion fixes */

.results-division-block {
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.division-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--deep-forest-green, #1E3A1B);
    color: #fff;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
}

.division-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-family: var(--font-headline);
    font-weight: 700;
}

.details-toggle-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.details-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.table-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

.results-division-block.active .table-wrapper {
    max-height: 5000px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

.results-table th {
    background-color: #f4f6f5;
    padding: 0.8rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
}

.results-table td {
    padding: 0.9rem 1rem;
    vertical-align: top;
    border-bottom: 1px solid #dee2e6;
}

.results-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.col-rank { text-align: center; width: 8%; }
.col-athlete { width: 25%; }
.col-total { text-align: left; width: 20%; }
.col-10x { text-align: center; width: 12%; min-width: 60px; }

.athlete-primary {
    display: flex;
    align-items: center;
    font-weight: 500;
    margin-bottom: 4px;
}

.athlete-primary a {
    color: var(--text-primary);
    text-decoration: none;
}
.athlete-primary a:hover {
    text-decoration: underline;
    color: var(--target-red);
}

.athlete-details {
    display: none;
    font-size: 0.85rem;
    color: #6c757d;
    padding-left: 34px;
}

.results-division-block.details-visible .athlete-details {
    display: block;
}

/* --- MOBILE STYLES FOR FULL CONTENT VISIBILITY --- */
@media (max-width: 768px) {
    .results-division-block {
        margin-bottom: 0.5rem; /* Reduced from 1rem */
        border-radius: 6px; /* Reduced from 8px */
    }
    
    .division-header {
        padding: 0.4rem 0.8rem; /* Reduced from 0.6rem 1rem */
        flex-direction: column;
        gap: 0.3rem; /* Reduced from 0.5rem */
        text-align: center;
    }
    
    .division-header h2 {
        font-size: 0.95rem; /* Reduced from 1rem */
        margin-bottom: 0.3rem; /* Reduced from 0.5rem */
    }
    
    .details-toggle-btn {
        padding: 0.3rem 0.6rem; /* Reduced from 0.4rem 0.8rem */
        font-size: 0.75rem; /* Reduced from 0.8rem */
        width: 100%;
        max-width: 180px; /* Reduced from 200px */
    }
    
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0;
        border-radius: 0;
    }
    
    .results-table {
        width: 100% !important;
        min-width: auto !important;
        font-size: 0.8rem; /* Reduced from 0.85rem */
        table-layout: fixed;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.4rem 0.25rem !important; /* Reduced from 0.5rem 0.3rem */
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        display: table-cell !important;
    }
    
    /* Force column widths and visibility on mobile */
    .results-table .col-rank,
    .results-table th:nth-child(1),
    .results-table td:nth-child(1) { 
        width: 15% !important;
        text-align: center !important;
        display: table-cell !important;
    }
    
    .results-table .col-athlete,
    .results-table th:nth-child(2),
    .results-table td:nth-child(2) { 
        width: 50% !important;
        display: table-cell !important;
    }
    
    .results-table .col-total,
    .results-table th:nth-child(3),
    .results-table td:nth-child(3) { 
        width: 20% !important;
        text-align: center !important;
        display: table-cell !important;
    }
    
    .results-table .col-10x,
    .results-table th:nth-child(4),
    .results-table td:nth-child(4) { 
        width: 18% !important;
        min-width: 50px !important;
        text-align: center !important;
        display: table-cell !important;
    }
    
    /* Ensure any additional columns are visible */
    .results-table .col-x,
    .results-table th:nth-child(5),
    .results-table td:nth-child(5) {
        display: table-cell !important;
        width: 15% !important;
        text-align: center !important;
    }
    
    .athlete-primary {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem; /* Reduced from 0.3rem */
    }
    
    .athlete-details {
        padding-left: 0;
        margin-top: 0.2rem; /* Reduced from 0.3rem */
        font-size: 0.7rem; /* Reduced from 0.75rem */
        line-height: 1.2; /* Reduced from 1.3 */
    }
    
    /* Make athlete names shorter on mobile */
    .athlete-primary a {
        font-size: 0.8rem; /* Reduced from 0.85rem */
        line-height: 1.1; /* Reduced from 1.2 */
    }
    
    /* Control panel mobile optimization */
    .control-panel {
        padding: 0.6rem 0.8rem; /* Reduced from 0.8rem 1rem */
        margin-bottom: 1rem; /* Reduced from 1.5rem */
    }
    
    .control-panel h3 {
        font-size: 1rem; /* Reduced from 1.1rem */
        margin-bottom: 0.6rem; /* Reduced from 0.8rem */
    }
    
    .division-controls {
        gap: 0.6rem; /* Reduced from 0.8rem */
    }
    
    .control-item {
        flex: 1;
        min-width: 120px;
    }
    
    .control-panel-actions {
        margin-top: 0.8rem; /* Reduced from 1rem */
        padding-top: 0.8rem; /* Reduced from 1rem */
    }
    
    /* Navigation mobile optimization */
    .results-nav {
        margin-bottom: 1rem; /* Reduced from 1.5rem */
        gap: 0.3rem; /* Reduced from 0.5rem */
    }
    
    .results-nav a {
        padding: 0.5rem 0.8rem; /* Reduced from 0.6rem 1rem */
        font-size: 0.9rem; /* Reduced from default */
    }
    
    /* Results page header optimization */
    .results-page-header {
        margin-bottom: 0.8rem; /* Reduced from 1rem */
        padding-bottom: 0.5rem; /* Reduced from 0.75rem */
    }
    
    .back-link {
        font-size: 0.85rem; /* Reduced from 0.9rem */
        padding: 0.4rem 0; /* Reduced from 0.5rem */
    }
}

/* --- SMALL MOBILE STYLES (under 480px) --- */
@media (max-width: 480px) {
    .results-division-block {
        margin-bottom: 0.3rem; /* Further reduced from 0.5rem */
        border-radius: 4px; /* Reduced from 6px */
    }
    
    .division-header {
        padding: 0.3rem 0.6rem; /* Further reduced from 0.4rem 0.8rem */
    }
    
    .division-header h2 {
        font-size: 0.85rem; /* Further reduced from 0.9rem */
    }
    
    .details-toggle-btn {
        padding: 0.25rem 0.5rem; /* Further reduced from 0.3rem 0.6rem */
        font-size: 0.7rem; /* Further reduced from 0.75rem */
        max-width: 150px; /* Reduced from 180px */
    }
    
    .results-table {
        font-size: 0.75rem; /* Reduced from 0.8rem */
    }
    
    .results-table th,
    .results-table td {
        padding: 0.3rem 0.2rem !important; /* Further reduced from 0.4rem 0.25rem */
    }
    
    /* Force column widths on small mobile */
    .results-table .col-rank,
    .results-table th:nth-child(1),
    .results-table td:nth-child(1) { 
        width: 12% !important;
        display: table-cell !important;
    }
    
    .results-table .col-athlete,
    .results-table th:nth-child(2),
    .results-table td:nth-child(2) { 
        width: 53% !important;
        display: table-cell !important;
    }
    
    .results-table .col-total,
    .results-table th:nth-child(3),
    .results-table td:nth-child(3) { 
        width: 20% !important;
        display: table-cell !important;
    }
    
    .results-table .col-10x,
    .results-table th:nth-child(4),
    .results-table td:nth-child(4) { 
        width: 18% !important;
        min-width: 45px !important;
        text-align: center !important;
        display: table-cell !important;
    }
    
    .results-table .col-x,
    .results-table th:nth-child(5),
    .results-table td:nth-child(5) {
        width: 18% !important;
        min-width: 45px !important;
        text-align: center !important;
        display: table-cell !important;
    }
    
    .athlete-primary a {
        font-size: 0.75rem; /* Reduced from 0.8rem */
    }
    
    .athlete-details {
        font-size: 0.65rem; /* Reduced from 0.7rem */
        margin-top: 0.15rem; /* Further reduced from 0.2rem */
    }
    
    /* Control panel further optimization */
    .control-panel {
        padding: 0.5rem 0.6rem; /* Further reduced */
        margin-bottom: 0.8rem; /* Further reduced */
    }
    
    .control-panel h3 {
        font-size: 0.9rem; /* Further reduced */
        margin-bottom: 0.5rem; /* Further reduced */
    }
    
    .division-controls {
        gap: 0.5rem; /* Further reduced */
    }
    
    .control-panel-actions {
        margin-top: 0.6rem; /* Further reduced */
        padding-top: 0.6rem; /* Further reduced */
    }
    
    /* Navigation further optimization */
    .results-nav {
        margin-bottom: 0.8rem; /* Further reduced */
        gap: 0.2rem; /* Further reduced */
    }
    
    .results-nav a {
        padding: 0.4rem 0.6rem; /* Further reduced */
        font-size: 0.85rem; /* Further reduced */
    }
    
    /* Results page header further optimization */
    .results-page-header {
        margin-bottom: 0.6rem; /* Further reduced */
        padding-bottom: 0.4rem; /* Further reduced */
    }
    
    .back-link {
        font-size: 0.8rem; /* Further reduced */
        padding: 0.3rem 0; /* Further reduced */
    }
}

/* --- EXTRA SMALL MOBILE STYLES (under 360px) --- */
@media (max-width: 360px) {
    .results-division-block {
        margin-bottom: 0.2rem; /* Minimal spacing */
        border-radius: 3px; /* Minimal border radius */
    }
    
    .division-header {
        padding: 0.25rem 0.5rem; /* Minimal padding */
    }
    
    .division-header h2 {
        font-size: 0.8rem; /* Minimal font size */
    }
    
    .details-toggle-btn {
        padding: 0.2rem 0.4rem; /* Minimal padding */
        font-size: 0.65rem; /* Minimal font size */
        max-width: 120px; /* Minimal width */
    }
    
    .results-table {
        font-size: 0.7rem; /* Minimal font size */
    }
    
    .results-table th,
    .results-table td {
        padding: 0.25rem 0.15rem !important; /* Minimal padding */
    }
    
    /* Force column widths on extra small mobile */
    .results-table .col-rank,
    .results-table th:nth-child(1),
    .results-table td:nth-child(1) { 
        width: 10% !important;
        display: table-cell !important;
    }
    
    .results-table .col-athlete,
    .results-table th:nth-child(2),
    .results-table td:nth-child(2) { 
        width: 55% !important;
        display: table-cell !important;
    }
    
    .results-table .col-total,
    .results-table th:nth-child(3),
    .results-table td:nth-child(3) { 
        width: 20% !important;
        display: table-cell !important;
    }
    
    .results-table .col-10x,
    .results-table th:nth-child(4),
    .results-table td:nth-child(4) { 
        width: 18% !important;
        min-width: 45px !important;
        text-align: center !important;
        display: table-cell !important;
    }
    
    .results-table .col-x,
    .results-table th:nth-child(5),
    .results-table td:nth-child(5) {
        width: 18% !important;
        min-width: 45px !important;
        text-align: center !important;
        display: table-cell !important;
    }
    
    .athlete-primary a {
        font-size: 0.7rem; /* Minimal font size */
    }
    
    .athlete-details {
        font-size: 0.6rem; /* Minimal font size */
        margin-top: 0.1rem; /* Minimal margin */
    }
    
    /* Control panel minimal optimization */
    .control-panel {
        padding: 0.4rem 0.5rem; /* Minimal padding */
        margin-bottom: 0.6rem; /* Minimal margin */
    }
    
    .control-panel h3 {
        font-size: 0.85rem; /* Minimal font size */
        margin-bottom: 0.4rem; /* Minimal margin */
    }
    
    .division-controls {
        gap: 0.4rem; /* Minimal gap */
    }
    
    .control-panel-actions {
        margin-top: 0.5rem; /* Minimal margin */
        padding-top: 0.5rem; /* Minimal padding */
    }
    
    /* Navigation minimal optimization */
    .results-nav {
        margin-bottom: 0.6rem; /* Minimal margin */
        gap: 0.15rem; /* Minimal gap */
    }
    
    .results-nav a {
        padding: 0.3rem 0.5rem; /* Minimal padding */
        font-size: 0.8rem; /* Minimal font size */
    }
    
    /* Results page header minimal optimization */
    .results-page-header {
        margin-bottom: 0.5rem; /* Minimal margin */
        padding-bottom: 0.3rem; /* Minimal padding */
    }
    
    .back-link {
        font-size: 0.75rem; /* Minimal font size */
        padding: 0.25rem 0; /* Minimal padding */
    }
}

/* --- Compact Accordion Styles --- */

/* Reduce the gap BETWEEN each event block */
.results-division-block {
    margin-bottom: 1rem; /* Original was 2rem */
}

/* Make the header bar itself shorter */
.division-header {
    padding-top: 0.6rem;    /* Original was 0.8rem */
    padding-bottom: 0.6rem; /* Original was 0.8rem */
}

/* Make the title text inside the header slightly smaller */
.division-header h2 {
    font-size: 1.1rem; /* Original was 1.2rem */
}

/* Adjust the "Show Details" button to match */
.details-toggle-btn {
    padding: 0.4rem 0.9rem;
}

/* --- Even More Compact Accordion Styles --- */
.results-division-block {
    margin-bottom: 0.5rem; /* Further reduce the gap between blocks */
}
.division-header {
    padding: 0.4rem 1rem; /* Make the header shorter */
}
.division-header h2 {
    font-size: 1rem; /* Make the title text smaller */
}
.details-toggle-btn {
    padding: 0.25rem 0.75rem; /* Shrink the button to fit */
    font-size: 0.8rem;
}

/* --- Styles for Division Control Panel --- */
.control-panel {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
}

.control-panel h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--deep-forest-green);
}

.division-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.control-item {
    display: flex;
    align-items: center;
}

.control-item label {
    margin-left: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.control-item input[type="checkbox"] {
    width: 1.15em;
    height: 1.15em;
    cursor: pointer;
}

/* Mobile styles for control panel */
@media (max-width: 768px) {
    .control-panel {
        padding: 0.8rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .control-panel h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .division-controls {
        gap: 0.8rem;
    }
    
    .control-item {
        flex: 1;
        min-width: 120px;
    }
}

/* Styling for error messages */
.error-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
    background-color: #FFF5F5;
    color: #C53030;
    border: 1px solid #FC8181;
}

/* Re-using button style for links */
a.results-button {
    display: inline-block;
    background-color: var(--deep-forest-green);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

a.results-button:hover {
    background-color: var(--target-red);
}

/* Position the save button in the control panel */
.control-panel-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
}

/* Mobile styles for control panel actions */
@media (max-width: 768px) {
    .control-panel-actions {
        margin-top: 1rem;
        padding-top: 1rem;
        justify-content: center;
    }
    
    a.results-button {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        width: 100%;
        max-width: 200px;
        text-align: center;
    }
}

/* Styling for the Individual/Team navigation */
.results-nav {
    margin-bottom: 2rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.results-nav a {
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    color: var(--slate-gray);
    border-bottom: 3px solid transparent;
}

.results-nav a.active {
    color: var(--deep-forest-green);
    border-bottom-color: var(--deep-forest-green);
}

/* Mobile styles for navigation */
@media (max-width: 768px) {
    .results-nav {
        margin-bottom: 1.5rem;
        flex-direction: column;
        gap: 0;
    }
    
    .results-nav a {
        padding: 0.6rem 1rem;
        text-align: center;
        border-bottom: 1px solid #dee2e6;
        border-radius: 0;
    }
    
    .results-nav a.active {
        background-color: var(--deep-forest-green);
        color: #fff;
        border-bottom-color: var(--deep-forest-green);
    }
}

/* Round Robin Matches Styles */
.round-robin-matches {
    margin-top: 2rem;
}

.round-section {
    margin-bottom: 3rem;
}

.round-title {
    color: var(--deep-forest-green, #1E3A1B);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--deep-forest-green, #1E3A1B);
}

.match-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.match-header {
    background-color: var(--deep-forest-green, #1E3A1B);
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.match-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.match-schedule {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.match-date {
    font-size: 0.9rem;
    opacity: 0.9;
}

.match-time {
    font-size: 0.8rem;
    opacity: 0.8;
}

.athletes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.athlete-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease-in-out;
}

.athlete-card.winner {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
}

.athlete-info {
    margin-bottom: 1rem;
}

.athlete-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--deep-forest-green, #1E3A1B);
    margin-bottom: 0.5rem;
}

.athlete-country {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.country-flag {
    background: var(--deep-forest-green, #1E3A1B);
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.athlete-target {
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
}

.athlete-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.total-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--deep-forest-green, #1E3A1B);
    background: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 2px solid var(--deep-forest-green, #1E3A1B);
}

.set-score {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.set-points {
    background: #fff3e0;
    color: #f57c00;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.tie-indicator {
    background: #fff8e1;
    color: #f9a825;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.final-rank {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.event-filter {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.event-filter label {
    font-weight: 600;
    color: var(--deep-forest-green, #1E3A1B);
    margin-right: 1rem;
}

.event-filter select {
    padding: 0.5rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    font-size: 1rem;
    color: var(--deep-forest-green, #1E3A1B);
    cursor: pointer;
}

.event-filter select:focus {
    outline: none;
    border-color: var(--deep-forest-green, #1E3A1B);
    box-shadow: 0 0 0 2px rgba(30, 58, 27, 0.1);
}

/* Collapsible Match Cards */
.match-card {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.match-header.clickable {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
    min-height: auto;
}

.match-header.clickable:hover {
    background: #e9ecef;
}

.match-header-content {
    flex: 1;
}

.match-header h3 {
    margin: 0 0 0.2rem 0;
    color: var(--deep-forest-green, #1E3A1B);
    font-size: 1rem;
    font-weight: 600;
}

.match-schedule {
    display: flex;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: #666;
}

.expand-icon {
    font-size: 1rem;
    color: var(--deep-forest-green, #1E3A1B);
    transition: transform 0.2s ease;
    user-select: none;
}

.match-content {
    padding: 0;
}

/* Scorecard-style Round Robin Matches */
.scorecard-container {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    margin: 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.scorecard-header {
    background: var(--deep-forest-green, #1E3A1B);
    color: #fff;
    text-align: center;
    padding: 0.8rem;
}

.scorecard-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.teams-scorecard {
    display: flex;
    align-items: stretch;
    min-height: 400px;
    width: 100%;
}

.team-scorecard {
    flex: 1;
    padding: 1.5rem;
    border-right: 1px solid #dee2e6;
    position: relative;
}

.team-scorecard:last-child {
    border-right: none;
}

.team-scorecard.winner {
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
}

.team-scorecard.winner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #28a745;
}

.team-header-scorecard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.team-flag-name {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.country-flag-large {
    display: inline-block;
    background: var(--deep-forest-green, #1E3A1B);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 60px;
    text-align: center;
}

.team-name-large {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--deep-forest-green, #1E3A1B);
}

.winner-badge {
    background: #28a745;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scorecard-table {
    width: 100%;
}

.scores-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    table-layout: fixed;
}

.scores-table th,
.scores-table td {
    border: 1px solid #dee2e6;
    padding: 0.4rem 0.2rem;
    text-align: center;
}

.scores-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--deep-forest-green, #1E3A1B);
    font-size: 0.75rem;
}

.end-number {
    background: #e9ecef !important;
    font-weight: 600;
    width: 30px;
}

.arrow-score {
    background: #fff;
    font-weight: 500;
    min-width: 25px;
    font-size: 0.9rem;
}

.end-sum {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--deep-forest-green, #1E3A1B);
    width: 35px;
}

.end-points {
    background: #e3f2fd;
    font-weight: 600;
    color: #1976d2;
    width: 35px;
}

.total-row {
    background: #e9ecef;
    font-weight: 700;
}

.total-label {
    text-align: left;
    font-size: 1rem;
    color: var(--deep-forest-green, #1E3A1B);
}

.total-sum {
    background: #fff3cd !important;
    color: #856404;
    font-size: 1.1rem;
}

.total-points {
    background: #d1ecf1 !important;
    color: #0c5460;
    font-size: 1.1rem;
}

.vs-divider-large {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    background: var(--deep-forest-green, #1E3A1B);
    color: #fff;
    font-weight: 700;
    font-size: 1.4rem;
    writing-mode: vertical-lr;
    text-orientation: mixed;
}

/* Responsive adjustments for round robin matches */
@media (max-width: 768px) {
    .teams-scorecard {
        flex-direction: column;
    }
    
    .team-scorecard {
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        padding: 0.8rem;
    }
    
    .team-scorecard:last-child {
        border-bottom: none;
    }
    
    .vs-divider-large {
        width: 100%;
        height: 40px;
        font-size: 1.2rem;
        writing-mode: horizontal-tb;
        text-orientation: initial;
    }
    
    .match-header.clickable {
        flex-direction: column;
        gap: 0.3rem;
        text-align: center;
        padding: 0.6rem;
    }
    
    .match-header-content {
        width: 100%;
    }
    
    .match-header h3 {
        font-size: 0.95rem;
        margin-bottom: 0.2rem;
    }
    
    .match-schedule {
        justify-content: center;
        gap: 0.4rem;
        font-size: 0.75rem;
    }
    
    .expand-icon {
        position: absolute;
        top: 0.6rem;
        right: 0.6rem;
        font-size: 0.9rem;
    }
    
    .round-title {
        font-size: 1.3rem;
    }
    
    .scores-table {
        font-size: 0.75rem;
        width: 100%;
        table-layout: auto;
    }
    
    .scores-table th,
    .scores-table td {
        padding: 0.3rem 0.2rem;
        min-width: 25px;
    }
    
    .scorecard-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .team-header-scorecard {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .team-flag-name {
        justify-content: center;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .team-name-large {
        font-size: 1.1rem;
    }
    
    .country-flag-large {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }
    
    .scorecard-header h3 {
        font-size: 1rem;
        padding: 0.6rem;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    .results-header {
        padding: 1rem 0.5rem;
    }
    
    .results-navigation {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .results-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}