:root {
    --bg-primary: #0a0a0a;
    /* True Black/Dark Grey */
    --bg-secondary: #111111;
    --bg-card: rgba(255, 255, 255, 0.05);
    /* Keep Glassy */
    --bg-hover: rgba(255, 255, 255, 0.1);
    --accent-blue: #333333;
    /* Neutral instead of blue */
    --accent-red: #dc2743;
    --accent-gold: #D4AF37;
    /* Rich Gold from Image */
    --accent-green: #10b981;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --border-color: rgba(255, 255, 255, 0.15);
    --success: #22c55e;
    --warning: #D4AF37;
    --error: #ef4444;
    --gradient-usa: linear-gradient(135deg, #B47B2B 0%, #E8BD56 100%);
    --gradient-gold: linear-gradient(135deg, #B47B2B 0%, #E8BD56 100%);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.2);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    /* Removed Blue Tint, kept premium radial darkness */
    background: radial-gradient(circle at top center, #222222 0%, #000000 80%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    /* Prevent horizontal shift */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

body::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: rgba(10, 10, 10, 0.9);
    /* Neutral dark */
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.usa-badge {
    background: linear-gradient(135deg, rgba(180, 123, 43, 0.2) 0%, rgba(232, 189, 86, 0.4) 100%);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 2px;
    box-shadow: 0 0 15px rgba(232, 189, 86, 0.2);
    text-shadow: 0 0 10px rgba(232, 189, 86, 0.5);
}

.title-group h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, var(--accent-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 2px rgba(232, 189, 86, 0.3));
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Navigation */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-tab {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.nav-tab:hover {
    background: rgba(232, 189, 86, 0.1);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(232, 189, 86, 0.1);
}

.nav-tab.active {
    background: linear-gradient(135deg, rgba(232, 189, 86, 0.2) 0%, rgba(180, 123, 43, 0.3) 100%);
    border-color: var(--accent-gold);
    color: #fff;
    box-shadow: 0 0 20px rgba(232, 189, 86, 0.2), inset 0 0 10px rgba(232, 189, 86, 0.1);
    text-shadow: 0 0 5px rgba(232, 189, 86, 0.5);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Holographic Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* Highlight top edge */
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
}

.card:hover {
    border-color: rgba(232, 189, 86, 0.3);
    box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.6), 0 0 15px rgba(232, 189, 86, 0.05);
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(232, 189, 86, 0.2);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Holographic sheen effect on hover */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: 0.5s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(232, 189, 86, 0.2);
}

.stat-icon {
    font-size: 2rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    display: block;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-danger {
    background: var(--error);
    color: white;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: var(--bg-hover);
}

.data-table .rank-1 {
    color: #ffd700;
    font-weight: 700;
}

.data-table .rank-2 {
    color: #c0c0c0;
    font-weight: 600;
}

.data-table .rank-3 {
    color: #cd7f32;
    font-weight: 600;
}

.data-table .dropped {
    color: var(--text-muted);
    text-decoration: line-through;
}

.data-table .highlight {
    background: rgba(59, 130, 246, 0.1);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

input,
select {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.2rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-group select {
    width: auto;
    min-width: 150px;
}

.search-input {
    max-width: 300px;
}

/* Race Entry */
.race-setup {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sprint-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.sprint-row:last-child {
    border-bottom: none;
}

.sprint-label {
    font-weight: 600;
    color: var(--accent-gold);
}

.finish-row {
    display: grid;
    grid-template-columns: 60px 1fr 100px;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem 0;
}

.finish-position {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-blue);
}

/* Olympic Panel */
.olympic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
}

.olympic-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.5rem;
    background: var(--gradient-usa);
    font-weight: 600;
}

.panel-header h3 {
    margin: 0;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.acrs-toggle {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
}

.acrs-toggle:hover {
    background: var(--border-color);
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

.text-muted {
    color: var(--text-muted);
}

.mb-1 {
    margin-bottom: 1rem;
}

.mt-1 {
    margin-top: 1rem;
}

/* Race tabs */
.race-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.race-tab {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
}

.race-tab.active {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #000;
}

/* Action buttons row */
.action-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Section headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    background: linear-gradient(90deg, var(--text-primary), var(--accent-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* DNF list */
.dnf-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.dnf-item select {
    flex: 1;
}

/* Results panels */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.results-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.results-panel h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* ACRS Modal table */
.acrs-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
}

.acrs-cell {
    background: var(--bg-secondary);
    padding: 0.5rem;
    text-align: center;
    border-radius: var(--radius-sm);
}

.acrs-cell .place {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.acrs-cell .pts {
    font-weight: 700;
    color: var(--accent-gold);
}

/* Info cards */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-card h4 {
    color: var(--accent-gold);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.info-card ul,
.info-card ol {
    margin-left: 1.5rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-tabs {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .olympic-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 1rem;
    }
}

/* Print Styles */
.print-only {
    display: none;
}

@media print {
    body {
        background: white;
        color: black;
        font-family: 'Times New Roman', serif;
    }

    .header,
    .nav-tabs,
    .footer,
    .btn,
    .no-print,
    .action-row,
    .race-tabs,
    .filter-bar,
    .section-header button {
        display: none !important;
    }

    .main-content {
        padding: 0;
        margin: 0;
        box-shadow: none;
        border: none;
        background: white;
        max-width: 100%;
    }

    .app-container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .print-only {
        display: block !important;
    }

    /* Table Styling for Print */
    /* Table Styling for Print - Modern Professional */
    table {
        width: 100% !important;
        border-collapse: collapse;
        font-family: 'Outfit', sans-serif;
        font-size: 10pt;
        color: black;
        margin-bottom: 20px;
    }

    th {
        border-bottom: 2px solid #000 !important;
        padding: 8px 12px;
        text-align: left;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-size: 9pt;
        color: #444;
    }

    td {
        border-bottom: 1px solid #ddd !important;
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
        padding: 8px 12px;
        vertical-align: middle;
    }

    tr:nth-child(even) {
        background-color: #f4f4f4 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Badges */
    .rank-badge {
        background: none;
        color: black;
        border: none;
        padding: 0;
        font-weight: bold;
        box-shadow: none;
    }

    .pts-badge {
        background: none;
        color: black;
        padding: 0;
    }

    /* Layout */
    .results-grid,
    .olympic-grid {
        display: block;
    }

    .results-panel,
    .olympic-panel {
        border: none;
        margin-bottom: 20px;
        page-break-inside: auto;
    }

    .panel-header {
        background: none;
        border-bottom: 1px solid black;
        padding: 5px 0;
        color: black;
    }

    .panel-header h3 {
        font-size: 16pt;
        margin: 0;
    }

    /* Hide dashboard */
    .dashboard-grid {
        display: none;
    }

    /* Specific overrides */
    h2,
    h3,
    h4 {
        color: black !important;
    }

    .text-muted {
        color: #333 !important;
    }
}

.print-header {
    text-align: center;
    margin-bottom: 60px;
    border-bottom: 4px solid #C5A059;
    /* Salty Gold Bar */
    padding-bottom: 20px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.print-title h1 {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.print-footer {
    margin-top: 30px;
}

/* Olympic Print Logic */
body[data-tab="olympic"] .print-footer {
    display: none !important;
}

/* Button Group */
.btn-group {
    display: inline-flex;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #444;
}

.btn-group .btn {
    border-radius: 0;
    margin: 0;
    border: none;
    border-right: 1px solid #444;
}

.btn-group .btn:last-child {
    border-right: none;
}

.btn-outline-primary {
    background: transparent;
    color: var(--text-primary);
}

.btn-outline-primary:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Branding Updates */
.footer-info {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.branding-text {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.7;
}

.salty-link {
    color: #C5A059;
    /* Muted Gold */
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.salty-link:hover {
    color: #FFD700;
    /* Bright Gold */
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
    text-decoration: none;
}

@media print {

    /* 1. Page Setup */
    @page {
        margin: 1.0cm;
        /* Slightly more space */
        size: letter portrait;
    }

    body {
        background: white;
        color: #000 !important;
        font-family: "Georgia", serif;
        margin: 0;
        padding: 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 2. Hide Screen Elements & Ghost Headers */
    .no-print,
    .nav-bar,
    button,
    .share-download-btn,
    .print-footer,
    .ig-standings-card,
    .share-overlay,
    .panel-header h2,
    /* Hide screen headers */
    .panel-header svg,
    .panel-header {
        display: none !important;
    }

    /* 3. Reset Layout Containers */
    .container,
    .main-content,
    .card {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* 4. Professional Header Styling */
    .print-only {
        display: block !important;
        margin-bottom: 30px !important;
        border-bottom: 3px solid #D4AF37 !important;
        /* SALTY GOLD BORDER */
        padding-bottom: 20px !important;
        text-align: center !important;
    }

    .print-only h1 {
        font-family: "Georgia", serif !important;
        font-size: 32pt !important;
        color: #000 !important;
        letter-spacing: 2px !important;
        margin: 15px 0 10px 0 !important;
        text-transform: uppercase !important;
    }

    .print-only h2 {
        font-family: "Arial", sans-serif !important;
        font-size: 11pt !important;
        color: #666 !important;
        font-weight: normal !important;
        margin-top: 5px !important;
        letter-spacing: 2px !important;
        text-transform: uppercase !important;
    }

    /* 5. Data Table Styling */
    .table-container {
        overflow: visible !important;
        margin-top: 0 !important;
    }

    .data-table {
        width: 100% !important;
        border-collapse: collapse !important;
        border: none !important;
        margin-top: 20px !important;
    }

    .data-table thead th {
        background: transparent !important;
        color: #000 !important;
        border-bottom: 2px solid #D4AF37 !important;
        /* GOLD HEADER LINE */
        border-top: none !important;
        font-family: "Arial", sans-serif !important;
        font-weight: 800 !important;
        font-size: 10pt !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        padding: 10px 4px !important;
    }

    .data-table tbody td {
        background: transparent !important;
        /* FORCE REMOVE GRADIENTS */
        color: #000 !important;
        border-bottom: 1px solid #ddd !important;
        font-family: "Arial", sans-serif !important;
        font-size: 11pt !important;
        padding: 12px 4px !important;
        line-height: 1.4 !important;
    }

    /* Remove Zebra Striping */
    .data-table tbody tr {
        background: transparent !important;
    }

    /* 6. Rank Highlighting (Salty Gold Flair) */
    .rank-1 {
        color: #B8860B !important;
        font-weight: 900 !important;
        font-size: 1.2em !important;
    }

    /* Dark Gold for print */
    .rank-2 {
        color: #333 !important;
        font-weight: 800 !important;
    }

    .rank-3 {
        color: #555 !important;
        font-weight: 800 !important;
    }

    /* 7. Footer Branding */
    .print-branding {
        display: block !important;
        margin-top: 50px !important;
        padding-top: 20px !important;
        border-top: 1px solid #D4AF37 !important;
        /* THIN GOLD LINE */
        text-align: center !important;
    }

    .print-branding div {
        color: #000 !important;
        font-family: "Georgia", serif !important;
        letter-spacing: 3px !important;
        font-size: 9pt !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
    }
}

/* Admin Mode Visibility */
.admin-only {
    display: none !important;
}

body.admin-mode .admin-only {
    display: inline-block !important;
}


/* SHARE CARD STYLING */
.share-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.share-modal {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    max-width: 90%;
}

.close-share {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

.ig-card {
    width: 340px;
    height: 520px;
    background: #000;
    background-image:
        radial-gradient(circle at top right, rgba(212, 175, 55, 0.15), transparent),
        radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 0.05), transparent);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    margin: 0 auto 20px auto;
    position: relative;
    overflow: hidden;
}

.ig-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #B47B2B, #E8BD56, #B47B2B);
}

.ig-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #B47B2B, #E8BD56, #B47B2B);
}

.ig-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.ig-qualified-label {
    color: #fff;
    font-size: 14px;
    letter-spacing: 5px;
    font-weight: 800;
    margin-bottom: 30px;
    padding: 10px 0;
    display: block;
    text-transform: uppercase;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#share-athlete-name {
    font-size: 42px;
    font-weight: 900;
    color: #fff;
    margin: 10px 0 25px 0;
    line-height: 0.95;
    text-transform: uppercase;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    letter-spacing: -1px;
}

.ig-events-label {
    color: #D4AF37;
    font-size: 11px;
    letter-spacing: 3px;
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.ig-events-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.ig-events-list span {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 0;
    font-size: 15px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
}

.ig-footer {
    width: 100%;
    padding-top: 20px;
}

.ig-footer p {
    margin: 0;
    color: #888;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
}

.ig-brand {
    color: #D4AF37 !important;
    font-weight: 800;
    margin-top: 8px !important;
    font-size: 13px !important;
    letter-spacing: 1px !important;
}

/* Member Status & Alerts */
.status-qualified {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: #ef4444 !important;
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1) !important;
    border-color: #22c55e !important;
    color: #86efac;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: #3b82f6 !important;
    color: #93c5fd;
}

.badge-warn {
    background: #D4AF37 !important;
    color: #000 !important;
}

.border-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2) !important;
}

/* --- NEW DASHBOARD ELEMENTS --- */

/* Selection 101 Explainer */
.explainer-card {
    background: rgba(212, 175, 55, 0.05);
    border: 1px dashed var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 2rem;
    position: relative;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.explainer-card h4 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent-gold);
}

.explainer-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.step-item {
    display: flex;
    gap: 12px;
}

.step-num {
    background: var(--accent-gold);
    color: #000;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.step-text b {
    display: block;
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.step-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* Roster Progress Bar */
.progress-section {
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 8px;
}

.progress-title {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.progress-count {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--accent-gold);
}

.progress-bar-container {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-segment {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.seg-protected {
    background: var(--success);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

/* SHARE CARD - STANDINGS */
.ig-standings-card {
    width: 450px;
    min-height: auto;
    padding-bottom: 40px;
    background: radial-gradient(circle at top, #1a1a2e, #000);
    border: 2px solid #D4AF37;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    display: none;
    font-family: 'Segoe UI', sans-serif;
    color: white;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
    /* Allow content to grow */
}

.ig-standings-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, #D4AF37, transparent);
    opacity: 0.8;
}

.ig-table-container {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ig-table-container table tr:last-child {
    border-bottom: none !important;
}

.ig-table-container table td {
    vertical-align: middle;
}

.seg-vulnerable {
    background: var(--accent-gold);
}

.seg-out {
    background: #444;
}

/* Roster Table Specifics */
.row-protected {
    border-left: 4px solid var(--success) !important;
    background: rgba(34, 197, 94, 0.05);
}

.row-vulnerable {
    border-left: 4px solid var(--accent-gold) !important;
    background: rgba(212, 175, 55, 0.03);
}

.row-out {
    opacity: 0.6;
    filter: grayscale(0.5);
    background: rgba(0, 0, 0, 0.1);
}

.status-note {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-top: 2px;
}

.note-protected {
    color: var(--success);
}

.note-vulnerable {
    color: var(--accent-gold);
}

.note-out {
    color: var(--text-muted);
}

/* Mass Start Dropped Logic */
.ms-score-dropped {
    text-decoration: line-through;
    opacity: 0.4;
    position: relative;
    color: var(--text-muted);
}

.ms-score-dropped::after {
    content: 'dropped';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: var(--error);
}

@keyframes pulse-red {
    0% {
        background: #ff4444;
        box-shadow: 0 0 5px #ff4444;
    }

    50% {
        background: #b30000;
        box-shadow: 0 0 20px #ff4444;
    }

    100% {
        background: #ff4444;
        box-shadow: 0 0 5px #ff4444;
    }
}

/* THEMED BUTTONS & TABS */
.segment-group-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.segment-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-gold);
    margin-bottom: -4px;
}

.segment-group {
    display: inline-flex;
    background: #1a1a1a;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--accent-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
}

.btn-segment {
    background: transparent;
    border: none;
    color: #999;
    padding: 6px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-segment:hover {
    color: #fff;
}

.btn-segment.active {
    background: #000;
    color: #D4AF37;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.btn-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    border-radius: 12px;
    padding: 8px 24px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-tab:hover {
    border-color: #D4AF37;
    color: #D4AF37;
    background: rgba(212, 175, 55, 0.05);
}

.btn-tab.active {
    background: #D4AF37;
    color: #000;
    border-color: #D4AF37;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

/* PULSE ANIMATION FOR EYE ICON */
@keyframes pulse-gold {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }

    70% {
        transform: scale(1.15);
        box-shadow: 0 0 0 8px rgba(212, 175, 55, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

.pulse-eye {
    animation: pulse-gold 2s infinite;
    background: #D4AF37 !important;
    color: #000 !important;
    border: none !important;
    font-size: 1.2em !important;
    padding: 2px 7px !important;
    line-height: 1;
    border-radius: 5px !important;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 5px;
}

.pulse-eye:hover {
    transform: scale(1.25);
    animation: none;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.9);
}

/* Fix for PDF print visibility from JS rendered tables */
.result-time-cell {
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
    text-align: center;
}

@media print {
    .result-time-cell {
        color: #000 !important;
    }
}

/* SHARE MODAL LAYOUT FIX */
/* SHARE MODAL LAYOUT FIX - REFACTORED FOR ROBUSTNESS */
.share-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    /* Use block display with scroll handling on the overlay itself */
    display: block;
    overflow-y: auto;
    backdrop-filter: blur(5px);
    padding: 20px;
    /* Padding to prevent edge touching */
    box-sizing: border-box;
    text-align: center;
    /* Helper for inline-block centering if needed, but we use margin auto */
}

/* Helper to vertically align if content is short, but scroll if long */
.share-overlay::before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
    margin-right: -0.25em;
}

.share-modal {
    background: #111;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #333;
    border-top: 4px solid #D4AF37;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);

    /* Layout */
    display: inline-block;
    /* Allows vertical-align middle */
    vertical-align: middle;
    width: auto;
    max-width: 90%;
    /* Prevent hitting edges */
    margin: 40px auto;
    /* Ensure space at top/bottom when scrolling */

    /* Remove internal scroll constraints - let it grow! */
    max-height: none;
    overflow: visible;
    position: relative;
    text-align: left;
    /* Reset text align */
}

/* Ensure Download button sits nicely at bottom with gap */
.share-download-btn {
    margin-top: 30px;
    /* Increased from 25px */
    width: 100%;
    max-width: 300px;
    background: linear-gradient(135deg, #D4AF37 0%, #aa8c2c 100%);
    border: none;
    color: #000;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    transition: all 0.2s;
    position: relative;
    z-index: 20;
    /* Ensure above any potential overflow */
}

.share-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    background: #fff;
}

.close-share {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

.close-share:hover {
    color: #fff;
}