/* Define standard box-sizing for all elements */
html {
    box-sizing: border-box;
}
*, *::before, *::after {
    box-sizing: inherit;
}

/* CSS Variables for precise table column widths (Rendered Widths) */
:root {
    --cell-padding-h: 36px; /* 2 * 18px (left+right padding) */
    --cell-border-w: 2px; /* 2 * 1px (left+right border) */

    --col-rank-w: 60px;
    --col-name-w: 180px;
    --col-score-w: 80px;
    --col-gd-w: 60px;
    --col-f-w: 60px;
    --col-a-w: 60px;

    /* Rendered width for each column (content + padding + border) */
    --col-rank-rw: calc(var(--col-rank-w) + var(--cell-padding-h) + var(--cell-border-w)); /* 98px */
    --col-name-rw: calc(var(--col-name-w) + var(--cell-padding-h) + var(--cell-border-w)); /* 218px */
    --col-score-rw: calc(var(--col-score-w) + var(--cell-padding-h) + var(--cell-border-w)); /* 118px */
    --col-gd-rw: calc(var(--col-gd-w) + var(--cell-padding-h) + var(--cell-border-w));     /* 98px */
    --col-f-rw: calc(var(--col-f-w) + var(--cell-padding-h) + var(--cell-border-w));       /* 98px */
    --col-a-rw: calc(var(--col-a-w) + var(--cell-padding-h) + var(--cell-border-w));       /* 98px */
}

body {
    font-family: 'Roboto', sans-serif;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    margin: 0;
    padding: 10px; /* Add some padding around the body */
    background-color: #eef2f7; /* Lighter grey background */
    color: #555; /* Changed from #444 to #555 for even lighter general text */
}

/* General Table Styling */
table {
    border-collapse: collapse;
    width: 100%; /* Full width within container */
    margin: 20px auto;
    border: 1px solid #c0d9ed; /* Softer border */
    border-bottom: 2px solid #5a82ad; /* Darker bottom border */
    font-size: 14px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.08); /* Softer, slightly larger shadow */
    border-radius: 10px; /* More rounded corners */
    overflow: hidden; /* Important for table-container below */
}
table tbody tr:nth-child(even) { /* Zebra striping */
    background-color: #f7f9fc;
}
table tr:hover {
    background-color: #e0f2f7; /* Lighter blue hover */
    transform: translateY(-1px); /* Slight lift on hover */
    transition: all 0.2s ease-in-out;
}
table tr:hover td {
    color: #1a1a1a; /* Darker text on hover */
}
table th, table td {
    color: #555; /* Applied #555 here too for consistency */
    border: 1px solid #e0eaf3; /* Lighter inner borders */
    padding: 12px 18px; /* Increased padding */
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
    background-color: #ffffff; /* Ensures cells have a background to show correctly */
}
table th {
    background: #5a82ad; /* Darker blue header */
    color: #fff !important; /* Force default header text to white */
    text-transform: uppercase;
    font-size: 15px;
    font-weight: 700 !important; /* Force default header text to bold */
    letter-spacing: 0.8px; /* Slightly more letter spacing */
}
table th.last {
    border-right: none;
}

/* --- NEW: Styling for the Top 3 Winners Table (.table-container > table:first-of-type) --- */
.table-container > table:first-of-type th:nth-child(1),
.table-container > table:first-of-type td:nth-child(1) {
    width: 80px; /* 'Pos.' column width */
    min-width: 80px;
    text-align: center; /* Center align position */
}
.table-container > table:first-of-type th:nth-child(2),
.table-container > table:first-of-type td:nth-child(2) {
    width: auto; /* Let Name column resize automatically */
    min-width: 150px; /* Minimum width for names */
    max-width: 250px; /* Optional: cap max width for names */
    text-align: left; /* Names are usually left aligned */
}
.table-container > table:first-of-type th:nth-child(3),
.table-container > table:first-of-type td:nth-child(3) {
    width: 120px; /* Adjust width for 'Prize Money' column - can be 100px, 120px, etc. */
    min-width: 120px;
    text-align: right; /* Prize money usually right aligned */
}


