/* Import a sporty, modern F1-style font */
@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@400;600;700&display=swap');

html {
    /* This handles the top status bar and the "pull down" bounce area */
    background-color: #0d0d0f; 
    touch-action: pan-y;
    overscroll-behavior-y: none;
}

body {
    font-family: 'Titillium Web', sans-serif;
    background-color: #0d0d0f; /* Deep F1 charcoal */
    color: #f4f4f9;
    margin: 0;
    padding: 0;
    touch-action: pan-y;
    overscroll-behavior-y: none;
}

/* Header & Navigation Styling */
/* --- Mobile App Header Layout --- */
header {
    background-color: #0d0d0f;
    position: sticky; /* Keeps the navigation locked to the top when scrolling */
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

header h1 {
    margin: 0;
    font-size: 1.5em;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Main Content Containers */
main {
    padding: 20px;
    max-width: 100%;
    margin: auto;
    background-color: #15151e;
    min-height: 100vh; 
    min-height: 100dvh;
}

section, #gradingArea {
    background-color: #1e1e24;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

h2, h3, h4 {
    color: #ffffff;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Inputs & Selects */
label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #aaaaaa;
    font-size: 0.9em;
    text-transform: uppercase;
}

input, select, textarea {
    width: 100%;
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #333;
    background-color: #2a2a35;
    color: #ffffff;
    font-family: 'Titillium Web', sans-serif;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #e10600;
}

select {
    appearance: none; /* Removes the default browser arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    
    /* Add a custom arrow using a background image (SVG) */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23e10600' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center; /* Positions the arrow on the right */
    background-size: 14px;
    
    padding-right: 40px; /* Ensures text doesn't overlap the new arrow */
    cursor: pointer;
}

/* Ensure the focus state maintains the custom arrow */
select:focus {
    border-color: #e10600;
    background-color: #33333f;
}

/* Fix for mobile devices to ensure the custom arrow shows up */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select {
        padding-right: 40px;
    }
}

/* --- Custom F1 Racing Scrollbar --- */

/* 1. The width of the entire scrollbar */
select::-webkit-scrollbar {
    width: 8px;
}

/* 2. The background 'track' of the scrollbar */
select::-webkit-scrollbar-track {
    background: #15151e; /* Matches your body background */
    border-radius: 10px;
}

/* 3. The draggable 'thumb' part */
select::-webkit-scrollbar-thumb {
    background: #444; /* Subtle dark grey by default */
    border-radius: 10px;
    border: 2px solid #15151e; /* Creates a little 'gap' around the thumb */
}

/* 4. Color change when you hover or scroll */
select::-webkit-scrollbar-thumb:hover {
    background: #e10600; /* F1 Red when interacting */
}

/* Firefox Support (Firefox uses a different, simpler syntax) */
select {
    scrollbar-width: thin;
    scrollbar-color: #444 #15151e;
}

#seasonPredictionFormBox input:focus, 
#seasonPredictionFormBox select:focus, 
#seasonPredictionFormBox textarea:focus {
    border-color: #FFD700;
}

#seasonPredictionFormBox select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23FFD700' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}


#predictionForm input:focus, 
#predictionForm select:focus, 
#predictionForm textarea:focus {
    border-color: #00d2be;
}
#predictionForm select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300d2be' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* 3. Ensure the focus background remains correct */
#predictionForm select:focus {
    background-color: #33333f;
}

/* 4. Update the WebKit Scrollbar Hover Color */
#predictionForm select::-webkit-scrollbar-thumb:hover {
    background: #00d2be; 
}

#predictionFormSprint input:focus, 
#predictionFormSprint select:focus, 
#predictionFormSprint textarea:focus {
    border-color: #00d2be;
}
#predictionFormSprint select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300d2be' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* 3. Ensure the focus background remains correct */
#predictionFormSprint select:focus {
    background-color: #33333f;
}

/* 4. Update the WebKit Scrollbar Hover Color */
#predictionFormSprint select::-webkit-scrollbar-thumb:hover {
    background: #00d2be; 
}


/* Dropdown options text color fix */
option {
    background-color: #2a2a35;
    color: #ffffff;
}

/* Buttons */
button {
    width: 100%;
    background-color: #e10600;
    color: white;
    font-weight: 700;
    font-size: 1.1em;
    font-family: 'Titillium Web', sans-serif;
    text-transform: uppercase;
    padding: 12px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    
}

button:hover {
    background-color: #c90500;
}

button:active {
    transform: scale(0.98);
}

header button#logoutBtn {
    width: auto;
    background-color: #0d0d0f;
    border: 1px solid #555; 
    font-size: 0.80em;
    padding: 8px 15px;
}

header button#logoutBtn:hover {
    background-color: #555;
}

/* Utilities & Community Cards */
.error {
    color: #e10600!important;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 15px;
}

/* Styling for the dynamically injected history/community cards */
#othersPredictionsList div, #chronologicalHistory div {
    color: #ffffff;
}

/* Leaderboard Specifics */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background-color: #2a2a35;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    text-align: left;
    padding: 15px;
    border-bottom: 1px solid #1e1e24;
}

th {
    background-color: #121212;
    color: #aaaaaa;
    text-transform: uppercase;
    font-size: 0.9em;
}

tr:last-child td {
    border-bottom: none;
}

/* --- Premium Prediction Card Layout --- */

