/* ===============================
   Base & Layout
   =============================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 12px;
}
/* ===============================
   Sticky Footer Layout
   =============================== */
html, body {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Let main content fill the remaining space */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Optional: Ensure container height behaves correctly */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}
body {
    font-family: "Segoe UI", sans-serif;
    background-color: #121212;
    color: #f0f0f0;
    line-height: 1.6;
}
i.ph {
    position: relative;
    top: 1px;
}
/* ===============================
   Headings - Yellow Styling
   =============================== */
h1, h2, h3 {
    display: block;
    width: 100%;
    color: #e4b600;
}
h1 {
    font-size: 14px;
}

/* ===============================
   Links & Buttons
   =============================== */
a {
    color: #e4b600;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===============================
   Container
   =============================== */
/* Only apply flex layout to header container */
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}
/* ===============================
   Header
   =============================== */
.site-header {
    background-color: #1e1e1e;
    color: #fff;
    height: 60px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0; /* remove default h1 spacing */
    line-height: 60px; /* vertical align fallback for logo */
}
/* ===============================
   Header Layout
   =============================== */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.nav-left {
    flex: 1;
}
.nav-center {
    flex: 1;
    text-align: center;
}

.nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.logo-img {
    max-height: 30px;
    height: auto;
}
/* ===============================
   Logo and Tagline Styling
   =============================== */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-tagline {
    font-size: 0.9rem;
    color: #ccc;
    margin-top: 0.4rem;
    letter-spacing: 0.2em;
    font-weight: 600;
}
/* ===============================
   Logo and Tagline (Mobile Scaling)
   =============================== */
@media (max-width: 600px) {
    .logo-container {
        flex-direction: column;       /* stack vertically again */
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    .logo-img {
        max-height: 20px;
    }

    .logo-tagline {
        font-size: 0.5rem;
        letter-spacing: 0.05em;
        margin-top: 0.1rem;
        white-space: nowrap;          /* prevent text wrapping to 2 lines */
    }

    .site-header {
        height: 60px;
        overflow: hidden;
    }

    .site-header .container {
        height: 60px;
    }

    .header-flex {
        height: 60px;
    }
}




/* ===============================
   Navigation Styles - Slide-in Drawer
   =============================== */
/* ░░ Navigation Container ░░ */
.main-nav {
    z-index: 1000;
}

/* ░░ Hamburger Icon (within header) ░░ */
.nav-toggle {
    background: #222;
    border: none;
    color: #ccc;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0.4rem 0.75rem;
    margin: 0;
}

/* ░░ Drawer Panel ░░ */
.nav-drawer {
    position: fixed;
    top: 0;
    left: -260px;
    width: 250px;
    height: 100vh;
    background-color: #1e1e1e;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.4);
    padding: 1rem;
    transition: left 0.3s ease;
    z-index: 1001;
    display: flex;                /* ✅ Flex layout */
    flex-direction: column;
    overflow: hidden;            /* prevents scrollbars from breaking layout */
}

.nav-drawer ul {
    flex-grow: 1;                /* ✅ Expand to fill space above footer */
    overflow-y: auto;            /* ✅ Allow scroll if nav items overflow */
    padding: 0;
    margin: 0;
    list-style: none;
}

.nav-drawer.show {
    left: 0;
}

/* ░░ Close Button ░░ */
.nav-drawer-header {
    display: flex;
    justify-content: flex-end;  /* ✅ align content to the right */
    align-items: center;
    height: 40px;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}
/* ✅ Ensure the button doesn't expand */
.nav-drawer-header button {
    all: unset;                 /* remove default styles */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    font-size: 1.2rem;
}
.close-drawer {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}
/* Push footer to bottom */
.nav-drawer-footer {
    margin-top: auto;            /* ✅ Push footer to bottom */
    padding-top: 1rem;
    font-size: 0.8rem;
    color: #aaa;
    text-align: center;
    border-top: 1px solid #333;
}
.nav-drawer-footer img {
    max-width: 60px;         /* or whatever size looks best */
    height: auto;
    display: block;
    margin: 0 auto 0.5rem;   /* center image + spacing below */
    transition: opacity 0.2s ease;
}

/* ░░ Avatar Display in Drawer ░░ */
.nav-avatar-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.nav-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #333;
}