/* Responsive Table Container (Default: No horizontal scroll on mobile) */
.table-container {
    overflow-x: hidden; /* Prevent horizontal scroll on mobile by default */
    -webkit-overflow-scrolling: touch;
    margin: 20px auto;
    padding: 0 10px;
    border-radius: 10px;
    box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.04);
    background-color: #ffffff;
}

/* Specific column classes for styling/hiding */
.priority-1 { /* Always visible */ }
.priority-3 { display: none; } /* Hide priority-3 columns on mobile by default */
.column-rank { width: var(--col-rank-w); min-width: var(--col-rank-w); text-align: center; font-weight: bold; }
.column-name { width: var(--col-name-w); min-width: var(--col-name-w); text-align: left; font-weight: normal; color: inherit; } /* Ensures names are normal weight and inherit default color */
.column-score { width: var(--col-score-w); min-width: var(--col-score-w); text-align: center; font-weight: normal; } /* MODIFIED: Score is now normal weight */
.column-gd { width: var(--col-gd-w); min-width: var(--col-gd-w); text-align: center; font-weight: normal; } /* Ensure GD is normal weight */
.column-f { width: var(--col-f-w); min-width: var(--col-f-w); text-align: center; font-weight: normal; } /* Ensure F is normal weight */
.column-a { width: var(--col-a-w); min-width: var(--col-a-w); text-align: center; font-weight: normal; } /* Ensure A is normal weight */
.column-league { min-width: 140px; }
.column-campaign { min-width: 160px; }
.column-rawdata { font-family: monospace; font-size: 11px; white-space: pre-wrap; word-break: break-all; }

/* --- REMOVED STICKY COLUMN BEHAVIOR COMPLETELY --- */
.sticky-col {
    position: static !important; /* Forces columns to be non-sticky on all screens */
    box-shadow: none !important; /* Ensure no residual sticky shadow */
    background-color: inherit !important; /* Ensure background inherits from row, not fixed white */
}


/* Color classes for table cells */
.bg-green-success {
    background-color: #e6ffe6;
    color: #28a745; /* Dark green text */
    font-weight: bold;
}
.bg-red-danger {
    background-color: #ffe6e6;
    color: #dc3545; /* Dark red text */
    font-weight: bold;
}
.bg-orange-warning {
    background-color: #fff8e1;
    color: #ffc107; /* Dark orange text */
    font-weight: bold;
}
.bg-blue-info {
    background-color: #e0f2fd;
    color: #17a2b8; /* Dark info blue text */
    font-weight: bold;
}

/* Header/logo Title */
.header {
    padding: 25px;
    text-align: center;
    background: linear-gradient(135deg, #6fa8dc 0%, #3e7cb1 100%);
    color: white;
    border-radius: 10px;
    margin: 10px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.25);
    font-family: 'Montserrat', sans-serif;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allows header content to wrap if needed */
}
.header h1 {
    font-size: 3.8em;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 3px 5px rgba(0,0,0,0.4);
    letter-spacing: 1px;
    line-height: 1.2;
    flex-shrink: 1; /* Allow h1 to shrink */
    min-width: 0; /* Allow it to shrink to 0 if needed */
}
.hamburger { /* Adjust hamburger position when wrapping */
    flex-shrink: 0; /* Prevent hamburger from shrinking */
    margin-left: auto; /* Push hamburger to the right when wrapping */
}

/* --- GLOBAL NAVIGATION MENU (Hamburger & Slide-in for ALL screens) --- */

/* Hamburger Icon (Always Visible for all screens) */
.hamburger {
    display: block;
    background: none;
    border: none;
    font-size: 2em;
    color: white;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
    z-index: 1001;
}
.hamburger:focus {
    outline: none;
}
body.nav-open .hamburger {
    transform: rotate(90deg);
}