.prediction-card {
    background-color: #1e1e24 !important;
    border-top: 5px solid #e10600; /* Moves the F1 red accent to the top like a banner */
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.card-header h3 {
    font-size: 1.6em; /* Makes the username massive and prominent */
    color: #ffffff;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.races-page .race-card-header h3 {
    font-size: 1.6em; /* Makes the username massive and prominent */
    color: #ffffff;
    margin: 5px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    /* border-bottom: 2px solid #333; */
    /* padding-bottom: 1px; */
}

.prediction-section {
    margin-bottom: 20px;
}

.prediction-section:last-child {
    margin-bottom: 0;
}

/* Callout Titles */
.section-title {
    display: block;
    font-size: 0.85em;
    color: #aaaaaa;
    text-transform: uppercase;
    letter-spacing: 1px;
	margin-top: 12px;
    margin-bottom: 12px;
    font-weight: 700;
}

/* The 3-Column Podium Row */
.podium-row {
    display: flex; /* Forces items into a single row */
    justify-content: space-between;
	padding: 5px;
    gap: 10px;
}

.podium-place {
    flex: 1; /* Ensures all 3 columns take up exactly equal space */
    background-color: #2a2a35;
    padding: 12px 5px;
    border-radius: 6px;
    text-align: center;
    border-top: 3px solid #555; 
}

/* Podium Accents */
.p1-gold { border-top-color: #FFD700; }
.p2-silver { border-top-color: #C0C0C0; }
.p3-bronze { border-top-color: #CD7F32; }

.medal {
    display: block;
    font-size: 0.9em;
    color: #888888;
    margin-bottom: 5px;
    font-weight: bold;
}

.driver-name {
    display: block;
    font-weight: 700;
    color: #ffffff;
    font-size: 0.9em;
    text-transform: capitalize;
    word-wrap: break-word; /* Prevents long names from breaking the columns */
}

/* Wildcard Section */
.wildcard-box {
    background-color: rgba(21, 21, 30, 0.5);
    padding: 15px;
    border-radius: 6px;
    border-top: 3px solid  #5F9EA0;
}

.wildcard-text {
    color: #f4f4f9;
    font-style: italic;
    font-size: 1.05em;
    line-height: 1.4;
}

/* --- Race Header Banner --- */
.race-header-card {
    background: rgb(30, 30, 36);
    border-top: 4px solid #e10600;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.pre-title {
    display: block;
    color: #aaaaaa;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9em;
    font-weight: 700;
    margin-bottom: 15px;
}

#currentRaceName {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.round-badge {
    background-color: #333333;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.5em;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.race-name-text {
    font-size: 1.2em;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.race-date-text {
    color: #e10600;
    font-size: 0.55em;
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* --- Status Banner (Predictions Locked) --- */
.status-banner {
    display: flex;
    align-items: center;
    background-color: #1e1e24;
    border-left: 5px solid #4CAF50; /* Success Green */
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.status-icon {
    font-size: 2.5em;
    margin-right: 20px;
}

.status-text h3 {
    color: #4CAF50;
    margin: 0 0 5px 0;
    font-size: 1.4em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    padding: 0;
}

.status-text p {
    color: #cccccc;
    margin: 0;
    font-size: 0.95em;
    line-height: 1.4;
}

/* --- Authentication Layout --- */
.transparent-section {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.auth-card {
    background-color: #1e1e24;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    margin-bottom: 25px;
}

/* --- Admin Grading Cards --- */

.admin-grading-card {
    background-color: #2a2a35;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #555;
    transition: border-color 0.3s ease;
}

/* Highlight the card if the checkbox is checked (Optional JS needed for this effect) */
.admin-grading-card:has(.other-guess-checkbox:checked) {
    border-left-color: #4CAF50;
    background-color: #2d352d;
}

.grading-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid #3a3a45;
    padding-bottom: 8px;
}

.player-name {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
}

.submission-time {
    font-size: 0.75em;
    color: #888;
}

.guess-text {
    font-style: italic;
    color: #f4f4f9;
    margin: 5px 0 15px 0;
    line-height: 1.4;
    font-size: 1.05em;
}

.small-label {
    font-size: 0.85em;
    /* color: #e10600;  */
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 2px;
}

/* Custom Toggle Switch Styling */
.grade-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
    user-select: none;
}

.grade-toggle input {
    display: none; /* Hide the default checkbox */
}

.grade-toggle input:checked + .toggle-slider {
    background-color: #4CAF50;
}

.grade-toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: white;
}

.toggle-label {
    font-size: 0.9em;
    font-weight: 600;
    color: #ccc;
}

.grade-toggle input:checked ~ .toggle-label {
    color: #4CAF50;
}

/* --- Leaderboard Podium Styling --- */
.podium-container {
    display: flex;
    align-items: flex-end; /* Aligns steps to the bottom */
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
    height: 180px; /* Fixed height for the podium area */
}

.podium-step {
    flex: 1;
    background-color: #1e1e24;
    border-radius: 8px 8px 4px 4px;
    text-align: center;
    padding: 15px 5px;
    border-top: 4px solid #555;
    /*box-shadow: 0 4px 15px rgba(0,0,0,0.4);*/
    display: flex;
    flex-direction: column;
    justify-content: center;
}


/* Staircase Heights and Colors */
.step-1 { height: 100%; border-top-color: #FFD700; order: 2; z-index: 2; background: linear-gradient(180deg, rgba(255,215,0,0.2) 0%, rgba(21,21,30,0) 100%);} /* Winner in Middle */
.step-2 { height: 80%;  border-top-color: #C0C0C0; order: 1; background: linear-gradient(180deg, rgba(192,192,192,0.15) 0%, rgba(21,21,30,0) 100%);}           /* 2nd on Left */
.step-3 { height: 65%;  border-top-color: #CD7F32; order: 3; background: linear-gradient(180deg, rgba(205,127,50,0.15) 0%, rgba(21,21,30,0) 100%);}           /* 3rd on Right */

.podium-rank { font-size: 1.5em; margin-bottom: 5px; }
.podium-name { font-weight: 700; color: #ffffff; font-size: 0.9em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; }
.podium-points { color: #aaaaaa; font-size: 0.75em; font-weight: 600; }

/* --- Leaderboard Table Styling --- */
.table-container {
    background-color: #1e1e24;
    border-radius: 8px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #000000;
    color: #e10600;
    font-size: 0.75em;
    text-transform: uppercase;
    padding: 12px 15px;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #2a2a35;
    color: #f4f4f9;
}

.driver-name-cell {
    font-weight: 600;
    text-transform: capitalize;
}

.player-name-cell {
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #25252d;
}

/* --- Dashboard Specific Styling --- */

.score-header {
    margin-top: 15px;
    padding-bottom: 10px;
}

.points-badge {
    background-color: #2d352d;
    color: #4CAF50;
    border: 1px solid #4CAF50;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.9em;
    text-transform: uppercase;
}

.pending-badge {
    background-color: #333;
    color: #888;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    text-transform: uppercase;
}
/* --- Deep Result Colors --- */

/* Correct Podium Hits (Green) */
#chronologicalHistory .result-correct {
    background: linear-gradient(180deg, rgba(28, 95, 30, 0.8) 0%, rgba(30, 30, 36, 0) 100%);
    color: #ffffff !important;
}

/* Incorrect Podium Hits (Red) */
#chronologicalHistory .result-incorrect {
    background: linear-gradient(180deg, rgba(143, 4, 4, 0.75) 0%, rgba(30, 30, 36, 0) 100%);
    color: #ffffff !important;
}

/* Specificity Fix: These rules now match the ID strength of the general div rule */

#chronologicalHistory .wildcard-box.wildcard-correct {
    background-color: #06402b !important;
}

#chronologicalHistory .wildcard-box.wildcard-incorrect {
    background-color: #4a0e0e !important;
}

/* Force the text to stay white inside these colored boxes */
#chronologicalHistory .wildcard-box.wildcard-correct .wildcard-text,
#chronologicalHistory .wildcard-box.wildcard-incorrect .wildcard-text {
    color: #ffffff !important;
}

/* --- Top Bar Actions & Profile Icon --- */

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 15px; /* Adds space between the icon and logout button */
}

.profile-icon {
    color: #aaaaaa;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.profile-icon:hover {
    color: #ffffff;
}

/* Success text for profile saving */
.success-text {
    color: #4CAF50;
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 10px;
    text-align: center;
}

/* --- Profile Picture Styling --- */
.profile-pic-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.profile-pic {
    width: 200px;
    height: 200px;
    border-radius: 50%; /* Makes it a circle */
    object-fit: cover;  /* Prevents the image from stretching/squishing */
    border: 3px solid #e10600; /* F1 Red Border */
    margin-bottom: 10px;
    background-color: #15151e;
}

.small-btn {
    background-color: #333;
    padding: 6px 12px;
    font-size: 0.8em;
    width: auto;
    border-radius: 4px;
}

.small-btn:hover {
    background-color: #444;
}

/* --- Dashboard Player Grid --- */
/* --- Dashboard Player Grid (Updated 3-Column Layout) --- */
.player-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Forces exactly 3 equal columns */
    gap: 15px; /* Slightly reduced gap to ensure they fit nicely on mobile */
    margin-bottom: 35px;
    justify-items: center; /* Centers the avatar inside its specific column */
    max-width: 600px; /* Keeps the grid from stretching too far on large PC monitors */
    margin-left: auto;
    margin-right: auto;
}

.player-avatar-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    width: 100%; 
    min-width: 0; /* Critical for text truncation to work inside a grid */
}

.player-avatar-card:hover {
    transform: scale(1.08);
}

.grid-profile-pic {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #333;
    transition: border-color 0.2s ease;
}

.player-avatar-card:hover .grid-profile-pic {
    border-color: #e10600; /* F1 Red highlight on hover */
}

.grid-username {
    margin-top: 8px;
    font-size: 0.75em;
    color: #aaaaaa;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    
    /* Force long names to truncate with "..." instead of stretching the layout */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 5px;
}

/* --- Detailed Profile Header (Stacked Layout with Cool Gradient & Bars) --- */
.detailed-profile-header {
    display: flex;
    flex-direction: column; 
    align-items: center;
    
    /* 🚀 THE UPGRADE: Deep Teal Spotlight & Underglow */
    background: 
        /* 1. The sleek diagonal racing bars */
        repeating-linear-gradient(
            -45deg,
            rgba(255, 255, 255, 0.03) 0px,
            rgba(255, 255, 255, 0.03) 15px,
            transparent 15px,
            transparent 30px
        ),
        /* 2. Soft F1 Teal spotlight behind the profile picture */
        radial-gradient(circle at 50% 15%, rgba(0, 210, 190, 0.15) 0%, transparent 50%),
        /* 3. Deep slate fading to midnight teal */
        linear-gradient(135deg, #15151e 20%, #0a2623 100%);
        
    padding: 30px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    
    /* Slightly deepened the shadow to make the gradient pop */
    box-shadow: 0 8px 25px rgba(0,0,0,0.5); 
    text-align: center;
    
    /* CRITICAL: Stops the diagonal bars from bleeding outside your rounded corners */
    overflow: hidden; 
    position: relative;
}

/* Wrapper to let the race number overlap the image */
.profile-pic-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.detail-profile-pic {
    width: 160px; /* Scaled down slightly so it fits perfectly on all phones */
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffffff;
    background-color: #15151e;
}

/* Position the badge in the bottom right corner of the picture */
.race-number-badge {
    position: absolute;
    bottom: 5px;
    right: -10px;
    background-color: #e10600;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 1.4em;
    font-style: italic;
    letter-spacing: 1px;
    border: 3px solid #1e1e24; /* Creates a cutout effect against the picture */
}

.detail-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-info h2 {
    margin: 0 0 5px 0;
    font-size: 2.2em;
    color: #ffffff;
    text-transform: uppercase;
    line-height: 1;
}

.detail-full-name {
    color: #888888;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    text-transform: capitalize;
}

/* --- The Upgraded Holographic Points Pill --- */
.points-pill {
    /* Frosted glass effect to blend beautifully with the background spotlight */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: 900;
    width: fit-content;
    margin-top: 5px;
    
    /* Subtle F1 Teal outer border and inner glow */
    border: 1px solid rgba(0, 210, 190, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(0, 210, 190, 0.1);
    
    /* Perfectly align the number and the "PTS" text */
    display: flex;
    align-items: baseline;
    gap: 6px;
    
    /* Smooth animation for the hover effect */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

/* Add a subtle lift and glow when the user hovers over their score */
.points-pill:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 210, 190, 0.2), inset 0 0 20px rgba(0, 210, 190, 0.25);
}

/* The Points Value (The Number) */
.points-pill span:first-child {
    /* Metallic/Neon Teal text gradient */
    background: linear-gradient(180deg, #ffffff 0%, #00d2be 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    
    font-size: 1.8em;
    line-height: 1;
    letter-spacing: 1px;
}

/* The 'PTS' Label */
.points-pill span:last-child {
    /* Using !important to override the inline style in your HTML */
    color: #00d2be !important; 
    font-size: 0.85em !important;
    opacity: 0.8;
    letter-spacing: 2px;
    text-transform: uppercase;
}


/* --- Live Broadcast UI Elements --- */

/* 1. The Fading Pulse Animation */
@keyframes fadePulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* 2. Apply the pulse to the LIVE text with a subtle text shadow */
.live-text-pulse {
    animation: fadePulse 1.5s infinite ease-in-out;
    color: #e10600 !important;
    font-weight: 900 !important;
    text-shadow: 0 0 8px rgba(225, 6, 0, 0.5);
    letter-spacing: 1px;
}

/* --- VIP PADDOCK LIVE GLOW (NIGHT RACE EDITION) --- */
.live-card-glow {
    /* 1. The Diagonal Sweep: Dark slate ramping up to aggressive F1 Red in the bottom right */
    background: linear-gradient(135deg, #121216 0%, #310d10 50%,  #241e74 120%) !important;

    /* 2. Dual-Tone Edge Lighting: Cool Teal top-left, Hot Red bottom-right */
    border-top: 1px solid rgba(0, 210, 190, 0.3) !important;
    border-left: 1px solid rgba(0, 210, 190, 0.1) !important;
    border-right: 1px solid rgba(225, 6, 0, 0.5) !important;
    border-bottom: 1px solid rgba(225, 6, 0, 0.8) !important;

    /* 3. Dual-Tone 3D Shadows */
    box-shadow: -10px -10px 30px rgba(0, 210, 190, 0.03), 15px 15px 40px rgba(225, 6, 0, 0.25) !important;

    /* 4. Keeps the premium frosted UI feel */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    /* Required for the texture overlay below */
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

/* 5. Stylized "Speed Line" Texture Overlay */
.live-card-glow::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Creates a subtle 45-degree carbon/speed stripe across the card */
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.015) 10px,
        rgba(255, 255, 255, 0.015) 20px
    );
    pointer-events: none; /* Ensures you can still click things inside the card */
    z-index: 0; /* Keeps the texture behind your text */
}

.live-card-glow-dark {
    /* 1. The Diagonal Sweep: Dark slate ramping up to aggressive F1 Red in the bottom right */
    background: linear-gradient(135deg, #121216 0%, #1f0709 50%, #0a082c 120%) !important;

    /* 2. Dual-Tone Edge Lighting: Cool Teal top-left, Hot Red bottom-right */
    border-left: 1px solid rgba(0, 210, 190, 0.1) !important;
    border-right: 1px solid rgba(225, 6, 0, 0.5) !important;
    border-bottom: 1px solid rgba(225, 6, 0, 0.8) !important;

    /* 3. Dual-Tone 3D Shadows */
    box-shadow: -10px -10px 30px rgba(0, 210, 190, 0.03), 15px 15px 40px rgba(225, 6, 0, 0.25) !important;

    /* 4. Keeps the premium frosted UI feel */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    /* Required for the texture overlay below */
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

/* 5. Stylized "Speed Line" Texture Overlay */
.live-card-glow-dark::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Creates a subtle 45-degree carbon/speed stripe across the card */
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.015) 10px,
        rgba(255, 255, 255, 0.015) 20px
    );
    pointer-events: none; /* Ensures you can still click things inside the card */
    z-index: 0; /* Keeps the texture behind your text */
}

/* Ensure the text inside the card stays above the texture overlay */
.live-card-glow > * {
    position: relative;
    z-index: 2;
}


.vault-header {
    padding: 20px;
    text-align: center;
}

.vault-status {
    color: #00d2be;
    font-weight: 800;
    font-size: 1.1em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 1px;
}

/* The pulsing green 'recording' style dot */
.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: #00d2be;
    border-radius: 50%;
    box-shadow: 0 0 8px #00d2be;
    animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 210, 190, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 210, 190, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 210, 190, 0); }
}