/* ░░ Drawer Menu Links ░░ */
.nav-drawer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-drawer ul li {
    margin-bottom: 1rem;
}

.nav-drawer a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
/* ===============================
   Header Widget Container
   =============================== */
.nav-widgets {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto; /* pushes it to the right in a flex container */
}
.nav-notification-widget {
    color: #ccc;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #222;
    padding: 0.4rem 0.75rem;
    border-radius: 5px;
    height: 32px;
    margin-right: 1rem;
}
/* ░░ Always-visible Balance Widget (within header) ░░ */
.nav-balance-widget {
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #222;
    padding: 0.4rem 0.75rem;
    border-radius: 5px;
    height: 32px;
    margin-right: 1rem;
}
/* ===============================
   Online User Widget
   =============================== */
.nav-online-widget {
    color: #ccc;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #222;
    padding: 0.4rem 0.75rem;
    border-radius: 5px;
    height: 32px;
    margin-right: 1rem;
    font-size: 1rem;
}
/* ░░ Overlay behind nav drawer ░░ */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 999;
}

.nav-overlay.show {
    display: block;
}
/* ===============================
   Hero Section
   =============================== */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    background: #1e1e1e;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

/* ===============================
   Features Section
   =============================== */
.features {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.feature-card {
    background-color: #1b1b1b;
    padding: 1.5rem;
    border-radius: 10px;
    width: 300px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    color: #ffffff;
}

/* ===============================
   Footer
   =============================== */
.site-footer {
    background-color: #1e1e1e;
    color: #ccc;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    font-weight: 600;
}
/* ===============================
   Form Row Layout (Label Left, Field Right)
   =============================== */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
}

.form-row label {
    width: auto;
    min-width: 130px;
    margin-bottom: 0;
    padding-right: 1rem;
    text-align: left;
}

.form-row input,
.form-row select,
.form-row textarea,
.form-row span,
.form-row button {
    flex: 1;
}
/* Optional: Align hidden input + change button */
#changeFuelBtn {
    margin-left: 1rem;
}
.form-row.validation {
    display: none;
    margin-bottom: 0;
}

.form-row.validation small {
    font-size: 0.9rem;
    margin-top: -1rem;
}
/* ===============================
   Forms
   =============================== */
form {
    background-color: #1a1a1a;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
    max-width: 500px;
    margin: 2rem auto;
}
form p {
    margin-bottom: 3px;
}
/* ===============================
   Input Fields
   =============================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #333;
    border-radius: 5px;
    background-color: #222;
    color: #f0f0f0;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #0061AE;
    outline: none;
}

/* ===============================
   Form Labels
   =============================== */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #cccccc;
}

/* ===============================
   Buttons
   =============================== */
/* ░░ Global Buttons – Yellow Variant ░░ */
button,
input[type="submit"] {
    background-color: #e4b600;
    color: #000;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin: 0.5rem auto;
}

button:hover,
input[type="submit"]:hover {
    background-color: #ffd700;
}
/* ░░ Disabled Button Styling ░░ */
button:disabled,
input[type="submit"]:disabled {
    background-color: #999;   /* Muted tone */
    color: #666;              /* Slightly dull text */
    cursor: not-allowed;
    opacity: 0.7;
}
button.no-hover:hover {
    background-color: inherit !important;
    color: inherit !important;
    cursor: pointer; /* still clickable */
}
.form-row .password-wrapper {
    flex: 1;
    position: relative;
    max-width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-right: 2.5rem; /* space for eye icon */
    box-sizing: border-box;
}

.password-wrapper i.ph {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
    color: #888;
}
/* ===============================
   Styled Lists (ul / li)
   =============================== */
ul {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
    list-style-type: disc;
}

ul ul {
    list-style-type: circle;
}

li {
    margin-bottom: 0.4rem;
    line-height: 1.6;
    font-size: 0.95rem;
    color: #ddd;
}

/* Optional: list inside cards */
.full-card ul,
.card ul {
    padding-left: 1.5rem;
}

/* Optional: Custom bullet color */
ul li::marker {
    color: #e4b600;
}
/* ===============================
   Dashboard Cards
   =============================== */
