.players-tonight-inputs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 1200px) {
    .players-tonight-inputs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .players-tonight-inputs {
        grid-template-columns: 1fr;
    }
}
/* Tournament View Page Styles */

/* Hero Section with Sponsors */
.hero {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.hero-with-sponsors {
    padding: 40px 0 50px 0;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.hero-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-layout.has-sponsors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    text-align: left;
}

.tournament-info {
    margin-bottom: 0;
}

.tournament-header {
    display: flex;
    /* align-items: center; */
    gap: 20px;
    margin-bottom: 1.5rem;
}

.tournament-logo {
    flex-shrink: 0;
    img {
        border-radius: 10px;
    }
}

.tournament-logo-img {
    max-width: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.tournament-title-meta {
    flex: 1;
}

/* Custom Modal Styles (no Bootstrap) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex !important;
}

.modal-dialog {
    position: relative;
    margin: 1.75rem auto;
    max-width: 500px;
    width: 90%;
}

.modal-xl-custom {
    max-width: 1280px;
    width: 90%;
}

.modal-content {
    position: relative;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: calc(100vh - 3.5rem);
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: calc(0.375rem - 1px);
    border-top-right-radius: calc(0.375rem - 1px);
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.5;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem;
    border-top: 1px solid #dee2e6;
    border-bottom-right-radius: calc(0.375rem - 1px);
    border-bottom-left-radius: calc(0.375rem - 1px);
}

.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='m.235.867 8.832 8.832-8.832 8.832a.5.5 0 0 0 .707.707L9.774 10.4l8.832 8.832a.5.5 0 0 0 .707-.707L10.481 9.774l8.832-8.832a.5.5 0 0 0-.707-.707L9.774 9.067.942.235a.5.5 0 0 0-.707.632z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.375rem;
    opacity: 0.5;
    cursor: pointer;
}

.btn-close:hover {
    opacity: 0.75;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Button styles */
/* Tournament Actions Section */
.tournament-actions-section {
    padding: 20px 0;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tournament-prospectus-button {
    margin-bottom: 20px;
}

.tournament-prospectus-button .btn {
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.tournament-prospectus-button .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Additional Information Card */
.tournament-additional-info {
    margin-top: 15px;
}

.additional-info-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.additional-info-card h4 {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.additional-info-card h4 i {
    color: #007bff;
}

.additional-info-content {
    color: #6c757d;
    line-height: 1.6;
    font-size: 0.95rem;
}

.additional-info-content p {
    margin-bottom: 10px;
}

.additional-info-content p:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments for tournament header */
@media (max-width: 768px) {
    .tournament-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .tournament-logo-img {
        max-width: 80px;
    }

    .modal-xl-custom {
        width: 95%;
        margin: 1rem auto;
    }

    .tournament-actions-section {
        padding: 15px 0;
    }

    .tournament-prospectus-button .btn {
        width: 100%;
        margin-bottom: 15px;
    }

    .additional-info-card {
        padding: 15px;
    }

    .additional-info-card h4 {
        font-size: 1rem;
    }
}

.tournament-info h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tournament-meta {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0 0 20px 0;
}

.tournament-actions {
    margin-top: 20px;
}

.tournament-actions .btn {
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tournament-actions .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Compact Sponsors Section */
.sponsors-compact {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: none;
    box-shadow: none;
}

.sponsors-header-compact {
    text-align: center;
    margin-bottom: 15px;
}

.sponsors-header-compact h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.sponsors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: flex-start;
}

.sponsor-compact {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    backdrop-filter: blur(5px);
}

.sponsor-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.2);
}

.sponsor-logo-compact {
    width: auto;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    flex-shrink: 0;
}

.sponsor-logo-compact img {
    /* max-height: 100%;
    max-width: 100%; */
    max-height: 100px;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
}

.sponsor-info-compact {
    flex: 1;
    color: white;
}

.sponsor-name-compact {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: white;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sponsor-tagline-compact {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 6px 0;
    font-style: italic;
    line-height: 1.2;
}

.sponsor-type-compact {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Sponsors Section */
.sponsors-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.sponsors-header {
    text-align: center;
    margin-bottom: 30px;
}

.sponsors-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.sponsors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: center;
}

.sponsor-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.sponsor-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.sponsor-item[style*="cursor: pointer"]:hover {
    background: rgba(255, 255, 255, 1);
}

.sponsor-logo {
    margin-bottom: 15px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sponsor-logo img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.sponsor-info {
    color: #333;
}

.sponsor-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #2c3e50;
}

.sponsor-tagline {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 10px 0;
    font-style: italic;
}

.sponsor-type {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Design for Sponsors */
@media (max-width: 768px) {
    .hero {
        padding: 40px 0;
    }

    .hero-with-sponsors {
        padding: 30px 0 40px 0;
    }

    .hero-layout.has-sponsors {
        display: flex;
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .tournament-info h1 {
        font-size: 2rem;
    }

    .tournament-meta {
        font-size: 1rem;
    }

    .sponsors-compact {
        padding: 15px;
    }

    .sponsors-header-compact h4 {
        font-size: 1rem;
    }

    .sponsor-compact {
        padding: 12px;
        border-radius: 8px;
        width: 130px;
        min-height: 140px;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(8px);
        border: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .sponsor-logo-compact {
        width: 110px;
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 8px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 6px;
        padding: 8px;
        overflow: hidden;
    }

    .sponsor-logo-compact img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .sponsor-name-compact {
        font-size: 0.7rem;
        font-weight: 600;
        margin: 0 0 4px 0;
        line-height: 1.1;
        min-height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sponsor-tagline-compact {
        font-size: 0.6rem;
        margin: 0 0 6px 0;
        line-height: 1.1;
        opacity: 0.9;
    }

    .sponsor-type-compact {
        font-size: 0.5rem;
        padding: 2px 6px;
        border-radius: 8px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        margin-top: auto;
    }

    .sponsors-section {
        padding: 20px;
        margin: 0 10px;
    }

    .sponsors-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .sponsor-item {
        padding: 15px;
    }

    .sponsor-logo {
        height: 60px;
        margin-bottom: 10px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sponsors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .sponsors-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Special styling for different sponsor types */
.sponsor-item[data-type="title"] {
    border: 3px solid #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
}

.sponsor-item[data-type="presenting"] {
    border: 3px solid #ff6b35;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 107, 53, 0.05));
}

/* Animation for sponsor items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sponsor-item {
    animation: fadeInUp 0.6s ease forwards;
}

.sponsor-item:nth-child(1) {
    animation-delay: 0.1s;
}

.sponsor-item:nth-child(2) {
    animation-delay: 0.2s;
}

.sponsor-item:nth-child(3) {
    animation-delay: 0.3s;
}

.sponsor-item:nth-child(4) {
    animation-delay: 0.4s;
}

.sponsor-item:nth-child(5) {
    animation-delay: 0.5s;
}

.sponsor-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* Tournament disclaimer */
.tournament-disclaimer {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 8px 12px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.tournament-disclaimer i {
    margin-right: 6px;
    color: #f39c12;
}

.tournament-disclaimer small {
    font-size: inherit;
}

/* Custom Tab styling similar to player-rankings */
.tournament-tabs {
    margin-bottom: 20px;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.tab-buttons::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.tab-button {
    padding: 10px 15px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    position: relative;
    transition: color 0.3s ease;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-button.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-button.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
}

.tab-spots {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 5px;
    background: #e9f5ff;
    color: #0d6efd;
    vertical-align: middle;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

.tab-spots.low {
    background: #fff3cd;
    color: #856404;
}

.tab-spots.full {
    background: #f8d7da;
    color: #842029;
}

.tab-button.tab-full {
    opacity: 0.65;
}

.tab-content .tab-pane {
    display: none;
}

.tab-content .tab-pane.active {
    display: block;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #555;
    font-size: 1rem;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 2s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.tournament-header-section {
    background-color: #f8f8f8;
    padding: 30px 0;
    border-bottom: 1px solid #e0e0e0;
}

.tournament-header {
    /* padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
}

.tournament-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
}

.tournament-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.tournament-date,
.tournament-location {
    font-size: 1rem;
    color: #666;
}

.tournament-description {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.tournament-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-live {
    background-color: #e6f7e6;
    color: #28a745;
}

.status-upcoming {
    background-color: #e6f0ff;
    color: #0d6efd;
}

.status-completed {
    background-color: #f0f0f0;
    color: #6c757d;
}

/* Tournament Content Section */
.tournament-content-section {
    padding: 30px 0;
}

/* Category Tabs */
.category-tabs {
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.category-tabs .nav-link {
    color: #666;
    font-weight: 600;
    border: none;
    padding: 12px 20px;
    border-radius: 0;
    margin-right: 5px;
}

.category-tabs .nav-link:hover {
    color: var(--primary);
}

.category-tabs .nav-link.active {
    color: var(--primary);
    background-color: transparent;
    border-bottom: 3px solid var(--primary);
}

/* Category Content Tabs */
.category-content-tabs {
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.category-content-tabs .nav-link {
    color: #666;
    font-weight: 600;
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    margin-right: 10px;
    padding: 8px 15px;
    border-radius: 5px;
}

.category-content-tabs .nav-link:hover {
    color: var(--primary);
}

.category-content-tabs .nav-link.active {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}

.category-content {
    padding: 20px 0;
}

/* Custom Groups Grid Layout */
.groups-container {
    margin-bottom: 30px;
    font-family: 'Bio Sans';
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 1200px) {
    .groups-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .groups-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .groups-grid {
        grid-template-columns: 1fr;
    }
}

.group-column {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.group-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.group-header {
    background-color: var(--primary);
    color:white;
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #495057;

    h6 {
        font-size: 1rem;
        margin-bottom: 0px !important;
        color: white;
    }
}

.group-content {
    padding: 15px;
    flex: 1;
}

.group-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.group-table th {
    background-color: #f8f9fa;
    /* padding: 6px 8px; */
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
}

.group-table th.text-start {
    text-align: left;
}

.group-table td {
    /* padding: 6px 8px; */
    text-align: center;
    border-bottom: 1px solid #f1f3f4;
    font-size: 0.7rem;
}

.group-table td.text-start {
    text-align: left;
}

.group-table tr.position-1 {
    background-color: rgba(40, 167, 69, 0.1);
    font-weight: 500;
}

.group-table tr.position-2 {
    background-color: rgba(23, 162, 184, 0.1);
    font-weight: 500;
}

.match-heading {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin: 15px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
}

.match-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.match-table th {
    background-color: #f8f9fa;
    padding: 2px 0px;
    text-align: center;
    font-weight: 600;
    font-size: 0.7rem;
    border-bottom: 1px solid #dee2e6;
}

.match-table td {
    padding: 0px 0px;
    text-align: center;
    /* border-bottom: 1px solid #f1f3f4; */
    font-size: 10px;
}

.match-table .player-name {
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    /* min-width: 120px; */
}

.match-table .score-cell {
    text-align: center;
    font-weight: 600;
    /* min-width: 25px; */
    border-left: 1px solid #efefef;
    border-top: none;
    border-bottom: none;
    border-right: none;
}

.group-section {
    margin-bottom: 30px;
}

.group-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--dark);
    padding-bottom: 5px;
    border-bottom: 2px solid #f0f0f0;
}

/* Group Tables */
.group-tables {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.group-table {
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.group-table-header {
    background-color: #f8f8f8;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.group-table-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.group-standings-table {
    width: 100%;
}

.group-standings-table th {
    background-color: #f0f0f0;
    padding: 8px;
    text-align: center;
    font-weight: 600;
}

.group-standings-table td {
    padding: 8px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.group-standings-table .player-name {
    text-align: left;
    font-weight: 500;
}

.group-standings-table .position-1,
.group-standings-table .position-2 {
    background-color: rgba(40, 167, 69, 0.1);
}

/* Group Matches */
.group-matches {
    margin-top: 20px;
}

.match-row {
    /* display: flex; */
    align-items: center;
    padding: 10px;
    /* border-bottom: 1px solid #e0e0e0; */
}

.match-row:last-child {
    border-bottom: none;
}

.match-player {
    flex: 1;
    text-align: center;
}

.match-player.winner {
    font-weight: 700;
    color: #28a745;
}

.match-score {
    padding: 0 15px;
    font-weight: 700;
    font-size: 1.1rem;
}

div.bracket-player.winner>div>span.player-name {
    color: white !important;
}

div.bracket-player.winner>div>span.player-name a {
    color: white !important;
}

.ko-seed-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    line-height: 1;
    color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
    border: 1px solid rgba(108, 117, 125, 0.3);
    border-radius: 3px;
    padding: 1px 3px;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.8;
}

div.bracket-player.winner .ko-seed-badge {
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
}

.match-vs {
    padding: 0 10px;
    color: #999;
    font-size: 0.9rem;
}

/* Knockout Section */
.knockout-container {
    overflow-x: auto;
    margin-top: 20px;
    padding-bottom: 20px;
}

.knockout-bracket {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    min-width: 100%;
}

.knockout-round {
    margin-right: 40px;
    min-width: 250px;
}

.knockout-round-title {
    text-align: center;
    font-weight: 700;
    margin-bottom: 15px;
    padding: 8px;
    background-color: #f0f0f0;
    border-radius: 5px;
}

/* Loading spinner */
.loading-spinner {
    padding: 40px 0;
}

/* Walkover match styling */
.walkover-match {
    background-color: #fff3cd !important;
    border-color: #ffeaa7 !important;
}

.walkover-match .score-input {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #6c757d !important;
}

.walkover-checkbox {
    margin-left: 5px;
    cursor: pointer;
}

.walkover-checkbox:hover {
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tournament-meta {
        flex-direction: column;
        gap: 10px;
    }

    .group-tables {
        grid-template-columns: 1fr;
    }

    .category-tabs {
        /* Allow tabs to wrap on mobile */
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 15px;
        border-bottom: 1px solid #e0e0e0;
        padding-bottom: 10px;
    }

    .category-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
        margin-right: 0;
        margin-bottom: 5px;
        border: 1px solid #ddd;
        border-radius: 6px;
        background-color: #f8f9fa;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: auto;
    }

    .category-tabs .nav-link.active {
        border-bottom: none;
        background-color: var(--primary);
        color: white;
        border-color: var(--primary);
    }

    .category-tabs .nav-link:hover {
        background-color: #e9ecef;
        border-color: #adb5bd;
    }

    .category-tabs .nav-link.active:hover {
        background-color: var(--primary);
        border-color: var(--primary);
    }

    .category-content-tabs .nav-link {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}

.separator-row {
    background: lightgrey;
    height: 1px;
}

.text-success,
.winner {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}



/* Knockout Bracket Styles */
.bracket-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 30px;
    padding: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #f8f9fa;
    border-radius: 8px;
    width: 100%;
    /* Fixed minimum width to ensure horizontal scrolling */
    min-width: 1200px;
    /* Smooth scrolling */
    -webkit-overflow-scrolling: touch;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #ff6b35 #f1f1f1;
}

/* Webkit scrollbar styling for bracket */
.bracket-container::-webkit-scrollbar {
    height: 8px;
}

.bracket-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.bracket-container::-webkit-scrollbar-thumb {
    background: #ff6b35;
    border-radius: 4px;
}

.bracket-container::-webkit-scrollbar-thumb:hover {
    background: #e55a2b;
}

.bracket-round {
    position: relative;
    /* text-align: center; */
}

.bracket-round-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    text-align: center;
    margin-bottom: 20px;
    padding: 5px;
    background: var(--dark);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 120px;
    width: 200px;
    display: inline-block;
}

.bracket-matches {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
}

/* Quarterfinals - 4 matches, normal spacing */
.bracket-round:nth-child(1) .bracket-matches {
    gap: 20px;
}

/* Semifinals - 2 matches, centered with larger gaps */
.bracket-round:nth-child(2) .bracket-matches {
    gap: 104px;
    /* margin-top: 100px; */
}

/* Finals - 1 match, centered */
.bracket-round:nth-child(3) .bracket-matches {
    gap: 273px;
    /* margin-top: 180px; */
}

.bracket-round:nth-child(4) .bracket-matches {
    gap: 610px;
    /* margin-top: 180px; */
}

.bracket-round:nth-child(5) .bracket-matches {
    gap: 1280px;
    /* margin-top: 180px; */
}

.bracket-match {
    border: 2px solid var(--orange-secondary);
    border-radius: 0;
    background: white;
    position: relative;
    min-height: 60px;
    min-width: 200px;
}

.bracket-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    border-bottom: 1px solid #dee2e6;
    min-height: 30px;
    position: relative;
    width: 100%;
    transition: background-color 0.3s ease;
}

.bracket-player:last-child {
    border-bottom: none;
}

.bracket-player.winner {
    background-color: #28a745 !important;
    /* Fallback color for browsers that don't support gradients */
    background: #28a745;
    /* Second fallback */
    background: -webkit-linear-gradient(135deg, #28a745 0%, #e55a2b 100%);
    /* Safari/Chrome */
    background: -moz-linear-gradient(135deg, #28a745 0%, #e55a2b 100%);
    /* Firefox */
    background: linear-gradient(135deg, #28a745 0%, #e55a2b 100%);
    /* Standard */
    color: white !important;
    font-weight: bold;
}

.player-content {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
}

.player-name {
    font-size: 0.7rem;
    font-weight: 500;
    flex: 1;
    text-transform: uppercase;
    min-width: 0;
}

/* Club span: hidden in normal web view, shown inline in compact/print */
.player-club {
    display: none;
}

/* ═══════════════════════════════════════════
   Compact groups view
   ═══════════════════════════════════════════ */

/* 6 groups per row on desktop */
.groups-compact.groups-grid,
.groups-compact .groups-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 6px !important;
    margin-bottom: 12px !important;
}

/* 2 groups per row on mobile */
@media (max-width: 767px) {
    .groups-compact.groups-grid,
    .groups-compact .groups-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 4px !important;
    }
}

/* Compact group card */
.groups-compact .group-column {
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.groups-compact .group-header {
    padding: 4px 6px !important;
}

.groups-compact .group-header h6 {
    font-size: 0.7rem !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.groups-compact .group-content {
    padding: 3px 5px !important;
}

/* Hide every column except the player-name column (2nd th/td) */
.groups-compact .group-table thead,
.groups-compact .group-table th:not(:nth-child(2)),
.groups-compact .group-table td:not(:nth-child(2)) {
    display: none !important;
}

.groups-compact .group-table {
    font-size: 0.72rem !important;
    margin-bottom: 0 !important;
    table-layout: fixed;
    width: 100%;
}

.groups-compact .group-table td:nth-child(2) {
    display: table-cell !important;
    padding: 2px 0 !important;
    border-bottom: 1px solid #f3f3f3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0;   /* forces ellipsis inside table cell */
    width: 100%;
}

/* Remove position highlight colours in compact */
.groups-compact .group-table tr.position-1,
.groups-compact .group-table tr.position-2 {
    background: none !important;
}

/* Club inline, tiny, italic */
.groups-compact .player-club {
    display: inline !important;
    font-size: 0.62rem;
    color: #b0b8c1;
    font-style: italic;
    margin-left: 3px;
}

/* Hide the entire matches section */
.groups-compact .group-matches-section {
    display: none !important;
}

@media print {
    .player-club {
        display: inline !important;
        font-size: 0.62rem;
        color: #9ca3af;
        font-style: italic;
        margin-left: 3px;
    }
    .groups-compact .group-matches-section {
        display: none !important;
    }
    .groups-compact.groups-grid,
    .groups-compact .groups-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 6px !important;
    }
}

.player-scores {
    font-size: 0.5rem;
    /* font-weight: bold; */
    font-family: 'Bio Sans';
    flex: none;
    text-align: right;
    white-space: nowrap;
    margin-left: 8px;
}

.bracket-player.winner .player-scores {
    color: white;
}

/* Bracket connecting lines - universal system for any bracket size */

/* Base horizontal connectors from each match */
.bracket-round:not(:last-child) .bracket-match::after {
    content: '';
    position: absolute;
    right: -15px;
    top: 50%;
    width: 15px;
    height: 2px;
    /* background: #333; */
    background: var(--orange-secondary);
    transform: translateY(-50%);
    /* z-index: 1; */
}

/* UNIVERSAL VERTICAL CONNECTORS - Connect pairs of matches */
/* Odd matches (1st, 3rd, 5th, etc.) connect down to even matches */
.bracket-round:not(:last-child) .bracket-match:nth-child(odd)::before {
    content: '';
    position: absolute;
    right: -15px;
    top: 50%;
    width: 2px;
    /* background: #333; */
    background: var(--orange-secondary);
    z-index: 1;
}

/* Even matches (2nd, 4th, 6th, etc.) connect up to odd matches */
.bracket-round:not(:last-child) .bracket-match:nth-child(even)::before {
    content: '';
    position: absolute;
    right: -15px;
    width: 2px;
    /* background: #333; */
    background: var(--orange-secondary);
    z-index: 1;
}

/* UNIVERSAL HORIZONTAL CONNECTORS - From even matches to next round */
/* Every even match (2nd, 4th, 6th, etc.) sends a line to the next round */
.bracket-round:not(:last-child) .bracket-match:nth-child(even)::after {
    right: -245px;
    width: 230px;

}

/* Override the base horizontal connector for odd matches since they have the special one */
.bracket-round:not(:last-child) .bracket-match:nth-child(odd)::after {
    display: none;
    /* Hide the base connector for odd matches */
}

/* DYNAMIC SPACING BASED ON BRACKET ROUND GAPS */

/* Round 1 (Quarterfinals) - 20px gaps */
.bracket-round:nth-child(1) .bracket-match:nth-child(odd)::before {
    height: 40px;
    /* 30px (half match) + 10px (half gap) */
}

.bracket-round:nth-child(1) .bracket-match:nth-child(even)::before {
    top: -14px;
    /* Connect upward */
    height: 44px;
}

.bracket-round:nth-child(1) .bracket-match:nth-child(even)::after {
    top: -12px;
    /* Midpoint */
}

/* Round 2 (Semifinals) - 104px gaps */
.bracket-round:nth-child(2) .bracket-match:nth-child(odd)::before {
    height: 82px;
    /* 30px (half match) + 52px (half gap) */
}

.bracket-round:nth-child(2) .bracket-match:nth-child(even)::before {
    top: -56px;
    /* Connect upward */
    height: 86px;
}

.bracket-round:nth-child(2) .bracket-match:nth-child(even)::after {
    top: -58px;
    /* Midpoint */
}

/* Round 3 (Finals) - 273px gaps */
.bracket-round:nth-child(3) .bracket-match:nth-child(odd)::before {
    height: 166px;
    /* 30px (half match) + 136px (half gap) */
}

.bracket-round:nth-child(3) .bracket-match:nth-child(even)::before {
    top: -141px;
    /* Connect upward */
    height: 170px;
}

.bracket-round:nth-child(3) .bracket-match:nth-child(even)::after {
    top: -138px;
    /* Midpoint */
}

/* Round 4 - 610px gaps */
.bracket-round:nth-child(4) .bracket-match:nth-child(odd)::before {
    height: 335px;
    /* 30px (half match) + 305px (half gap) */
}

.bracket-round:nth-child(4) .bracket-match:nth-child(even)::before {
    top: -309px;
    /* Connect upward */
    height: 339px;
}

.bracket-round:nth-child(4) .bracket-match:nth-child(even)::after {
    top: -305px;
    /* Midpoint */
}

/* Round 5 - 1280px gaps */
.bracket-round:nth-child(5) .bracket-match:nth-child(odd)::before {
    height: 670px;
    /* 30px (half match) + 640px (half gap) */
}

.bracket-round:nth-child(5) .bracket-match:nth-child(even)::before {
    top: -644px;
    /* Connect upward */
    height: 674px;
}

.bracket-round:nth-child(5) .bracket-match:nth-child(even)::after {
    top: -642px;
    /* Midpoint */
}

/* Tournament Champion Display */
.tournament-champion {
    margin-top: 40px;
    margin-bottom: 20px;
    text-align: center;
    clear: both;
    width: 100%;
}

/* Enhanced Knockout Bracket Styles from PHP */
.knockout-container {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

/* Champion Column - Integrated into Bracket */
.champion-column {
    display: flex;
    flex-direction: column;
    min-width: 250px;
    align-items: center;
    justify-content: center;
    position: relative;
}

.champion-column-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    border: 2px solid #fff;
}

.champion-display {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.15);
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.champion-badge {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    padding: 15px 25px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    border: 3px solid #fff;
    position: relative;
    animation: championGlow 2s ease-in-out infinite alternate;
}

.champion-badge::before {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #ff6b35, #f7931e, #ffd700, #ffed4e);
    border-radius: 23px;
    z-index: -1;
    opacity: 0.7;
}

.champion-trophy {
    font-size: 2rem;
    color: #ffd700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes championGlow {
    0% {
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
        transform: scale(1);
    }

    100% {
        box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6);
        transform: scale(1.02);
    }
}

/* Champion connecting line */
.champion-column::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 50%;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #ff6b35);
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* No categories message */
.no-categories-message {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin: 20px 0;
}

.no-categories-message i {
    margin-right: 8px;
}

/* Section headers */
.section-header {
    margin: 30px 0 20px 0;
}

.section-header h3 {
    color: #495057;
    font-weight: 600;
    font-size: 1.3rem;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.section-header h3 i {
    margin-right: 10px;
    color: var(--primary);
}

/* Info and error messages */
.info-message {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin: 20px 0;
}

.info-message i {
    margin-right: 8px;
}

.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin: 20px 0;
}

.error-message i {
    margin-right: 8px;
}

/* Responsive Design for Brackets */
@media (max-width: 768px) {
    .champion-column {
        min-width: 200px;
    }

    .champion-column-header {
        font-size: 1rem;
        padding: 8px;
    }

    .champion-badge {
        font-size: 1rem;
        padding: 12px 20px;
    }

    .champion-trophy {
        font-size: 1.5rem;
    }
}



/* Mo
dal z-index fixes for tournament view */
.modal {
    z-index: 9999 !important;
}

.modal-backdrop {
    z-index: 9998 !important;
}

/* Ensure tournament modals appear above all other elements */
#prospectusModal,
#additionalInfoModal {
    z-index: 9999 !important;
}

#prospectusModal .modal-dialog,
#additionalInfoModal .modal-dialog {
    z-index: 10000 !important;
}

/* Fix for elements that might interfere with modals */
.hero {
    position: relative;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.tournament-sponsors {
    position: relative;
    z-index: 3;
}

/* Ensure modal content is always on top */
.modal.show {
    z-index: 9999 !important;
}

.modal-backdrop.show {
    z-index: 9998 !important;
}

/* Prospectus Content Styles */
.prospectus-content {
    width: 100%;
}

.pdf-container {
    width: 100%;
    min-height: 600px;
    position: relative;
}

.pdf-container embed {
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.pdf-fallback {
    display: none;
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 20px;
}

.pdf-fallback p {
    margin-bottom: 20px;
    color: #6c757d;
}

.image-container {
    text-align: center;
    width: 100%;
}

.prospectus-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-content {
    padding: 20px;
    line-height: 1.6;
    color: #495057;
}

/* PDF fallback for browsers that don't support embed */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .pdf-container embed {
        display: block;
    }
}

/* Mobile responsive adjustments for prospectus */
@media (max-width: 768px) {
    .pdf-container {
        min-height: 400px;
    }

    .pdf-container embed {
        height: 400px;
    }

    .prospectus-image {
        max-width: 100%;
        height: auto;
    }
}

/* Match info display styles */
.match-info-row {
    /* background-color: #f8f9fa; */
}

.match-info-cell {
    padding: 0px 4px 4px 4px !important;
    font-size: 0.75rem;
    color: #6c757d;
    text-align: center;
    font-style: italic;
    /* border-top: 1px solid #e9ecef; */
}

/* Knockout bracket match info */
.bracket-match-info {
    font-size: 0.7rem;
    color: #6c757d;
    text-align: center;
    padding: 2px 4px;
    background-color: rgba(248, 249, 250, 0.8);
    border-top: 1px solid #e9ecef;
    font-style: italic;
    line-height: 1.2;
}

/* Responsive adjustments for match info */
@media (max-width: 768px) {
    .match-info-cell {
        font-size: 0.7rem;
        padding: 3px 6px !important;
    }

    .bracket-match-info {
        font-size: 0.65rem;
        padding: 1px 3px;
    }
}

/* Winning score highlighting */
.winning-score {
    /* background-color: #d4edda; */
    color: #28a745;
    font-weight: bold;
}

.walkover-cell {
    background-color: #f8d7da !important;
    color: #dc3545 !important;
    font-weight: bold !important;
    font-size: 0.9em;
}

/* Final Winner Trophy Icon Styling */
.final-winner-trophy {
    color: #ffd700 !important;
    font-size: 1.2em !important;
    margin-left: 8px !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: trophy-glow 2s ease-in-out infinite alternate;
}

@keyframes trophy-glow {
    from {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }

    to {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.6);
    }
}

/* Enhanced styling for final winner */
.bracket-player.winner .final-winner-trophy {
    color: #ffd700 !important;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.7));
}

/* Additional emphasis for final round */
.bracket-round-header:contains("FINAL") {
    color: #ffd700;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Make final match more prominent */
.bracket-round:last-child .bracket-match {
    border: 3px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.bracket-round:last-child .bracket-player.winner {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.2);
}

/* Bracket Wrapper - preserves horizontal scrolling */
.bracket-wrapper {
    display: block;
    width: 100%;
}

/* Champion Section Styling */
.champion-section {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 30px;
    padding: 0 20px;
    box-sizing: border-box;
}

.champion-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    padding: 20px 30px;
    border-radius: 15px;
    text-align: center;
    font-weight: 700;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
    border: 3px solid #e6c200;
    animation: champion-pulse 3s ease-in-out infinite;
    min-width: 300px;
    position: relative;
}

.champion-badge i {
    display: block;
    font-size: 2.5em;
    color: #b8860b;
    margin-bottom: 10px;
}

.champion-badge span {
    display: block;
    font-size: 1.4em;
    margin-bottom: 5px;
    color: #333;
}

.champion-title {
    font-size: 1.1em;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes champion-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 12px 35px rgba(255, 215, 0, 0.6);
    }
}

/* Alternative layout - champion to the right of bracket on larger screens */
@media (min-width: 1600px) {
    .bracket-wrapper {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 40px;
        overflow-x: visible;
        /* Ensure wrapper doesn't interfere with bracket scrolling */
    }

    .bracket-container {
        flex: 1 1 auto;
        /* Preserve original bracket scrolling properties */
        min-width: 1200px;
        max-width: calc(100vw - 350px);
        /* Leave space for champion section */
    }

    .champion-section {
        flex: 0 0 300px;
        margin-top: 60px;
        /* Align with bracket content */
        margin-left: 0;
        padding: 0;
    }

    .champion-badge {
        min-width: 250px;
    }
}

/*
 Runner-up Badge Styling */
.runner-up-badge {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #333;
    padding: 18px 25px;
    border-radius: 15px;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(192, 192, 192, 0.4);
    border: 3px solid #a8a8a8;
    min-width: 250px;
    position: relative;
    animation: runner-up-glow 4s ease-in-out infinite;
}

.runner-up-badge i {
    display: block;
    font-size: 2.2em;
    color: #888;
    margin-bottom: 8px;
}

.runner-up-badge span {
    display: block;
    font-size: 1.2em;
    margin-bottom: 5px;
    color: #333;
}

.runner-up-title {
    font-size: 1em;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes runner-up-glow {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 6px 20px rgba(192, 192, 192, 0.4);
    }

    50% {
        transform: scale(1.01);
        box-shadow: 0 8px 25px rgba(192, 192, 192, 0.6);
    }
}

/* Update champion section to display badges side by side */
.champion-section {
    display: flex;
    justify-content: center;
    gap: 30px;
    width: 100%;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Responsive adjustments for champion and runner-up badges */
@media (max-width: 768px) {
    .champion-section {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .champion-badge,
    .runner-up-badge {
        min-width: 280px;
    }
}

@media (min-width: 1200px) {
    .champion-section {
        margin-top: 0;
        margin-left: 40px;
        align-self: center;
        flex-direction: column;
        gap: 20px;
    }

    .champion-badge {
        min-width: 280px;
    }

    .runner-up-badge {
        min-width: 280px;
    }
}

/* Final
 Runner-up Medal Icon Styling */
.final-runner-up-medal {
    color: #c0c0c0 !important;
    font-size: 1.2em !important;
    margin-left: 8px !important;
    text-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
    animation: medal-glow 3s ease-in-out infinite alternate;
}

@keyframes medal-glow {
    from {
        text-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
    }

    to {
        text-shadow: 0 0 15px rgba(192, 192, 192, 0.8), 0 0 20px rgba(192, 192, 192, 0.6);
    }
}

/* Enhanced styling for final runner-up */
.bracket-player .final-runner-up-medal {
    color: #c0c0c0 !important;
    filter: drop-shadow(0 0 6px rgba(192, 192, 192, 0.7));
}

/*
 Semi-Final Bronze Medal Icon Styling */
.semi-final-bronze-medal {
    color: #cd7f32 !important;
    font-size: 1.1em !important;
    margin-left: 8px !important;
    text-shadow: 0 0 6px rgba(205, 127, 50, 0.5);
    animation: bronze-glow 4s ease-in-out infinite alternate;
}

@keyframes bronze-glow {
    from {
        text-shadow: 0 0 6px rgba(205, 127, 50, 0.5);
    }

    to {
        text-shadow: 0 0 12px rgba(205, 127, 50, 0.8), 0 0 18px rgba(205, 127, 50, 0.6);
    }
}

/* Enhanced styling for semi-final bronze medalists */
.bracket-player .semi-final-bronze-medal {
    color: #cd7f32 !important;
    filter: drop-shadow(0 0 4px rgba(205, 127, 50, 0.7));
}

/* Group
 Calculator Styles */
.section-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Tournament Wizard Style - Compact Match Table */
.match-table {
    font-size: 0.85rem;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: white;
    border: none;
    border-radius: 6px;
    overflow: hidden;
}

.match-header-row {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.match-header-cell {
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    border-bottom: 1px solid #dee2e6;
}

.player-row {
    border-bottom: 1px solid #f1f1f1;
}

.player-row:hover {
    background-color: #f8f9fa;
}

.player-name-cell {
    padding: 0.4rem 0.75rem;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    text-align: left;
    width: 120px;
    min-width: 120px;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-cell {
    padding: 0.25rem;
    text-align: center;
    border-right: 1px solid #f1f1f1;
    /* width: 60px; */
}

.score-input-compact {
    width: 100%;
    max-width: 50px;
    padding: 0.25rem 0.1rem;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    background: white;
    transition: all 0.15s ease;
}

.score-input-compact:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 0.15rem rgba(var(--primary-rgb), 0.2);
    background-color: #fff;
}

.score-input-compact:disabled {
    background-color: #f8f9fa;
    opacity: 0.7;
    cursor: not-allowed;
}

.walkover-cell {
    padding: 0.4rem;
    text-align: center;
    width: 50px;
    background-color: #f8f9fa;
    border-left: 1px solid #dee2e6;
}

.walkover-checkbox-compact {
    margin: 0;
    transform: scale(0.9);
    cursor: pointer;
}

.walkover-checkbox-compact:checked {
    accent-color: #dc3545;
}

.match-spacer-row {
    height: 8px;
}

.match-spacer-row td {
    background-color: #f8f9fa;
    border: none;
    padding: 0;
}

.matches-grid {
    /* max-height: 500px; */
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom scrollbar for matches grid */
.matches-grid::-webkit-scrollbar {
    width: 6px;
}

.matches-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.matches-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.matches-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Standings table styling */
#standingsTable .table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

#standingsTable .table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
    color: #495057;
    padding: 0.5rem 0.25rem;
}

#standingsTable .table td {
    padding: 0.5rem 0.25rem;
    vertical-align: middle;
}

#standingsTable .position-1 {
    background-color: #fff3cd;
    font-weight: 600;
}

#standingsTable .position-2 {
    background-color: #f8f9fa;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .match-table {
        font-size: 0.8rem;
    }

    .match-header-cell {
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }

    .player-name-cell {
        padding: 0.3rem 0.5rem;
        width: 35px;
        font-size: 0.8rem;
    }

    .score-cell {
        padding: 0.2rem;
        /* width: 50px; */
    }

    .score-input-compact {
        max-width: 40px;
        padding: 0.2rem 0.05rem;
        font-size: 0.8rem;
    }

    .walkover-cell {
        padding: 0.3rem;
        width: 40px;
    }
}

.set-input {
    padding: 0.4rem;
    font-size: 0.85rem;
}
}

@media (max-width: 576px) {

    .sets-header,
    .sets-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* P
layer Names Section */
.player-name-input {
    font-weight: 500;
}

.player-name-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
}

/* Improved spacing for player names grid */
#playerNamesGrid .col-md-6 {
    min-width: 200px;
}

/* Better responsive layout for player names */
@media (max-width: 768px) {
    #playerNamesGrid .col-md-6 {
        min-width: 100%;
    }
}

/* 
Group Calculator Modal Layout */
#groupCalculatorModal .modal-dialog {
    max-width: 1200px;
}

#groupCalculatorModal .modal-body {
    padding: 1.5rem;
}

/* Left Column Styling */
#groupCalculatorModal .col-lg-4 {
    padding-right: 1rem;
}

/* Right Column Styling */
#groupCalculatorModal .col-lg-8 {
    padding-left: 1rem;
}

/* Settings Card */
.card-header.bg-primary {
    background-color: var(--primary) !important;
}

.card-header.bg-success {
    background-color: #28a745 !important;
}

.card-header.bg-info {
    background-color: #17a2b8 !important;
}

/* Player Names in Left Column */
#playerNamesGrid .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

#playerNamesGrid .form-control-sm {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
}

/* Enhanced Instructions Panel */
#calculatorInstructions {
    background: linear-gradient(135deg, #e8f4fd 0%, #d1ecf1 100%);
    border: none;
    border-left: 5px solid #3498db;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.1);
    position: relative;
    overflow: hidden;
}

#calculatorInstructions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #f39c12, #e74c3c);
}

#calculatorInstructions h6 {
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

#calculatorInstructions ol {
    font-size: 0.9rem;
    padding-left: 1.5rem;
    line-height: 1.6;
    color: #34495e;
}

#calculatorInstructions ol li {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

#calculatorInstructions p.small {
    font-size: 0.85rem;
    color: #5d6d7e;
    font-style: italic;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(52, 152, 219, 0.2);
}

/* Enhanced Form Controls */
#groupCalculatorModal .form-select,
#groupCalculatorModal .form-control {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #2c3e50;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#groupCalculatorModal .form-select:focus,
#groupCalculatorModal .form-control:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 0.25rem rgba(230, 126, 34, 0.25), 0 4px 12px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #ffffff 0%, #fef9e7 100%);
    transform: translateY(-1px);
    outline: none;
}