.pulse-red {
    width: 10px;
    height: 10px;
    background-color: #e10600 ! important;
    border-radius: 50%;
    box-shadow: 0 0 8px #e10600;
    animation: pulseRed 2s infinite;
}


@keyframes pulseRed {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(225, 6, 0, 0.7); }
    80% { transform: scale(1); box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.vault-subtitle {
    color: #aaaaaa;
    font-size: 0.95em;
    margin-top: 6px;
}

.vault-content {
    padding: 0 20px 20px 20px;
}

/* --- Premium Leaderboard Table --- */

/* The outer container adds the rounded corners and prevents mobile scrolling issues */
.leaderboard-table-container {
    width: 100%;
    overflow-x: auto; 
    background: #1e1e24;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* The table itself */
.premium-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    color: #ffffff;
    white-space: nowrap; /* Keeps data on a single line */
}

/* The Header Row */
.premium-table th {
    background-color: #2a2a35;
    color: #aaaaaa;
    padding: 16px 20px;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 3px solid #e10600; /* Sharp F1 Red Accent */
}

/* Standard Data Rows */
.premium-table td {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95em;
}

/* Alternating row colors for easier reading */
.premium-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.2);
}

/* Slight red highlight when hovering over a row */
.premium-table tbody tr:hover {
    background-color: rgba(225, 6, 0, 0.1); 
    transition: background-color 0.2s ease;
}