.dashboard-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background-color: #1b1b1b;
    color: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    width: 300px;
    flex: 1 1 300px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.card h3 {
    margin-bottom: 0.5rem;
}

.card p {
    margin-bottom: 1rem;
}
.full-card {
    background-color: #1b1b1b;
    color: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
    max-width: 700px;
    margin: 2rem auto;
}


/* ===============================
   Notification Bar
   =============================== */
.notification-dropdown {
    display: none; /* hidden by default */
    position: absolute;
    top: 50px;
    right: 1rem;
    background: #222;
    border: 1px solid #444;
    padding: 1rem;
    border-radius: 0.5rem;
    min-width: 250px;
    z-index: 1000;
}

.notification-dropdown.visible {
    display: block; /* shown when .visible is added */
}
.note-item.unread {
    font-weight: bold;
}

.note-item a {
    display: block;
    color: white;
    margin-bottom: 0.5rem;
}

.empty-note {
    color: #888;
    font-style: italic;
}

/* ===============================
   Nav avatar
   =============================== */
.avatar-frame {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.avatar-img-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
}
.avatar-img-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 2;
}
.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.username {
    color: #e4b600;
}
.frame-preview-img {
    background: #f9f9f9;
    border-radius: 12px;
}
/* ===============================
   Changing frames
   =============================== */
.frame-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.frame-select-item {
    text-align: center;
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: transform 0.2s ease;
}
.frame-select-item.owned:hover {
    transform: scale(1.05);
}
.frame-select-item.locked {
    opacity: 1;
    cursor: default;
}
.frame-preview-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0 auto 0.5rem;
}
.lock-mark {
    position: absolute;
    top: 35px;
    right: 40px;
    color: white;
}
.lock-mark i {
    font-size: 1.5rem;
}
.equipped-label {
    font-size: 1rem;
    color: #e4b600;
}
.frame-name {
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

/* ===============================
   Card Section Layout
   =============================== */
.card-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.card-section .card {
    flex: 1 1 calc(33.333% - 1rem); /* 3 cards per row */
    background: #1e1e1e;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    min-width: 250px;
}

/* For small screens, stack cards */
@media (max-width: 768px) {
    .card-section .card {
        flex: 1 1 100%;
    }
}
/* ===============================
   auction css
   =============================== */
.auction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.5rem;
}
/* ===============================
   Garage css
   =============================== */
.garage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.5rem;
}

/* ░░ CAR CARD – Top Trumps Style ░░ */
/* ░░ CAR CARD WITH BACKGROUND ░░ */
.car-card {
    position: relative;
    background: #121212;
    border: 4px solid #e4b600;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    width: 350px; /* Wider card */
    margin: 1rem;
    color: #fff;
    font-family: 'Segoe UI', sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 0;
}

/* ░░ BACKGROUND LAYER ░░ */
.car-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../imgs/card-bg.jpg');
    background-size: 100% auto; /* sets height to match card */
    background-position: left bottom;
    background-repeat: no-repeat;
    opacity: 0.5;
    z-index: -1;
    filter: brightness(0.5) contrast(1.2);
    border-radius: 12px;
}
.car-card .stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.car-card .stat-grid li {
    background: #1e1e1e;
    border-left: 4px solid #e4b600;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    list-style: none;
}
/* ░░ CAR IMAGE ░░ */
.car-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e4b600;
}

.missing-thumb {
    background: #333;
    border: 2px dashed #888;
    color: #aaa;
    font-size: 0.9rem;
}

/* ░░ CAR TITLE ░░ */
.car-card h3 {
    margin: 0.75rem 0 0.3rem;
    font-size: 1.1rem;
    text-align: center;
    font-weight: 600;
    color: #f0c200;
}

/* ░░ GENERAL TEXT ░░ */
.car-card p {
    margin: 0.2rem 0;
    font-size: 0.85rem;
    text-align: center;
}

/* ░░ STATS LIST ░░ */
.car-card ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 1rem;
}

.car-card li {
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    background: #1e1e1e;
    border-left: 4px solid #e4b600;
    padding: 0.4rem 0.6rem;
}

/* ░░ BOOST TAG ░░ */
.boost-tag {
    font-size: 0.8rem;
    margin-top: 0.3rem;
    background: #272727;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    color: #ff6a00;
    font-weight: bold;
}