/* Slide-in Navigation Menu (Fixed position for all screens) */
nav {
    position: fixed;
    top: 0;
    left: -100%;
    height: 100%;
    width: 280px;
    max-width: 90%;
    background-color: #343a40;
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
    display: block;
    transition: left 0.3s ease-in-out;
    z-index: 999;
    border-radius: 0;
    overflow-y: auto;
    padding-top: 20px;
}

/* When 'nav-open' class is on body, slide the navigation into view */
body.nav-open nav {
    left: 0;
}

/* Semi-transparent overlay when the menu is open (GLOBAL for all screens) */
body.nav-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    cursor: pointer;
}
body.nav-open::before {
    pointer-events: auto;
}
body:not(.nav-open)::before {
    pointer-events: none;
}

/* Adjust individual list items/links for vertical display within the slide-in menu (GLOBAL for all screens) */
nav ul {
    list-style-type: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 10px 0;
    margin: 0;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
}

nav ul li {
    width: 100%;
    margin: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
nav ul li:last-child {
    border-bottom: none;
}
li a, .dropbtn { /* This general rule now applies to all nav items */
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f8f9fa; /* Light text for contrast in main menu items */
    text-align: left;
    padding: 14px 18px;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: 500;
    border-radius: 0;
    margin: 0;
    justify-content: flex-start;
}
li a:hover, .dropdown:hover .dropbtn, li a.active {
    background-color: #495057;
    color: #ffffff;
    transform: none;
    box-shadow: none;
}

/* Adjust dropdown content within the vertical menu (GLOBAL for all screens) */
.dropdown-content {
    position: static;
    display: none;
    width: auto;
    min-width: unset;
    transform: none;
    border-radius: 0;
    box-shadow: none;
    background-color: #495057; /* Dark background for sub-items */
    padding-left: 0;
}
nav ul .dropdown-content a { /* This rule for dropdown links within the mobile menu */
    padding-left: 40px;
    color: #f8f9fa; /* Explicitly set light text color for links in dropdowns on dark background */
}
body.nav-open nav ul .dropdown.active .dropdown-content {
    display: flex;
    flex-direction: column;
}


/* Main Content Area */
.main-content {
    padding: 25px;
    margin: 10px auto; /* Centered with auto margin */
    max-width: 1200px; /* Constrain max width for large screens */
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    color: #555; /* Ensures text inside main-content is also #555 */
}
.main-content h1 {
    color: #5a82ad;
    font-family: 'Montserrat', sans-serif;
    font-size: 2.2em; /* Slightly larger */
    margin-top: 0;
    margin-bottom: 25px; /* More space below heading */
    text-align: center;
    font-weight: 700;
}
.main-content p { /* Explicitly set paragraph color in main content to #666 */
    color: #666; /* A slightly softer dark grey for body text */
}

/* How it Works Section (base styles for content moved to help-box-container) */
.how-it-works {
    background-color: #e3f2fd; /* Light blue background */
    border: 1px solid #90caf9; /* Blue border */
    padding: 20px; /* More padding */
    margin-bottom: 30px; /* More space below */
    border-radius: 8px;
    line-height: 1.6;
    color: #1a237e;
    display: flex; /* Use flexbox for icon and text */
    align-items: flex-start;
    gap: 15px; /* Space between icon and text */
}
.how-it-works .fa-solid {
    font-size: 2em; /* Larger icon */
    color: #0d47a1; /* Dark blue for icon */
}
.how-it-works h2 {
    color: #0d47a1; /* Darker blue for heading */
    margin-top: 0;
    font-size: 1.6em; /* Larger heading */
    font-weight: 700;
}
.how-it-works p {
    margin-bottom: 10px;
}
li a:hover {
    color: #1565c0;
}

/* Search Box */
#leagueInput {
    width: calc(100% - 36px); /* Adjusted width for padding and border */
    padding: 12px 18px; /* More padding */
    margin: 10px 10px 25px 10px; /* NEW: Added 10px left/right margin */
    border: 1px solid #c0d9ed; /* Softer border */
    border-radius: 8px; /* More rounded */
    font-size: 1em; /* Consistent font size */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08); /* Softer inset shadow */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#leagueInput:focus {
    border-color: #5a82ad; /* Darker blue on focus */
    outline: none;
    box-shadow: 0 0 0 3px rgba(90, 130, 173, 0.2); /* Subtle focus ring */
}