/* Optional: Auto-color the Top 3 positions (Gold, Silver, Bronze) */
.premium-table tbody tr:nth-child(1) td:first-child { color: #FFD700; font-weight: 900; } 
.premium-table tbody tr:nth-child(2) td:first-child { color: #C0C0C0; font-weight: 900; } 
.premium-table tbody tr:nth-child(3) td:first-child { color: #CD7F32; font-weight: 900; }

/* --- Leaderboard Avatars --- */
.leaderboard-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid #2a2a35;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.player-name-cell {
    display: flex; /* This aligns the image and the name horizontally */
    align-items: center; 
}

/* --- Hide Scrollbars for Native App Feel --- */

/* Hide scrollbar for Chrome, Safari, and Opera (iOS/Android) */
*::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for Firefox, IE, and Edge */
* {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* --- Notification Bell Icon --- */
.bell-icon {
    background: #4a4a5a;
    border: none;
    color: #FFD700;
    cursor: pointer;
    padding: 2px;
    margin-right: 0px; /* Keeps it spaced nicely from the profile icon */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, filter 0.2s ease;
}

/* Adds a slight pop and glow when tapped/hovered */
.bell-icon:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
}

/* --- APP NAVIGATION OVERHAUL --- */

/* Ensure the body doesn't hide content behind the fixed bottom nav */
body {
    padding-top: 60px; /* Space for top bar */
    padding-bottom: 80px; /* Space for bottom bar */
    min-height: 100vh; 
    min-height: 100dvh;

}

/* TOP BAR */
.app-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #0d0d0f; 
    backdrop-filter: blur(10px); /* Modern blur effect */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 1000;
}

.top-bar-left, .top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Base icon styling */
.profile-icon, .bell-icon, .logout-icon {
    background: none;
    border: none;
    color: #b3b3b3; /* Spotify inactive grey */
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
}

.profile-icon:hover, .logout-icon:hover {
    color: #ffffff;
}

/* BOTTOM NAVIGATION */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85px;
    background-color: #0d0d0f; 
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin: 0 0 15px 0;
    color: #b3b3b3; /* Spotify inactive grey */
    gap: 4px;
    flex: 1; /* Distributes space evenly */
}