/* ░░ FUEL TAG ░░ */
.fuel-type {
    font-weight: bold;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* ░░ BUTTONS ░░ */
.car-card-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem; /* Add gap between buttons */
    margin-top: 0.75rem;
}

.car-card-buttons button {
    flex: 1;
    padding: 0.6rem;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 6px;
    text-align: center;
    box-sizing: border-box;
}
.btn-edit-nickname {
    background: none;
    border: none;
    padding: 0;
    margin-left: 0.4rem;
    font-size: 0.9rem;
    color: #e4b600;
    cursor: pointer;
    vertical-align: middle;
}

.btn-edit-nickname i {
    font-size: 1rem;
    line-height: 1;
}
/* ===============================
   Transactions
   =============================== */
/* ░░ Transaction Table Styling ░░ */
.transaction-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
    background-color: #1a1a1a; /* Optional: dark background to match dark theme */
    color: #fff;
}

.transaction-table th,
.transaction-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #333;
    text-align: left;
}

/* ░░ Table Header in Yellow ░░ */
.transaction-table th {
    background-color: #e4b600;
    color: #000;
    text-transform: uppercase;
    font-weight: bold;
}

/* ░░ Optional Row Hover Effect ░░ */
.transaction-table tr:hover td {
    background-color: #333;
}
/* ░░ Fuel Type Styling ░░ */
.fuel-type {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.9rem;
}
.fuel-Regular { background: #ccc; color: #000; }
.fuel-Plus { background: #3498db; color: #fff; }
.fuel-Performance { background: #e67e22; color: #fff; }
.fuel-Race-Blend { background: #e74c3c; color: #fff; }

.boost-tag {
    margin-top: 4px;
    color: #e74c3c;
    font-weight: bold;
    font-size: 0.95rem;
}
.boost-tag i {
    margin-right: 4px;
    vertical-align: middle;
}
/* ───────────────────────────────────────────────────────────────
   GLOBAL MODAL STYLING
   ─────────────────────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6); /* Dark background */
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: #111;
    color: #fff;
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid #333;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    position: relative;
    text-align: center;
}

.modal-content h3 {
    margin-top: 0;
    font-size: 1.5rem;
    color: #fff;
}

#modalClose {
    position: absolute;
    top: 0.8rem;
    right: 1rem;
    font-size: 1.4rem;
    color: #888;
    cursor: pointer;
}

#modalClose:hover {
    color: #fff;
}
/* ===============================
   Winner Highlight
   =============================== */
tr.winner {
    background-color: #1c3c1c;
    font-weight: bold;
    border-left: 4px solid gold;
}
/* ===============================
   Race Winner Card
   =============================== */
.race-winner-card {
    position: relative;
    border: 2px solid gold;
    padding: 2rem;
    border-radius: 2rem;
    text-align: center;
    margin: 2rem 0;
    color: #fff;
    background: #222; /* fallback */
    overflow: hidden;
    z-index: 1;
}

.race-winner-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('../imgs/chequered-bg.jpg') center/cover no-repeat;
    opacity: 0.15; /* control transparency here */
    z-index: 0;
}
.trophy-icon,
.trophy-icon i {
    padding: 0;
    margin: 0;
}
.trophy-icon {
    font-size: 10rem;
    margin-bottom: 0.5rem;
}
.trophy-icon i {
    font-size: inherit;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    color: gold;
}
.winner-name {
    font-size: 2rem;
    color: gold;
    margin: 0;
}
.race-info {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: #aaa;
}
/* ===============================
   Toast Notifications
   =============================== */
.nav-notification-widget:hover {
    cursor: pointer;
}

.notification-toasts {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 200px;
}

.toast {
    background: #333;
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 10px #000;
    max-width: 300px;
    animation: fadeIn 0.3s ease;
    position: relative;
}

.toast.unread {
    border-left: 4px solid #ffd700;
}

.toast a {
    color: #61dafb;
    text-decoration: underline;
}