/* No Data Message */
.no-data-message {
    text-align: center;
    color: #d8000c; /* Stronger red */
    font-size: 1.3em; /* Larger font */
    padding: 25px; /* More padding */
    background-color: #ffcccc; /* Soft red background */
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #d8000c;
    font-weight: bold;
}

/* New styles for the help box container */
.help-box-container {
    display: none; /* Initially hidden */
    position: fixed; /* Fixed position relative to viewport */
    top: 50%; /* Center vertically */
    left: 50%; /* Center horizontally */
    transform: translate(-50%, -50%); /* Adjust for its own size */
    z-index: 1000; /* Ensure it's on top of everything else */
    background-color: #ffffff; /* White background for the box */
    border: 1px solid #90caf9; /* Light blue border */
    border-radius: 10px; /* Rounded corners */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); /* Stronger shadow to make it pop */
    max-width: 600px; /* Maximum width for larger screens */
    width: 90%; /* Responsive width for smaller screens */
    padding: 25px; /* Internal padding */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Style for the close button */
.help-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5em; /* Larger font size for visibility */
    font-weight: bold;
    color: #888; /* Grey color */
    cursor: pointer;
    transition: color 0.2s ease;
}
.help-close-button:hover {
    color: #333; /* Darker on hover */
}

/* Adjust existing .how-it-works style for its new container context */
.help-box-container .how-it-works {
    margin-bottom: 0; /* Remove bottom margin if it's the sole content */
    padding: 0; /* Remove padding if container handles it */
    border: none; /* Remove border as the parent container now has one */
    background-color: transparent; /* Transparent background */
    box-shadow: none; /* No shadow, parent container has shadow */
}


/* --- Responsive Styles (Specific mobile overrides for global nav and table) --- */

/* Mobile Portrait/Narrow Screens (max-width 768px) */
@media only screen and (max-width: 768px) {
    /* Adjust header for hamburger (make it relative for hamburger positioning) */
    .header {
        position: relative;
        justify-content: space-between;
        padding-right: 60px;
    }
    .header h1 {
        font-size: 2em;
    }

    /* Adjustments for general layout (not specific to nav) */
    .main-content {
        padding: 15px;
        margin: 10px;
    }
    .how-it-works {
        padding: 12px;
        font-size: 0.9em;
    }
    .how-it-works h2 {
        font-size: 1.3em;
    }

    /* Existing responsive styles (ensure they don't conflict) */
    .priority-5, .priority-4, .priority-3, .priority-2 {
        display: none;
    }
    table {
        font-size: 11px;
        margin: 10px auto;
    }
    table th, table td {
        padding: 8px 10px;
        font-size: 11px;
    }
    #leagueInput {
        width: calc(100% - 20px);
        margin: 10px auto 20px auto;
        padding: 8px 12px;
        font-size: 1em;
    }

    /* --- Responsive adjustments for the new OR layout on mobile --- */
    .or-separator {
        margin: 30px 0;
    }
    .or-separator::before,
    .or-separator::after {
        width: 30px;
    }
}


