/* ===========================================
   THE RACE - the-race.css
   Race Simulator
   =========================================== */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Globe green (continent/land) */
    --tr-green-200: #bbf7d0;
    --tr-green-300: #86efac;
    --tr-green-400: #4ade80;
    --tr-green-500: #22c55e;
    --tr-green-600: #16a34a;
    --tr-green-700: #15803d;
    --tr-green-800: #166534;

    /* Ocean blue (water/depth) */
    --tr-ocean-300: #7dd3fc;
    --tr-ocean-400: #38bdf8;
    --tr-ocean-500: #0ea5e9;
    --tr-ocean-600: #0284c7;

    /* Deep ocean-black neutral */
    --tr-neutral-900: #030b10;
    --tr-neutral-800: #05131c;
    --tr-neutral-700: #091c28;
    --tr-neutral-600: #0e2638;
    --tr-neutral-500: #133049;
    --tr-neutral-400: #193c5a;

    /* Text */
    --tr-text-primary:   #ffffff;
    --tr-text-secondary: #c8f0dc;
    --tr-text-muted:     #b8dcc8;
    --tr-text-accent:    var(--tr-green-400);

    /* Borders */
    --tr-border-default: rgba(34, 197, 94, 0.13);
    --tr-border-accent:  rgba(34, 197, 94, 0.36);
    --tr-border-subtle:  rgba(255, 255, 255, 0.06);

    /* Surfaces */
    --tr-surface-dark:    var(--tr-neutral-800);
    --tr-surface-card:    var(--tr-neutral-700);
    --tr-surface-overlay: var(--tr-neutral-600);

    /* Spacing */
    --tr-space-1:  4px;
    --tr-space-2:  8px;
    --tr-space-3:  12px;
    --tr-space-4:  16px;
    --tr-space-5:  20px;
    --tr-space-6:  24px;
    --tr-space-8:  32px;
    --tr-space-10: 40px;
    --tr-space-12: 48px;
}

/* ============================================
   BASE
   ============================================ */
#the-race-app {
    min-height: 100vh;
    background: var(--tr-neutral-900);
    color: var(--tr-text-primary);
    font-family: 'Inter', sans-serif;
}

#the-race-app * {
    box-sizing: border-box;
}

#the-race-app .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--tr-space-4);
}

/* ============================================
   HEADER & LOGO
   ============================================ */
#the-race-app .header {
    position: relative;
    background: linear-gradient(
        180deg,
        rgba(34, 197, 94, 0.06) 0%,
        rgba(3, 11, 16, 0.97) 100%
    );
    border-bottom: 3px solid;
    border-image: linear-gradient(
        90deg,
        var(--tr-neutral-900),
        var(--tr-green-800),
        var(--tr-green-400),
        var(--tr-ocean-500),
        var(--tr-green-700),
        var(--tr-neutral-900)
    ) 1;
    padding: var(--tr-space-8) var(--tr-space-6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.85), 0 0 60px rgba(34, 197, 94, 0.03);
}

#the-race-app .logo {
    text-align: center;
}

#the-race-app .logo-main {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    background: linear-gradient(
        135deg,
        var(--tr-green-300)  0%,
        var(--tr-ocean-400)  25%,
        var(--tr-green-400)  55%,
        var(--tr-ocean-300)  75%,
        var(--tr-green-600)  100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

#the-race-app .logo-subtitle {
    font-size: 0.75rem;
    color: var(--tr-text-muted);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-top: var(--tr-space-2);
}

#the-race-app .logo-credit {
    font-size: 0.65rem;
    color: var(--tr-text-muted);
    margin-top: var(--tr-space-1);
    opacity: 0.5;
}

/* ============================================
   ACCENT BAR
   ============================================ */
#the-race-app .tr-accent-bar {
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--tr-neutral-900) 0%,
        var(--tr-green-800)   20%,
        var(--tr-green-500)   40%,
        var(--tr-ocean-500)   55%,
        var(--tr-green-700)   80%,
        var(--tr-neutral-900) 100%
    );
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.3);
}

/* ============================================
   LAYOUT COMPONENTS
   ============================================ */
#the-race-app .modern-section {
    padding: var(--tr-space-8) var(--tr-space-6);
    max-width: 1100px;
    margin: 0 auto;
}

#the-race-app .modern-grid {
    display: grid;
    gap: var(--tr-space-6);
}