#groupCalculatorModal .form-select:hover:not(:focus),
#groupCalculatorModal .form-control:hover:not(:focus) {
    border-color: #f39c12;
    background: linear-gradient(135deg, #ffffff 0%, #fef5e7 100%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

#groupCalculatorModal .form-label {
    font-weight: 700;
    color: #2c3e50;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* Enhanced Responsive Design - Keep Two Column Layout */
@media (max-width: 1200px) {

    #groupCalculatorModal .col-lg-4,
    #groupCalculatorModal .col-md-4,
    #groupCalculatorModal .col-sm-4,
    #groupCalculatorModal .col-4 {
        flex: 0 0 35% !important;
        max-width: 35% !important;
    }

    #groupCalculatorModal .col-lg-8,
    #groupCalculatorModal .col-md-8,
    #groupCalculatorModal .col-sm-8,
    #groupCalculatorModal .col-8 {
        flex: 0 0 65% !important;
        max-width: 65% !important;
    }
}

/* Only stack on very small screens */
@media (max-width: 768px) {

    #groupCalculatorModal .col-lg-4,
    #groupCalculatorModal .col-lg-8,
    #groupCalculatorModal .col-md-4,
    #groupCalculatorModal .col-md-8,
    #groupCalculatorModal .col-sm-4,
    #groupCalculatorModal .col-sm-8,
    #groupCalculatorModal .col-4,
    #groupCalculatorModal .col-8 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    #groupCalculatorModal .col-lg-4,
    #groupCalculatorModal .col-md-4,
    #groupCalculatorModal .col-sm-4,
    #groupCalculatorModal .col-4 {
        margin-bottom: 1.5rem;
    }

    #groupCalculatorModal .modal-body {
        padding: 1.5rem !important;
    }
}