.nav-item svg {
    transition: color 0.2s;
}

.nav-item span {
    font-size: 10px; 
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

/* Active State (The page the user is currently on) */
.nav-item.active {
    color: #ffffff;
    font-weight: bold !important;
    font-weight: 600 !important;
}

.paddock-active {
    font-weight: 600 !important;
    /*font-size: 15px !important;*/
    font-weight: bold !important;
    /*color: #e10600 !important;*/
}


/* --- Text-Based Logout Button --- */
.logout-text-btn {
    background: none;
    border: none;
    color: #b3b3b3; /* Spotify inactive grey */
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.logout-text-btn:hover {
    color: #ffffff; /* Brightens on hover */
}

/* --- Live Dot "Emitting" Pulse --- */
@keyframes iconEmitPulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(252, 12, 4, 0.7));
        opacity: 0.8;
    }
    70% {
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(225, 6, 0, 0));
        opacity: 1;
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(225, 6, 0, 0));
        opacity: 0.8;
    }
}

/* Attach the animation directly to BOTH live icons */
#nav-icon-live, #header-live-icon {
    /*animation: iconEmitPulse 3s infinite;*/
    transform-origin: center; 
}

/* Base styles for the center action item */
.center-action {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end; /* Pushes the text label to the bottom */
}

/* 1. Base State (INACTIVE - User is on a different page) */
.center-action-circle {
    /* Muted dark styling so it doesn't distract from the active tab */
    background-color: #1e1e24; 
    border: 5px solid #0d0d0f; /* Must match your app background */
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -30px; 
    /*box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);*/
    
    /* Smooth transition for when they click back to the portal */
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Base State Icon Color (Muted Grey) */
.center-action-circle svg {
    color: #888888;
    stroke: #b3b3b3;
    transition: stroke 0.3s ease, color 0.3s ease;
}

/* Push the 'Predictions' text down */
.center-action span {
    margin-top: 35px; 
    color: #b3b3b3;; /* Standard inactive text color */
}


/* ========================================= */
/* 2. Active State (User is ON portal.html)  */
/* ========================================= */

/* Change the circle to F1 Red when active */
.center-action.active .center-action-circle {
    background-color: #4f4f4f; 
}

/* Change the icon to solid White when active */
.center-action.active .center-action-circle svg {
    color: #ffffff !important; 
    stroke: #ffffff !important;
}

/* Change the text to solid White when active */
.center-action.active span {
    color: #ffffff;
}

/* Optional: Slight pop effect when clicked */
.center-action:active .center-action-circle {
    transform: scale(0.95);
}

/* Push the 'Predictions' text down so it clears the new circle */
.center-action span {
    margin-top: 35px; 
}

/* Keep the active color override from ruining the white icon in the red circle */
.center-action.active .center-action-circle svg {
    color: #ffffff !important; 
    stroke: #ffffff !important;
}

/* --- BROADCAST SLASH HEADER --- */
.page-header-f1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.page-header-f1::before {
    content: '';
    display: block;
    width: 10px;
    height: 26px;
    background: #e10600; /* F1 Red */
    transform: skewX(-20deg); /* The aggressive angle */
    box-shadow: 0 0 12px rgba(225, 6, 0, 0.6); /* Red glow */
    border-radius: 2px;
}

.page-header-f1 h2 {
    margin: 0;
    font-size: 1.6em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-style: italic; /* Conveys speed */
    /* Metallic text gradient */
    color: #ececec;
}


/* =========================================================
   1. TIPS SUBMITTED (SUCCESS & LOCKED)
   Color Palette: Deep Slate to Secure F1 Teal (#00d2be)
========================================================= */
.locked-success-glow {
    border-radius: 10px;
    border-top: 4px solid #00d2be;
    overflow: hidden;
    background: linear-gradient(135deg, #14141b  0%, #00413b  140%) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(0, 210, 190, 0.05) !important;
    position: relative;
}

.locked-success-glow::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    /* Standard 45deg speed line */
  background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.01) 5px, rgba(255, 255, 255, 0.01) 15px);
    pointer-events: none; z-index: 0;
}
.locked-success-glow > * { position: relative; z-index: 2; }