#the-race-app .modern-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
    #the-race-app .modern-grid-2 {
        grid-template-columns: 1fr;
    }
    #the-race-app .modern-section {
        padding: var(--tr-space-5) var(--tr-space-3);
    }
}

#the-race-app .modern-flex { display: flex; }
#the-race-app .modern-items-center { align-items: center; }
#the-race-app .modern-gap-4 { gap: var(--tr-space-4); }

/* ============================================
   HEADINGS
   ============================================ */
#the-race-app .modern-heading {
    font-weight: 700;
    color: var(--tr-text-primary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#the-race-app .modern-heading-lg {
    font-size: 1.4rem;
    margin-bottom: var(--tr-space-2);
}

#the-race-app .modern-text-accent {
    color: var(--tr-text-accent);
}

/* ============================================
   CARDS
   ============================================ */
#the-race-app .modern-card {
    background: linear-gradient(145deg, var(--tr-neutral-700) 0%, var(--tr-neutral-800) 100%);
    border: 1px solid var(--tr-border-default);
    border-radius: 12px;
    padding: var(--tr-space-6);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

#the-race-app .modern-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.28), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#the-race-app .modern-card:hover::before { opacity: 1; }

#the-race-app .modern-card:hover {
    border-color: var(--tr-border-accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 20px rgba(34, 197, 94, 0.05);
}

/* ============================================
   FORM COMPONENTS
   ============================================ */
#the-race-app .modern-form-group {
    margin-bottom: var(--tr-space-5);
}

#the-race-app .modern-form-group:last-child {
    margin-bottom: 0;
}

#the-race-app .modern-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--tr-space-2);
}

#the-race-app .modern-label::after {
    content: '';
    display: block;
    width: 18px;
    height: 1px;
    background: var(--tr-green-700);
    margin-top: 3px;
    opacity: 0.45;
}

#the-race-app .modern-input,
#the-race-app .modern-select {
    width: 100%;
    background: var(--tr-neutral-900);
    border: 1px solid var(--tr-border-subtle);
    border-radius: 8px;
    color: var(--tr-text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    padding: 10px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

#the-race-app .modern-input:focus,
#the-race-app .modern-select:focus {
    outline: none;
    border-color: var(--tr-green-700);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

#the-race-app .modern-input::placeholder { color: var(--tr-text-muted); }

#the-race-app .modern-input:hover,
#the-race-app .modern-select:hover {
    border-color: rgba(34, 197, 94, 0.22);
}

/* Hide the native number-input spinner arrows on all Race inputs */
#the-race-app input[type=number]::-webkit-outer-spin-button,
#the-race-app input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#the-race-app input[type=number] {
    -moz-appearance: textfield;
}

/* ============================================
   SLIDER
   ============================================ */
#the-race-app .modern-slider {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--tr-neutral-500);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#the-race-app .modern-slider::-moz-range-track {
    height: 4px;
    background: var(--tr-neutral-500);
    border-radius: 2px;
    border: none;
}

#the-race-app .modern-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--tr-green-500);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
    transition: all 0.15s ease;
}

#the-race-app .modern-slider::-webkit-slider-thumb:hover {
    background: var(--tr-green-400);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.7);
    transform: scale(1.15);
}

#the-race-app .modern-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--tr-green-500);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
    transition: all 0.15s ease;
}

#the-race-app .modern-slider::-moz-range-thumb:hover {
    background: var(--tr-green-400);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.7);
    transform: scale(1.15);
}

/* ============================================
   DIVIDER
   ============================================ */
#the-race-app .tr-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tr-border-accent), transparent);
    margin: var(--tr-space-6) 0;
}

/* ============================================
   TOTAL BOX
   ============================================ */
#the-race-app .total-box {
    text-align: center;
    padding: var(--tr-space-5) var(--tr-space-8);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.06) 0%, rgba(3, 11, 16, 0.5) 100%);
    border: 1px solid var(--tr-border-default);
    border-radius: 12px;
    margin-top: var(--tr-space-6);
}

#the-race-app .total-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--tr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#the-race-app .total-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--tr-green-400);
    line-height: 1.1;
    margin: var(--tr-space-1) 0;
}

#the-race-app .total-sub {
    font-size: 0.85rem;
    color: var(--tr-text-secondary);
}

/* ============================================
   BADGES
   ============================================ */