@media (max-width: 768px) {
    #groupCalculatorModal .modal-dialog {
        max-width: 98% !important;
        width: 98% !important;
        margin: 0.5rem auto !important;
    }

    #groupCalculatorModal .modal-body {
        padding: 1rem !important;
    }

    #groupCalculatorModal .modal-header {
        padding: 1rem 1.5rem !important;
    }

    #groupCalculatorModal .modal-title {
        font-size: 1.1rem !important;
    }

    .match-table {
        font-size: 0.75rem;
    }

    .score-input-compact {
        max-width: 40px;
        font-size: 0.8rem;
    }

    .player-name-cell {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

/* Score Capture Modal Styles */
.score-capture-form {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Modal close button styling */
#scoreCaptureModal .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.25rem;
    opacity: 0.5;
    width: 1em;
    height: 1em;
    padding: 0.25em;
    cursor: pointer;
}

#scoreCaptureModal .btn-close:hover {
    opacity: 0.75;
}

#scoreCaptureModal .btn-close:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 53, 0.25);
    opacity: 1;
}

.match-info {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
}

.sets-container {
    margin: 1.5rem 0;
}

.sets-header {
    background-color: #e9ecef;
    padding: 0.75rem;
    border-radius: 0.5rem 0.5rem 0 0;
    border: 1px solid #dee2e6;
    border-bottom: none;
}