/* =========================================================
   2. TIPS MISSED (WARNING / DNF)
   Color Palette: Deep Slate to Hazard Amber (#ff8c00)
========================================================= */
.locked-missed-glow {
    border-radius: 10px;
    border-top: 4px solid #00d2be;
    overflow: hidden;
    background: linear-gradient(135deg, #14141b  0%, #00413b  140%) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(0, 210, 190, 0.05) !important;
    position: relative;
}

.locked-missed-glow::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    /* Standard 45deg speed line */
    background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.01) 5px, rgba(255, 255, 255, 0.01) 15px);
    pointer-events: none; z-index: 0;
}
.locked-missed-glow > * { position: relative; z-index: 2; }


/* =========================================================
   3. OTHER DRIVER PREDICTIONS (NEUTRAL DATA)
   Color Palette: Matte Carbon Fiber
========================================================= */
.other-driver-glow {
    border-top: 4px solid #e10600;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #1a1a1f 0%, #043c49 400%) !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4) !important;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 8px;
}

.other-driver-glow::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    /* Tighter, fainter weave for carbon fiber feel */
    background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.01) 5px, rgba(255, 255, 255, 0.01) 15px);
    pointer-events: none; z-index: 0;
}
.other-driver-glow > * { position: relative; z-index: 2; }



/* --- PREMIUM FORM STYLING --- */
.prediction-submission-card {
    border-top: 4px solid #00d2be; /* F1 Teal action accent */
    border-radius: 12px;
    padding: 25px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    margin-bottom: 30px;
    background: rgb(30, 30, 36);
}

/* --- LIGHTS OUT ANIMATION SEQUENCE --- */

.lights-out-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(9, 9, 11, 0.98);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.lights-out-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* 1. The F1 Light Gantry */
.f1-lights-container {
    display: flex;
    gap: 15px;
    z-index: 2;
    transition: opacity 0.1s ease;
}

/* The dark matte box holding the bulb */
.f1-light-box {
    width: 50px;
    height: 90px;
    background: #111;
    border: 2px solid #222;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 25px rgba(0,0,0,0.8), inset 0 5px 10px rgba(255,255,255,0.05);
}

/* The Bulbs (Off by default) */
.f1-light {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #2a0303; /* Dull, dark red */
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
    transition: background 0.05s ease, box-shadow 0.05s ease;
}

/* The Bulbs (Turned ON via JavaScript) */
.f1-light.on {
    background: #ff1e00; /* Blazing F1 Red */
    box-shadow: 0 0 25px 8px rgba(255, 30, 0, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.8);
}

/* --- UPGRADED SUCCESS REVEAL --- */

.lights-success-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; 
    pointer-events: none;
}

.lights-success-content.reveal {
    opacity: 1;
}

/* The dramatic teal explosion */
.teal-flash {
    position: absolute;
    top: 50%; left: 50%;
    width: 10px; height: 10px;
    background: #00d2be;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.lights-success-content.reveal .teal-flash {
    animation: flashBang 1s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

@keyframes flashBang {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    40% { opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(250); opacity: 0; } 
}

/* The Cinematic Text Stack */
.success-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
}

.success-badge, .lights-text-main, .lights-text-sub {
    opacity: 0;
    transform: translateY(15px);
}

/* Stagger the animations so they slide in smoothly after the flash */
.lights-success-content.reveal .success-badge {
    animation: slideUpFade 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s forwards;
}

.lights-success-content.reveal .lights-text-main {
    animation: slideUpFade 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s forwards;
}

.lights-success-content.reveal .lights-text-sub {
    animation: slideUpFade 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s forwards;
}

@keyframes slideUpFade {
    to { opacity: 1; transform: translateY(0); }
}

