/* Core Layout Styling */
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            background-color: #f4f9fd;
            color: #111111;
            margin: 0;
            padding: 0;
        }
        
        /* Navigation Top Bar */
        .members-header {
            position: relative;
            background-color: #111111;
            color: white;
            padding: 15px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 4px solid #ffcc00;
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        }
        .members-header .header-badge-link {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
        }
        .members-header h1 {
            margin: 0;
            font-size: 1.3rem;
            letter-spacing: 0.5px;
        }

        .logout-btn {
            background-color: transparent;
            color: #fff;
            border: 2px solid #fff;
            padding: 8px 16px;
            border-radius: 4px;
            text-decoration: none;
            font-weight: bold;
            font-size: 0.85rem;
            transition: all 0.2s ease;
        }
        .logout-btn:hover {
            background-color: #fff;
            color: #111111;
        }

        /* Container Layout */
        .container {
            max-width: 1050px;
            margin: 50px auto 30px;
            padding: 0 15px;
        }

        /* Draws-Style Main Navigation Tabs */
        .tab-menu {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            margin-bottom: 24px;
            flex-wrap: wrap;
        }

        .tab-button {
            background: none;
            border: none;
            font-size: 0.95rem;
            font-weight: 600;
            color: #0369a1;
            cursor: pointer;
            padding: 4px 8px;
            border-bottom: 2px solid transparent;
            transition: color 0.2s ease, border-color 0.2s ease;
            white-space: nowrap;
        }

        .tab-button:hover,
        .tab-button:focus-visible,
        .knockout-tab:hover,
        .knockout-tab:focus-visible,
        .draws-tabs > .tab-btn:hover,
        .draws-tabs > .tab-btn:focus-visible {
            background: #0369a1;
            color: #ffffff;
            outline: 2px solid #ffcc00;
            outline-offset: 1px;
        }

        /* Active tab matching style.css (.tab-btn.active) */
        .tab-button.active {
            color: #111111;
            border-bottom: 2px solid #ffcc00;
        }

        .tab-divider {
            color: #cbd5e1;
            font-size: 0.85rem;
        }

        .external-content-section {
            max-width: 1100px;
            margin: 0 auto;
        }

        .external-content-section h2,
        .external-content-section p {
            text-align: center;
        }

        .knockout-tabs {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 8px;
            margin: 0 0 18px;
        }

        .knockout-tab {
            padding: 8px 12px;
            border: 1px solid #bae6fd;
            border-radius: 5px;
            background: #e0f2fe;
            color: #0369a1;
            font-size: 0.88rem;
            font-weight: 600;
            cursor: pointer;
        }

        .knockout-tab:hover,
        .knockout-tab.active {
            background: #0369a1;
            border-color: #0369a1;
            color: white;
        }

        .external-content-frame-wrap {
            display: block;
            width: 100%;
            height: min(80vh, 900px);
            min-height: 600px;
            overflow: hidden;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            background: white;
        }

        .external-content-frame {
            display: block;
            width: 100%;
            height: 100%;
            border: 0;
            background: white;
        }

        .league-results-upload-frame-wrap {
            position: relative;
            width: min(100%, 850px);
            height: 930px;
            overflow: hidden;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            background: white;
            margin-inline: auto;
        }

        .league-results-upload-frame-wrap::before {
            position: absolute;
            z-index: 2;
            top: 0;
            left: 0;
            right: 0;
            height: 70px;
            background: white;
            content: "";
            pointer-events: none;
        }

        .league-results-upload-frame {
            position: relative;
            z-index: 0;
            display: block;
            width: 1100px;
            height: 1400px;
            transform: translate(-266px, -200px);
            border: 0;
            background: white;
        }

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

        .team-rinks .draw-card {
            min-width: 0;
        }

        .team-fixture {
            margin: 0 0 18px;
            text-align: center;
            font-weight: 600;
            color: #334155;
        }

        .team-sheet-heading,
        .team-sheet-intro {
            text-align: center;
        }

        .team-sheet-heading {
            margin: 0 0 10px;
        }

        .team-sheet-intro {
            margin: 0 0 18px;
            color: #64748b;
            font-size: 0.88rem;
        }

        .team-venue {
            display: inline-block;
            margin-left: 6px;
            padding: 3px 9px;
            border-radius: 999px;
            font-size: 0.75rem;
            font-weight: 700;
        }

        .team-venue.home {
            background: #e0f2fe;
            color: #0369a1;
        }

        .team-venue.away {
            background: #ffedd5;
            color: #c2410c;
        }

        .league-table-section {
            max-width: 1100px;
            margin: 34px auto 0;
            padding: 24px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            background: #f8fafc;
        }

        .league-table-section h2 {
            text-align: center;
            margin: 0 0 10px;
            font-size: 1.2rem;
        }

        .league-fixtures-section {
            max-width: 900px;
            margin: 30px auto 0;
            padding-top: 22px;
            border-top: 1px solid #cbd5e1;
        }

        .league-fixtures-section > h3 {
            margin: 0 0 16px;
            color: #1e293b;
            text-align: center;
            font-size: 1.08rem;
        }

        .league-fixture-period + .league-fixture-period {
            margin-top: 20px;
        }

        .league-fixture-more {
            margin-top: 16px;
        }

        .league-fixture-more summary {
            width: fit-content;
            margin: 0 auto;
            padding: 8px 14px;
            border: 1px solid #bae6fd;
            border-radius: 5px;
            background: #e0f2fe;
            color: #0369a1;
            font-size: 0.88rem;
            font-weight: 600;
            cursor: pointer;
        }

        .league-fixture-more summary:hover {
            background: #bae6fd;
        }

        .league-fixture-more[open] summary {
            margin-bottom: 14px;
        }

        .league-fixture-period h4 {
            margin: 0 0 8px;
            color: #475569;
            font-size: 0.92rem;
            text-align: center;
        }

        .league-table-link {
            margin: 0 0 14px;
            text-align: center;
        }

        .league-table-link a {
            display: inline-block;
            padding: 7px 12px;
            border: 1px solid #bae6fd;
            border-radius: 5px;
            background: #e0f2fe;
            color: #0369a1;
            font-size: 0.88rem;
            font-weight: 600;
            text-decoration: none;
        }

        .league-table-link a:hover {
            background: #bae6fd;
        }

        .league-table-scroll {
            display: flex;
            justify-content: safe center;
            width: min(100%, 900px);
            margin: 18px auto 0;
            overflow-x: auto;
            border: 1px solid #cbd5e1;
            border-radius: 6px;
            background: white;
            -webkit-overflow-scrolling: touch;
        }

        .league-table-frame {
            display: block;
            width: 100%;
            min-width: 825px;
            height: 280px;
            border: 0;
            background: white;
        }

        .league-fixture-frame {
            display: block;
            width: 100%;
            min-width: 650px;
            max-width: 760px;
            height: 700px;
            border: 0;
            background: white;
            margin-inline: auto;
        }

        .league-fixture-scroll {
            width: min(100%, 760px);
            margin-top: 0;
        }

        @media (max-width: 560px) {
            .league-table-section {
                margin-top: 24px;
                padding: 12px;
            }

            .league-fixtures-section {
                margin-top: 22px;
                padding-top: 16px;
            }

            .league-fixture-scroll {
                justify-content: flex-start;
                align-items: flex-start;
            }

            .league-table-section > .league-table-scroll {
                height: 135px;
                overflow-y: hidden;
            }

            .league-table-frame {
                height: 280px;
                transform: scale(0.48);
                transform-origin: top left;
            }

            .league-fixture-frame {
                height: 700px;
            }
        }

        /*
         * Google controls the table cells inside the cross-origin iframe.
         * Keep its full table width available and let the wrapper scroll on
         * narrow screens rather than clipping the standings columns.
         */
        .league-table-section p {
            color: #64748b;
        }

        @media (max-width: 900px) {
            .team-rinks {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        @media (max-width: 768px) {
            .league-results-upload-frame-wrap {
                width: 100%;
                height: 1068px;
            }

            .league-results-upload-frame {
                width: 100%;
                transform: translateY(-140px);
            }
        }

        @media (max-width: 560px) {
            .league-results-upload-frame-wrap {
                height: 1100px;
            }

            .knockout-tabs {
                flex-wrap: nowrap;
                gap: 4px;
            }

            .knockout-tab {
                flex: 0 1 auto;
                padding: 4px 5px;
                font-size: 0.72rem;
                white-space: nowrap;
            }

            .external-content-frame-wrap {
                height: 75vh;
                min-height: 500px;
            }

            .external-content-frame {
                width: 760px;
                height: 150vh;
                max-width: none;
                min-height: 0;
                transform: scale(0.5);
                transform-origin: top left;
            }

            .members-header {
                flex-direction: row;
                align-items: center;
                gap: 8px;
                padding: 12px 16px;
            }

            .members-header h1 {
                flex: 1 1 auto;
                min-width: 0;
                font-size: clamp(0.65rem, 3vw, 1.15rem);
                white-space: nowrap;
            }

            .logout-btn {
                flex: 0 0 auto;
                white-space: nowrap;
            }

            .team-rinks {
                grid-template-columns: 1fr;
            }

            #draws-root .tier-2 .draw-card,
            #draws-root .tier-3 .draw-card {
                flex-basis: auto;
            }
        }

        @media (max-width: 500px) {
            .league-results-upload-frame-wrap {
                height: 1120px;
            }
        }

        @media (max-width: 483px) {
            .league-results-upload-frame-wrap {
                height: 1230px;
            }
        }

        @media (max-width: 450px) {
            .league-results-upload-frame-wrap {
                height: 1250px;
            }
        }

        @media (max-width: 420px) {
            .league-results-upload-frame-wrap {
                height: 1290px;
            }
        }

        @media (max-width: 410px) {
            .league-results-upload-frame-wrap {
                height: 1315px;
            }
        }

        @media (max-width: 400px) {
            .league-results-upload-frame-wrap {
                height: 1330px;
            }
        }

        @media (max-width: 390px) {
            .league-results-upload-frame-wrap {
                height: 1330px;
            }
        }

        @media (max-width: 375px) {
            .league-results-upload-frame-wrap {
                height: 1460px;
            }
        }

        @media (max-width: 360px) {
            .league-results-upload-frame-wrap {
                height: 1490px;
            }
        }

        @media (max-width: 340px) {
            .league-results-upload-frame-wrap {
                height: 1530px;
            }
        }

        @media (max-width: 320px) {
            .league-results-upload-frame-wrap {
                height: 1790px;
            }
        }

        @media (max-width: 650px) {
            .members-header {
                padding-bottom: 42px;
            }

            .members-header .header-badge-link {
                top: auto;
                bottom: -35px;
                transform: translateX(-50%);
            }
        }

        /* Tab Content Containers */
        .tab-content {
            display: none;
            background: white;
            padding: 25px;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
            border: 1px solid #e2e8f0;
            animation: fadeIn 0.3s ease;
        }

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

        /* Rink Card Row Layouts (Matches Draws Row Styling) */
        .rink-list {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .rink-row {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 4px;
            padding: 6px 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.82rem;
        }

        .rink-position {
            font-size: 0.72rem;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .rink-player {
            font-weight: 600;
            color: #0369a1;
        }

        /* Custom Table Style */
        .club-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
        }
        .club-table th, .club-table td {
            border: 1px solid #dee2e6;
            padding: 12px;
            text-align: left;
        }
        .club-table th {
            background-color: #f8f9fa;
            font-weight: bold;
        }
        .club-table tr:nth-child(even) {
            background-color: #fafafa;
        }

        .downloads-section {
            max-width: 800px;
            margin: 0 auto;
        }

        .downloads-section > h2,
        .downloads-intro {
            text-align: center;
        }

        .downloads-intro {
            margin: 0 0 24px;
            color: #64748b;
        }

        .download-category + .download-category {
            margin-top: 24px;
        }

        .download-category h3 {
            margin: 0 0 10px;
            color: #1e293b;
            font-size: 1rem;
        }

        .download-list {
            list-style: none;
            margin: 0;
            padding: 0;
        }

        .download-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 14px 16px;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            background: #f8fafc;
        }

        .download-name {
            font-weight: 600;
            color: #0369a1;
        }

        .download-status {
            flex: 0 0 auto;
            color: #64748b;
            font-size: 0.82rem;
        }

        @media (max-width: 560px) {
            .download-item {
                align-items: flex-start;
                flex-direction: column;
                gap: 4px;
                padding: 12px;
            }
        }

        @media (max-width: 560px) and (orientation: portrait) {
            .tab-menu,
            .knockout-tabs {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 5px;
            }

            .draws-tabs {
                display: grid;
                grid-template-columns: repeat(4, minmax(0, 1fr));
                gap: 5px;
            }

            .tab-divider {
                display: none;
            }

            .tab-button,
            .knockout-tab,
            .draws-tabs > .tab-btn {
                width: 100%;
                min-width: 0;
                min-height: 34px;
                padding: 4px 5px;
                border: 1px solid #bae6fd;
                border-radius: 4px;
                background: #e0f2fe;
                color: #0369a1;
                font-size: 0.72rem;
                line-height: 1.15;
                text-align: center;
                white-space: normal;
                justify-self: stretch;
            }

            .tab-button:hover,
            .tab-button:focus-visible,
            .knockout-tab:hover,
            .knockout-tab:focus-visible,
            .draws-tabs > .tab-btn:hover,
            .draws-tabs > .tab-btn:focus-visible {
                background: #0369a1;
                color: #ffffff;
                outline: 2px solid #ffcc00;
                outline-offset: 1px;
            }

            .tab-button.active,
            .knockout-tab.active,
            .draws-tabs > .tab-btn.active {
                border-color: #0369a1;
                background: #0369a1;
                color: #ffffff;
                box-shadow: inset 0 -2px 0 #ffcc00;
            }
        }

        @media (max-width: 380px) and (orientation: portrait) {
            .draws-tabs > .tab-btn {
                padding-inline: 1px;
                font-size: clamp(0.5rem, 2.8vw, 0.68rem);
                white-space: nowrap;
            }
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(5px); }
            to { opacity: 1; transform: translateY(0); }
        }