.sets-inputs {
    background-color: #fff;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0 0 0.5rem 0.5rem;
}

.player-row {
    align-items: center;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

.player-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    /* padding: 0.375rem 0; */
}

.set-score {
    font-size: 1.1rem;
    font-weight: 600;
    height: 2.5rem;
    border: 2px solid #dee2e6;
    transition: all 0.2s ease;
}

.set-score:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.sets-won-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: #0d6efd;
}

.match-result {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
}

.winner-display, .match-score-display {
    font-size: 1.1rem;
}

.walkover-section {
    background-color: #fff3cd;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #ffeaa7;
}

.form-actions {
    /* border removed for cleaner look */
    padding-top: 1.5rem;
}

.umpire-link {
    /* color: #0d6efd; */
    text-decoration: none;
    cursor: pointer;
}

.umpire-link:hover {
    color: #0a58ca;
    text-decoration: underline;
}

/* Modal backdrop fix */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sets-header .row > div,
    .sets-inputs .row > div {
        padding: 0.25rem;
    }
    
    .set-score {
        font-size: 1rem;
        height: 2rem;
    }
    
    .player-name {
        font-size: 0.9rem;
    }
}

/* League Tournament Styles - Multi-round group play with 4-column layout */
/* Full-width container for 2 round league tournaments */
.full-width-league {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 20px;
    margin: 0 auto;
}