#the-race-app .role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 14px;
    border-radius: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#the-race-app .tr-team-badge {
    background: rgba(21, 128, 61, 0.18);
    border: 1px solid rgba(21, 128, 61, 0.45);
    color: var(--tr-green-300);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-tr-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    background: linear-gradient(135deg, var(--tr-green-600) 0%, var(--tr-green-800) 100%);
    color: #f0fdf4;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: 1px solid rgba(74, 222, 128, 0.45);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.btn-tr-primary:hover {
    background: linear-gradient(135deg, var(--tr-green-500) 0%, var(--tr-green-700) 100%);
    border-color: rgba(134, 239, 172, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(34, 197, 94, 0.45), 0 4px 14px rgba(0, 0, 0, 0.4);
}

.btn-tr-primary:active {
    transform: translateY(0);
}

/* Setup tool buttons */
.tr-setup-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 22px;
    background: rgba(255, 255, 255, 0.06);
    color: #d4d4d4;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tr-setup-tool-btn:hover {
    background: rgba(34, 197, 94, 0.13);
    color: var(--tr-green-300);
    border-color: rgba(34, 197, 94, 0.38);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.18);
}

.tr-setup-tool-btn:active { transform: translateY(0); }

/* Format/mode toggle buttons */
.tr-format-btn {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.05);
    color: #888;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.tr-format-btn:hover { border-color: rgba(34, 197, 94, 0.48); color: #ccc; }

.tr-format-btn.active {
    background: rgba(34, 197, 94, 0.14);
    border-color: var(--tr-green-500);
    color: var(--tr-green-300);
}

/* ============================================
   NAV BUTTONS
   ============================================ */
#the-race-app .btn-nav,
.btn-nav {
    background: #27282d;
    color: #a1a1aa;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
}

#the-race-app .btn-nav:hover,
.btn-nav:hover {
    background: #32333a;
    color: #e4e4e7;
}

/* ============================================
   HIDDEN / UTILITY
   ============================================ */
#the-race-app .hidden-screen {
    display: none !important;
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */
#the-race-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

/* ============================================
   TEAM COLOR PICKER
   ============================================ */
.tr-tc-color-input {
    width: 24px;
    height: 32px;
    border: none;
    border-radius: 4px 0 0 4px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    display: block;
    background: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.tr-tc-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
    border-radius: 4px 0 0 4px;
}

.tr-tc-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 4px 0 0 4px;
}

.tr-tc-color-input::-moz-color-swatch {
    border: none;
    border-radius: 4px 0 0 4px;
}

.tr-tc-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    padding: 0;
    display: block;
    transition: transform 0.15s, border-color 0.15s;
}

.tr-tc-swatch:hover {
    transform: scale(1.18);
    border-color: rgba(255, 255, 255, 0.5);
}

.tr-tc-palette {
    position: absolute;
    top: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    background: #091c28;
    border: 1px solid rgba(34, 197, 94, 0.28);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: 120px;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 12px rgba(34, 197, 94, 0.08);
}

.tr-tc-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    display: block;
    transition: transform 0.12s, border-color 0.12s;
}

.tr-tc-dot:hover {
    transform: scale(1.22);
    border-color: rgba(255, 255, 255, 0.55);
}

.tr-tc-dot.active {
    border-color: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.45);
}

/* ============================================
   RACER GRID (teams display)
   ============================================ */
#the-race-app .tr-teams-grid {
    display: grid;
    gap: var(--tr-space-3);
}

#the-race-app .tr-team-card {
    background: rgba(9, 28, 40, 0.8);
    border: 1px solid var(--tr-border-default);
    border-radius: 10px;
    padding: var(--tr-space-3) var(--tr-space-4);
    display: flex;
    align-items: center;
    gap: var(--tr-space-3);
}

#the-race-app .tr-team-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--tr-green-400);
    flex-shrink: 0;
}

/* ============================================
   TEAM STATUS SCREEN
   ============================================ */
#the-race-app .tr-status-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

#the-race-app .tr-status-team-card {
    background: var(--tr-neutral-700);
    border: 1px solid var(--tr-border-default);
    border-left: 4px solid;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#the-race-app .tr-status-team-name {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

#the-race-app .tr-status-portraits {
    display: flex;
    gap: 16px;
    justify-content: center;
}

#the-race-app .tr-status-portrait-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

#the-race-app .tr-status-portrait {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 3px solid;
    overflow: hidden;
    background: var(--tr-neutral-600);
    flex-shrink: 0;
}

#the-race-app .tr-status-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#the-race-app .tr-status-portrait-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.2);
}