/* --- Landscape/Desktop-Specific Styles (min-width 769px) for Table Scrolling/Sticky --- */
@media (min-width: 769px) {
    /* Enable horizontal scroll for table on wider screens */
    .table-container {
        overflow-x: auto;
    }

    /* Re-enable priority-3 columns for wider screens */
    .priority-3 {
        display: table-cell;
    }

    /* Sticky columns are explicitly NOT active - see .sticky-col global rule */
    /* This section is retained as comments for future reference if sticky is needed (e.g., via JS library) */
    /*
    .sticky-col {
        position: sticky;
        background-color: #ffffff;
        z-index: 10;
        box-shadow: 2px 0 3px rgba(0,0,0,0.1);
        background-clip: padding-box;
    }
    table tbody tr:nth-child(even) .sticky-col { background-color: #f7f9fc; }
    table tbody tr:nth-child(odd) .sticky-col { background-color: #ffffff; }
    table th.sticky-col { background-color: #5a82ad; box-shadow: 2px 0 3px rgba(0,0,0,0.1), 0 2px 3px rgba(0,0,0,0.1); }
    .sticky-col-1 { left: 0; }
    .sticky-col-2 { left: var(--col-rank-rw); }
    .sticky-col-3 { left: calc(var(--col-rank-rw) + var(--col-name-rw)); }
    .sticky-col-4 { left: calc(var(--col-rank-rw) + var(--col-name-rw) + var(--col-score-rw)); }
    .sticky-col-5 { left: calc(var(--col-rank-rw) + var(--col-name-rw) + var(--col-score-rw) + var(--col-gd-rw)); }
    .sticky-col-6 { left: calc(var(--col-rank-rw) + var(--col-name-rw) + var(--col-score-rw) + var(--col-gd-rw) + var(--col-f-rw)); }
    */
}


/* --- Dark Mode Styles --- */
body.dark-mode {
    background-color: #2c2c2c;
    color: #f0f0f0 !important; /* Force light text in dark mode */
}