.full-width-league .groups-grid {
    width: 100%;
}

.full-width-league .group-column {
    width: 100% !important;
    max-width: 100% !important;
}

.full-width-league .group-container {
    max-width: 100% !important;
    width: 100%;
}

.full-width-league .group-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.full-width-league .group-content table {
    width: 100%;
    margin-bottom: 1.5rem;
}

.league-tournament .group-column {
    width: 100% !important;
    max-width: 100% !important;
}

.league-tournament .group-container {
    max-width: 100% !important;
}

.league-tournament .group-content table {
    width: 100%;
}

/* Match search filter */
.match-search-container {
    margin: 1.5rem 0 1rem 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.match-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

/* Search icon is positioned absolutely when present inside the wrapper */
.match-search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    color: #6c757d;
    pointer-events: none;
    z-index: 1;
}

.match-search-input {
    flex: 1;
    padding: 10px 12px 10px 38px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.match-search-input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.15);
}

.match-count {
    font-size: 0.875rem;
    color: #6c757d;
    white-space: nowrap;
    font-weight: 500;
}

/* 4-column match grid for league tournaments */
.league-matches-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Match numbering for Players Tonight */
.match-row[data-match-number]::before {
    content: "#" attr(data-match-number) " ";
    font-weight: bold;
    color: #007bff;
    margin-right: 5px;
    font-size: 0.9em;
}