/* Typography Styling */
.success-badge {
    margin-bottom: 5px;
    background: rgba(0, 210, 190, 0.1);
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 210, 190, 0.2);
}

.lights-text-main {
    color: #fff;
    font-size: 2.5em;
    line-height: 1.2em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    margin-bottom: 8px;
    text-align: center;
}

.lights-text-sub {
    color: #00d2be;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 6px;
    text-shadow: 0 0 10px rgba(0, 210, 190, 0.4);
    opacity: 0.9;
}

/* --- CONFIRMATION MODAL STYLING --- */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.confirm-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.confirm-modal-card {
    background: #1e1e24;
    border-top: 4px solid #00d2be;
    border-radius: 12px;
    padding: 30px 25px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    margin: 20px;
}

.confirm-modal-overlay.active .confirm-modal-card {
    transform: translateY(0);
}

.confirm-modal-title {
    color: #fff;
    margin: 0 0 15px 0;
    font-size: 1.4em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.confirm-modal-text {
    color: #aaa;
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 25px;
}

.confirm-modal-text strong {
    color: #e10600; /* F1 Red warning */
}

.confirm-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-btn-cancel {
    background: rgba(255,255,255,0.05);
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s ease;
}

.confirm-btn-cancel:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.confirm-btn-lock {
    background: linear-gradient(90deg, #00d2be, #00a896);
    color: #111;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    flex: 1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.confirm-btn-lock:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 210, 190, 0.3);
}


/* --- DRIVER PROFILE MODAL STYLING --- */

.profile-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.profile-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* NEW WRAPPER: Handles the layout and animation of the button + card */
.profile-modal-wrapper {
    width: 95%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Aligns the close button to the right edge */
    
    /* Animation logic moved here so button and card slide up together */
    transform: translateY(20px); 
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-modal-overlay.active .profile-modal-wrapper {
    transform: translateY(0);
}

/* NEW EXTERNAL CLOSE BUTTON */
.profile-close-btn-outside {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 15px; /* Gives nice breathing room above the modal */
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}

.profile-close-btn-outside:hover {
    background: #e10600; /* Snaps to F1 Red on hover */
    border-color: #e10600;
    transform: scale(1.1) rotate(90deg); /* Sleek spin effect */
}

/* THE MODAL CARD */
.profile-modal-card {
    background: #15151e; 
    border-top: 8px solid #00d2be;
    border-bottom: 8px solid #00d2be;
    border-radius: 12px;
    width: 100%;
    max-height: 80vh; /* Prevents card from pushing the external button off screen */
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden; 
}

/* --- THE SOLID BEZEL STRIPS --- */

/* Top Framing Strip */
.profile-modal-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 18px;
    background: #15151e; /* Matches the modal background exactly */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* Crisp, subtle edge */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Casts a tiny shadow over the scrolling text */
    z-index: 5;
    pointer-events: none;
}

/* Bottom Framing Strip */
.profile-modal-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 18px;
    background: #15151e; 
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.2);
    z-index: 5;
    pointer-events: none;
}

/* Ensure the scroll area clears the solid strips */
.profile-modal-scroll-area {
    overflow-y: auto;
    padding: 25px 20px; 
    flex-grow: 1;
    -webkit-overflow-scrolling: touch; 
}

/* THE SCROLL AREA */
.profile-modal-scroll-area {
    overflow-y: auto;
    padding: 30px 20px; /* Added extra top/bottom padding so content clears the fades */
    flex-grow: 1;
    -webkit-overflow-scrolling: touch; 
}

/* Custom Modal Scrollbar */
.profile-modal-scroll-area::-webkit-scrollbar {
    width: 6px;
}
.profile-modal-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}


/* --- PREFERENCES & TOGGLE SWITCH STYLING --- */

.preference-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.preference-info {
    text-align: left;
}

.preference-info h3 {
    margin: 0;
    font-size: 1.1em;
    color: #fff;
    letter-spacing: 0.5px;
}

.preference-info p {
    margin: 4px 0 0 0;
    font-size: 0.85em;
    color: #888;
}

/* The Toggle Container */
.toggle-switch {
    position: relative;
    display: inline-flex; /* Swapped to flex for stricter bounds */
    align-items: center;
    width: 53px;
    height: 28px;
    flex-shrink: 0;
    margin: 0; /* Overrides any global label margins */
}

/* Hide default HTML checkbox */
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    margin: 0;
}

/* The Slider Background */
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #333; 
    transition: 0.3s ease;
    border-radius: 30px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

/* The Slider Circle */
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px; 
    width: 22px;
    left: 5px; /* 3px gap on the left */
    top: 50%;
    transform: translateY(-50%); /* Bulletproof vertical centering */
    background-color: white;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Checked State (ON) */
.toggle-switch input:checked + .toggle-slider {
    background-color: #00d2be; /* F1 Teal */
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 10px rgba(0, 210, 190, 0.3);
}

/* Move the circle when checked */
.toggle-switch input:checked + .toggle-slider:before {
    /* 22px movement + keeps the Y-axis perfectly centered */
    transform: translate(22px, -50%); 
}

/* Disabled State (In case it's loading) */
.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- LEAGUES LIST STYLING --- */
.leagues-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.league-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.league-name {
    color: #fff;
    font-size: 1.1em;
    font-weight: 900;
    margin: 0;
}

/* Badges for Admin vs Member */
.league-badge {
    font-size: 0.7em;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-admin {
    background: rgba(255, 0, 0, 0.15);
    color: #e10600;
    border: 1px solid #e10600;
    margin-left: 10px;
}

.badge-member {
    background: rgba(0, 210, 190, 0.15);
    color: #00d2be;
    border: 1px solid rgba(0, 210, 190, 0.3);
    margin-left: 10px;
}

.league-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s ease;
}