/* Header (Dark Mode) */
body.dark-mode .header {
    background: linear-gradient(135deg, #3d5a80 0%, #2a3d51 100%);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}
body.dark-mode .header h1 {
    text-shadow: 2px 3px 5px rgba(0, 0, 0, 0.6);
}
body.dark-mode .hamburger {
    color: #e0e0e0;
}


/* Navigation Bar (Dark Mode) */
body.dark-mode nav {
    background-color: #3f3f3f;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}
body.dark-mode nav ul {
    background-color: #3f3f3f;
}
body.dark-mode li a, body.dark-mode .dropbtn {
    color: #c0c0c0;
}
body.dark-mode li a:hover, body.dark-mode .dropdown:hover .dropbtn, body.dark-mode li a.active {
    background-color: #555;
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
body.dark-mode .dropdown-content {
    background-color: #4a4a4a;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
}
body.dark-mode .dropdown-content a {
    color: #e0e0e0 !important; /* Force light text in dark mode dropdown */
}
body.dark-mode .dropdown-content a:hover {
    background-color: #555;
    color: #fff;
}
body.dark-mode .dropbtn .fa-solid {
    color: #c0c0c0;
}


/* Main Content Area (Dark Mode) */
body.dark-mode .main-content {
    background-color: #3a3a3a;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    color: #f0f0f0 !important; /* Force light text in dark mode */
}
body.dark-mode .main-content h1,
body.dark-mode .main-content h2 {
    color: #98c1d9;
}
body.dark-mode .main-content p {
    color: #e0e0e0 !important; /* Force paragraphs light in dark mode */
}


/* How it Works Section (Dark Mode) */
body.dark-mode .how-it-works {
    background-color: #38424a;
    border: 1px solid #5d6d7e;
    color: #a0a0a0 !important;
}
body.dark-mode .how-it-works .fa-solid {
    color: #88a8c4;
}
body.dark-mode .how-it-works h2 {
    color: #b0c9df;
}
body.dark-mode .how-it-works a {
    color: #98c1d9;
}
body.dark-mode .how-it-works a:hover {
    color: #a7d3ee;
}

/* Search Box (Dark Mode) */
body.dark-mode #leagueInput {
    background-color: #4a4a4a;
    color: #e0e0e0 !important;
    border: 1px solid #5d6d7e;
}
body.dark-mode #leagueInput:focus {
    border-color: #88a8c4;
    outline: none;
    box-shadow: 0 0 0 3px rgba(136, 168, 196, 0.3);
}

/* General Table Styling in Dark Mode - IMPROVED READABILITY */
body.dark-mode table {
    border: 1px solid #555;
    border-bottom: 2px solid #777;
    /* This sets a background for the table, but individual cells might override it */
    background-color: #2f2f2f;
}

body.dark-mode table tbody tr:nth-child(even) {
    background-color: #383838; /* Slightly lighter for zebra */
}
body.dark-mode table tbody tr:nth-child(odd) {
    background-color: #2f2f2f; /* Darker for zebra */
}

/* THE CRUCIAL CHANGE IS HERE: Force cell backgrounds in dark mode */
body.dark-mode table th,
body.dark-mode table td {
    color: #f0f0f0 !important; /* Force text light in dark mode tables */
    border: 1px solid #555;
    background-color: #2f2f2f; /* Default cell background for dark mode */
}

/* Now re-apply the zebra striping to the cells themselves, overriding the default cell background */
body.dark-mode table tbody tr:nth-child(even) td {
    background-color: #383838;
}

body.dark-mode table tbody tr:nth-child(odd) td {
    background-color: #2f2f2f;
}

body.dark-mode table tr:hover td { /* Ensure hover also works correctly on cells */
    background-color: #555;
}

body.dark-mode table th {
    background: #444;
    color: #fff !important; /* Force header text light in dark mode */
}

/* Color classes for table cells in dark mode (ensure good contrast) */
body.dark-mode .bg-green-success {
    background-color: #3a5a4a;
    color: #90ee90 !important; /* Force light green text */
}
body.dark-mode .bg-red-danger {
    background-color: #5a3a3a;
    color: #ffb0b0 !important; /* Force light red text */
}
body.dark-mode .bg-orange-warning {
    background-color: #5a4a3a;
    color: #ffd700 !important; /* Force light orange text */
}
body.dark-mode .bg-blue-info {
    background-color: #3a4a5a;
    color: #a0c0e0 !important; /* Force light blue text */
}

/* No Data Message (Dark Mode) */
body.dark-mode .no-data-message {
    color: #ff9999 !important;
    background-color: #4a3a4a;
    border: 1px solid #ff9999;
}

/* --- Start of Signup Page Specific Styles (NEW & MODIFIED) --- */

/* Overall container for the two signup options (QR vs. Button) */
.signup-options {
    display: flex;
    flex-direction: column; /* Default to column (top/down) for mobile */
    align-items: center; /* Center items for mobile */
    gap: 30px; /* Vertical space between options on mobile */
    margin-top: 40px;
    margin-bottom: 20px;
    width: 100%; /* Ensure it takes full width of main-content */
}

/* Container for each individual signup option (QR code or button) */
.option-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%; /* Take full width on mobile within signup-options */
    max-width: 320px; /* Constrain individual option container max width on mobile */
}

/* Introductory text above QR or button */
.option-intro-text {
    margin-bottom: 15px; /* Space between introductory text and the element */
    font-size: 1.05em;
    color: #666; /* Ensures consistency with other body text, slightly lighter */
}

/* Label below the QR code or button */
.option-label {
    font-size: 0.9em;
    color: #777;
    margin-top: 15px; /* Space below the option element */
    font-style: italic;
    font-weight: 500;
}

/* The "OR" separator with lines */
.or-separator {
    font-size: 1.8em;
    font-weight: bold;
    color: #5a82ad; /* Your primary blue */
    text-transform: uppercase;
    margin: 30px 0; /* Vertical margin for mobile */
    position: relative;
    padding: 0 20px; /* Horizontal padding to make space for lines */
    text-align: center;
    min-width: 80px; /* Ensure space for OR text */
    flex-shrink: 0; /* Prevent "OR" from shrinking */
    /* REMOVED order: 2; from here */
}
.or-separator::before,
.or-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px; /* Line length */
    height: 2px;
    background-color: #c0d9ed; /* Lighter blue for separator lines */
    transform: translateY(-50%); /* Vertically center lines */
}
.or-separator::before {
    left: 0; /* Position at the left of the padding */
    transform: translateX(calc(-100% - 10px)) translateY(-50%); /* Adjust to connect to OR text */
}
.or-separator::after {
    right: 0; /* Position at the right of the padding */
    transform: translateX(calc(100% + 10px)) translateY(-50%); /* Adjust to connect to OR text */
}