.league-match-column {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.league-match-column .match-table {
    font-size: 0.85rem;
    margin: 0;
}

/* Match separator and info styling */
.match-table .separator-row {
    height: 8px;
    background: transparent;
}

.match-table .separator-row td {
    padding: 0;
    border-bottom: 2px solid #e9ecef;
}

.match-table .match-info-row {
    background-color: #f8f9fa;
    font-size: 0.8rem;
}

.match-table .match-info-cell {
    padding: 4px 8px !important;
    color: #6c757d;
    font-style: italic;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
}

.match-table .umpire-link {
    color: #ff6b35;
    text-decoration: none;
    font-weight: 500;
}

.match-table .umpire-link:hover {
    text-decoration: underline;
    color: #e55a2a;
}

/* Responsive adjustments for league layout */
@media (max-width: 1400px) {
    .league-matches-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .league-matches-grid {
        grid-template-columns: 1fr;
    }
    
    .full-width-league {
        padding: 0 10px;
    }
    
    .match-search-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        max-width: 100%;
    }
    
    .match-count {
        text-align: center;
    }
}

/* Draw Log Modal - mobile optimisation */
@media (max-width: 576px) {
    #drawLogModal .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }
    #drawLogModal .modal-content {
        border-radius: 0;
        height: 100%;
    }
    #drawLogModal .modal-body {
        padding: 8px;
    }
    #drawLogModal .modal-header {
        padding: 10px 12px;
    }
    #drawLogModal .modal-footer {
        padding: 8px 12px;
    }
    #drawLogModal details {
        border-width: 1px !important;
    }
    #drawLogModal details summary {
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
    }
    #drawLogModal details > div {
        padding: 8px 10px !important;
    }
    #drawLogModal details > div > div {
        font-size: 0.72rem !important;
        padding: 8px !important;
        max-height: 55vh !important;
    }
}

