        :root {
            --check-ok: #2E7D32;
            --check-ok-hover: #1B5E20;
            --check-ok-bg: #C8E6C9;
            --check-ok-border: #66BB6A;
            --check-wrong: #B71C1C;
            --check-wrong-hover: #8E1E1E;
            --check-wrong-bg: #FFCDD2;
            --check-wrong-bg-hover: #EF9A9A;
            --check-wrong-border: #EF9A9A;
            --check-wrong-cell-text: #000000;
            --check-review: #E65100;
            --check-review-hover: #BF360C;
            --check-review-bg: #FFF3CD;
            --check-review-bg-hover: #FFE69C;
            --check-review-border: #FF9800;
            --check-review-cell-text: #E65100;
            --cb-pattern-wrong: none;
            --cb-pattern-review: none;
        }

        body {
            background-color: #FAFAFA;
            font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        }

        /* Dashboard Header */
        .dashboard-header {
            padding: 20px 0;
        }

        .medal-logo {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .medal-logo img {
            height: 3rem;
            width: auto;
            display: block;
        }

        .dashboard-title {
            color: #262730;
            font-size: 3rem;
            font-weight: 700;
            margin: 0;
        }

        /* Tab titles styling to match Streamlit */
        .tab-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 1.5rem;
            font-weight: 700;
            color: #262730;
            margin-bottom: 1rem;
        }

        .tab-title svg {
            flex-shrink: 0;
            color: #1E88E5;
        }

        .grid-stats-line {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
        }

        .grid-stats-line svg {
            flex-shrink: 0;
            color: #1E88E5;
        }

        .main-container {
            padding: 15px;
            max-width: 100%;
        }

        /* Sport tabs styling to match Streamlit */
        .sport-tabs {
            display: flex;
            width: 60%;
        }

        .sport-tabs .nav-item {
            flex: 1;
            min-width: 0;
        }

        .sport-tabs .nav-link {
            background-color: #F0F2F6;
            color: #262730;
            border: 1px solid #E6E9EF;
            padding: 12px 20px;
            margin-right: 2px;
            font-weight: 500;
            flex: 1;
            text-align: center;
            width: 100%;
            white-space: nowrap;
        }

        .sport-tabs .nav-link.active {
            background-color: #80CBC4;
            color: white;
            border-color: #80CBC4;
        }

        /* NFL tab - match the green banner */
        .sport-tabs .nav-link[href="#nfl-tab"].active {
            background-color: #A5D6A7;
            border-color: #A5D6A7;
        }

        /* NBA tab - match the purple banner */
        .sport-tabs .nav-link[href="#nba-tab"].active {
            background-color: #B39DDB;
            border-color: #B39DDB;
        }

        /* MLB tab - match the orange banner */
        .sport-tabs .nav-link[href="#mlb-tab"].active {
            background-color: #FFCC80;
            border-color: #FFCC80;
        }

        /* NHL tab - light red to avoid clash with Sports Blue */
        .sport-tabs .nav-link[href="#nhl-tab"].active {
            background-color: #E57373;
            border-color: #E57373;
        }

        /* Sport banner */
        .sport-banner {
            background-color: #A5D6A7;
            padding: 15px;
            border-radius: 4px;
            margin-bottom: 15px;
        }

        .sport-banner h2 {
            margin: 0;
            color: #262730;
            font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            font-weight: 600;
        }

        .db-updated-at {
            text-align: right;
            margin: -4px 0 10px;
            font-size: 0.8rem;
            font-weight: 500;
            color: rgba(38, 39, 48, 0.6);
            font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            min-height: 1.1em;
            line-height: 1.2;
        }

        /* Left menu styling */
        .menu-container {
            background-color: white;
            border: 1px solid #E6E9EF;
            border-radius: 4px;
            padding: 0;
        }

        .menu-tabs .nav-link {
            background-color: #F0F2F6;
            color: #262730;
            border: none;
            padding: 10px 8px;
            margin: 0;
            font-weight: 500;
            text-align: center;
            border-radius: 0;
            width: auto;
            flex: 1;
        }

        .menu-tabs .nav-link.active {
            background-color: #1E88E5;
            color: white;
        }

        .menu-tabs .nav-link:hover:not(.active) {
            background-color: #1976D2;
            color: white;
        }

        .menu-tabs {
            display: flex;
            flex-direction: row;
        }

        .menu-tabs .nav-item {
            flex: 1;
        }

        .menu-content {
            padding: 15px;
            background-color: white;
            border-top: 1px solid #E6E9EF;
        }

        .menu-content h6 {
            color: #262730;
            font-weight: 600;
            margin-bottom: 12px;
            font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        }

        /* Ensure consistent font across all form elements */
        .form-label, .form-select, .form-control, .btn, .nav-link {
            font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        }

        /* Grid container */
        .grid-container {
            background-color: white;
            border: 1px solid #E6E9EF;
            border-radius: 4px;
            padding: 15px;
        }

        /* Grid wrapper with scrolling */
        .grid-wrapper {
            width: 100%;
            height: 600px;
            overflow: auto;
            border: 1px solid #E6E9EF;
            -webkit-overflow-scrolling: touch;
        }

        /* Grid stats bar */
        .grid-stats {
            background-color: #E1F5FE;
            padding: 12px 16px;
            border-radius: 6px;
            margin-bottom: 15px;
            font-size: 14px;
            border: 1px solid #B3E5FC;
            color: #1E88E5;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            position: relative;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .grid-stats:hover {
            background-color: #B3E5FC;
            transform: translateY(-1px);
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .grid-stats::after {
            content: "";
            flex-shrink: 0;
            width: 16px;
            height: 16px;
            opacity: 0.7;
            background-color: currentColor;
            -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E");
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
            -webkit-mask-position: center;
            mask-position: center;
            -webkit-mask-size: contain;
            mask-size: contain;
        }

        .check-accuracy-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
        }

        .check-accuracy-stats + .check-accuracy-stats {
            margin-top: 16px;
            padding-top: 16px;
            border-top: 1px solid #E0E0E0;
        }

        .check-accuracy-stats.correct .stat-item {
            border-left-color: #43A047;
        }

        .check-accuracy-stats.errors .stat-item {
            border-left-color: #E53935;
        }

        .check-accuracy-stats .stat-item {
            margin: 0;
            position: relative;
            padding-right: 28px;
        }

        .check-accuracy-stats .stat-info-icon {
            position: absolute;
            top: 8px;
            right: 8px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            font-size: 10px;
            font-weight: bold;
            font-style: normal;
            color: #90A4AE;
            cursor: help;
            text-transform: none;
            letter-spacing: normal;
        }

        .check-accuracy-stats .stat-info-icon:hover {
            color: #1E88E5;
        }

        /* Same icon inline after a section heading, where it sits in the text
           flow instead of being pinned to a stat tile's corner. */
        .stats-section h3 .section-info-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-left: 6px;
            font-size: 13px;
            font-style: normal;
            font-weight: normal;
            line-height: 1;
            vertical-align: middle;
            color: #90A4AE;
            cursor: help;
        }

        .stats-section h3 .section-info-icon:hover,
        .stats-section h3 .section-info-icon:focus {
            color: #1E88E5;
        }

        /* Bootstrap's 200px default turns this note into an eight-line column. */
        .section-info-tooltip .tooltip-inner {
            max-width: 300px;
            text-align: left;
        }

        @media (max-width: 991px) {
            .check-accuracy-stats {
                grid-template-columns: 1fr;
            }
        }

        /* Stats Modal */
        .stats-modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            animation: fadeIn 0.2s ease;
        }

        .stats-modal.show {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .stats-modal-content {
            background-color: #fff;
            margin: auto;
            padding: 30px;
            border-radius: 10px;
            max-width: 1000px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            animation: slideIn 0.3s ease;
        }

        @keyframes slideIn {
            from {
                transform: translateY(-50px);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .stats-modal-header {
            display: flex;
            flex-direction: column;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid #E1F5FE;
        }

        .stats-modal-header-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
        }

        .stats-modal-header h2 {
            margin: 0;
            color: #1E88E5;
            font-size: 24px;
        }

        .stats-modal-close {
            color: #aaa;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
            line-height: 1;
            transition: color 0.2s;
        }

        .stats-modal-close:hover {
            color: #000;
        }

        .stats-section {
            margin-bottom: 25px;
        }

        .stats-section h3 {
            color: #1E88E5;
            font-size: 18px;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid #E1F5FE;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-bottom: 15px;
        }

        /* Progress Overview section - force 3 columns (2 rows x 3 columns) */
        .stats-grid.progress-overview {
            grid-template-columns: repeat(3, 1fr);
        }

        /* Grid Highlights section - force 3 columns */
        .stats-grid.grid-highlights {
            grid-template-columns: repeat(3, 1fr);
        }

        @media (max-width: 768px) {
            .stats-grid.progress-overview {
                grid-template-columns: repeat(2, 1fr);
            }
            .stats-grid.grid-highlights {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 480px) {
            .stats-grid.progress-overview {
                grid-template-columns: 1fr;
            }
            .stats-grid.grid-highlights {
                grid-template-columns: 1fr;
            }
        }

        .stat-item {
            background-color: #F5F5F5;
            padding: 12px;
            border-radius: 6px;
            border-left: 4px solid #2196F3;
        }

        .stat-label {
            font-size: 12px;
            color: #666;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 4px;
        }

        .stat-value {
            font-size: 20px;
            font-weight: bold;
            color: #1E88E5;
        }

        .stat-value a {
            color: #1E88E5;
            text-decoration: none;
            transition: color 0.2s ease;
        }

        .stat-value a:hover {
            color: #1565C0;
            text-decoration: underline;
        }

        .stat-description {
            font-size: 13px;
            color: #555;
            margin-top: 8px;
            line-height: 1.5;
        }

        .stats-disclaimer {
            margin: 10px 0 0 0;
            font-size: 12px;
            color: #78909C;
            line-height: 1.45;
            font-style: italic;
        }

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

        .stats-list li {
            padding: 8px 12px;
            margin-bottom: 6px;
            background-color: #F9F9F9;
            border-radius: 4px;
            border-left: 3px solid #E57373;
        }

        /* Histogram styles - Vertical */
        .histogram-container {
            margin-top: 15px;
            padding: 20px 40px 20px 50px;
            position: relative;
        }

        .histogram-chart {
            display: flex;
            align-items: flex-end;
            justify-content: space-around;
            gap: 8px;
            height: 250px;
            border-bottom: 2px solid #333;
            border-left: 2px solid #333;
            padding-bottom: 0;
            padding-left: 5px;
            margin-bottom: 25px;
        }

        .histogram-bar-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            flex: 1;
            height: 100%;
            justify-content: flex-end;
            gap: 0;
            position: relative;
        }

        .histogram-bar-wrapper {
            width: 100%;
            display: flex;
            align-items: flex-end;
            justify-content: center;
            height: 100%;
            position: relative;
        }

        .histogram-bar {
            width: 100%;
            max-width: 60px;
            background: linear-gradient(180deg, #2196F3 0%, #1976D2 100%);
            border-radius: 4px 4px 0 0;
            min-height: 4px;
            transition: height 0.3s ease;
            box-shadow: 0 -1px 3px rgba(0,0,0,0.1);
            position: relative;
        }

        .histogram-bar:hover {
            opacity: 0.8;
        }

        .histogram-label {
            font-weight: 600;
            color: #1E88E5;
            font-size: 13px;
            margin-top: 8px;
            text-align: center;
            position: absolute;
            bottom: -25px;
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
        }

        .histogram-value {
            position: absolute;
            top: -20px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 12px;
            color: #333;
            font-weight: 600;
            white-space: nowrap;
        }

        .histogram-y-axis-label {
            position: absolute;
            left: -45px;
            top: 20px;
            height: 250px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 600;
            color: #333;
            white-space: nowrap;
            transform: rotate(-90deg);
            transform-origin: center;
        }

        .histogram-x-axis-label {
            text-align: center;
            font-size: 13px;
            font-weight: 600;
            color: #333;
            margin-top: 10px;
        }

        .histogram-y-axis-ticks {
            position: absolute;
            left: -50px;
            top: 0;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            font-size: 11px;
            color: #666;
        }

        /* Era Coverage - a true histogram: decades are contiguous, so the bars
           butt up against each other instead of standing apart like the
           categorical Player Count Distribution chart above. */
        .era-histogram .histogram-chart {
            gap: 0;
            /* Flush against the y-axis, so the first decade has no phantom gap. */
            padding-left: 0;
        }

        .era-histogram .histogram-bar {
            max-width: none;
            border-radius: 0;
            box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.85);
        }

        .era-histogram .histogram-bar-container:last-child .histogram-bar {
            box-shadow: none;
        }

        /* Match the plot area, so 100% lands on the chart top and 0% on the
           baseline instead of the ticks stretching over the axis labels too. */
        .era-histogram .histogram-y-axis-ticks {
            top: 20px;
            height: 250px;
        }

        .era-histogram .histogram-label {
            font-size: 12px;
        }

        @media (max-width: 768px) {
            /* Decade labels stop fitting side by side on a phone, so tip them
               instead of shortening them - "'20" cannot tell 1920s from 2020s.
               The extra bottom margin is the room the tipped labels need. */
            .era-histogram .histogram-chart {
                margin-bottom: 44px;
            }

            .era-histogram .histogram-label {
                font-size: 10px;
                bottom: -32px;
                width: auto;
                white-space: nowrap;
                transform: translateX(-50%) rotate(-45deg);
            }

            .era-histogram .histogram-value {
                font-size: 10px;
            }

            /* At ~20px per decade "<1%" runs into its neighbour, so the bars
               shed the sign; the ticks keep theirs and carry the unit. */
            .era-histogram .histogram-value .era-pct-sign {
                display: none;
            }

            /* Seat the ticks inside the container's own left padding rather
               than hanging them off its edge, where a phone-width modal clips
               them. That is the rotated label's space, so it stands down - the
               ticks read "100%" and the note below spells out the rest. */
            .era-histogram {
                padding-left: 42px;
                padding-right: 12px;
            }

            .era-histogram .histogram-y-axis-ticks {
                left: 0;
            }

            .era-histogram .histogram-y-axis-label {
                display: none;
            }
        }

        /* Grid table */
        .grid-table {
            border-collapse: separate;
            border-spacing: 0;
            width: 100%;
            font-size: 12px;
            table-layout: fixed;
        }

        .grid-table tr {
            height: 28px;
        }

        .grid-table th,
        .grid-table td {
            border: 1px solid #E6E9EF;
            padding: 0;
            text-align: left;
            vertical-align: middle;
            width: 180px;
            height: 28px;
            overflow: hidden;
            position: relative;
            box-sizing: border-box;
            font-size: 14px;
            line-height: 28px;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        /* Sticky headers */
        .grid-table thead th {
            position: sticky;
            top: 0;
            background-color: #F0F2F6;
            z-index: 10;
        }

        /* Sticky first column */
        .grid-table th:first-child,
        .grid-table td:first-child {
            position: sticky;
            left: 0;
            background-color: #F0F2F6;
            z-index: 5;
        }

        /* Corner cell (intersection of sticky header and column) */
        .grid-table thead th:first-child {
            z-index: 15;
        }

        /* Inner content wrapper for better text control */
        .grid-table th > div,
        .grid-table td > div {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            padding: 0 4px;
            box-sizing: border-box;
            line-height: 28px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 14px;
            text-align: left;
        }

        /* Header cells should be centered */
        .grid-table th > div {
            justify-content: center;
            font-weight: 600;
            text-align: center;
        }

        .grid-table tbody th {
            text-align: center;
        }

        .grid-table tbody th > div {
            justify-content: center;
            text-align: center;
        }

        .grid-table th {
            background-color: #F0F2F6;
            font-weight: 600;
            color: #262730;
            cursor: pointer;
        }

        /* Blank corner cell has no team name — not clickable */
        .grid-table thead th:first-child {
            cursor: default;
        }

        .grid-table th:hover:not(.grid-header-active) {
            background-color: #dbe4f0;
        }

        .grid-table thead th:first-child:hover {
            background-color: #F0F2F6;
        }

        /* Excel-style row/column highlighting */
        .grid-table th.grid-header-active {
            background-color: #1E88E5 !important;
            color: white !important;
        }

        .grid-table .grid-highlighted {
            box-shadow: inset 0 0 0 9999px rgba(30, 136, 229, 0.16);
        }

        /* Active cell: Excel-style selection border (wins over hover shadows) */
        .grid-table td.grid-cell-selected,
        .grid-table td.grid-cell-selected:hover {
            box-shadow: inset 0 0 0 2px #1E88E5 !important;
            z-index: 4;
        }

        /* Grid cell types: color communicates availability/fill state, not square type */
        .grid-table td.lower-triangular {
            background-color: black;
            color: white;
        }

        .grid-table td.diagonal {
            background-color: white;
            color: black;
            cursor: pointer;
        }

        /* Player card headshot styling */
        .player-card {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        /* Player card link styling */
        .player-card a {
            color: inherit;
            text-decoration: none;
            transition: color 0.2s ease;
        }

        .player-card a:hover {
            color: #007bff;
            text-decoration: underline;
        }

        .player-card .card-title a:hover {
            color: #0056b3;
        }

        /* Team badge link styling */
        .player-card .badge {
            transition: all 0.2s ease;
        }

        .player-card a:hover .badge {
            transform: scale(1.05);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }

        /* Ensure team badge links don't inherit text color */
        .player-card .card-text a {
            color: inherit;
        }

        .player-card .card-text a:hover {
            color: inherit;
            text-decoration: none;
        }

        /* Make headshot area more clickable - only for non-image headshots */
        .player-headshot:not(.has-image) a {
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            width: 100%;
            height: 100%;
            cursor: pointer;
            text-decoration: none;
            color: inherit;
        }

        .player-headshot a:hover {
            opacity: 0.8;
        }

        /* Ensure initials are centered when wrapped in link */
        .player-headshot a:has(.player-initials),
        .player-headshot a:has(span) {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Specific styling for player initials */
        .player-initials {
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            width: 100%;
            height: 100%;
            font-weight: bold;
            color: white;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
        }

        /* Fallback for browsers without :has() support */
        .player-headshot a span {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
        }

        /* Ensure proper centering for all headshot content */
        .player-headshot {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .player-headshot.has-image {
            display: block;
        }

        .player-headshot.has-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: inherit;
        }

        /* Override for split-alt headshots to maintain centering */
        .player-headshot.split-alt {
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
        }

        .player-info {
            flex: 1;
        }

        .player-headshot {
            width: 60px !important;
            height: 80px !important;
            border-radius: 16px;
            background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 24px;
            text-transform: uppercase;
            flex-shrink: 0;
            position: relative;
            z-index: 2;
            overflow: hidden;
        }

        .player-headshot.small {
            width: 40px;
            height: 40px;
            font-size: 14px;
            border-radius: 8px;
        }

        /* Small headshots for grid cells */
        .cell-content .player-headshot.small {
            width: 32px;
            height: 32px;
            font-size: 12px;
            margin: 1px;
            flex-shrink: 0;
            border-radius: 6px;
        }

        .cell-content .player-headshot.small img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            object-position: center;
            border-radius: 6px;
        }

        /* Split-circle headshot for team-specific colors */
        .player-headshot.split {
            width: 60px !important;
            height: 80px !important;
            border-radius: 16px;
            background: none;
            position: relative;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 24px;
            text-transform: uppercase;
            z-index: 2;
            flex-shrink: 0;
        }

        .player-headshot.split::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 50%;
            height: 100%;
            background: var(--team1-color, #1e3a8a);
            z-index: 1;
        }

        .player-headshot.split::after {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 50%;
            height: 100%;
            background: var(--team2-color, #3b82f6);
            z-index: 1;
        }

        /* Ensure text appears above the background */
        .player-headshot.split > * {
            position: relative;
            z-index: 3;
        }

        /* Alternative approach using background-clip for better text visibility */
        .player-headshot.split-alt {
            width: 60px !important;
            height: 80px !important;
            border-radius: 16px;
            background: linear-gradient(135deg, var(--team1-color, #1e3a8a) 0%, var(--team1-color, #1e3a8a) 45%, var(--team2-color, #3b82f6) 55%, var(--team2-color, #3b82f6) 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 24px;
            text-transform: uppercase;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
            flex-shrink: 0;
            position: relative;
            z-index: 2;
        }

        /* Headshot image styling */
        .player-headshot img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center top;
            border-radius: 16px;
            display: block;
        }

        /* Headshot link wrapper styling */
        .player-headshot a {
            display: block;
            width: 100%;
            height: 100%;
        }

        .player-headshot.has-image a {
            display: block;
            width: 100%;
            height: 100%;
        }

        /* Headshot with image - override background */
        .player-headshot.has-image {
            width: 60px !important;
            height: 80px !important;
            border-radius: 16px;
            background: none !important;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            position: relative;
            z-index: 2;
            overflow: hidden;
        }

        .player-headshot.has-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center top;
            border-radius: 16px;
            display: block;
        }

        /* Cell content — flex row keeps commas aligned when names mix weights/colors */
        .cell-content {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            align-items: center;
            width: 100%;
            height: 100%;
            min-width: 0;
            line-height: 28px;
            white-space: nowrap;
            overflow: hidden;
            box-sizing: border-box;
        }

        .cell-content .grid-player-name {
            font-weight: 400;
            flex-shrink: 0;
        }

        .cell-content .grid-player-sep {
            font-weight: 400;
            color: inherit;
            flex-shrink: 0;
            margin-right: 0.35em;
        }

        .grid-table td.diagonal:hover {
            background-color: rgb(220, 220, 220);
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .grid-table td.diagonal.incorrect {
            background-color: var(--check-wrong-bg) !important;
            color: var(--check-wrong-cell-text) !important;
        }

        .grid-table td.diagonal.incorrect:hover {
            background-color: var(--check-wrong-bg-hover) !important;
        }

        .grid-table td.diagonal.orange {
            background-color: var(--check-review-bg) !important;
            color: var(--check-review-cell-text) !important;
        }

        .grid-table td.diagonal.orange:hover {
            background-color: var(--check-review-bg-hover) !important;
        }

        .grid-table td.filled {
            background-color: white;
            color: black;
            cursor: pointer;
        }

        .grid-table td.filled:hover {
            background-color: #f8f9fa;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .grid-table td.filled.incorrect {
            background-color: var(--check-wrong-bg) !important;
            color: var(--check-wrong-cell-text) !important;
        }

        .grid-table td.filled.incorrect:hover {
            background-color: var(--check-wrong-bg-hover) !important;
        }

        .grid-table td.filled.orange {
            background-color: var(--check-review-bg) !important;
            color: var(--check-review-cell-text) !important;
        }

        .grid-table td.filled.orange:hover {
            background-color: var(--check-review-bg-hover) !important;
        }

        .grid-table td.empty {
            background-color: #E7E6E6;
            color: black;
            cursor: pointer;
        }

        .grid-table td.empty:hover {
            background-color: #DCDCDC;
        }

        .grid-table td.empty.incorrect {
            background-color: var(--check-wrong-bg) !important;
            color: var(--check-wrong-cell-text) !important;
        }

        .grid-table td.empty.incorrect:hover {
            background-color: var(--check-wrong-bg-hover) !important;
        }

        .grid-table td.empty.orange {
            background-color: var(--check-review-bg) !important;
            color: var(--check-review-cell-text) !important;
        }

        .grid-table td.empty.orange:hover {
            background-color: var(--check-review-bg-hover) !important;
        }

        /* ---- The Bench ---------------------------------------------------
           The rightmost column, past every team column and set off from the
           grid proper by a gap spacer. It scrolls with the grid like any other
           column. Row i holds the players placed on it for row i's team. */
        .grid-table th.bench-gap,
        .grid-table td.bench-gap {
            width: 14px;
            min-width: 14px;
            border-top: none;
            border-bottom: none;
            border-left: none;
            border-right: none;
            background-color: transparent;
            cursor: default;
        }

        .grid-table th.bench-col,
        .grid-table td.bench-col {
            border-left: 2px solid #B9A16B;
        }

        /* Clickable like the team headers — it highlights the bench column. */
        .grid-table thead th.bench-col {
            background-color: #EFE6CE;
            color: #6B5626;
        }

        .grid-table thead th.bench-col:hover:not(.grid-header-active) {
            background-color: #E4D6B4;
        }

        .grid-table td.bench-col {
            background-color: #FBF6EA;
            color: #4A3C1A;
            cursor: pointer;
        }

        .grid-table td.bench-col:hover {
            background-color: #F5EAD2;
        }

        .grid-table td.bench-col.filled {
            background-color: #F5EAD2;
            color: #4A3C1A;
        }

        .grid-table td.bench-col.filled:hover {
            background-color: #EFE0BF;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        /* The bench is off-grid, so check-grid coloring never applies to it. */
        .grid-table td.bench-col .grid-player-name {
            font-style: italic;
        }

        /* Bench detail modal disclaimer — same palette as the bench column
           header, so the note reads as part of the bench. */
        .alert.bench-alert {
            background-color: #EFE6CE;
            border-color: #B9A16B;
            color: #6B5626;
        }

        /* The Bench is a toggle button, not a switch, so it's the same size and
           shape as Inspire Me / Check / Clear Grid beside it. It inherits
           .btn-secondary for the resting grey and the blue hover; the rules
           here only add the pressed ("column showing") state. */
        .grid-controls .bench-toggle {
            white-space: nowrap;
        }

        /* Pressed = the column is showing. The button reads as physically
           depressed rather than changing colour: a darker face, a darker rim,
           and an inset shadow along the top edge where a real key would sit
           below the surface. Keeping the colour means it still matches its
           neighbours at a glance. */
        .grid-controls .bench-toggle.bench-on,
        .dashboard-header .bench-toggle.bench-on {
            background-color: #CFCECE;
            border-color: #B0AFAF;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.32);
        }

        /* Hover matches the siblings' blue in both states — the inset carries
           through it, so the pressed state survives the fill rather than being
           painted over. Specificity here has to beat .grid-controls
           .btn-secondary:hover, which is defined later in this sheet. */
        .grid-controls .bench-toggle.bench-on:hover {
            background-color: #1E88E5;
            border-color: #1670C4;
            color: white;
            box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.38);
        }

        /* Keyboard focus has to stay visible in both states, and must not wipe
           out the inset that carries the pressed state. */
        .grid-controls .bench-toggle:focus-visible {
            outline: 2px solid #1E88E5;
            outline-offset: 2px;
        }

        .grid-controls .bench-toggle:not(.bench-on):focus-visible {
            box-shadow: none;
        }

        /* Add tab's "Place on The Bench" checkbox — styled like the rest of the
           form (plain control + muted helper text), not like a callout box. */
        .bench-draft-check .form-check-input {
            cursor: pointer;
        }

        .bench-draft-check .form-check-input:checked {
            background-color: #B9A16B;
            border-color: #B9A16B;
        }

        .bench-draft-check .form-check-label {
            cursor: pointer;
            color: #262730;
        }

        .bench-draft-check.is-disabled .form-check-input,
        .bench-draft-check.is-disabled .form-check-label {
            cursor: default;
            color: #9AA0A6;
        }

        .bench-draft-hint {
            display: block;
            margin-top: 2px;
            line-height: 1.35;
            white-space: normal;
        }

        .lookup-chip-bench {
            color: #6B5626;
            font-weight: 600;
        }

        /* Check-grid player highlights (single-line cells prevent row growth) */
        .cell-content .grid-player-name.incorrect-player {
            color: var(--check-wrong) !important;
            font-weight: 600;
        }

        .cell-content .grid-player-name.orange-player {
            color: var(--check-review) !important;
            font-weight: 600;
        }

        .cell-content .grid-player-name.complete-career-player {
            color: var(--check-ok) !important;
            font-weight: 700;
        }

        .player-card .complete-career-player,
        .player-card a.complete-career-player {
            color: var(--check-ok) !important;
            font-weight: 700;
        }

        .player-card a.complete-career-player:hover {
            color: var(--check-ok-hover) !important;
        }

        .player-card .incorrect-player,
        .player-card a.incorrect-player {
            color: var(--check-wrong) !important;
            font-weight: 700;
        }

        .player-card a.incorrect-player:hover {
            color: var(--check-wrong-hover) !important;
        }

        .player-card .orange-player,
        .player-card a.orange-player {
            color: var(--check-review) !important;
            font-weight: 700;
        }

        .player-card a.orange-player:hover {
            color: var(--check-review-hover) !important;
        }

        /* Check Square / Check Player: shared light red (not deep Bootstrap danger) */
        .card.player-card-incorrect {
            background-color: var(--check-wrong-bg);
            border-color: var(--check-wrong-border);
        }

        .card.player-card-orange {
            background-color: var(--check-review-bg);
            border-color: var(--check-review-border);
        }

        .card.player-card-complete {
            background-color: var(--check-ok-bg);
            border-color: var(--check-ok-border);
        }

        .badge.check-incorrect-badge {
            background-color: var(--check-wrong-bg) !important;
            color: var(--check-wrong) !important;
            border: 1px solid var(--check-wrong-border);
        }

        .grid-controls .dropdown-menu {
            --bs-dropdown-min-width: 10rem;
        }

        .grid-controls .dropdown-item:active {
            background-color: #1E88E5;
        }

        .grid-controls .dropdown-divider {
            margin: 2px 0;
        }

        /* Header menu — one dropdown for everything outside The Grid */
        .main-menu-toggle {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
        }

        .main-menu-dropdown {
            --bs-dropdown-min-width: 13.5rem;
            padding: 0.35rem;
            border: 1px solid #E0E0E0;
            border-radius: 10px;
            box-shadow: 0 10px 28px rgba(38, 39, 48, 0.16);
        }

        .main-menu-dropdown .dropdown-item {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            border-radius: 7px;
            padding: 0.45rem 0.6rem;
            font-weight: 500;
        }

        .main-menu-dropdown .dropdown-item svg {
            flex-shrink: 0;
            color: #1E88E5;
        }

        .main-menu-dropdown .dropdown-item:hover,
        .main-menu-dropdown .dropdown-item:focus {
            background-color: #E3F2FD;
            color: #0D47A1;
        }

        .main-menu-dropdown .dropdown-item:active {
            background-color: #1E88E5;
            color: #fff;
        }

        .main-menu-dropdown .dropdown-item:active svg {
            color: #fff;
        }

        .main-menu-dropdown .dropdown-item-danger,
        .main-menu-dropdown .dropdown-item-danger svg {
            color: #B71C1C;
        }

        .main-menu-dropdown .dropdown-item-danger:hover,
        .main-menu-dropdown .dropdown-item-danger:focus {
            background-color: #FFEBEE;
            color: #B71C1C;
        }

        .main-menu-dropdown .dropdown-divider {
            margin: 0.3rem 0.2rem;
        }

        /* Revision History */
        .revision-footer {
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        /* Player and square cards opened from Revision History sit above it
           so closing them returns you to the same list. */
        body.revision-card-open #cellDetailsModal,
        body.revision-card-open #lookupPlayersModal {
            z-index: 1075;
        }

        body.revision-card-open .modal-backdrop ~ .modal-backdrop {
            z-index: 1065 !important;
        }

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

        .revision-day {
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: #8A8F98;
            margin: 1rem 0 0.4rem;
        }

        .revision-list .revision-day:first-child {
            margin-top: 0;
        }

        .revision-item {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            padding: 0.7rem 0.25rem;
            border-top: 1px solid #EEEEEE;
        }

        .revision-day + .revision-item {
            border-top: none;
        }

        .revision-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            margin-top: 0.1rem;
        }

        .revision-body {
            flex: 1 1 auto;
            min-width: 0;
        }

        .revision-headline {
            display: flex;
            flex-wrap: wrap;
            align-items: baseline;
            gap: 0.45rem;
        }

        .revision-tag {
            font-size: 0.67rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            padding: 0.1rem 0.4rem;
            border-radius: 999px;
        }

        .revision-message {
            color: #262730;
            font-weight: 600;
            overflow-wrap: anywhere;
        }

        /* Player and team names inside a history line open their card. */
        .revision-link {
            background: none;
            border: none;
            padding: 0;
            font: inherit;
            color: #1565C0;
            text-decoration: underline;
            text-decoration-color: rgba(21, 101, 192, 0.35);
            text-underline-offset: 2px;
            cursor: pointer;
        }

        .revision-link:hover,
        .revision-link:focus-visible {
            color: #0D47A1;
            text-decoration-color: currentColor;
        }

        .revision-badges {
            display: flex;
            flex-wrap: wrap;
            gap: 0.3rem;
            margin-top: 0.4rem;
        }

        /* New square sits on the right of the same row as the optimize-grid count. */
        .revision-meta {
            display: flex;
            align-items: center;
            flex-wrap: nowrap;
            gap: 0.5rem;
            margin-top: 0.35rem;
        }

        .revision-meta .revision-moves-summary {
            flex: 1 1 auto;
            margin-top: 0;
            min-width: 0;
        }

        .revision-meta .revision-badges {
            flex: 0 0 auto;
            margin-top: 0;
            margin-left: auto;
        }

        /* Same placard shape as the team badges on a player card. */
        .revision-new-square {
            display: inline-block;
            background-color: #2E7D32;
            border: none;
            border-radius: 0.25rem;
            color: #fff;
            font-size: 0.7rem;
            font-weight: 700;
            letter-spacing: 0.02em;
            padding: 0.25em 0.5em;
            line-height: 1;
        }

        button.revision-new-square {
            cursor: pointer;
        }

        button.revision-new-square:hover,
        button.revision-new-square:focus-visible {
            background-color: #1B5E20;
        }

        .revision-new-square-inline {
            margin-left: 0.15em;
            vertical-align: 0.12em;
            white-space: nowrap;
        }

        .revision-moves {
            list-style: none;
            margin: 0.4rem 0 0;
            padding: 0 0 0 0.85rem;
            border-left: 2px solid #E3F2FD;
        }

        .revision-moves li {
            color: #5A5F6A;
            font-size: 0.88rem;
            padding: 0.1rem 0;
            overflow-wrap: anywhere;
        }

        .revision-moves-summary {
            margin-top: 0.35rem;
            font-size: 0.8rem;
            color: #8A8F98;
        }

        .revision-time {
            flex-shrink: 0;
            font-size: 0.78rem;
            color: #8A8F98;
            white-space: nowrap;
            padding-top: 0.15rem;
        }

        .revision-empty {
            text-align: center;
            color: #5A5F6A;
            padding: 2rem 1rem;
        }

        .revision-empty-title {
            font-weight: 700;
            color: #262730;
            margin-bottom: 0.35rem;
        }

        /* Revision action colors, shared by the icon bubble and the tag */
        .revision-add { background-color: #E8F5E9; color: #2E7D32; }
        .revision-promote { background-color: #E8F5E9; color: #1B5E20; }
        .revision-bench { background-color: #FFF3E0; color: #E65100; }
        .revision-update { background-color: #E3F2FD; color: #1565C0; }
        .revision-remove { background-color: #FFEBEE; color: #B71C1C; }
        .revision-clear { background-color: #FFEBEE; color: #B71C1C; }

        /* Account & Settings */
        .account-profile {
            display: flex;
            align-items: center;
            gap: 0.9rem;
            padding-bottom: 1.1rem;
            border-bottom: 1px solid #EEEEEE;
        }

        .account-avatar {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background-color: #1E88E5;
            color: #fff;
            font-size: 1.35rem;
            font-weight: 700;
            flex-shrink: 0;
        }

        .account-name {
            font-size: 1.15rem;
            font-weight: 700;
            color: #262730;
            overflow-wrap: anywhere;
        }

        .account-meta {
            font-size: 0.85rem;
            color: #8A8F98;
        }

        .account-section {
            padding-top: 1.1rem;
            margin-top: 1.1rem;
            border-top: 1px solid #EEEEEE;
        }

        .account-profile + .account-section,
        .account-section-first {
            border-top: none;
            margin-top: 0;
        }

        .account-section-title {
            font-size: 0.74rem;
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: #8A8F98;
            margin-bottom: 0.7rem;
        }

        .account-help {
            font-size: 0.85rem;
            color: #5A5F6A;
            margin: 0.5rem 0 0.85rem;
        }

        .account-switch .form-check-input {
            cursor: pointer;
        }

        .account-switch .form-check-label {
            font-weight: 600;
            color: #262730;
            cursor: pointer;
        }

        .account-select {
            max-width: 22rem;
        }

        .appearance-mode-toggle {
            display: inline-flex;
            border: 1px solid #E6E9EF;
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 0.15rem;
        }

        .appearance-mode-btn {
            background: #F0F2F6;
            border: none;
            color: #262730;
            font-weight: 600;
            padding: 0.45rem 1.15rem;
            min-width: 5.5rem;
            font-family: inherit;
        }

        .appearance-mode-btn + .appearance-mode-btn {
            border-left: 1px solid #E6E9EF;
        }

        .appearance-mode-btn.active {
            background: #1E88E5;
            color: #fff;
        }

        .appearance-mode-btn:hover:not(.active) {
            background: #E3F2FD;
        }

        .check-label-ok { color: var(--check-ok); }
        .check-label-wrong { color: var(--check-wrong); }
        .check-label-review { color: var(--check-review); }

        .colorblind-legend-list {
            margin: 0.35rem 0 0;
            padding-left: 0;
            list-style: none;
            font-size: 0.85rem;
            color: #5A5F6A;
        }

        .colorblind-legend-list li {
            display: flex;
            align-items: flex-start;
            gap: 0.5rem;
        }

        .colorblind-legend-list li + li {
            margin-top: 0.4rem;
        }

        .colorblind-swatch {
            display: inline-block;
            flex-shrink: 0;
            width: 1.15rem;
            height: 1.15rem;
            margin-top: 0.12rem;
            border-radius: 3px;
            border: 1px solid rgba(0, 0, 0, 0.2);
            background-color: var(--check-ok-bg);
            background-repeat: repeat;
        }

        .colorblind-swatch-ok {
            background-color: var(--check-ok-bg);
            border-color: var(--check-ok-border);
        }

        .colorblind-swatch-wrong {
            background-color: var(--check-wrong-bg);
            border-color: var(--check-wrong-border);
            background-image: var(--cb-pattern-wrong);
        }

        .colorblind-swatch-review {
            background-color: var(--check-review-bg);
            border-color: var(--check-review-border);
            background-image: var(--cb-pattern-review);
        }

        .stats-body-empty {
            text-align: center;
            padding: 40px 20px;
        }

        .stats-empty-title {
            font-size: 24px;
            color: #37474F;
            margin-bottom: 12px;
        }

        .stats-empty-copy {
            font-size: 18px;
            color: #78909C;
            margin: 0;
        }

        #changePasswordForm {
            max-width: 24rem;
        }

        /* Landing page — match dashboard visual language */
        #landingPage {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background-color: #FAFAFA;
            padding: 32px 20px;
        }

        #landingPage .landing-card {
            width: 100%;
            max-width: 960px;
            background-color: white;
            border: 1px solid #E6E9EF;
            border-radius: 4px;
            padding: 2rem 2rem 1.75rem;
            text-align: center;
        }

        #landingPage .landing-header {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 14px;
            margin-bottom: 1rem;
        }

        #landingPage .landing-medal {
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            flex-shrink: 0;
        }

        #landingPage .landing-medal img {
            height: 2.5rem;
            width: auto;
            display: block;
        }

        #landingPage .landing-title {
            color: #262730;
            font-size: 2.5rem;
            font-weight: 700;
            margin: 0;
        }

        #landingPage .landing-tagline {
            color: #5f6b7a;
            font-size: 1.15rem;
            margin: 0 auto 1.5rem;
            max-width: 560px;
        }

        #landingPage .landing-inspired {
            color: #5f6b7a;
            font-size: 0.95rem;
            margin: 0 auto 1.75rem;
            max-width: 640px;
            line-height: 1.5;
        }

        #landingPage .landing-mini-grid-wrap {
            display: flex;
            justify-content: center;
            margin: 0 auto 1.25rem;
        }

        #landingPage .landing-mini-grid {
            border-collapse: collapse;
            table-layout: fixed;
            width: 280px;
            height: auto;
            font-size: 0.62rem;
            user-select: none;
            pointer-events: none;
        }

        #landingPage .landing-mini-grid col {
            width: 70px;
        }

        #landingPage .landing-mini-grid th,
        #landingPage .landing-mini-grid td {
            border: 1px solid #E6E9EF;
            width: 70px;
            height: 70px;
            text-align: center;
            vertical-align: middle;
            padding: 0;
            line-height: 1.15;
            box-sizing: border-box;
            overflow: hidden;
        }

        #landingPage .landing-mini-grid tr {
            height: 70px;
        }

        #landingPage .landing-mini-grid th {
            background-color: #F0F2F6;
            color: #262730;
            font-weight: 600;
            font-size: 0.75rem;
        }

        #landingPage .landing-mini-grid td {
            background-color: white;
            color: #262730;
        }

        #landingPage .landing-mini-grid td.filled {
            background-color: white;
            color: #262730;
            font-weight: 600;
        }

        #landingPage .landing-mini-grid td.diagonal {
            background-color: white;
            color: #262730;
            font-weight: 600;
        }

        #landingPage .landing-mini-grid td.lower-triangular {
            background-color: black;
            color: white;
            border-color: #333;
        }

        #landingPage .landing-mini-grid td.empty {
            background-color: #E7E6E6;
            color: #262730;
            font-weight: 600;
            font-size: 1rem;
            line-height: 1;
        }

        #landingPage .landing-features {
            margin-bottom: 1.75rem;
        }

        #landingPage .landing-panel {
            background-color: #F7F9FC;
            border: 1px solid #E6E9EF;
            border-radius: 4px;
            padding: 1.25rem 1rem;
            height: 100%;
            text-align: center;
        }

        #landingPage .landing-panel-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 0.5rem;
            line-height: 1;
            color: #1565C0;
        }

        #landingPage .landing-panel-icon svg {
            width: 1.75rem;
            height: 1.75rem;
        }

        #landingPage .landing-panel h5 {
            color: #262730;
            font-weight: 700;
            font-size: 0.95rem;
            margin-bottom: 0.4rem;
        }

        #landingPage .landing-panel p {
            color: #5f6b7a;
            font-size: 0.85rem;
            margin: 0;
        }

        #landingPage .landing-panel-nfl { border-top: 3px solid #A5D6A7; }
        #landingPage .landing-panel-nba { border-top: 3px solid #B39DDB; }
        #landingPage .landing-panel-mlb { border-top: 3px solid #FFCC80; }
        #landingPage .landing-panel-nhl { border-top: 3px solid #E57373; }

        #landingPage .landing-cta {
            background-color: #1E88E5;
            border-color: #1E88E5;
            color: white;
            font-weight: 700;
            font-size: 1.1rem;
            padding: 0.75rem 2.5rem;
            transition: background-color 0.2s ease, border-color 0.2s ease;
        }

        #landingPage .landing-cta:hover {
            background-color: #1976D2;
            border-color: #1976D2;
            color: white;
        }

        #landingPage .landing-footer {
            color: #78909C;
            font-size: 0.9rem;
            margin-top: 1rem;
            margin-bottom: 0;
        }

        #landingPage .landing-feedback {
            background: none;
            border: none;
            color: #78909C;
            font-size: 0.85rem;
            margin-top: 0.35rem;
            padding: 0;
            text-decoration: underline;
            text-underline-offset: 2px;
        }

        #landingPage .landing-feedback:hover {
            color: #1E88E5;
        }

        .feedback-honeypot {
            position: absolute;
            left: -10000px;
            top: auto;
            width: 1px;
            height: 1px;
            overflow: hidden;
        }

        @media (max-width: 576px) {
            #landingPage .landing-title {
                font-size: 1.75rem;
            }

            #landingPage .landing-card {
                padding: 1.5rem 1rem 1.25rem;
            }

            #landingPage .landing-mini-grid {
                width: 220px;
            }

            #landingPage .landing-mini-grid col {
                width: 55px;
            }

            #landingPage .landing-mini-grid th,
            #landingPage .landing-mini-grid td {
                width: 55px;
                height: 55px;
            }

            #landingPage .landing-mini-grid tr {
                height: 55px;
            }
        }

        /* Loading spinners - override Bootstrap's text-primary to use Sports Blue */
        .spinner-border.text-primary {
            color: #1E88E5 !important;
            border-color: #1E88E5;
        }

        .spinner-border.text-primary .spinner-border-sm {
            border-color: #1E88E5;
            border-right-color: transparent;
        }

        /* Forms */
        .form-label {
            font-weight: 600;
            color: #262730;
            margin-bottom: 5px;
        }

        .form-control, .form-select {
            border: 1px solid #E6E9EF;
            border-radius: 4px;
            padding: 8px 12px;
            font-size: 14px;
        }

        .form-control:focus, .form-select:focus {
            border-color: #1E88E5;
            box-shadow: 0 0 0 0.2rem rgba(30, 136, 229, 0.25);
        }

        /* Buttons */
        .btn-primary {
            background-color: #1E88E5;
            border-color: #1E88E5;
            font-weight: 500;
        }

        .btn-primary:hover {
            background-color: #1976D2;
            border-color: #1976D2;
        }

        .confirm-modal-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .confirm-modal-title svg {
            flex-shrink: 0;
            color: #1E88E5;
        }

        #clearGridModal .confirm-modal-title svg {
            color: #B71C1C;
        }

        .btn-clear-grid {
            background-color: #B71C1C;
            border-color: #B71C1C;
            color: #fff;
            font-weight: 500;
        }

        .btn-clear-grid:hover {
            background-color: #8E1E1E;
            border-color: #8E1E1E;
            color: #fff;
        }

        /* Header and grid control buttons - light gray by default, fill with primary color on hover */
        .dashboard-header .btn-secondary,
        .grid-controls .btn-secondary {
            background-color: rgb(231, 230, 230);
            border-color: rgb(231, 230, 230);
            color: black;
            transition: all 0.2s ease;
            font-weight: 500;
        }

        .dashboard-header .btn-secondary:hover,
        .grid-controls .btn-secondary:hover {
            background-color: #1E88E5;
            border-color: #1E88E5;
            color: white;
        }

        /* Inspire Me cards: soft slate (player) + soft peach (team combo) */
        #inspireMeModal .inspire-option-card .card-header.inspire-header-slate {
            background-color: #78909C;
            color: #fff;
            border-bottom: none;
        }

        #inspireMeModal .inspire-option-card .card-header.inspire-header-peach {
            background-color: #E8B4A0;
            color: #fff;
            border-bottom: none;
        }

        #inspirePlayerForm .btn-primary {
            background-color: #78909C;
            border-color: #78909C;
        }

        #inspirePlayerForm .btn-primary:hover {
            background-color: #607D8B;
            border-color: #607D8B;
        }

        #inspireTeamComboForm .btn-primary {
            background-color: #E8B4A0;
            border-color: #E8B4A0;
        }

        #inspireTeamComboForm .btn-primary:hover {
            background-color: #D9A08C;
            border-color: #D9A08C;
        }

        /* Hide select elements in Inspire Me / Check modals until Select2 initializes */
        #inspireMeModal select.form-select:not(.select2-hidden-accessible),
        #checkPlayerModal select.form-select:not(.select2-hidden-accessible),
        #checkSquareModal select.form-select:not(.select2-hidden-accessible) {
            opacity: 0;
            position: absolute;
            pointer-events: none;
        }

        #inspireMeModal .select2-container,
        #checkPlayerModal .select2-container,
        #checkSquareModal .select2-container {
            opacity: 1 !important;
            position: relative !important;
            pointer-events: auto !important;
            z-index: 9999 !important;
        }

        #inspireMeModal .select2-container .select2-selection,
        #checkPlayerModal .select2-container .select2-selection,
        #checkSquareModal .select2-container .select2-selection {
            pointer-events: auto !important;
            cursor: pointer !important;
        }

        #inspireMeModal .select2-dropdown,
        #checkPlayerModal .select2-dropdown,
        #checkSquareModal .select2-dropdown {
            z-index: 10000 !important;
        }

        .inspire-position-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem 0.85rem;
        }

        .inspire-position-grid .form-check {
            min-width: 3.5rem;
        }

        /* Check Square / Check Player: scroll long player-card result lists.
           Select2 uses dropdownParent: body, so the modal can keep overflow auto. */
        #checkSquareModal .modal-dialog.modal-dialog-scrollable,
        #checkPlayerModal .modal-dialog.modal-dialog-scrollable {
            max-height: calc(100vh - 2rem);
        }

        #checkSquareModal .modal-dialog-scrollable .modal-body,
        #checkPlayerModal .modal-dialog-scrollable .modal-body {
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        /* Prevent modal backdrop from closing Select2 dropdowns */
        .modal-backdrop {
            z-index: 1040 !important;
        }

        .select2-dropdown {
            z-index: 10001 !important;
        }

        /* Ensure Select2 results are clickable */
        .select2-results__option {
            pointer-events: auto !important;
            cursor: pointer !important;
        }

        .btn-secondary {
            background-color: #F0F2F6;
            border-color: #E6E9EF;
            color: #262730;
            font-weight: 500;
        }

        .btn-secondary:hover {
            background-color: #E6E9EF;
            border-color: #D1D5DB;
            color: #262730;
        }

        /* Alerts */
        .alert {
            border-radius: 4px;
            border: 1px solid;
            font-size: 14px;
        }

        #alertsContainer .alert {
            min-width: 300px;
            max-width: 420px;
            margin-bottom: 10px;
        }

        .alert-success {
            background-color: #D4EDDA;
            border-color: #C3E6CB;
            color: #155724;
        }

        .alert-danger {
            background-color: #F8D7DA;
            border-color: #F5C6CB;
            color: #721C24;
        }

        .alert-warning {
            background-color: #FFF3CD;
            border-color: #FFEAA7;
            color: #856404;
        }

        .alert-check-incorrect {
            --bs-alert-color: var(--check-wrong);
            --bs-alert-bg: var(--check-wrong-bg);
            --bs-alert-border-color: var(--check-wrong-border);
            background-color: var(--check-wrong-bg);
            border-color: var(--check-wrong-border);
            color: var(--check-wrong);
        }

        .alert-info {
            background-color: #D1ECF1;
            border-color: #BEE5EB;
            color: #0C5460;
        }

        /* One-time product announcement. Borrows the .alert-info palette, but
           caps the width: announcements run to a couple of sentences, and
           without a ceiling the toast stretches across the whole screen the way
           the one-line toasts around it never do. */
        .alert.alert-announcement {
            background-color: #D1ECF1;
            border-color: #BEE5EB;
            color: #0C5460;
            max-width: 420px;
            /* Above the first-run tutorial overlay (~10000) so a deferred
               announcement is still readable if timing overlaps. */
            position: relative;
            z-index: 10110;
        }

        /* Loading states */
        .loading {
            display: none;
        }

        /* Sports-themed progress bar - matches website color scheme */
        #gridProgressBar {
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            background-color: #F0F2F6;
        }

        #gridProgressBar .progress-bar {
            background: linear-gradient(90deg,
                #1E88E5 0%,
                #42A5F5 50%,
                #1E88E5 100%);
            background-size: 200% 100%;
            animation: progressGradient 2s ease infinite;
            font-weight: 600;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            border-radius: 12px;
            transition: width 0.3s ease;
        }

        @keyframes progressGradient {
            0% {
                background-position: 0% 50%;
            }
            50% {
                background-position: 100% 50%;
            }
            100% {
                background-position: 0% 50%;
            }
        }

        #gridProgressText {
            font-weight: 600;
            color: white;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
            letter-spacing: 0.5px;
        }

        /* History and lookup output */
        .history-output, .lookup-results {
            background-color: #F8F9FA;
            border: 1px solid #E6E9EF;
            border-radius: 4px;
            padding: 15px;
            max-height: 300px;
            overflow-y: auto;
            font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            font-size: 14px;
            line-height: 1.6;
            margin-top: 15px;
        }

        /* Lookup results are grouped chips rather than a paragraph, so they need
           a little more room before scrolling. */
        .lookup-results {
            max-height: 420px;
        }

        /* Structured Lookup / History results: a header line plus one item per
           row (player or team), with an "and N others" row that opens the full
           list in a popup. */
        .lookup-head {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 10px;
            flex-wrap: wrap;
            padding-bottom: 10px;
            border-bottom: 1px solid #E6E9EF;
        }

        .lookup-square {
            font-weight: 700;
            font-size: 1.05rem;
            color: #262730;
        }

        .lookup-total {
            font-size: 0.85rem;
            font-weight: 600;
            color: #6C757D;
        }

        .lookup-group {
            margin-top: 14px;
        }

        .lookup-group-head {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 6px;
        }

        .lookup-group-title {
            font-size: 0.78rem;
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: #6C757D;
        }

        .lookup-group-count {
            background: #ECEFF3;
            color: #495057;
            border-radius: 10px;
            padding: 0 8px;
            font-size: 0.75rem;
            font-weight: 700;
            line-height: 18px;
        }

        .lookup-chips {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 6px;
        }

        .lookup-chip {
            display: block;
            width: 100%;
            box-sizing: border-box;
            text-align: left;
            background: #FFFFFF;
            border: 1px solid #E6E9EF;
            border-radius: 6px;
            padding: 6px 10px;
            font-size: 0.9rem;
            color: #262730;
        }

        .lookup-chip-current {
            background: #E1F5FE;
            border-color: #B3E5FC;
            color: #1565C0;
            font-weight: 600;
        }

        button.lookup-chip {
            font-family: inherit;
            appearance: none;
            -webkit-appearance: none;
        }

        .lookup-chip-more {
            cursor: pointer;
            font-weight: 600;
            color: #1565C0;
            background: #F1F6FB;
            border-color: #CFE2F3;
        }

        .lookup-chip-more:hover {
            background: #1E88E5;
            border-color: #1E88E5;
            color: #FFFFFF;
        }

        .lookup-empty {
            font-size: 0.9rem;
            color: #6C757D;
        }

        /* Chips with a card behind them, same as double-clicking a grid square */
        .lookup-chip-player {
            cursor: pointer;
        }

        .lookup-chip-player:hover {
            border-color: #1E88E5;
        }

        .lookup-modal-subtitle {
            font-size: 0.85rem;
            color: #6C757D;
            margin-top: 2px;
        }

        /* Coming soon pages */
        .coming-soon {
            background-color: #E0E0E0;
            padding: 100px;
            border-radius: 4px;
            text-align: center;
        }

        .coming-soon h1 {
            margin: 0;
            color: #757575;
        }

        .coming-soon p {
            margin: 0;
            color: #757575;
        }

        /* Floating action button — opens player menu on mobile */
        .mobile-menu-fab {
            align-items: center;
            background-color: #1E88E5;
            border: none;
            border-radius: 999px;
            bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
            box-shadow: 0 4px 14px rgba(30, 136, 229, 0.45);
            color: white;
            display: none;
            font-size: 0.95rem;
            font-weight: 600;
            gap: 0.4rem;
            padding: 0.65rem 1.1rem;
            position: fixed;
            right: 1rem;
            z-index: 1055;
        }

        .mobile-menu-fab svg {
            flex-shrink: 0;
        }

        .mobile-menu-backdrop {
            background: rgba(0, 0, 0, 0.45);
            display: none;
            inset: 0;
            position: fixed;
            z-index: 1058;
        }

        .mobile-menu-backdrop.show {
            display: block;
        }

        /* Responsive */
        @media (max-width: 991px) {
            .dashboard-header .d-flex.justify-content-between {
                align-items: flex-start !important;
                flex-direction: column;
                gap: 0.75rem;
            }

            .dashboard-header .dashboard-title {
                font-size: 1.5rem;
            }

            .dashboard-header .medal-logo img {
                height: 2.25rem;
            }

            .dashboard-header-actions {
                display: flex;
                flex-wrap: wrap;
                gap: 0.5rem;
                width: 100%;
            }

            .dashboard-header-actions .btn {
                flex: 1 1 auto;
                min-width: 0;
                padding: 0.4rem 0.65rem;
                font-size: 0.85rem;
            }

            .dashboard-header-actions #mainMenuGroup {
                flex: 1 1 auto;
            }

            .dashboard-header-actions .main-menu-toggle {
                justify-content: center;
            }

            #usernameDisplay {
                display: block;
                margin: 0 0 0.25rem !important;
                width: 100%;
            }

            .dashboard-toolbar {
                align-items: stretch !important;
                flex-direction: column;
                gap: 0.65rem;
            }

            .sport-tabs {
                width: 100%;
            }

            .sport-tabs .nav-link {
                font-size: 0.8rem;
                padding: 0.55rem 0.35rem;
            }

            .grid-controls {
                flex-wrap: wrap;
                gap: 0.45rem;
                justify-content: flex-start;
                width: 100%;
            }

            .grid-controls .btn,
            .grid-controls .btn-group {
                flex: 1 1 calc(50% - 0.25rem);
                min-width: 0;
            }

            .grid-controls .btn-group .btn {
                width: 100%;
            }

            .sport-content-row .grid-content-col {
                flex: 0 0 100%;
                max-width: 100%;
            }

            .sport-content-row .sidebar-menu-col {
                bottom: 0;
                left: 0;
                max-height: 88vh;
                max-width: 100%;
                padding: 0 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
                pointer-events: none;
                position: fixed;
                right: 0;
                transform: translateY(105%);
                transition: transform 0.28s ease;
                width: 100%;
                z-index: 1070;
            }

            .sport-content-row .sidebar-menu-col.is-open {
                pointer-events: auto;
                transform: translateY(0);
            }

            .sport-content-row .sidebar-menu-col .menu-container {
                border-radius: 12px 12px 0 0;
                box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
                max-height: 88vh;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }

            .sport-content-row .sidebar-menu-col .menu-tabs .nav-link {
                font-size: 0.78rem;
                padding: 0.55rem 0.2rem;
            }

            .sport-content-row .sidebar-menu-col .mobile-menu-header {
                align-items: center;
                background: white;
                border-bottom: 1px solid #E6E9EF;
                border-radius: 12px 12px 0 0;
                display: flex;
                justify-content: space-between;
                padding: 0.75rem 1rem;
                position: sticky;
                top: 0;
                z-index: 2;
            }

            .sport-content-row .sidebar-menu-col .mobile-menu-header h6 {
                font-size: 1rem;
                font-weight: 700;
                margin: 0;
            }

            .grid-wrapper {
                --grid-cell-base: 76px;
                --grid-font-base: 11px;
                --grid-line-base: 32px;
                --grid-zoom: 1;
                height: calc(100vh - 20rem);
                max-height: 560px;
                min-height: 280px;
                -webkit-overflow-scrolling: touch;
            }

            body.tour-active .grid-wrapper {
                height: min(calc(100vh - 22rem), 360px);
                max-height: min(38vh, 360px);
                min-height: 140px;
            }

            body.tour-active.tour-grid-compact .grid-wrapper {
                height: min(calc(100vh - 30rem), 220px);
                max-height: min(26vh, 240px);
                min-height: 100px;
            }

            @media (min-height: 700px) {
                body.tour-active.tour-grid-compact .grid-wrapper {
                    height: min(calc(100vh - 32rem), 200px);
                    max-height: min(22vh, 220px);
                }
            }

            .grid-wrapper .grid-table th:not(.bench-gap),
            .grid-wrapper .grid-table td:not(.bench-gap) {
                font-size: calc(var(--grid-font-base) * var(--grid-zoom));
                line-height: 1.2;
                max-width: calc(var(--grid-cell-base) * var(--grid-zoom));
                min-width: calc(var(--grid-cell-base) * var(--grid-zoom));
                width: calc(var(--grid-cell-base) * var(--grid-zoom));
            }

            .grid-wrapper .grid-table th.bench-gap,
            .grid-wrapper .grid-table td.bench-gap {
                max-width: 8px;
                min-width: 8px;
                width: 8px;
            }

            .grid-wrapper .grid-table tr {
                height: calc(var(--grid-line-base) * var(--grid-zoom));
            }

            .grid-wrapper .grid-table thead th > div,
            .grid-wrapper .grid-table tbody th > div {
                align-items: center;
                display: flex;
                font-size: calc((var(--grid-font-base) + 1px) * var(--grid-zoom));
                font-weight: 700;
                justify-content: center;
                letter-spacing: 0.02em;
                line-height: 1.1;
                padding: 0 2px;
                text-align: center;
                white-space: nowrap;
                width: 100%;
            }

            .grid-wrapper .grid-table tbody th {
                text-align: center;
            }

            .grid-wrapper .grid-table td > div {
                font-size: calc(var(--grid-font-base) * var(--grid-zoom));
                line-height: 1.2;
                padding: 0 3px;
            }

            .grid-table th,
            .grid-table td {
                touch-action: manipulation;
            }

            .grid-container {
                padding: 10px;
            }

            .grid-stats {
                font-size: 0.85rem;
                padding: 10px 12px;
            }

            .sport-banner {
                padding: 10px 12px;
            }

            .sport-banner h2 {
                font-size: 1.15rem;
            }

            body.dashboard-visible .main-container {
                padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
            }

            .mobile-menu-fab {
                display: none;
            }

            body.dashboard-visible .mobile-menu-fab.mobile-menu-fab-visible {
                display: inline-flex;
            }

            body.mobile-menu-open {
                overflow: hidden;
            }

            .menu-content small.text-muted {
                display: block;
            }

            /* How to Play / Check / Inspire modals — fullscreen below lg */
            #inspireMeModal .modal-content,
            #inspireFiltersModal .modal-content,
            #checkAccuracyModal .modal-content,
            #checkPlayerModal .modal-content,
            #checkSquareModal .modal-content {
                display: flex;
                flex-direction: column;
                min-height: 100%;
            }

            #howToPlayModal .modal-dialog.modal-fullscreen-lg-down,
            #revisionHistoryModal .modal-dialog.modal-fullscreen-lg-down,
            #accountModal .modal-dialog.modal-fullscreen-lg-down {
                height: 100%;
                margin: 0;
                max-height: 100dvh;
            }

            #howToPlayModal .modal-content,
            #revisionHistoryModal .modal-content,
            #accountModal .modal-content {
                display: flex;
                flex-direction: column;
                height: 100%;
                max-height: 100dvh;
                overflow: hidden;
            }

            #howToPlayModal .modal-header,
            #howToPlayModal #howToPlayTabs,
            #howToPlayModal .modal-footer,
            #revisionHistoryModal .modal-header,
            #revisionHistoryModal #revisionSportTabs,
            #revisionHistoryModal .modal-footer,
            #accountModal .modal-header,
            #accountModal #accountTabs {
                flex-shrink: 0;
            }

            #howToPlayModal .modal-body {
                display: flex;
                flex: 1 1 auto;
                flex-direction: column;
                min-height: 0;
                overflow: hidden;
            }

            #revisionHistoryModal .modal-body,
            #accountModal .modal-body {
                flex: 1 1 auto;
                min-height: 0;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
                padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
            }

            #howToPlayModal .htp-tab-content {
                flex: 1 1 auto;
                height: auto;
                min-height: 0;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }

            #howToPlayModal .modal-header,
            #revisionHistoryModal .modal-header,
            #accountModal .modal-header {
                padding: 14px 16px;
            }

            #howToPlayModal .modal-title,
            #revisionHistoryModal .modal-title,
            #accountModal .modal-title {
                font-size: 1.05rem;
            }

            #howToPlayModal .htp-subtitle,
            #revisionHistoryModal .htp-subtitle,
            #accountModal .htp-subtitle {
                font-size: 0.8rem;
            }

            #howToPlayModal #howToPlayTabs,
            #revisionHistoryModal #revisionSportTabs,
            #accountModal #accountTabs {
                flex-wrap: nowrap;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                padding: 8px 12px 0;
                scrollbar-width: none;
            }

            #howToPlayModal #howToPlayTabs::-webkit-scrollbar,
            #revisionHistoryModal #revisionSportTabs::-webkit-scrollbar,
            #accountModal #accountTabs::-webkit-scrollbar {
                display: none;
            }

            #howToPlayModal #howToPlayTabs .nav-link,
            #revisionHistoryModal #revisionSportTabs .nav-link,
            #accountModal #accountTabs .nav-link {
                font-size: 0.75rem;
                padding: 6px 10px;
                white-space: nowrap;
            }

            #howToPlayModal .menu-content {
                padding: 16px;
            }

            #howToPlayModal .modal-footer,
            #revisionHistoryModal .modal-footer {
                flex-shrink: 0;
                flex-direction: column;
                gap: 0.5rem;
                padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
            }

            #howToPlayModal .modal-footer .btn,
            #revisionHistoryModal .modal-footer .btn {
                margin: 0;
                width: 100%;
            }

            #revisionHistoryModal .modal-footer .stats-disclaimer {
                margin: 0 !important;
                text-align: center;
            }

            #inspireMeModal .modal-body,
            #inspireFiltersModal .modal-body,
            #checkAccuracyModal .modal-body,
            #checkPlayerModal .modal-body,
            #checkSquareModal .modal-body {
                flex: 1 1 auto;
                min-height: 0;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
                padding: 1rem !important;
                padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
            }

            #inspireMeModal .inspire-option-card .card-header {
                flex-wrap: wrap;
                gap: 0.35rem;
            }

            #inspireMeModal .inspire-option-card .card-header h6 {
                flex: 1 1 auto;
                min-width: 0;
            }

            #checkPlayerModal .tab-title,
            #checkSquareModal .tab-title {
                display: none;
            }

            #checkSquareModal .modal-dialog.modal-dialog-scrollable,
            #checkPlayerModal .modal-dialog.modal-dialog-scrollable {
                max-height: 100%;
            }

            /* During the tour, leave headroom above the slide-up player menu */
            body.tour-active.mobile-menu-open .sport-content-row .sidebar-menu-col.is-open,
            body.tour-active.mobile-menu-open .sport-content-row .sidebar-menu-col.is-open .menu-container {
                max-height: 58vh;
            }

            /* Tutorial — compact layout: flex sheet so footer never clips */
            .tour-tooltip.tour-tooltip-compact {
                display: flex;
                flex-direction: column;
                left: 0.75rem !important;
                max-height: min(52vh, 480px);
                max-width: none;
                overflow: hidden;
                padding: 0;
                position: fixed !important;
                right: 0.75rem;
                width: auto;
            }

            .tour-tooltip.tour-tooltip-compact-top:not(.tour-tooltip-fill-band) {
                border-radius: 0 0 12px 12px;
                bottom: auto !important;
                max-height: none;
            }

            .tour-tooltip.tour-tooltip-compact-bottom:not(.tour-tooltip-fill-band) {
                border-radius: 12px 12px 0 0;
                max-height: none;
                top: auto !important;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-fill-band .tour-tooltip-main {
                flex: 1 1 auto;
                max-height: none !important;
                min-height: 0;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-above-sheet:not(.tour-tooltip-fill-band) {
                border-radius: 12px;
                bottom: auto !important;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-fill-band {
                max-height: none !important;
                min-height: 0;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-above-sheet.tour-tooltip-fill-band {
                border-radius: 0 0 12px 12px;
                bottom: auto !important;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-fill-band .tour-tooltip-footer {
                flex-shrink: 0;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-compact-top.tour-tooltip-content-sized {
                border-radius: 12px;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-compact-top.tour-tooltip-content-sized .tour-tooltip-footer {
                padding-bottom: 8px;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-content-sized {
                height: auto !important;
                min-height: 0 !important;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-content-sized .tour-tooltip-main {
                flex: 0 1 auto;
                overflow-y: auto;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-above-sheet.tour-tooltip-content-sized {
                border-radius: 12px;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-above-sheet.tour-tooltip-content-sized .tour-tooltip-footer {
                padding-bottom: 6px;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-below-target.tour-tooltip-content-sized {
                height: auto !important;
            }

            .tour-tooltip.tour-tooltip-compact .tour-tooltip-header {
                flex-shrink: 0;
                margin-bottom: 0;
                padding: 14px 16px 8px;
            }

            .tour-tooltip.tour-tooltip-compact:not(.tour-tooltip-fill-band):not(.tour-tooltip-content-sized) .tour-tooltip-main {
                flex: 1 1 auto;
                min-height: 0;
                max-height: 38vh;
                overflow-x: hidden;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
                overscroll-behavior: contain;
                touch-action: pan-y;
                padding: 0 16px 8px;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-fill-band .tour-tooltip-main {
                padding: 0 16px 8px;
            }

            .tour-tooltip.tour-tooltip-compact.tour-tooltip-below-target:not(.tour-tooltip-fill-band) {
                bottom: auto !important;
                max-height: none;
            }

            .tour-tooltip.tour-tooltip-compact .tour-tooltip-title {
                flex-shrink: 0;
                margin-bottom: 8px;
                padding: 0;
            }

            .tour-tooltip.tour-tooltip-compact .tour-tooltip-body {
                flex: none;
                overflow: visible;
                padding: 0;
            }

            .tour-tooltip.tour-tooltip-compact .tour-tooltip-footer {
                align-items: flex-end;
                border-top: 1px solid #e5e7eb;
                flex-shrink: 0;
                flex-wrap: wrap;
                gap: 0.5rem;
                margin-top: 0;
                padding: 10px 16px;
            }

            .tour-tooltip.tour-tooltip-compact-bottom .tour-tooltip-footer {
                padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
            }

            .tour-tooltip.tour-tooltip-compact .tour-dots {
                flex: 0 1 auto;
                min-width: 0;
            }

            .tour-tooltip.tour-tooltip-compact .tour-dot {
                padding: 8px 4px;
            }

            .tour-tooltip.tour-tooltip-compact .tour-nav-buttons {
                flex: 1 1 auto;
                justify-content: flex-end;
            }

            .tour-tooltip.tour-tooltip-compact .tour-skip-btn {
                font-size: 0.8rem;
            }

            /* Last walkthrough step: pin the open Menu under the Menu button
               (CSS variables beat Popper's inline top/left) and only show
               How to Play so it reads as a dropdown from Menu, not a sheet. */
            body.tour-active.tour-menu-step .main-menu-dropdown.show {
                position: fixed !important;
                transform: none !important;
                right: auto !important;
                bottom: auto !important;
            }

            body.tour-active.tour-menu-step #mainMenuGroup.tour-menu-toggle-pinned {
                left: var(--tour-menu-btn-left) !important;
                position: fixed !important;
                top: var(--tour-menu-btn-top) !important;
                width: var(--tour-menu-btn-width) !important;
                z-index: 9997;
            }

            body.tour-active.tour-menu-step .main-menu-dropdown.show.tour-menu-dropdown-pinned {
                top: var(--tour-menu-top) !important;
                left: var(--tour-menu-left) !important;
                width: var(--tour-menu-width) !important;
                max-height: var(--tour-menu-max-height) !important;
            }

            body.tour-active.tour-menu-step .main-menu-dropdown.show > li:not(:has(#howToPlayBtn)) {
                display: none;
            }
        }

        @media (max-width: 768px) {
            .main-container {
                padding: 10px;
            }
        }

        @media (max-width: 480px) {
            .grid-wrapper {
                --grid-cell-base: 68px;
            }

            .dashboard-header .dashboard-title {
                font-size: 1.25rem;
            }
        }

        /* Custom dropdown styling for headshots */
        .player-select-option {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 4px 8px;
        }

        .player-select-option .player-headshot {
            width: 24px;
            height: 24px;
            font-size: 10px;
            flex-shrink: 0;
        }

        .player-select-option .player-headshot img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            object-position: center;
            border-radius: 8px;
        }

        /* Enhanced select styling */
        .form-select.with-headshots {
            padding: 8px 12px;
        }

        .form-select.with-headshots option {
            padding: 8px;
        }

        /* Streamlit-style Searchable Dropdown */
        .searchable-dropdown {
            position: relative;
            display: inline-block;
            width: 100%;
        }

        .searchable-dropdown input {
            width: 100%;
            padding: 12px 16px;
            font-size: 16px;
            line-height: 1.5;
            color: #262730;
            background-color: #ffffff;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
        }

        .searchable-dropdown input:hover {
            border-color: #cbd5e1;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
        }

        .searchable-dropdown input:focus {
            outline: none;
            border-color: #00acb5;
            box-shadow: 0 0 0 3px rgba(0, 172, 181, 0.1), 0 4px 12px rgba(0, 0, 0, 0.15);
            transform: translateY(-1px);
        }

        .searchable-dropdown input::placeholder {
            color: #9ca3af;
            font-weight: 400;
        }

        .searchable-dropdown .dropdown-menu {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            width: 100%;
            max-height: 280px;
            overflow-y: auto;
            z-index: 1050;
            background: #ffffff;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            backdrop-filter: blur(10px);
            opacity: 0;
            transform: translateY(-8px) scale(0.98);
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            display: none;
        }

        .searchable-dropdown .dropdown-menu.show {
            opacity: 1;
            transform: translateY(0) scale(1);
        }

        .searchable-dropdown .dropdown-item {
            padding: 14px 20px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 1px solid #f3f4f6;
            transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            opacity: 0;
            transform: translateX(-10px);
            animation: slideIn 0.2s ease-out forwards;
            font-feature-settings: "kern" 1, "liga" 1;
            text-rendering: optimizeLegibility;
        }

        .searchable-dropdown .dropdown-item:nth-child(1) { animation-delay: 0.05s; }
        .searchable-dropdown .dropdown-item:nth-child(2) { animation-delay: 0.1s; }
        .searchable-dropdown .dropdown-item:nth-child(3) { animation-delay: 0.15s; }
        .searchable-dropdown .dropdown-item:nth-child(4) { animation-delay: 0.2s; }
        .searchable-dropdown .dropdown-item:nth-child(5) { animation-delay: 0.25s; }
        .searchable-dropdown .dropdown-item:nth-child(n+6) { animation-delay: 0.3s; }

        @keyframes slideIn {
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .searchable-dropdown .dropdown-item:last-child {
            border-bottom: none;
        }

        .searchable-dropdown .dropdown-item:hover {
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            transform: translateX(4px);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }

        .searchable-dropdown .dropdown-item.active {
            background: linear-gradient(135deg, #00acb5 0%, #009aa3 100%);
            color: white;
            transform: translateX(6px);
            box-shadow: 0 4px 12px rgba(0, 172, 181, 0.3);
        }

        .searchable-dropdown .dropdown-item.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background: linear-gradient(180deg, #00d4e0 0%, #00acb5 100%);
            border-radius: 0 2px 2px 0;
        }

        /* Select2 will handle all the dropdown functionality */

        /* Custom scrollbar for dropdown */
        .searchable-dropdown .dropdown-menu::-webkit-scrollbar {
            width: 6px;
        }

        .searchable-dropdown .dropdown-menu::-webkit-scrollbar-track {
            background: #f1f5f9;
            border-radius: 3px;
        }

        .searchable-dropdown .dropdown-menu::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
            border-radius: 3px;
            transition: background 0.2s ease;
        }

        .searchable-dropdown .dropdown-menu::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
        }

        /* No results styling */
        .searchable-dropdown .dropdown-item.no-results {
            color: #6b7280;
            font-style: italic;
            text-align: center;
            padding: 20px;
            background: #f9fafb;
            border: 1px dashed #d1d5db;
            border-radius: 8px;
            margin: 8px;
        }

        /* Form validation styles */
        .searchable-dropdown input.is-valid {
            border-color: #10b981;
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1), 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .searchable-dropdown input.is-invalid {
            border-color: #ef4444;
            box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1), 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        /* Loading state */
        .searchable-dropdown.loading input {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%2300acb5' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            background-size: 20px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /* Focus ring animation */
        .searchable-dropdown input:focus {
            animation: focusRing 0.3s ease-out;
        }

        @keyframes focusRing {
            0% { box-shadow: 0 0 0 0 rgba(0, 172, 181, 0.4); }
            100% { box-shadow: 0 0 0 3px rgba(0, 172, 181, 0.1), 0 4px 12px rgba(0, 0, 0, 0.15); }
        }

        /* Subtle pulse animation for focus */
        .searchable-dropdown input:focus {
            animation: focusRing 0.3s ease-out, subtlePulse 2s ease-in-out infinite;
        }

        @keyframes subtlePulse {
            0%, 100% { transform: translateY(-1px) scale(1); }
            50% { transform: translateY(-1px) scale(1.002); }
        }

        /* How to Play modal */
        #howToPlayModal .modal-content,
        #revisionHistoryModal .modal-content,
        #accountModal .modal-content {
            border: none;
            border-radius: 14px;
            overflow: hidden;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
        }

        #howToPlayModal .modal-header,
        #revisionHistoryModal .modal-header,
        #accountModal .modal-header {
            background: linear-gradient(135deg, #1E88E5 0%, #1565C0 100%);
            border-bottom: none;
            padding: 18px 24px;
            flex-direction: column;
            align-items: flex-start;
        }

        #howToPlayModal .modal-header .htp-header-row,
        #revisionHistoryModal .modal-header .htp-header-row,
        #accountModal .modal-header .htp-header-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
        }

        #howToPlayModal .modal-title,
        #revisionHistoryModal .modal-title,
        #accountModal .modal-title {
            color: #fff;
            font-weight: 700;
            font-size: 1.3rem;
        }

        #howToPlayModal .htp-subtitle,
        #revisionHistoryModal .htp-subtitle,
        #accountModal .htp-subtitle {
            color: rgba(255, 255, 255, 0.85);
            font-size: 0.85rem;
            margin: 4px 0 0;
        }

        #howToPlayModal .modal-header .btn-close,
        #revisionHistoryModal .modal-header .btn-close,
        #accountModal .modal-header .btn-close {
            filter: brightness(0) invert(1);
            opacity: 0.85;
        }

        #howToPlayModal .modal-header .btn-close:hover,
        #revisionHistoryModal .modal-header .btn-close:hover,
        #accountModal .modal-header .btn-close:hover {
            opacity: 1;
        }

        /* Tab bar */
        #howToPlayModal #howToPlayTabs,
        #revisionHistoryModal #revisionSportTabs,
        #accountModal #accountTabs {
            background-color: #F7F9FC;
            border-bottom: 1px solid #E6E9EF;
            padding: 10px 16px 0;
            gap: 6px;
            flex-wrap: wrap;
        }

        #howToPlayModal #howToPlayTabs .nav-item,
        #revisionHistoryModal #revisionSportTabs .nav-item,
        #accountModal #accountTabs .nav-item {
            flex: 0 0 auto;
        }

        #howToPlayModal #howToPlayTabs .nav-link,
        #revisionHistoryModal #revisionSportTabs .nav-link,
        #accountModal #accountTabs .nav-link {
            background-color: transparent;
            color: #5f6b7a;
            border: 1px solid transparent;
            border-radius: 10px 10px 0 0;
            padding: 8px 16px;
            font-weight: 600;
            font-size: 0.86rem;
            transition: all 0.15s ease;
        }

        #howToPlayModal #howToPlayTabs .nav-link:hover:not(.active),
        #revisionHistoryModal #revisionSportTabs .nav-link:hover:not(.active),
        #accountModal #accountTabs .nav-link:hover:not(.active) {
            background-color: #E1F5FE;
            color: #1565C0;
        }

        #howToPlayModal #howToPlayTabs .nav-link.active,
        #revisionHistoryModal #revisionSportTabs .nav-link.active,
        #accountModal #accountTabs .nav-link.active {
            background-color: #fff;
            color: #1565C0;
            border-color: #E6E9EF;
            border-bottom-color: #fff;
            margin-bottom: -1px;
        }

        /* Content area */
        #howToPlayModal .menu-content {
            padding: 24px 28px;
        }

        #howToPlayModal .htp-tab-content {
            height: 60vh;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        #howToPlayModal .htp-section-title {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 700;
            color: #1565C0;
            font-size: 1.05rem;
            margin-bottom: 14px;
            padding-bottom: 8px;
            border-bottom: 2px solid #E1F5FE;
        }

        #howToPlayModal .menu-content p {
            line-height: 1.6;
            color: #374151;
        }

        #howToPlayModal .menu-content li {
            margin-bottom: 8px;
            line-height: 1.55;
        }

        #howToPlayModal .menu-content li:last-child {
            margin-bottom: 0;
        }

        #howToPlayModal .htp-chip {
            display: inline-block;
            background: #E1F5FE;
            color: #1565C0;
            border: 1px solid #B3E5FC;
            border-radius: 6px;
            padding: 1px 7px;
            font-weight: 600;
            font-size: 0.9em;
        }

        /* Numbered step list (How to Play tab) */
        #howToPlayModal .htp-steps {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        #howToPlayModal .htp-step {
            display: flex;
            gap: 14px;
        }

        #howToPlayModal .htp-step-num {
            flex: 0 0 28px;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: linear-gradient(135deg, #1E88E5, #1565C0);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.85rem;
            box-shadow: 0 2px 6px rgba(30, 136, 229, 0.35);
        }

        #howToPlayModal .htp-step-title {
            font-weight: 700;
            color: #262730;
            margin-bottom: 3px;
        }

        #howToPlayModal .htp-step-desc {
            color: #4b5563;
            font-size: 0.93rem;
        }

        #howToPlayModal .htp-step-desc ul {
            margin-top: 8px;
            margin-bottom: 0;
            padding-left: 0;
            list-style: none;
        }

        #howToPlayModal .htp-step-desc li {
            position: relative;
            padding-left: 1.05em;
        }

        #howToPlayModal .htp-step-desc li::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0.55em;
            width: 0.35em;
            height: 0.35em;
            border-radius: 50%;
            background: currentColor;
        }

        /* Card rows (Check Your Work / Interacting / Tips / Eligibility tabs) */
        #howToPlayModal .htp-cards {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        #howToPlayModal .htp-card {
            display: flex;
            gap: 14px;
            align-items: flex-start;
            background: #F7F9FC;
            border: 1px solid #E6E9EF;
            border-radius: 10px;
            padding: 12px 14px;
        }

        /* Icon badge inside a card row — matches the numbered badges on How to Play */
        #howToPlayModal .htp-card-icon {
            flex: 0 0 28px;
            width: 28px;
            height: 28px;
            align-self: center;
            border-radius: 50%;
            background: linear-gradient(135deg, #1E88E5, #1565C0);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 6px rgba(30, 136, 229, 0.35);
        }

        #howToPlayModal .htp-card-icon svg {
            display: block;
        }

        #howToPlayModal .htp-card-icon-amber {
            background: linear-gradient(135deg, #FBC02D, #F9A825);
            box-shadow: 0 2px 6px rgba(249, 168, 37, 0.35);
        }

        #howToPlayModal .htp-card-icon-green {
            background: linear-gradient(135deg, #66BB6A, #43A047);
            box-shadow: 0 2px 6px rgba(67, 160, 71, 0.35);
        }

        #howToPlayModal .htp-position-reference {
            margin-top: 10px;
            border: 1px solid #B3E5FC;
            border-radius: 10px;
            background: #fff;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(21, 101, 192, 0.08);
        }

        #howToPlayModal .htp-card .htp-position-reference {
            margin-top: 10px;
        }

        #howToPlayModal .htp-position-reference summary {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 11px 14px;
            cursor: pointer;
            font-weight: 600;
            color: #1565C0;
            list-style: none;
            font-size: 0.93rem;
            background: linear-gradient(135deg, #E3F2FD 0%, #F4FAFF 100%);
            transition: background 0.15s ease;
        }

        #howToPlayModal .htp-position-reference summary:hover {
            background: linear-gradient(135deg, #D6EEFF 0%, #EDF6FF 100%);
        }

        #howToPlayModal .htp-position-reference summary::-webkit-details-marker {
            display: none;
        }

        #howToPlayModal .htp-position-reference summary::after {
            content: "▸";
            flex: 0 0 auto;
            color: #1565C0;
            font-size: 0.95rem;
            transition: transform 0.15s ease;
        }

        #howToPlayModal .htp-position-reference[open] summary {
            border-bottom: 1px solid #D6EAF8;
        }

        #howToPlayModal .htp-position-reference[open] summary::after {
            transform: rotate(90deg);
        }

        #howToPlayModal .htp-position-reference-body {
            padding: 12px;
            background: linear-gradient(180deg, #FAFCFF 0%, #fff 100%);
        }

        #howToPlayModal .htp-position-glossary-note {
            color: #4b5563;
            font-size: 0.86rem;
            line-height: 1.45;
            margin: 0 0 12px;
        }

        #howToPlayModal .htp-position-glossary {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
            gap: 10px;
        }

        #howToPlayModal .htp-position-glossary--three-col {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }

        #howToPlayModal .htp-position-glossary--two-col {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        @media (max-width: 640px) {
            #howToPlayModal .htp-position-glossary--three-col,
            #howToPlayModal .htp-position-glossary--two-col {
                grid-template-columns: 1fr;
            }
        }

        #howToPlayModal .htp-position-glossary-item {
            display: flex;
            flex-direction: column;
            gap: 8px;
            min-height: 100%;
            padding: 12px;
            border: 1px solid #E6E9EF;
            border-radius: 10px;
            background: #fff;
            box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
        }

        #howToPlayModal .htp-position-glossary-label {
            align-self: flex-start;
            display: inline-block;
            font-weight: 700;
            color: #1565C0;
            background: #E1F5FE;
            border: 1px solid #B3E5FC;
            border-radius: 999px;
            padding: 3px 11px;
            font-size: 0.9rem;
            letter-spacing: 0.03em;
            line-height: 1.2;
        }

        #howToPlayModal .htp-position-glossary-desc {
            margin: 0;
            font-size: 0.82rem;
            color: #4b5563;
            line-height: 1.45;
        }

        #howToPlayModal .htp-card-icon-red {
            background: linear-gradient(135deg, #EF5350, #C62828);
            box-shadow: 0 2px 6px rgba(198, 40, 40, 0.35);
        }

        #howToPlayModal .htp-color-dots {
            flex: 0 0 28px;
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 3px;
        }

        #howToPlayModal .htp-color-dots span {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            display: inline-block;
        }

        /* Intro line above a set of card rows */
        #howToPlayModal .htp-lead {
            font-size: 0.93rem;
            margin-bottom: 14px;
        }

        /* Footer */
        #howToPlayModal .modal-footer {
            background: #F7F9FC;
            border-top: 1px solid #E6E9EF;
            padding: 14px 24px;
        }

        #howToPlayModal .modal-footer .btn-outline-secondary {
            border-color: #CBD5E1;
            color: #475569;
            font-weight: 600;
        }

        #howToPlayModal .modal-footer .btn-outline-secondary:hover {
            background-color: #EEF2F7;
            border-color: #94A3B8;
            color: #1E293B;
        }

        #howToPlayModal .modal-footer .btn-primary {
            background: linear-gradient(135deg, #1E88E5, #1565C0);
            border: none;
            font-weight: 600;
            box-shadow: 0 2px 8px rgba(30, 136, 229, 0.35);
        }

        #howToPlayModal .modal-footer .btn-primary:hover {
            background: linear-gradient(135deg, #1976D2, #0D47A1);
        }

        /* Click-through onboarding tour */
        html.tour-active,
        body.tour-active {
            overflow: hidden !important;
            overscroll-behavior: none;
        }

        body.tour-active .grid-wrapper,
        body.tour-active .menu-container,
        body.tour-active .sport-content-row .sidebar-menu-col .menu-container {
            overflow: hidden !important;
            overscroll-behavior: none;
            touch-action: none;
        }

        /* Bench step has to pan The Grid so Example Player's row is on screen,
           and keep that row above the Players FAB. */
        body.tour-active.tour-grid-show-bench-player .grid-wrapper {
            overflow: auto !important;
            padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
        }

        body.tour-active .tour-spotlight,
        body.tour-active .tour-shade,
        body.tour-active .tour-grid-spotlight {
            transition: none !important;
        }

        body.tour-active .tour-tooltip {
            overflow: hidden !important;
            overscroll-behavior: none;
            transition: none !important;
        }

        body.tour-active .tour-tooltip-main {
            overflow-x: hidden !important;
            overflow-y: auto !important;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
            touch-action: pan-y;
        }

        /* During the tour, leave more room for the tooltip — especially on tablet. */
        body.tour-active .grid-wrapper {
            height: min(480px, calc(100vh - 17rem));
            max-height: min(480px, calc(100vh - 17rem));
        }

        body.tour-active.tour-grid-compact .grid-wrapper {
            height: min(320px, calc(100vh - 21rem));
            max-height: min(320px, calc(100vh - 21rem));
        }

        #tourOverlay {
            display: none;
        }

        #tourOverlay.active {
            display: block;
            inset: 0;
            pointer-events: none;
            position: fixed;
            z-index: 9998;
        }

        /* Full-viewport click catcher: blocks every click behind the tour so only the
           tooltip's own controls (Back/Next/Skip, z-index 10002) remain interactive. */
        .tour-clickblock {
            position: fixed;
            inset: 0;
            z-index: 9999;
            pointer-events: auto;
        }

        .tour-spotlight {
            position: fixed;
            top: 0;
            left: 0;
            width: 0;
            height: 0;
            border-radius: 8px;
            box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.65);
            pointer-events: none;
            z-index: 10000;
            opacity: 0;
            transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease, opacity 0.2s ease;
        }

        .tour-spotlight.visible {
            opacity: 1;
        }

        /* Full-page dim with no cutout. Kept for steps that should shade
           the page without punching a hole. */
        .tour-spotlight.tour-spotlight-dim-only {
            top: 0 !important;
            left: 0 !important;
            width: 100% !important;
            height: 100% !important;
            border-radius: 0;
            box-shadow: none;
            background: rgba(15, 23, 42, 0.65);
        }

        .tour-shade {
            position: fixed;
            top: 0;
            left: 0;
            width: 0;
            height: 0;
            background: rgba(255, 193, 7, 0.32);
            border: 2px solid rgba(255, 193, 7, 0.9);
            border-radius: 4px;
            pointer-events: none;
            z-index: 10001;
            opacity: 0;
            transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease, opacity 0.2s ease;
        }

        .tour-shade.visible {
            opacity: 1;
        }

        /* Sits above the dimming layer and clones a grid square's real markup, so
           it reads as brightly spotlighted (like the true cutout under .tour-spotlight)
           even though the actual spotlight/tooltip is pointed elsewhere. */
        .tour-grid-spotlight {
            position: fixed;
            top: 0;
            left: 0;
            width: 0;
            height: 0;
            box-sizing: border-box;
            background: white;
            box-shadow: 0 0 0 3px #FFC107, 0 4px 14px rgba(0, 0, 0, 0.35);
            border-radius: 2px;
            overflow: hidden;
            pointer-events: none;
            z-index: 10001;
            opacity: 0;
            transition: top 0.3s ease, left 0.3s ease, opacity 0.2s ease;
        }

        .tour-grid-spotlight.is-diagonal {
            background: white;
        }

        .tour-grid-spotlight.visible {
            opacity: 1;
        }

        .tour-tooltip {
            position: fixed;
            top: 0;
            left: 0;
            z-index: 10002;
            background: white;
            border-radius: 10px;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
            padding: 18px 20px;
            max-width: 360px;
            width: calc(100vw - 32px);
            opacity: 0;
            pointer-events: none;
            transition: top 0.3s ease, left 0.3s ease, bottom 0.3s ease, opacity 0.2s ease;
        }

        .tour-tooltip.visible {
            opacity: 1;
            pointer-events: auto;
        }

        .tour-tooltip-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }

        .tour-header-left {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
        }

        /* Names the walkthrough on every step, so a user who wandered in mid-tour
           can tell the demo grid apart from their real one. */
        .tour-badge {
            background: #1E88E5;
            color: #fff;
            border-radius: 999px;
            padding: 2px 9px;
            font-size: 0.68rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            white-space: nowrap;
        }

        .tour-step-counter {
            font-size: 0.8rem;
            font-weight: 600;
            color: #6b7280;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .tour-skip-btn {
            background: none;
            border: none;
            color: #6b7280;
            font-size: 0.85rem;
            cursor: pointer;
            padding: 0;
        }

        .tour-skip-btn:hover {
            color: #262730;
            text-decoration: underline;
        }

        .tour-tooltip-title {
            font-weight: 700;
            font-size: 1.05rem;
            margin-bottom: 8px;
            color: #262730;
        }

        .tour-tooltip-body {
            font-size: 0.92rem;
            color: #374151;
            line-height: 1.45;
            min-width: 0;
            overflow-wrap: anywhere;
            word-break: break-word;
        }

        .tour-tooltip-body p:last-child {
            margin-bottom: 0;
        }

        .tour-tooltip-body ul.tour-list {
            padding-left: 1.1rem;
            margin-bottom: 0;
        }

        .tour-tooltip-body ul.tour-list li {
            margin-bottom: 8px;
        }

        .tour-tooltip-body ul.tour-list li:last-child {
            margin-bottom: 0;
        }

        /* A closing line after a list needs its own air. */
        .tour-tooltip-body ul.tour-list + p {
            margin-top: 10px;
        }

        .tour-tooltip-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 14px;
        }

        .tour-dots {
            display: flex;
            align-items: center;
            gap: 0;
        }

        .tour-dot {
            appearance: none;
            -webkit-appearance: none;
            width: auto;
            height: auto;
            margin: 0;
            padding: 10px 5px;
            border: 0;
            border-radius: 999px;
            background: transparent;
            line-height: 0;
            cursor: pointer;
        }

        .tour-dot::before {
            content: '';
            display: block;
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #d1d5db;
            transition: background 0.15s ease, transform 0.15s ease;
        }

        .tour-dot:hover::before,
        .tour-dot:focus-visible::before {
            background: #9ca3af;
            transform: scale(1.2);
        }

        .tour-dot.active {
            cursor: default;
        }

        .tour-dot.active::before,
        .tour-dot.active:hover::before,
        .tour-dot.active:focus-visible::before {
            background: #1E88E5;
            transform: scale(1.15);
        }

        .tour-dot:focus-visible {
            outline: 2px solid #1E88E5;
            outline-offset: -2px;
        }

        .tour-nav-buttons {
            display: flex;
            gap: 8px;
        }

        /* Increase the max-width of the tooltip (desktop only — compact uses flex layout). */
        .tour-tooltip:not(.tour-tooltip-compact) {
            max-height: 82vh;
            overflow-y: auto;
        }

        /* Right-toolbar steps (Check / Inspire / How to Play): stay by the
           control instead of jumping to the left. Check shrinks on small
           desktop; Inspire / How to Play keep the normal width unless JS
           decides a narrower card is required to fit. */
        .tour-tooltip.tour-tooltip-desktop-right {
            width: auto;
            max-width: 360px;
        }

        @media (max-width: 1399px) {
            .tour-tooltip.tour-tooltip-desktop-right.tour-tooltip-desktop-right-narrow {
                max-width: 252px;
            }
        }

        /* Confetti burst for a grid that is complete AND fully correct. Sits above
           everything, never intercepts clicks, and is removed once the run ends. */
        #confettiCanvas {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            pointer-events: none;
            z-index: 10050;
        }

        /* Walkthrough demo (Peyton Manning on NFL, Kareem on NBA) — plain narration notes */
        .tour-demo-note {
            margin-top: 10px;
            font-size: 0.78rem;
            color: #6b7280;
            font-style: italic;
        }

        /* Color-blind Check Grid palette (IBM/Wong: blue, magenta, gold).
           Independent of light/dark so both can be on at once. */
        html[data-colorblind] {
            --check-ok: #005AB5;
            --check-ok-hover: #003E80;
            --check-ok-bg: #D6E8FF;
            --check-ok-border: #648FFF;
            --check-wrong: #C4006A;
            --check-wrong-hover: #8C004C;
            --check-wrong-bg: #FAD2E6;
            --check-wrong-bg-hover: #F0A8CC;
            --check-wrong-border: #DC267F;
            --check-wrong-cell-text: #5A0030;
            --check-review: #8A5A00;
            --check-review-hover: #5C3C00;
            --check-review-bg: #FFE8A3;
            --check-review-bg-hover: #FFD56A;
            --check-review-border: #FFB000;
            --check-review-cell-text: #6B4500;
            --cb-pattern-wrong: repeating-linear-gradient(-45deg, transparent, transparent 5px, rgba(8, 28, 64, 0.22) 5px, rgba(8, 28, 64, 0.22) 8px);
            --cb-pattern-review: repeating-linear-gradient(90deg, transparent, transparent 4px, rgba(8, 28, 64, 0.24) 4px, rgba(8, 28, 64, 0.24) 6px);
        }

        html[data-colorblind] .grid-table td.incorrect,
        html[data-colorblind] .card.player-card-incorrect,
        html[data-colorblind] .badge.check-incorrect-badge {
            background-image: var(--cb-pattern-wrong);
        }

        html[data-colorblind] .grid-table td.orange,
        html[data-colorblind] .card.player-card-orange {
            background-image: var(--cb-pattern-review);
        }

        html[data-colorblind] .player-card .incorrect-player,
        html[data-colorblind] .player-card a.incorrect-player {
            text-shadow: 0 0 5px var(--check-wrong-bg), 0 1px 0 var(--check-wrong-bg);
        }

        html[data-colorblind] .player-card .orange-player,
        html[data-colorblind] .player-card a.orange-player {
            text-shadow: 0 0 5px var(--check-review-bg), 0 1px 0 var(--check-review-bg);
        }

        html[data-colorblind] .player-card .complete-career-player,
        html[data-colorblind] .player-card a.complete-career-player {
            text-shadow: 0 0 5px var(--check-ok-bg), 0 1px 0 var(--check-ok-bg);
        }

        html[data-colorblind] .incorrect-player {
            text-decoration: underline;
            text-underline-offset: 2px;
        }

        html[data-colorblind] .orange-player {
            text-decoration: underline dotted;
            text-underline-offset: 2px;
        }

        /* Dark mode chrome. Check colors are overridden again below when
           color-blind is also on. Light mode hexes above are left untouched. */
        html[data-theme="dark"] {
            color-scheme: dark;
            --check-ok: #81C784;
            --check-ok-hover: #A5D6A7;
            --check-ok-bg: #1A3A24;
            --check-ok-border: #43A047;
            --check-wrong: #EF9A9A;
            --check-wrong-hover: #FFCDD2;
            --check-wrong-bg: #4A2226;
            --check-wrong-bg-hover: #5C2A30;
            --check-wrong-border: #E57373;
            --check-wrong-cell-text: #FFCDD2;
            --check-review: #FFB74D;
            --check-review-hover: #FFE082;
            --check-review-bg: #3D2E14;
            --check-review-bg-hover: #4A3818;
            --check-review-border: #FFA726;
            --check-review-cell-text: #FFE082;
        }

        html[data-theme="dark"][data-colorblind] {
            --check-ok: #7EB6FF;
            --check-ok-hover: #B3D4FF;
            --check-ok-bg: #16324D;
            --check-ok-border: #648FFF;
            --check-wrong: #FF7AB6;
            --check-wrong-hover: #FFB0D2;
            --check-wrong-bg: #4A1A33;
            --check-wrong-bg-hover: #5C2240;
            --check-wrong-border: #DC267F;
            --check-wrong-cell-text: #FFD0E6;
            --check-review: #FFCC4D;
            --check-review-hover: #FFE08A;
            --check-review-bg: #4A3B10;
            --check-review-bg-hover: #5C4A14;
            --check-review-border: #FFB000;
            --check-review-cell-text: #FFE8A3;
            --cb-pattern-wrong: repeating-linear-gradient(-45deg, transparent, transparent 5px, rgba(8, 28, 64, 0.4) 5px, rgba(8, 28, 64, 0.4) 8px);
            --cb-pattern-review: repeating-linear-gradient(90deg, transparent, transparent 4px, rgba(8, 28, 64, 0.42) 4px, rgba(8, 28, 64, 0.42) 6px);
        }

        html[data-theme="dark"] .colorblind-swatch {
            border-color: rgba(255, 255, 255, 0.4);
        }

        html[data-theme="dark"] body,
        html[data-theme="dark"] #landingPage {
            background-color: #121417;
            color: #e8eaed;
        }

        html[data-theme="dark"] .medal-logo img,
        html[data-theme="dark"] #landingPage .landing-medal img {
            filter:
                drop-shadow(1px 0 0 rgba(255, 255, 255, 0.28))
                drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.28))
                drop-shadow(0 1px 0 rgba(255, 255, 255, 0.28))
                drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.28));
        }

        html[data-theme="dark"] .dashboard-title,
        html[data-theme="dark"] .tab-title,
        html[data-theme="dark"] .menu-content h6,
        html[data-theme="dark"] .form-label,
        html[data-theme="dark"] .form-check-label,
        html[data-theme="dark"] .account-name,
        html[data-theme="dark"] .account-switch .form-check-label,
        html[data-theme="dark"] .bench-draft-check .form-check-label,
        html[data-theme="dark"] .revision-message,
        html[data-theme="dark"] .revision-empty-title,
        html[data-theme="dark"] .player-card .card-title,
        html[data-theme="dark"] .player-card .card-title a,
        html[data-theme="dark"] .player-card .card-text,
        html[data-theme="dark"] .histogram-y-axis-label,
        html[data-theme="dark"] .histogram-x-axis-label,
        html[data-theme="dark"] #landingPage .landing-title,
        html[data-theme="dark"] #landingPage .landing-panel h5,
        html[data-theme="dark"] #howToPlayModal .htp-step-title,
        html[data-theme="dark"] .tour-tooltip-title,
        html[data-theme="dark"] .tour-skip-btn:hover {
            color: #f2f4f7;
        }

        html[data-theme="dark"] .sport-banner h2 {
            color: #262730;
        }

        html[data-theme="dark"] .player-card .card-title a:hover {
            color: #90CAF9;
        }

        html[data-theme="dark"] .db-updated-at,
        html[data-theme="dark"] .account-meta,
        html[data-theme="dark"] .account-help,
        html[data-theme="dark"] .colorblind-legend-list,
        html[data-theme="dark"] .account-section-title,
        html[data-theme="dark"] .revision-empty,
        html[data-theme="dark"] .revision-time,
        html[data-theme="dark"] .lookup-empty,
        html[data-theme="dark"] .lookup-modal-subtitle,
        html[data-theme="dark"] .stat-label,
        html[data-theme="dark"] .stat-description,
        html[data-theme="dark"] #landingPage .landing-tagline,
        html[data-theme="dark"] #landingPage .landing-inspired,
        html[data-theme="dark"] #landingPage .landing-panel p,
        html[data-theme="dark"] #howToPlayModal .htp-step-desc,
        html[data-theme="dark"] #howToPlayModal .menu-content p,
        html[data-theme="dark"] .tour-tooltip-body,
        html[data-theme="dark"] .tour-step-counter,
        html[data-theme="dark"] .tour-skip-btn,
        html[data-theme="dark"] .tour-demo-note,
        html[data-theme="dark"] .stats-empty-title,
        html[data-theme="dark"] .stats-empty-copy,
        html[data-theme="dark"] .histogram-value,
        html[data-theme="dark"] .text-muted {
            color: #c5cdd6;
        }

        html[data-theme="dark"] .grid-container,
        html[data-theme="dark"] .menu-container,
        html[data-theme="dark"] .menu-content,
        html[data-theme="dark"] #landingPage .landing-card,
        html[data-theme="dark"] .stats-modal-content,
        html[data-theme="dark"] .tour-tooltip,
        html[data-theme="dark"] .tour-grid-spotlight,
        html[data-theme="dark"] .tour-grid-spotlight.is-diagonal {
            background-color: #1c2026;
            border-color: #3a424c;
            color: #e8eaed;
        }

        html[data-theme="dark"] .grid-wrapper {
            border-color: #3a424c;
        }

        html[data-theme="dark"] .sport-tabs .nav-link:not(.active),
        html[data-theme="dark"] .menu-tabs .nav-link:not(.active) {
            background-color: #3d4654;
            color: #ffffff;
            border-color: #5a6574;
        }

        html[data-theme="dark"] .sport-content-row .sidebar-menu-col .mobile-menu-header {
            background: #1c2026;
            border-bottom-color: #3a424c;
        }

        html[data-theme="dark"] .sport-tabs .nav-link.active {
            color: #1a1a1a;
        }

        html[data-theme="dark"] .grid-table thead th,
        html[data-theme="dark"] .grid-table th:first-child,
        html[data-theme="dark"] .grid-table td:first-child,
        html[data-theme="dark"] .grid-table th,
        html[data-theme="dark"] #landingPage .landing-mini-grid th {
            background-color: #6b7c90;
            color: #ffffff;
        }

        html[data-theme="dark"] .grid-table th:hover:not(.grid-header-active) {
            background-color: #7d8ea3;
        }

        html[data-theme="dark"] .grid-table thead th:first-child:hover {
            background-color: #6b7c90;
        }

        html[data-theme="dark"] .grid-table td.filled,
        html[data-theme="dark"] .grid-table td.diagonal,
        html[data-theme="dark"] #landingPage .landing-mini-grid td,
        html[data-theme="dark"] #landingPage .landing-mini-grid td.filled,
        html[data-theme="dark"] #landingPage .landing-mini-grid td.diagonal {
            background-color: #303846;
            color: #f2f4f7;
        }

        html[data-theme="dark"] .grid-table td.filled:hover,
        html[data-theme="dark"] .grid-table td.diagonal:hover {
            background-color: #3b4454;
        }

        html[data-theme="dark"] .grid-table td.empty,
        html[data-theme="dark"] #landingPage .landing-mini-grid td.empty {
            background-color: #4a5566;
            color: #f2f4f7;
        }

        html[data-theme="dark"] .grid-table td.empty:hover {
            background-color: #576273;
        }

        html[data-theme="dark"] .grid-table td.lower-triangular,
        html[data-theme="dark"] #landingPage .landing-mini-grid td.lower-triangular {
            background-color: #000000;
            color: #9aa3ad;
            border-color: #5a6574;
        }

        html[data-theme="dark"] .grid-table thead th.bench-col {
            background-color: #5c4d30;
            color: #f5ead2;
        }

        html[data-theme="dark"] .grid-table thead th.bench-col:hover:not(.grid-header-active) {
            background-color: #6e5c3a;
        }

        html[data-theme="dark"] .grid-table td.bench-col,
        html[data-theme="dark"] .grid-table td.bench-col.filled {
            background-color: #2e281c;
            color: #f0e6c8;
        }

        html[data-theme="dark"] .grid-table td.bench-col:hover,
        html[data-theme="dark"] .grid-table td.bench-col.filled:hover {
            background-color: #3d3424;
        }

        html[data-theme="dark"] .grid-table th.bench-col,
        html[data-theme="dark"] .grid-table td.bench-col {
            border-left-color: #c4a35a;
        }

        html[data-theme="dark"] .grid-table td,
        html[data-theme="dark"] .grid-table th,
        html[data-theme="dark"] #landingPage .landing-mini-grid th,
        html[data-theme="dark"] #landingPage .landing-mini-grid td {
            border-color: #6b7786;
        }

        html[data-theme="dark"] .grid-stats {
            background-color: #16324D;
            border-color: #1E88E5;
            color: #90CAF9;
        }

        html[data-theme="dark"] .grid-stats:hover {
            background-color: #1A3F61;
        }

        html[data-theme="dark"] .btn-secondary {
            background-color: #262b33;
            border-color: #3a424c;
            color: #e8eaed;
        }

        html[data-theme="dark"] .btn-secondary:hover {
            background-color: #323844;
            border-color: #4a535e;
            color: #f2f4f7;
        }

        html[data-theme="dark"] .dashboard-header .btn-secondary,
        html[data-theme="dark"] .grid-controls .btn-secondary {
            background-color: #2a2e35;
            border-color: #2a2e35;
            color: #e8eaed;
        }

        html[data-theme="dark"] .dashboard-header .btn-secondary:hover,
        html[data-theme="dark"] .grid-controls .btn-secondary:hover {
            background-color: #1E88E5;
            border-color: #1E88E5;
            color: white;
        }

        html[data-theme="dark"] .grid-controls .bench-toggle.bench-on,
        html[data-theme="dark"] .dashboard-header .bench-toggle.bench-on {
            background-color: #3a4048;
            border-color: #4a535e;
        }

        html[data-theme="dark"] .form-control,
        html[data-theme="dark"] .form-select,
        html[data-theme="dark"] .searchable-dropdown input {
            background-color: #1c2026;
            color: #e8eaed;
            border-color: #3a424c;
        }

        html[data-theme="dark"] .searchable-dropdown .dropdown-menu {
            background: #1c2026;
            border-color: #3a424c;
        }

        html[data-theme="dark"] .searchable-dropdown .dropdown-item {
            border-bottom-color: #2a2e35;
            color: #e8eaed;
        }

        html[data-theme="dark"] .searchable-dropdown .dropdown-item:hover {
            background: linear-gradient(135deg, #262b33 0%, #1c2026 100%);
        }

        html[data-theme="dark"] .main-menu-dropdown {
            background-color: #1c2026;
            border-color: #3a424c;
            box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
        }

        html[data-theme="dark"] .main-menu-dropdown .dropdown-item {
            color: #e8eaed;
        }

        html[data-theme="dark"] .main-menu-dropdown .dropdown-item:hover,
        html[data-theme="dark"] .main-menu-dropdown .dropdown-item:focus {
            background-color: #16324D;
            color: #90CAF9;
        }

        html[data-theme="dark"] .history-output,
        html[data-theme="dark"] .lookup-results,
        html[data-theme="dark"] #landingPage .landing-panel {
            background-color: #262b33;
            border-color: #3a424c;
            color: #e8eaed;
        }

        html[data-theme="dark"] .lookup-head {
            border-bottom-color: #3a424c;
        }

        html[data-theme="dark"] .lookup-square,
        html[data-theme="dark"] .lookup-total,
        html[data-theme="dark"] .lookup-group-title {
            color: #e8eaed;
        }

        html[data-theme="dark"] .account-profile,
        html[data-theme="dark"] .account-section,
        html[data-theme="dark"] .stats-modal-header {
            border-color: #3a424c;
        }

        html[data-theme="dark"] .appearance-mode-toggle {
            border-color: #3a424c;
        }

        html[data-theme="dark"] .appearance-mode-btn {
            background: #262b33;
            color: #e8eaed;
        }

        html[data-theme="dark"] .appearance-mode-btn + .appearance-mode-btn {
            border-left-color: #3a424c;
        }

        html[data-theme="dark"] .appearance-mode-btn:hover:not(.active) {
            background: #16324D;
            color: #90CAF9;
        }

        html[data-theme="dark"] #howToPlayModal .modal-footer,
        html[data-theme="dark"] #revisionHistoryModal .modal-footer,
        html[data-theme="dark"] #accountModal .modal-footer {
            background: #1c2026;
            border-top-color: #3a424c;
        }

        html[data-theme="dark"] #howToPlayModal .htp-chip {
            background: #16324D;
            color: #90CAF9;
            border-color: #1E88E5;
        }

        html[data-theme="dark"] #howToPlayModal .htp-position-reference {
            background: #1c2026;
            border-color: #3a424c;
        }

        html[data-theme="dark"] #howToPlayModal .htp-position-reference summary {
            color: #90CAF9;
            background: linear-gradient(135deg, #16324D 0%, #1c2026 100%);
        }

        html[data-theme="dark"] #gridProgressBar {
            background-color: #262b33;
        }

        html[data-theme="dark"] .alert-success {
            background-color: #1A3A24;
            border-color: #2E7D32;
            color: #A5D6A7;
        }

        html[data-theme="dark"] .alert-danger {
            background-color: #4A2226;
            border-color: #E57373;
            color: #EF9A9A;
        }

        html[data-theme="dark"] .alert-warning {
            background-color: #3D2E14;
            border-color: #FFA726;
            color: #FFE082;
        }

        html[data-theme="dark"] .alert-info {
            background-color: #16324D;
            border-color: #1E88E5;
            color: #90CAF9;
        }

        html[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
            background-color: #1c2026 !important;
            border-color: #3a424c !important;
            color: #e8eaed !important;
        }

        html[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
            color: #e8eaed !important;
        }

        html[data-theme="dark"] .select2-dropdown {
            background-color: #1c2026;
            border-color: #3a424c;
            color: #e8eaed;
        }

        html[data-theme="dark"] .select2-container--bootstrap-5 .select2-search__field {
            background-color: #121417;
            color: #e8eaed;
            border-color: #3a424c;
        }

        html[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option {
            color: #e8eaed;
        }

        html[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted {
            background-color: #1E88E5 !important;
            color: #fff !important;
        }

        html[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--selected {
            background-color: #262b33;
        }

        html[data-theme="dark"] .card {
            background-color: #1c2026;
            border-color: #3a424c;
            color: #e8eaed;
        }

        html[data-theme="dark"] .card.player-card-incorrect {
            background-color: var(--check-wrong-bg);
            border-color: var(--check-wrong-border);
        }

        html[data-theme="dark"] .card.player-card-orange {
            background-color: var(--check-review-bg);
            border-color: var(--check-review-border);
        }

        html[data-theme="dark"] .card.player-card-complete {
            background-color: var(--check-ok-bg);
            border-color: var(--check-ok-border);
        }

        html[data-theme="dark"] .modal-content {
            background-color: #1c2026;
            color: #e8eaed;
        }

        html[data-theme="dark"] .check-accuracy-stats + .check-accuracy-stats {
            border-top-color: #3a424c;
        }

        html[data-theme="dark"] .lookup-chip {
            background: #1c2026;
            border-color: #3a424c;
            color: #f2f4f7;
        }

        html[data-theme="dark"] .lookup-chip-player:hover {
            border-color: #90CAF9;
        }

        html[data-theme="dark"] .lookup-group-count {
            background: #3a424c;
            color: #f2f4f7;
        }

        html[data-theme="dark"] .stat-item {
            background-color: #262b33;
        }

        html[data-theme="dark"] .form-control::placeholder,
        html[data-theme="dark"] .form-select::placeholder,
        html[data-theme="dark"] .searchable-dropdown input::placeholder,
        html[data-theme="dark"] .select2-container--bootstrap-5 .select2-search__field::placeholder,
        html[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection__placeholder {
            color: #c5cdd6;
            opacity: 1;
        }

        html[data-theme="dark"] #howToPlayModal #howToPlayTabs,
        html[data-theme="dark"] #revisionHistoryModal #revisionSportTabs,
        html[data-theme="dark"] #accountModal #accountTabs {
            background-color: #1c2026;
            border-bottom-color: #3a424c;
        }

        html[data-theme="dark"] #landingPage .landing-footer,
        html[data-theme="dark"] #landingPage .landing-feedback,
        html[data-theme="dark"] #usernameDisplay {
            color: #c5cdd6;
        }

        html[data-theme="dark"] #landingPage .landing-feedback:hover {
            color: #90CAF9;
        }

        html[data-theme="dark"] .dropdown-menu {
            background-color: #1c2026;
            border-color: #3a424c;
        }

        html[data-theme="dark"] .dropdown-item {
            color: #e8eaed;
        }

        html[data-theme="dark"] #howToPlayModal .menu-tabs,
        html[data-theme="dark"] #revisionHistoryModal .menu-tabs,
        html[data-theme="dark"] #accountModal .menu-tabs,
        html[data-theme="dark"] #accountModal .modal-body,
        html[data-theme="dark"] #howToPlayModal .modal-body,
        html[data-theme="dark"] #revisionHistoryModal .modal-body {
            background-color: #1c2026;
        }

        html[data-theme="dark"] .dropdown-item:hover,
        html[data-theme="dark"] .dropdown-item:focus {
            background-color: #16324D;
            color: #90CAF9;
        }
        /* Admin activity dashboard */
        .activity-summary-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 0.75rem;
        }

        .activity-summary-card {
            background: #f4f4f4;
            border: 1px solid #d8d8d8;
            border-radius: 0.5rem;
            padding: 0.85rem 1rem;
        }

        .activity-summary-value {
            font-size: 1.5rem;
            font-weight: 700;
            line-height: 1.1;
            color: #222;
        }

        .activity-summary-label {
            margin-top: 0.25rem;
            font-size: 0.8rem;
            color: #666;
        }

        .activity-tabs {
            border-bottom-color: #d8d8d8;
        }

        .activity-tabs .nav-link {
            color: #555;
        }

        .activity-tabs .nav-link.active {
            color: #222;
            font-weight: 600;
        }

        .activity-section-title {
            font-size: 0.95rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
        }

        .activity-section-note {
            font-size: 0.85rem;
        }

        .activity-period-table tbody td:first-child {
            font-weight: 600;
            color: #333;
        }

        .activity-edits-scroll {
            max-height: 240px;
            overflow-y: auto;
        }

        .activity-account-filter {
            max-width: 220px;
        }

        .activity-table th,
        .activity-table td {
            vertical-align: middle;
            white-space: nowrap;
        }

        .activity-admin-badge {
            display: inline-block;
            margin-left: 0.35rem;
            padding: 0.05rem 0.4rem;
            border-radius: 0.25rem;
            background: #e8e8e8;
            color: #444;
            font-size: 0.7rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            text-transform: uppercase;
        }

        @media (max-width: 576px) {
            .activity-summary-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .activity-account-filter {
                max-width: none;
                width: 100%;
            }
        }