#the-race-app .tr-status-racer-name {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--tr-text-secondary);
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#the-race-app .tr-status-archetype {
    font-size: 0.63rem;
    font-weight: 500;
    color: var(--tr-text-muted);
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#the-race-app .tr-status-budget {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--tr-border-subtle);
}

#the-race-app .tr-status-budget-label {
    font-size: 0.68rem;
    color: var(--tr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
}

#the-race-app .tr-status-budget-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--tr-green-400);
}

/* ============================================
   TIMELINE BAR
   ============================================ */
#the-race-app .tr-timeline-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 14px 0 4px;
}

#the-race-app .tr-timeline-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.13);
    padding: 6px 12px;
    border-bottom: 2px solid transparent;
}

#the-race-app .tr-timeline-label.active {
    color: var(--tr-green-400);
    border-bottom-color: var(--tr-green-400);
}

#the-race-app .tr-timeline-sep {
    color: rgba(255, 255, 255, 0.07);
    font-size: 0.5rem;
    padding: 0 2px;
}

/* ============================================
   DEPARTURE SCREEN
   ============================================ */
#the-race-app .tr-departure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

#the-race-app .tr-departure-time-badge {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--tr-text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

#the-race-app .tr-departure-speedbump {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 4px;
    padding: 4px 10px;
    display: inline-block;
}

#the-race-app .tr-departure-narrative {
    font-size: 0.78rem;
    color: var(--tr-text-muted);
    line-height: 1.55;
    text-align: center;
}

/* ============================================
   TRANSIT OPTIONS PANEL
   ============================================ */
#the-race-app .tr-transit-options-panel {
    background: var(--tr-neutral-700);
    border: 1px solid var(--tr-border-default);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 24px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

#the-race-app .tr-transit-options-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tr-text-muted);
    margin-bottom: 10px;
}

#the-race-app .tr-transit-options-header {
    display: grid;
    grid-template-columns: 1fr 80px 50px 60px;
    gap: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--tr-border-subtle);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 4px;
}

#the-race-app .tr-transit-option-row {
    display: grid;
    grid-template-columns: 1fr 80px 50px 60px;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--tr-border-subtle);
}

#the-race-app .tr-transit-option-row:last-child {
    border-bottom: none;
}

#the-race-app .tr-transit-option-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--tr-text-secondary);
}

#the-race-app .tr-transit-option-speed {
    display: flex;
    align-items: center;
}

#the-race-app .tr-transit-option-cost {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--tr-green-400);
}

#the-race-app .tr-transit-option-risk {
    font-size: 0.72rem;
    font-weight: 700;
}

/* ============================================
   PANEL TOGGLE BUTTONS
   ============================================ */
#the-race-app .tr-panel-toggle-btn {
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-panel-toggle-btn-manager {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.28);
    color: var(--tr-green-300);
}

#the-race-app .tr-panel-toggle-btn-manager:hover {
    background: rgba(34, 197, 94, 0.18);
}

#the-race-app .tr-panel-toggle-btn-analytics {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.28);
    color: var(--tr-ocean-300);
}

#the-race-app .tr-panel-toggle-btn-skip {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.32);
    color: #fca5a5;
}

#the-race-app .tr-panel-toggle-btn-skip:hover {
    background: rgba(248, 113, 113, 0.16);
}

#the-race-app .tr-panel-toggle-btn-analytics:hover {
    background: rgba(14, 165, 233, 0.18);
}

/* ============================================
   COLLAPSE PANELS (Season Manager + Analytics)
   ============================================ */
#the-race-app .tr-collapse-panel {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(34, 197, 94, 0.18);
    background: var(--tr-neutral-800);
}

#the-race-app .tr-collapse-panel-analytics {
    border-color: rgba(14, 165, 233, 0.18);
}

#the-race-app .tr-collapse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

#the-race-app .tr-collapse-header:hover {
    background: rgba(34, 197, 94, 0.05);
}

#the-race-app .tr-collapse-panel-analytics .tr-collapse-header:hover {
    background: rgba(14, 165, 233, 0.05);
}

#the-race-app .tr-collapse-title {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

#the-race-app .tr-collapse-title-manager {
    color: var(--tr-green-300);
}

#the-race-app .tr-collapse-title-analytics {
    color: var(--tr-ocean-300);
}

#the-race-app .tr-collapse-arrow {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    transition: transform 0.3s;
}

#the-race-app .tr-collapse-arrow-analytics {
    color: rgba(14, 165, 233, 0.5);
}