/* --- MODIFIED EXISTING STYLES FOR SIGNUP PAGE ELEMENTS --- */

/* For .qr-code-section */
.qr-code-section {
    margin: 0;
    max-width: 100%;
}

.qr-code-section img {
    display: block;
    margin: 0 auto;
    height: auto;
    border: 5px solid #5a82ad;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease-in-out;
    width: 90%;
    max-width: 200px;
}

.qr-code-section img:hover {
    transform: scale(1.05);
}

/* For .signup-button */
.signup-button {
    display: inline-block;
    background: linear-gradient(135deg, #28a745 0%, #1c7c30 100%);
    color: #fff;
    padding: 20px 40px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.5em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid #1a6b2c;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
    margin-top: 0;
}

.signup-button:hover {
    background: linear-gradient(135deg, #218838 0%, #16426 100%);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}


/* --- NEW: Responsive Styles for Landscape/Desktop (min-width: 769px) for Signup Options --- */
@media (min-width: 769px) {
    .signup-options {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 40px;
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }

    .signup-options .option-container {
        flex: 1;
        max-width: 400px;
        padding: 20px;
        border: 1px solid #e0eaf3;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        min-height: 280px; /* Keep this to ensure a baseline height */
        justify-content: center; /* CHANGE: Centre content vertically within the container */
        align-items: center; /* Ensure items are horizontally centered */
    }

    .signup-options .qr-code-option {
        order: 1;
    }

    .signup-options .button-option {
        order: 3;
    }

    .or-separator {
        margin: 0 30px;
        order: 2;
        align-self: center;
    }
    .or-separator::before {
        transform: translateX(calc(-100% - 15px)) translateY(-50%);
    }
    .or-separator::after {
        transform: translateX(calc(100% + 15px)) translateY(-50%);
    }

    .qr-code-section img {
        max-width: 250px;
    }

    /* REVISED: Adjust intro text and labels for better vertical alignment within options */
    .option-intro-text {
        flex-grow: 1; /* Allow intro text to take available space */
        display: flex;
        align-items: flex-end; /* CHANGE: Push text to the bottom of its allocated flex-grow space */
        justify-content: center; /* Centre text horizontally */
        margin-bottom: 10px; /* NEW: Add a small margin below intro text */
        text-align: center; /* Ensure text is centered if it wraps */
    }

    .option-label {
        flex-grow: 1; /* Allow label to take available space */
        display: flex;
        align-items: flex-start; /* CHANGE: Push label text to the top of its allocated flex-grow space */
        justify-content: center; /* Centre text horizontally */
        margin-top: 10px; /* NEW: Add a small margin above label text */
        text-align: center; /* Ensure text is centered if it wraps */
    }

    .qr-code-section {
        flex-grow: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: auto 0; /* NEW: Add auto margins top/bottom to help centre vertically */
    }

    .signup-button {
        flex-grow: 0;
        margin: auto 0; /* NEW: Add auto margins top/bottom to help centre vertically */
    }
}

/* --- Mobile Portrait/Narrow Screens (max-width 768px) --- */
@media only screen and (max-width: 768px) {
    /* ... (rest of your mobile styles) ... */

    /* RESET ORDER FOR MOBILE VIEW */
    .signup-options .option-container,
    .or-separator {
        order: 0; /* Reset order to default for all flex items */
    }

    /* Restore specific mobile "OR" margin if needed (from original CSS) */
     .or-separator {
        margin: 30px 0; /* Vertical margin for mobile */
     }

    /* ... (rest of your mobile styles) ... */
}

/* Ensure the background of the table container is dark in dark mode */
body.dark-mode .table-container {
    background-color: #2f2f2f; /* A darker background for the overall table container */
    box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.3);
}

/* Table formatting adjustments for the main league table */
table:not(:first-of-type) th:nth-child(2),
table:not(:first-of-type) td:nth-child(2) {
    width: var(--col-name-rw);
    min-width: var(--col-name-rw);
    max-width: var(--col-name-rw);
}