/* ============================================
   MEDAL TABLES SECTION
   ============================================ */

.medal-tables-section {
    padding: 40px 0;
    background: #f8f9fa;
    border-top: 3px solid var(--primary, #1a5632);
}

.medal-section-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #1a1a1a;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

/* Medal Tally Table */
.medal-tally-wrapper {
    margin-bottom: 50px;
}

.medal-tally-table-wrapper {
    overflow-x: auto;
}

.medal-tally-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    overflow: hidden;
}

.medal-tally-table thead tr {
    background: var(--primary, #1a5632);
    color: white;
}

.medal-tally-table th {
    padding: 12px 16px;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.medal-tally-table th.club-col {
    text-align: left;
}

.medal-tally-table td {
    padding: 10px 16px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-weight: 500;
}

.medal-tally-table td.club-col {
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
}

.medal-tally-table td.rank-col {
    font-weight: 600;
    color: #555;
}

.medal-tally-table tbody tr:hover {
    background-color: #f5f5f5;
}

.medal-tally-table tbody tr:last-child td {
    border-bottom: none;
}

.medal-tally-table .gold-col {
    color: #b8860b;
}

.medal-tally-table .silver-col {
    color: #6c757d;
}

.medal-tally-table .bronze-col {
    color: #cd7f32;
}

.medal-tally-table .total-col {
    font-weight: 700;
    color: #1a1a1a;
}

.medal-tally-table thead .gold-col,
.medal-tally-table thead .silver-col,
.medal-tally-table thead .bronze-col,
.medal-tally-table thead .total-col {
    color: white;
}

/* Medal Breakdown Table (per event) */
.medal-breakdown-wrapper {
    margin-bottom: 30px;
}

.medal-breakdown-table-wrapper {
    overflow-x: auto;
}

.medal-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    overflow: hidden;
}

.medal-breakdown-table thead tr {
    background: var(--primary, #1a5632);
    color: white;
}

.medal-breakdown-table th {
    padding: 12px 14px;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.medal-breakdown-table th.event-col {
    text-align: left;
    min-width: 140px;
}

.medal-breakdown-table th.gold-col {
    background: #b8860b;
}

.medal-breakdown-table th.silver-col {
    background: #6c757d;
}

.medal-breakdown-table th.bronze-col {
    background: #cd7f32;
}

.medal-breakdown-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.medal-breakdown-table td.event-col {
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    background: #fafafa;
    border-right: 1px solid #eee;
}

.medal-breakdown-table td.medalist-col {
    text-align: center;
    min-width: 140px;
}

.medal-breakdown-table tbody tr:hover {
    background-color: #f9f9f9;
}

.medal-breakdown-table tbody tr:last-child td {
    border-bottom: none;
}

.medalist-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1a1a1a;
    text-transform: capitalize;
}

.medalist-club {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 4px;
}

/* Mobile medal cards (hidden on desktop, shown on mobile) */
.medal-breakdown-cards {
    display: none;
}

/* Responsive medal tables */
@media (max-width: 768px) {
    .medal-tables-section {
        padding: 20px 0;
    }

    .medal-section-title {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    /* Medal Tally - compact on mobile, keep all columns */
    .medal-tally-table {
        font-size: 0.75rem;
    }

    .medal-tally-table th {
        padding: 6px 3px;
        font-size: 0.65rem;
        letter-spacing: 0;
    }

    .medal-tally-table td {
        padding: 7px 3px;
    }

    .medal-tally-table th.rank-col,
    .medal-tally-table td.rank-col {
        width: 22px;
        padding: 6px 2px;
    }

    .medal-tally-table th.club-col,
    .medal-tally-table td.club-col {
        font-size: 0.7rem;
        padding-left: 4px;
    }

    .medal-tally-table .medal-col {
        /* width: 28px; */
        padding: 6px 2px;
    }

    /* Medal Breakdown - hide table, show cards */
    .medal-breakdown-table-wrapper {
        display: none;
    }

    .medal-breakdown-cards {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .medal-event-card {
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
        overflow: hidden;
    }

    .medal-event-card-header {
        background: var(--primary, #1a5632);
        color: white;
        padding: 8px 12px;
        font-weight: 700;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .medal-event-card-body {
        padding: 8px;
    }

    /* Gold & Silver side by side */
    .medal-event-top-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-bottom: 6px;
    }

    .medal-event-cell {
        display: flex;
        align-items: center;
        gap: 8px;
        /* padding: 6px 8px; */
        border-radius: 6px;
        background: #fafafa;
    }

    /* Bronze row below */
    .medal-event-bottom-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .medal-event-icon {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.6rem;
        font-weight: 700;
        flex-shrink: 0;
        color: white;
    }

    .medal-event-icon.gold {
        background: #b8860b;
    }

    .medal-event-icon.silver {
        background: #6c757d;
    }

    .medal-event-icon.bronze {
        background: #cd7f32;
    }

    .medal-event-info {
        flex: 1;
        min-width: 0;
    }

    .medal-event-player {
        font-weight: 600;
        font-size: 0.75rem;
        color: #1a1a1a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .medal-event-club {
        font-size: 0.6rem;
        color: #888;
        text-transform: uppercase;
        font-weight: 500;
    }
}

@media print {
    .medal-tables-section {
        page-break-before: always;
        background: white;
        border-top: none;
        padding: 20px 0;
    }

    .medal-tally-table,
    .medal-breakdown-table {
        box-shadow: none;
        border: 1px solid #333;
    }

    .medal-tally-table thead tr,
    .medal-breakdown-table thead tr {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .medal-breakdown-cards {
        display: none !important;
    }
}