#the-race-app .tr-collapse-panel.open .tr-collapse-arrow {
    transform: rotate(180deg);
}

#the-race-app .tr-collapse-body {
    display: none;
    border-top: 1px solid rgba(34, 197, 94, 0.12);
}

#the-race-app .tr-collapse-panel-analytics .tr-collapse-body {
    border-top-color: rgba(14, 165, 233, 0.12);
}

#the-race-app .tr-collapse-panel.open .tr-collapse-body {
    display: block;
}

#the-race-app .tr-tabs-row {
    display: flex;
    gap: 6px;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
}

#the-race-app .tr-tab-btn {
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #777;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-tab-btn:hover {
    background: rgba(34, 197, 94, 0.1);
    color: var(--tr-green-300);
    border-color: rgba(34, 197, 94, 0.3);
}

#the-race-app .tr-tab-btn.active {
    background: rgba(34, 197, 94, 0.14);
    color: var(--tr-green-400);
    border-color: rgba(34, 197, 94, 0.4);
}

#the-race-app .tr-tab-btn-analytics:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--tr-ocean-300);
    border-color: rgba(14, 165, 233, 0.3);
}

#the-race-app .tr-tab-btn-analytics.active {
    background: rgba(14, 165, 233, 0.14);
    color: var(--tr-ocean-400);
    border-color: rgba(14, 165, 233, 0.4);
}

/* ============================================
   AIRPORT SCREEN -- FLIGHT BOARD
   ============================================ */
#the-race-app .tr-flight-board {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(34, 197, 94, 0.14);
    border-radius: 8px;
    overflow: hidden;
    max-width: 780px;
    margin: 0 auto;
}

#the-race-app .tr-flight-board-title {
    padding: 10px 18px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(34, 197, 94, 0.1);
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-flight-row {
    display: grid;
    grid-template-columns: 48px 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-left: 3px solid transparent;
    font-family: 'Inter', sans-serif;
    transition: background 0.15s;
}

#the-race-app .tr-flight-row:last-child {
    border-bottom: none;
}

#the-race-app .tr-flight-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

#the-race-app .tr-flight-row-num {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    font-family: 'Inter', monospace;
}

#the-race-app .tr-flight-row-airline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#the-race-app .tr-flight-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--tr-text-primary);
}

#the-race-app .tr-tier-badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-flight-row-times {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

#the-race-app .tr-flight-dep,
#the-race-app .tr-flight-arr {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--tr-text-primary);
    font-variant-numeric: tabular-nums;
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-flight-arrow {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.2);
}

#the-race-app .tr-flight-delay-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

#the-race-app .tr-flight-row-teams {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1px;
    min-width: 60px;
    justify-content: flex-end;
}

/* ============================================
   AIRPORT SCREEN -- TEAM GROUP HEADERS
   ============================================ */
#the-race-app .tr-flight-group-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid transparent;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
    color: rgba(255, 255, 255, 0.5);
    flex-wrap: wrap;
}

/* ============================================
   TASKS SCREEN
   ============================================ */
#the-race-app .tr-task-summary-bar {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(34, 197, 94, 0.1);
    border-radius: 8px;
    padding: 14px 20px;
    max-width: 680px;
    margin: 0 auto 4px;
    flex-wrap: wrap;
}

#the-race-app .tr-task-summary-item {
    flex: 1;
    min-width: 180px;
}

#the-race-app .tr-task-summary-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.22);
    margin-bottom: 5px;
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-task-summary-name {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--tr-text-primary);
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-task-summary-meta {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 3px;
    text-transform: capitalize;
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-task-summary-sep {
    color: rgba(255, 255, 255, 0.12);
    font-size: 0.8rem;
    align-self: center;
}

#the-race-app .tr-detour-style-tag {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.25);
    font-family: 'Inter', sans-serif;
    vertical-align: middle;
}

#the-race-app .tr-detour-style-tag.risky {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.25);
}

#the-race-app .tr-landing-row {
    text-align: center;
    padding: 5px 0 7px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(34, 197, 94, 0.08);
    margin-bottom: 6px;
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-phase-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 0.77rem;
    font-family: 'Inter', sans-serif;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#the-race-app .tr-phase-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

#the-race-app .tr-phase-label {
    color: rgba(255, 255, 255, 0.52);
    flex: 1;
}