.league-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.league-btn-danger:hover {
    background: rgba(225, 6, 0, 0.1);
    color: #e10600;
    border-color: #e10600;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* --- MANAGE MEMBERS UI --- */
.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.member-row:last-child {
    border-bottom: none;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.member-name {
    color: #fff;
    font-weight: bold;
    font-size: 1.1em;
    margin: 0;
}

.member-remove-btn {
    background: rgba(225, 6, 0, 0.1);
    color: #e10600;
    border: 1px solid rgba(225, 6, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 70px;
}

.member-remove-btn:hover {
    background: #e10600;
    color: #fff;
}

.leagues-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.league-row {
    background: linear-gradient(145deg, #1e1e24 0%, #15151e 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.league-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.league-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.league-name {
    color: #fff;
    font-size: 1.2em;
    font-weight: 900;
    margin: 0;
    letter-spacing: 0.5px;
}

/* The Inset Telemetry Panel */
.league-details-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px inset rgba(255, 255, 255, 0.03);
}

.league-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.65em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 900;
}

.stat-value {
    font-size: 1.1em;
    color: #fff;
    font-weight: bold;
}

/* The Code Box inside the grid */
.league-code-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.league-code-box span {
    color: #00d2be;
    font-family: monospace;
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 2px;
}

.code-actions {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.05);
    padding: 2px;
    border-radius: 6px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* The Action Buttons */
.league-actions {
    display: flex;
    gap: 8px;
    /* padding-top: 15px;*/
    /* border-top: 1px dashed rgba(255, 255, 255, 0.1);  */
}

.league-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s ease;
}

.league-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.league-btn-danger:hover {
    background: rgba(225, 6, 0, 0.1);
    color: #e10600;
    border-color: #e10600;
}

/* --- LEAGUE CONTEXT SWITCHER --- */
.league-switcher-container {
    position: relative;
    display: inline-block;
}

.league-switcher-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #b3b3b3;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.league-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.league-dropdown-menu {
    position: absolute;
    top: 130%; /* Hangs slightly below the button */
    right: 0;
    background: #1e1e24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    min-width: 160px;
    display: none; /* Hidden by default */
    flex-direction: column;
    z-index: 2000; /* Ensures it floats above leaderboards */
    overflow: hidden;
}

/* Toggled via JS */
.league-dropdown-menu.active {
    display: flex;
}

.league-dropdown-item {
    padding: 12px 15px;
    color: #ccc;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.league-dropdown-item:last-child {
    border-bottom: none;
}

.league-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* The currently selected league */
.league-dropdown-item.active {
    color: #00d2be;
    background: rgba(0, 210, 190, 0.1);
    font-weight: bold;
}


/* PREMIUM PADDOCK TABS */

.paddock-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin: 30px auto;
}

.paddock-tab-container {
    display: flex;
    background: rgba(0, 0, 0, 0.4); /* Deep dark inset */
    border-radius: 8px;
    padding: 2px;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.6);
}

.paddock-tab-btn {
    flex: 1;
    padding: 12px 10px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 0.85em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.paddock-tab-btn:hover {
    color: #aaa;
}

/* The Glowing Active State */
.paddock-tab-btn.active {
    color: #fff;
    background: #e10600;
    box-shadow: 0 4px 15px rgba(225, 6, 0, 0.3);
}

button, input, select, textarea, a {
    touch-action: manipulation;
}

/* --- ONBOARDING & PUSH MODALS --- */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 15, 0.85); 
    backdrop-filter: blur(6px); 
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.onboarding-card {
    background: #1e1e24;
    border-top: 4px solid #e10600;
    border-radius: 12px;
    padding: 30px 20px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    text-align: center;
    position: relative;
    animation: slideUpFade 0.4s ease-out forwards;
}

@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transition: background 0.3s ease, transform 0.3s ease;
}

.carousel-dot.active {
    background: #00d2be;
    transform: scale(1.3);
}

.btn-primary-onboard {
    background: #e10600;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    cursor: pointer;
    margin-bottom: 10px;
}

.btn-secondary-onboard {
    background: transparent;
    color: #888;
    border: 1px solid #444;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: bold;
    width: 100%;
    cursor: pointer;
}

/* --- RACE RADIO: REACTIONS & REPLIES --- */
.chat-action-menu {
    position: fixed;
    background: #2a2a35;
    border: 1px solid #444;
    border-radius: 30px;
    padding: 6px 12px;
    display: none; /* Hidden until long-press */
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    transform: translate(-50%, -100%);
    margin-top: -10px;
}

.reaction-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s;
}

.reaction-btn:active {
    transform: scale(1.3);
}

.action-divider {
    width: 1px;
    height: 24px;
    background: #444;
    margin: 0 5px;
}

.reply-action-btn {
    background: none;
    border: none;
    color: #00d2be;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9em;
    padding: 0 5px;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    background: #15151e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 0.75em;
    margin-top: -8px;
    margin-bottom: 4px;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.reply-preview-banner {
    background: #2a2a35;
    border-left: 3px solid #00d2be;
    padding: 8px 12px;
    border-radius: 6px 6px 0 0;
    font-size: 0.85em;
    color: #aaa;
    display: none; /* Hidden until 'Reply' is clicked */
    justify-content: space-between;
    align-items: center;
    margin-bottom: -10px; /* Pulls the textarea flush against it */
}

.reply-bubble-inline {
    background: rgba(255,255,255,0.05);
    border-left: 3px solid #00d2be;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #aaa;
    margin-bottom: 6px;
    display: block;
    word-wrap: break-word;
}