.toast .close-toast {
    position: absolute;
    top: 0.3rem;
    right: 0.7rem;
    cursor: pointer;
    font-size: 1.2rem;
    color: #aaa;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* ===============================
   Event Card with Flag Background
   =============================== */
.event-card {
    position: relative;
    border: 2px solid #ffd700;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,1);
    color: #fff;
    z-index: 0;
}

/* ░░ FLAG BACKGROUND LAYER ░░ */
.event-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--flag);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.2; /* adjust to control visibility */
    z-index: -1;
    filter: brightness(0.7) contrast(1.1);
    border-radius: 1rem;
    pointer-events: none;
}

/* ===============================
   Flag Badge for Event Cards
   =============================== */
.flag-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ffd700;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.flag-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ensure card has relative positioning */
.event-card {
    position: relative;
    padding-top: 3rem; /* make space for badge if needed */
}
/* ===============================
   Race animation
   =============================== */
#race-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
}

#race-container {
    position: relative;
    width: 200px;
    height: 1000px;
    background: #333;
    border: 3px solid #fff;
    overflow: hidden;
}
.lane {
    position: absolute;
    width: 2px;
    height: 100%;
    top: 0;
    opacity: 0.4;
}

/* Center divider between two lanes */
.lane-left {
    left: 100px;
    width: 8px;
    background-image: repeating-linear-gradient(
            to bottom,
            red,
            red 10px,
            white 10px,
            white 20px
    );
}

/* Optional second lane divider */
.lane-right {
    left: 150px;
}
.car {
    position: absolute;
    width: 50px;
    top: 0;
    z-index: 10;
}
#car1 {
    left: 25px;   /* 50px center - 25px half car width */
}
#car2 {
    left: 100px;  /* 125px center - 25px half car width */
}
.lane-label {
    position: absolute;
    top: 10px;
    font-size: 10px;
    color: #fff;
    opacity: 0.5;
}

.lane-label.left { left: 25px; }
.lane-label.right { left: 100px; }
/* Mini-map track */
#mini-map {
    width: 80px;
    height: 300px;
    border: 2px solid #fff;
    background: #222;
    position: fixed; /* ⬅️ Make it fixed to stay visible */
    top: 80px;        /* adjust depending on your header height */
    right: 20px;      /* position on the right side */
    border-radius: 0.5rem;
    z-index: 1000;
}

.mini-car {
    width: 20px;
    height: 20px;
    background: yellow;
    border-radius: 50%;
    position: absolute;
}

#mini-car1 { left: 15px; background: red; }
#mini-car2 { left: 45px; background: blue; }
.smoke {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(rgba(255, 255, 255, 0.5), transparent);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.2s ease;
}

#smoke1 {
    top: 30px;
    left: 35px;
}

#smoke2 {
    top: 30px;
    left: 110px;
}


#drag-light {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 60px;  /* aligns with start line */
}

.light {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #222;
    border: 2px solid #555;
    transition: background 0.3s;
}

.light.red.on { background: red; }
.light.yellow.on { background: yellow; }
.light.green.on { background: limegreen; }

.start-line, .finish-line {
    position: absolute;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 2;
}
.start-line {
    position: absolute;
    top: 60px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 2;
}
.checkered-grid {
    width: 124px;
    display: grid;
    grid-template-columns: repeat(12, 10px);
    grid-template-rows: repeat(2, 10px);
    gap: 0;
    border: 2px solid white;
}

.cell {
    width: 10px;
    height: 10px;
}

.cell.white { background: white; }
.cell.black { background: black; }

.start-label {
    font-family: monospace;
    color: white;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 2px;
}
.finish-line {
    position: absolute;
    bottom: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 2;
}
/* ===============================
   Leaderboard Tabs
   =============================== */
.leaderboard-tabs {
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

.leaderboard-tabs a {
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: #333;
    color: #fff;
    border-radius: 5px;
    transition: background 0.3s;
}

.leaderboard-tabs a.active {
    background: #e4b600;
    color: #000;
    font-weight: bold;
}

/* ===============================
   Leaderboard Table
   =============================== */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: #1c1c1c;
    color: #fff;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #444;
    text-align: left;
}

/* ===============================
   Star Icon Next to Level
   =============================== */
.star-icon {
    color: gold;
    font-size: 1.2rem;
    vertical-align: middle;
    margin-right: 0.25rem;
}
.avatar-small-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.avatar-frame-small {
    width: 32px;
    height: 32px;
    border-radius: 2px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-small-img {
    width: 24px;
    height: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