#the-race-app .tr-phase-time {
    color: rgba(255, 255, 255, 0.32);
    font-variant-numeric: tabular-nums;
    font-size: 0.71rem;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-task-block {
    padding: 9px 0 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#the-race-app .tr-task-type-label {
    font-size: 0.57rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    margin-bottom: 3px;
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-task-name {
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--tr-text-primary);
    margin-bottom: 5px;
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-task-racer-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.58);
    margin-bottom: 4px;
    flex-wrap: wrap;
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-task-narrative {
    font-size: 0.71rem;
    color: rgba(255, 255, 255, 0.35);
    font-style: italic;
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-placement-badge {
    font-size: 0.67rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

#the-race-app .tr-placement-1 {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.35);
}

#the-race-app .tr-placement-2 {
    color: #d1d5db;
    background: rgba(209, 213, 219, 0.08);
    border-color: rgba(209, 213, 219, 0.22);
}

#the-race-app .tr-placement-3 {
    color: #d97706;
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.28);
}

#the-race-app .tr-placement-other {
    color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

/* ============================================
   TASKS SCREEN -- LIVE STATUS BADGES
   ============================================ */
#the-race-app .tr-task-status-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.67rem;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

#the-race-app .tr-status-badge-inflight {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.25);
}

#the-race-app .tr-status-badge-transit {
    color: #9ca3af;
    background: rgba(156, 163, 175, 0.08);
    border-color: rgba(156, 163, 175, 0.2);
}

#the-race-app .tr-status-badge-rb {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.25);
}

#the-race-app .tr-status-badge-dt {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.25);
}

#the-race-app .tr-status-badge-heading {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.1);
    border-color: rgba(192, 132, 252, 0.25);
}

#the-race-app .tr-status-badge-checkedin {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.3);
}

#the-race-app .tr-task-status-desc {
    font-size: 0.72rem;
    color: rgba(200, 240, 220, 0.5);
    font-family: 'Inter', sans-serif;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    line-height: 1.4;
}

/* ============================================
   TASKS SCREEN -- EVENT LOG (team card format)
   ============================================ */
#the-race-app .tr-event-tag {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 3px;
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.06em;
    white-space: nowrap;
    flex-shrink: 0;
    vertical-align: middle;
}

#the-race-app .tr-event-tag-landed  { color: #4ade80; background: rgba(74,222,128,0.1);  border-color: rgba(74,222,128,0.25); }
#the-race-app .tr-event-tag-transit { color: #9ca3af; background: rgba(156,163,175,0.08); border-color: rgba(156,163,175,0.2); }
#the-race-app .tr-event-tag-heading { color: #c084fc; background: rgba(192,132,252,0.1);  border-color: rgba(192,132,252,0.25); }
#the-race-app .tr-event-tag-rb      { color: #f87171; background: rgba(248,113,113,0.1);  border-color: rgba(248,113,113,0.25); }
#the-race-app .tr-event-tag-dt      { color: #60a5fa; background: rgba(96,165,250,0.1);   border-color: rgba(96,165,250,0.25); }
#the-race-app .tr-event-tag-pitstop { color: #fbbf24; background: rgba(251,191,36,0.1);   border-color: rgba(251,191,36,0.25); }

#the-race-app .tr-team-event-log {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0;
}

#the-race-app .tr-team-event-entry {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#the-race-app .tr-team-event-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

#the-race-app .tr-team-event-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

#the-race-app .tr-event-time-sm {
    font-size: 0.65rem;
    color: rgba(200, 240, 220, 0.3);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    white-space: nowrap;
    min-width: 64px;
}

#the-race-app .tr-team-event-detail {
    font-size: 0.72rem;
    color: rgba(200, 240, 220, 0.7);
    font-family: 'Inter', sans-serif;
    line-height: 1.45;
    padding-left: 71px;
}

#the-race-app .tr-event-narrative {
    font-size: 0.68rem;
    color: rgba(200, 240, 220, 0.38);
    font-style: italic;
    font-family: 'Inter', sans-serif;
    margin-top: 3px;
    line-height: 1.4;
}

#the-race-app .tr-clash-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
    padding: 8px 14px;
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.18);
    border-radius: 6px;
    font-size: 0.73rem;
    font-family: 'Inter', sans-serif;
}

#the-race-app .tr-clash-icon {
    color: #fbbf24;
    font-size: 0.85rem;
}

#the-race-app .tr-clash-and,
#the-race-app .tr-clash-label {
    color: rgba(200, 240, 220, 0.45);
}
