@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,700;1,700;1,800;1,900&family=Racing+Sans+One&family=Russo+One&family=Teko:wght@700&display=swap');

/* Racing stripe decorative elements */
.racing-stripe {
    background: repeating-linear-gradient(
        45deg,
        #f97316,
        #f97316 10px,
        #000000 10px,
        #000000 20px
    );
    height: 10px;
    width: 100%;
}

/* Card hover effects with subtle shadows */
.hover-card {
    transition: transform 0.2s, box-shadow 0.2s;
}
.hover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
}

/* Gradient header/banner */
.gradient-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* Animation for podium display */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.podium-anim {
    animation: slideUp 0.5s ease-out forwards;
}

/* Smooth page transitions */
.fade-enter {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}
.fade-enter-active {
    opacity: 1;
}

/* Custom checkbox styles */
.custom-checkbox {
    appearance: none;
    background-color: transparent;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.5em;
    height: 1.5em;
    border: 2px solid #94a3b8;
    border-radius: 0.15em;
    display: grid;
    place-content: center;
}
.custom-checkbox::before {
    content: "";
    width: 0.85em;
    height: 0.85em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em #f97316;
    background-color: #f97316;
    transform-origin: bottom left;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.custom-checkbox:checked::before {
    transform: scale(1);
}
.custom-checkbox:checked {
    border-color: #f97316;
}

/* NO STAR box styling */
.no-star-box {
    border: 4px solid #1e293b;
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toast container */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(100%);
    animation: slideInRight 0.3s forwards;
}
@keyframes slideInRight {
    to { opacity: 1; transform: translateX(0); }
}
.toast.success { background-color: #10b981; }
.toast.error { background-color: #ef4444; }
.toast.fade-out {
    animation: fadeOut 0.3s forwards;
}
@keyframes fadeOut {
    to { opacity: 0; }
}

/* Print Area */
.print-only { display: none; }

/* =======================================================
   PAPAN NOMOR START BALAP MOTOGP STYLE (RACING NUMBER PLATE)
   Desain Agresif Motorsport, Latar Belakang Foto, Slanted Plate
   ======================================================= */
.grid-start-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

@media (max-width: 640px) {
    .grid-start-board {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 14px;
    }
}

/* Base MotoGP Racing Plate Card */
.racing-plate, .start-card {
    position: relative;
    border-radius: 18px;
    padding: 0;
    overflow: hidden;
    min-height: 142px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    background: #060913;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}

/* MotoGP Carbon Weave & Aerodynamic Corner Notch */
.racing-plate::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 42px;
    height: 42px;
    background: linear-gradient(225deg, rgba(249, 115, 22, 0.4) 0%, transparent 60%);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
    z-index: 3;
    pointer-events: none;
    transition: all 0.3s ease;
}

.racing-plate.taken, .start-card.taken {
    cursor: pointer;
    border-color: rgba(249, 115, 22, 0.4);
}

.racing-plate.taken:hover, .start-card.taken:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: #f97316;
    box-shadow: 0 20px 35px -5px rgba(249, 115, 22, 0.45), 0 0 25px rgba(249, 115, 22, 0.25);
}

.racing-plate.taken:hover::before {
    background: linear-gradient(225deg, rgba(249, 115, 22, 0.9) 0%, transparent 70%);
    width: 55px;
    height: 55px;
}

/* MotoGP Photo Layer (Latar Foto Pembalap Penuh) */
.racing-plate-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    background: #070c18;
}

.racing-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transform: scale(1.02);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
    filter: brightness(0.92) contrast(1.1);
}

.racing-plate:hover .racing-bg-img {
    transform: scale(1.10);
    filter: brightness(1.0) contrast(1.15);
}

/* MotoGP Carbon & High-Speed Circuit Fallback Graphic */
.racing-bg-fallback {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 75% 30%, #1e293b 0%, #090e1a 75%);
    position: relative;
    overflow: hidden;
}

.racing-bg-fallback::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0, rgba(255, 255, 255, 0.02) 2px, transparent 0, transparent 6px);
}

/* MotoGP Cinematic Masking: Dark on Left (Text readable), Visible Rider on Right */
.racing-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, 
        rgba(4, 7, 16, 0.96) 0%, 
        rgba(5, 9, 20, 0.88) 42%, 
        rgba(6, 11, 24, 0.45) 75%, 
        rgba(4, 7, 16, 0.65) 100%),
        linear-gradient(180deg, 
        rgba(4, 7, 16, 0.35) 0%, 
        rgba(4, 7, 16, 0.90) 100%);
}

/* Card Content: Side-by-Side Flex Layout MotoGP Style */
.racing-plate-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: stretch;
    height: 100%;
    min-height: 142px;
    padding: 12px;
    gap: 14px;
}

/* Sisi Kiri: Kotak Nomor Fairing MotoGP (Slanted Cowl Plate) */
.racing-num-box {
    width: 100px;
    min-width: 100px;
    flex-shrink: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(3, 7, 18, 0.96) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(249, 115, 22, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8), 0 6px 16px rgba(0, 0, 0, 0.7);
    transform: skewX(-6deg);
    transition: all 0.28s ease;
}

.racing-plate.taken:hover .racing-num-box {
    border-color: #f97316;
    background: linear-gradient(135deg, rgba(20, 30, 55, 0.95) 0%, rgba(5, 9, 22, 0.98) 100%);
    box-shadow: 0 0 18px rgba(249, 115, 22, 0.5), inset 0 0 10px rgba(249, 115, 22, 0.2);
    transform: skewX(-8deg) scale(1.04);
}

.racing-num-label {
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #f97316;
    text-transform: uppercase;
    transform: skewX(6deg);
}

.racing-num-sub {
    font-size: 7.5px;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: #cbd5e1;
    text-transform: uppercase;
    transform: skewX(6deg);
}

/* Tipografi Nomor Balap MotoGP: Bold, Slanted, Metallic Gradient */
.racing-plate-num, .start-card-no {
    font-family: 'Impact', 'Arial Black', -apple-system, sans-serif;
    font-size: 38px;
    font-style: italic;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1px;
    text-align: center;
    margin: 3px 0;
    padding-right: 4px;
    display: inline-block;
    overflow: visible;
    transform: skewX(6deg);
    background: linear-gradient(180deg, #ffffff 0%, #ffedd5 30%, #fb923c 68%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 8px rgba(249, 115, 22, 0.4));
    transition: filter 0.25s ease;
}

.racing-plate.taken:hover .racing-plate-num {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 1)) drop-shadow(0 0 14px rgba(249, 115, 22, 0.7));
}

/* Sisi Sebelahnya: Info Pembalap MotoGP Rider Profile */
.racing-info-box {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2px 0;
}

.racing-info-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.racing-class-pill {
    font-size: 9.5px;
    font-weight: 900;
    color: #fed7aa;
    background: rgba(154, 52, 18, 0.5);
    border: 1px solid rgba(249, 115, 22, 0.45);
    border-radius: 6px;
    padding: 2px 7px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.3px;
}

.racing-status-pill {
    font-size: 8.5px;
    font-weight: 900;
    border-radius: 6px;
    padding: 2px 6px;
    white-space: nowrap;
    letter-spacing: 0.4px;
}

.racing-status-pill.status-lunas {
    background: rgba(6, 78, 59, 0.9);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.6);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.racing-status-pill.status-pending {
    background: rgba(120, 53, 15, 0.9);
    color: #fde047;
    border: 1px solid rgba(245, 158, 11, 0.6);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.racing-info-main {
    margin: 4px 0;
}

.racing-rider-name, .start-card-name {
    font-size: 14px;
    font-weight: 900;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 1), 0 0 10px rgba(0, 0, 0, 0.8);
}

.racing-team-pill {
    font-size: 10.5px;
    font-weight: 800;
    color: #fde047;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.racing-info-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding-top: 2px;
}

.racing-click-detail {
    font-size: 9.5px;
    font-weight: 800;
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s ease;
}

.racing-plate:hover .racing-click-detail {
    color: #fb923c;
    transform: translateX(2px);
}

/* Tombol Cepat Foto Joki di Kartu (Khusus Admin) */
.racing-photo-btn {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s ease;
}

.racing-photo-btn:hover {
    background: #f97316;
    color: #ffffff;
    border-color: #f97316;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
}

/* --- TERSEDIA / AVAILABLE MOTOGP RACING PLATE --- */
.racing-plate.available, .start-card.available {
    border: 1.5px dashed rgba(51, 65, 85, 0.8);
    background: #040812;
    cursor: pointer;
}

.racing-plate.available::before {
    background: linear-gradient(225deg, rgba(16, 185, 129, 0.35) 0%, transparent 60%);
}

.racing-plate.available:hover, .start-card.available:hover {
    border-style: solid;
    border-color: #10b981;
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 18px 32px -5px rgba(16, 185, 129, 0.35), 0 0 20px rgba(16, 185, 129, 0.2);
}

.racing-plate.available:hover::before {
    background: linear-gradient(225deg, rgba(16, 185, 129, 0.85) 0%, transparent 70%);
}

.racing-num-box.available-box {
    border-color: rgba(51, 65, 85, 0.7);
    background: rgba(4, 9, 20, 0.92);
}

.racing-plate.available:hover .racing-num-box.available-box {
    border-color: #10b981;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

.racing-plate-num.available-num, .start-card.available .start-card-no {
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: #64748b;
    color: #64748b;
    filter: none;
    transition: all 0.25s ease;
}

.racing-plate.available:hover .racing-plate-num.available-num, .start-card.available:hover .start-card-no {
    color: #10b981;
    -webkit-text-fill-color: #10b981;
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.6));
}

.racing-claim-inline-btn, .btn-card-add {
    font-size: 9.5px;
    font-weight: 900;
    padding: 3.5px 9px;
    border-radius: 7px;
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #34d399;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.racing-plate.available:hover .racing-claim-inline-btn, .start-card.available:hover .btn-card-add {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.45);
}

/* Outdoor Mode / Light Mode overrides for Racing Plate */
body.outdoor-mode .racing-plate, body.outdoor-mode .start-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}
body.outdoor-mode .racing-bg-overlay {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.82) 50%, rgba(255, 255, 255, 0.92) 100%) !important;
}
body.outdoor-mode .racing-num-box {
    background: rgba(248, 250, 252, 0.95) !important;
    border-color: #ea580c !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}
body.outdoor-mode .racing-num-label {
    color: #ea580c !important;
}
body.outdoor-mode .racing-num-sub {
    color: #64748b !important;
}
body.outdoor-mode .racing-plate.taken, body.outdoor-mode .start-card.taken {
    border-color: #ea580c !important;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.2) !important;
}
body.outdoor-mode .racing-plate.taken .racing-plate-num, body.outdoor-mode .start-card.taken .start-card-no {
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: #ea580c !important;
    color: #ea580c !important;
    filter: none !important;
}
body.outdoor-mode .racing-plate.taken .racing-rider-name, body.outdoor-mode .start-card.taken .start-card-name {
    color: #0f172a !important;
    text-shadow: none !important;
}
body.outdoor-mode .racing-plate.taken .racing-team-pill {
    color: #b45309 !important;
    text-shadow: none !important;
}
body.outdoor-mode .racing-click-detail {
    color: #64748b !important;
}
body.outdoor-mode .racing-plate.available, body.outdoor-mode .start-card.available {
    background: #f8fafc !important;
    border: 2px dashed #94a3b8 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}
body.outdoor-mode .racing-num-box.available-box {
    border-color: #cbd5e1 !important;
    background: #f1f5f9 !important;
}
body.outdoor-mode .racing-plate.available .racing-plate-num, body.outdoor-mode .start-card.available .start-card-no {
    color: #64748b !important;
}
body.outdoor-mode .racing-plate.available:hover, body.outdoor-mode .start-card.available:hover {
    border-color: #059669 !important;
}
body.outdoor-mode .racing-plate.available:hover .racing-plate-num, body.outdoor-mode .start-card.available:hover .start-card-no {
    color: #059669 !important;
}
}

/* Accordion for Rekap Kelas */
.accordion-header {
    background: #1e293b;
    border: 1px solid #334155;
    transition: background 0.2s;
}
.accordion-header:hover {
    background: #273549;
}

/* Tournament Bracket & Bagan Lines */
.bracket-wrapper {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding: 1.5rem 0.5rem;
    align-items: flex-start;
}
.bracket-col {
    flex: 0 0 310px;
    min-width: 290px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.bracket-line-col {
    flex: 0 0 270px;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.bracket-connector-card {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 1.5px solid rgba(16, 185, 129, 0.45);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    position: relative;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.bracket-connector-card:hover {
    border-color: #10b981;
    box-shadow: 0 14px 28px -4px rgba(16, 185, 129, 0.25);
    transform: translateY(-2px);
}
/* World Cup / Tournament Tree Cards */
.tree-card {
    background: #0f172a;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.6);
    transition: all 0.2s;
    border: 2px solid #334155;
    position: relative;
}
.tree-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.7);
}
.tree-card-blue {
    border-color: #3b82f6;
}
.tree-card-blue:hover {
    border-color: #60a5fa;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
}
.tree-card-cyan {
    border-color: #06b6d4;
}
.tree-card-cyan:hover {
    border-color: #22d3ee;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
}
.tree-card-amber {
    border-color: #f59e0b;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}
.tree-card-amber:hover {
    border-color: #fbbf24;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.3);
}
.tree-card-green {
    border-color: #10b981;
}
.tree-card-green:hover {
    border-color: #34d399;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}
.tree-card-gold {
    border-color: #f59e0b;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.2);
}
.tree-card-gold:hover {
    border-color: #fbbf24;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.35);
}
.tree-card-purple {
    border-color: #a855f7;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.25);
}
.tree-card-purple:hover {
    border-color: #c084fc;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.4);
}
.tree-card-red {
    border-color: #ef4444;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.25);
}
.tree-card-red:hover {
    border-color: #f87171;
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.4);
}
.bracket-fork-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.bracket-heat {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    position: relative;
    transition: all 0.2s;
}
.bracket-heat:hover {
    border-color: #f97316;
}
.bracket-slot {
    display: flex;
    align-items: center;
    justify-between;
    padding: 0.45rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    background: #0f172a;
    border: 1px solid #1e293b;
    margin-bottom: 0.35rem;
    transition: background 0.15s;
}
.bracket-slot.qualified {
    border-color: #10b981;
    background: rgba(6, 78, 59, 0.25);
}
.bracket-slot.champion {
    border-color: #eab308;
    background: rgba(113, 63, 18, 0.3);
}

/* Drag & Drop Styles for Race Results */
.drag-item {
    cursor: grab;
    user-select: none;
    transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}
.drag-item:active {
    cursor: grabbing;
}
.drag-item.dragging {
    opacity: 0.4;
    transform: scale(0.98);
    background: #334155 !important;
}
.drag-item.drag-over {
    border-top: 2px solid #f97316 !important;
    background: #1e293b;
}

/* ======================================================== */
/* DROPDOWN MENU HOVER BRIDGE (Never Disappear on Hover)    */
/* ========================================================
   NAVIGATION DROPDOWNS (MENU UTAMA & SUB-MENU ADMIN)
   ======================================================== */
.nav-dropdown,
#nav-dropdown-pengaturan,
#nav-dropdown-balap {
    position: relative;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown-menu.show,
#nav-dropdown-pengaturan:hover #menu-dropdown-pengaturan,
#nav-dropdown-pengaturan.open #menu-dropdown-pengaturan,
#menu-dropdown-pengaturan.show,
#nav-dropdown-balap:hover #menu-dropdown-balap,
#nav-dropdown-balap.open #menu-dropdown-balap,
#menu-dropdown-balap.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.nav-dropdown-menu,
#menu-dropdown-pengaturan,
#menu-dropdown-balap {
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

/* Invisible hover bridge between trigger button and menu */
.nav-dropdown-menu::before,
#menu-dropdown-pengaturan::before,
#menu-dropdown-balap::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
}

/* ==========================================================================
   RACE CARD LOCKED BINGKAI HIJAU & DRAG-AND-DROP MODAL HASIL
   ========================================================================== */

/* Bingkai Hijau Tegas & Glowing pada Posisi Lock */
.race-card-locked {
    border: 2px solid #10b981 !important; /* Emerald-500 */
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35), 0 10px 25px -5px rgba(6, 78, 59, 0.45) !important;
    position: relative;
}

.race-card-locked-inner {
    border-color: rgba(16, 185, 129, 0.4) !important;
}

/* Drag & Drop Visuals for Modal Input Hasil */
.modal-racer-row {
    user-select: none;
    cursor: grab;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-racer-row:active {
    cursor: grabbing;
}

.modal-racer-row.dragging {
    opacity: 0.35 !important;
    transform: scale(0.97);
    border: 2px dashed #f97316 !important;
    background: #1e293b !important;
}

.modal-racer-row.drag-over {
    border: 2px solid #f97316 !important;
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.45) !important;
    transform: scale(1.015);
    background: #1e293b !important;
}

/* ==========================================================================
   LIVE RACE SCOREBOARD, STARTING GRID & TV DISPLAY
   ========================================================================== */

@keyframes livePulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.live-pulse-dot {
    animation: livePulseGlow 2s infinite;
}

@keyframes liveCardPulse {
    0%, 100% {
        border-color: rgba(239, 68, 68, 0.85);
        box-shadow: 0 0 25px rgba(239, 68, 68, 0.25), inset 0 0 15px rgba(239, 68, 68, 0.08);
    }
    50% {
        border-color: rgba(249, 115, 22, 0.95);
        box-shadow: 0 0 35px rgba(249, 115, 22, 0.35), inset 0 0 20px rgba(249, 115, 22, 0.12);
    }
}

.live-on-track-card {
    border: 2px solid rgba(239, 68, 68, 0.85);
    animation: liveCardPulse 3s ease-in-out infinite;
}

.next-race-card {
    border: 2px solid rgba(245, 158, 11, 0.7);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.gate-badge {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    font-family: ui-monospace, monospace;
}

.gate-badge-active {
    background: linear-gradient(135deg, #7f1d1d 0%, #450a0a 100%);
    border: 1px solid #ef4444;
}

/* TV Broadcast Clock & Typography */
.tv-clock {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.05em;
}

.tv-display-header {
    background: linear-gradient(180deg, #0f172a 0%, #090d16 100%);
    border-bottom: 2px solid rgba(239, 68, 68, 0.7);
}

.tv-live-badge {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.5);
}

.tv-next-badge {
    background: linear-gradient(135deg, #d97706 0%, #92400e 100%);
    box-shadow: 0 0 15px rgba(217, 119, 6, 0.4);
}

.tv-results-badge {
    background: linear-gradient(135deg, #059669 0%, #065f46 100%);
    box-shadow: 0 0 15px rgba(5, 150, 105, 0.4);
}

/* Fullscreen TV Mode for Circuit Displays */
:fullscreen .live-race-container {
    background-color: #090d16;
    padding: 1.5rem 2rem;
    height: 100vh;
    overflow-y: auto;
}

:-webkit-full-screen .live-race-container {
    background-color: #090d16;
    padding: 1.5rem 2rem;
    height: 100vh;
    overflow-y: auto;
}

/* ==========================================================================
   SHIMMER SKELETON PLACEHOLDER
   ========================================================================== */
@keyframes shimmerAnim {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer-skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmerAnim 1.6s ease-in-out infinite;
    border-radius: 0.5rem;
}

/* ==========================================================================
   OUTDOOR / HIGH-CONTRAST LIGHT MODE (MODE SIRKUIT TERIK MATAHARI)
   ========================================================================== */
body.outdoor-mode {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

/* 1. Top Navbar & Navigation Menus in Light Mode (High Contrast Racing Bar) */
body.outdoor-mode nav.gradient-header,
body.outdoor-mode nav:not([aria-label="Tabs"]):not(.mobile-bottom-nav) {
    background: #0f172a !important;
    background-color: #0f172a !important;
    background-image: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-bottom: 2px solid #334155 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

/* ALL text and links in the top navigation bar MUST BE CRISP BRIGHT WHITE & ORANGE */
body.outdoor-mode nav:not([aria-label="Tabs"]) a,
body.outdoor-mode nav:not([aria-label="Tabs"]) .nav-link,
body.outdoor-mode nav:not([aria-label="Tabs"]) span.font-bold,
body.outdoor-mode nav:not([aria-label="Tabs"]) .text-white {
    color: #ffffff !important;
}

body.outdoor-mode nav:not([aria-label="Tabs"]) a.nav-link {
    color: #cbd5e1 !important;
    font-weight: 700 !important;
}

body.outdoor-mode nav:not([aria-label="Tabs"]) a.nav-link:hover {
    color: #ffffff !important;
}

body.outdoor-mode nav:not([aria-label="Tabs"]) a.nav-link.text-orange-500,
body.outdoor-mode nav:not([aria-label="Tabs"]) a.text-orange-500,
body.outdoor-mode nav:not([aria-label="Tabs"]) span.text-orange-500 {
    color: #f97316 !important;
    font-weight: 800 !important;
}

body.outdoor-mode nav:not([aria-label="Tabs"]) .text-red-400,
body.outdoor-mode nav:not([aria-label="Tabs"]) a.text-red-400,
body.outdoor-mode nav:not([aria-label="Tabs"]) span.text-red-400 {
    color: #f87171 !important;
    font-weight: 800 !important;
}

/* Outdoor Mode Toggle Button in Navbar */
body.outdoor-mode #btn-outdoor-mode-desktop,
body.outdoor-mode #btn-outdoor-mode-mobile {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #fbbf24 !important;
}

body.outdoor-mode #outdoor-label-desktop,
body.outdoor-mode #outdoor-icon-desktop,
body.outdoor-mode #outdoor-icon-mobile {
    color: #fbbf24 !important;
}

/* Role badges & logout in Top Navbar */
body.outdoor-mode nav .bg-amber-950 {
    background-color: rgba(120, 53, 15, 0.7) !important;
    border-color: #b45309 !important;
    color: #fde68a !important;
}
body.outdoor-mode nav .bg-amber-950 * {
    color: #fde68a !important;
}
body.outdoor-mode nav .bg-blue-950 {
    background-color: rgba(30, 58, 138, 0.7) !important;
    border-color: #2563eb !important;
    color: #bfdbfe !important;
}
body.outdoor-mode nav .bg-blue-950 * {
    color: #bfdbfe !important;
}
body.outdoor-mode nav .bg-purple-950 {
    background-color: rgba(88, 28, 135, 0.7) !important;
    border-color: #9333ea !important;
    color: #e9d5ff !important;
}
body.outdoor-mode nav .bg-purple-950 * {
    color: #e9d5ff !important;
}
body.outdoor-mode nav button[onclick*="handleNavbarLogout"] {
    background-color: rgba(127, 29, 29, 0.7) !important;
    border-color: #b91c1c !important;
    color: #fca5a5 !important;
}
body.outdoor-mode nav button[onclick*="handleNavbarLogout"] * {
    color: #fca5a5 !important;
}

/* 2. Mobile Dropdown Menu */
body.outdoor-mode #mobile-menu {
    background: #0f172a !important;
    background-color: #0f172a !important;
    border-bottom: 2px solid #334155 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
}

body.outdoor-mode #mobile-menu a,
body.outdoor-mode #mobile-menu .mobile-nav-link {
    color: #f1f5f9 !important;
    font-weight: 700 !important;
}

body.outdoor-mode #mobile-menu a:hover {
    color: #f97316 !important;
}

body.outdoor-mode #mobile-menu .text-red-400,
body.outdoor-mode #mobile-menu a.text-red-400 {
    color: #f87171 !important;
}

/* 3. Docked Mobile Bottom Navigation */
body.outdoor-mode .mobile-bottom-nav {
    background: #0f172a !important;
    background-color: #0f172a !important;
    border-top: 2px solid #334155 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35) !important;
}

body.outdoor-mode .mobile-bottom-nav .mobile-nav-btn,
body.outdoor-mode .mobile-bottom-nav .mobile-nav-btn span {
    color: #94a3b8 !important;
    font-weight: 700 !important;
}

body.outdoor-mode .mobile-bottom-nav .mobile-nav-btn.active,
body.outdoor-mode .mobile-bottom-nav .mobile-nav-btn.active span,
body.outdoor-mode .mobile-bottom-nav .mobile-nav-btn.text-orange-500,
body.outdoor-mode .mobile-bottom-nav .mobile-nav-btn.text-orange-500 span {
    color: #f97316 !important;
}

body.outdoor-mode .mobile-bottom-nav .mobile-nav-btn.text-red-400,
body.outdoor-mode .mobile-bottom-nav .mobile-nav-btn.text-red-400 span {
    color: #f87171 !important;
}

body.outdoor-mode .mobile-bottom-nav a[href="#/daftar"] div {
    background: linear-gradient(to top right, #ea580c, #f59e0b) !important;
}
body.outdoor-mode .mobile-bottom-nav a[href="#/daftar"] span {
    color: #ffffff !important;
}

/* 4. Tab Navigation inside Admin & Dashboard (nav[aria-label="Tabs"]) */
body.outdoor-mode nav[aria-label="Tabs"] .tab-btn {
    color: #475569 !important;
    font-weight: 700 !important;
}
body.outdoor-mode nav[aria-label="Tabs"] .tab-btn * {
    color: #475569 !important;
}
body.outdoor-mode nav[aria-label="Tabs"] .tab-btn:hover,
body.outdoor-mode nav[aria-label="Tabs"] .tab-btn:hover * {
    color: #0f172a !important;
}
body.outdoor-mode nav[aria-label="Tabs"] .tab-btn.active,
body.outdoor-mode nav[aria-label="Tabs"] .tab-btn.active * {
    color: #ea580c !important;
    border-color: #ea580c !important;
}

/* 3. Surface Cards & Containers: Turn dark backgrounds into white/light */
body.outdoor-mode .bg-slate-950,
body.outdoor-mode .bg-slate-900,
body.outdoor-mode .bg-slate-850,
body.outdoor-mode .bg-slate-800,
body.outdoor-mode .bg-slate-750,
body.outdoor-mode [class*="bg-slate-950"],
body.outdoor-mode [class*="bg-slate-900"],
body.outdoor-mode [class*="bg-slate-850"],
body.outdoor-mode [class*="bg-slate-800"],
body.outdoor-mode [class*="bg-slate-750"] {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* Subtle contrast for inner boxes, wells, and stat pills */
body.outdoor-mode [class*="bg-slate-950/"],
body.outdoor-mode [class*="bg-slate-900/"],
body.outdoor-mode .bg-slate-950,
body.outdoor-mode .bg-slate-900 {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

/* Card surfaces with clean light shadow */
body.outdoor-mode .bg-slate-800,
body.outdoor-mode [class*="bg-slate-800/"] {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06) !important;
}

/* 4. Text Typography on Light Surfaces */
body.outdoor-mode .text-white,
body.outdoor-mode .text-slate-100,
body.outdoor-mode .text-slate-200 {
    color: #0f172a !important;
}

body.outdoor-mode .text-slate-300,
body.outdoor-mode .text-slate-400 {
    color: #334155 !important;
}

body.outdoor-mode .text-slate-500 {
    color: #64748b !important;
}

/* 5. PROTECTED TEXT: All Buttons & Vibrant Elements MUST KEEP PURE WHITE TEXT */
body.outdoor-mode .bg-orange-600,
body.outdoor-mode .bg-orange-500,
body.outdoor-mode .bg-blue-600,
body.outdoor-mode .bg-blue-700,
body.outdoor-mode .bg-red-600,
body.outdoor-mode .bg-red-700,
body.outdoor-mode .bg-emerald-600,
body.outdoor-mode .bg-green-600,
body.outdoor-mode .bg-indigo-600,
body.outdoor-mode [class*="bg-orange-600"],
body.outdoor-mode [class*="bg-blue-600"],
body.outdoor-mode [class*="bg-red-600"],
body.outdoor-mode [class*="bg-emerald-600"],
body.outdoor-mode [class*="from-orange-"],
body.outdoor-mode [class*="from-blue-"],
body.outdoor-mode [class*="from-red-"],
body.outdoor-mode [class*="from-emerald-"],
body.outdoor-mode #btn-submit,
body.outdoor-mode button[type="submit"] {
    color: #ffffff !important;
}

body.outdoor-mode .bg-orange-600 *,
body.outdoor-mode .bg-orange-500 *,
body.outdoor-mode .bg-blue-600 *,
body.outdoor-mode .bg-blue-700 *,
body.outdoor-mode .bg-red-600 *,
body.outdoor-mode .bg-red-700 *,
body.outdoor-mode .bg-emerald-600 *,
body.outdoor-mode .bg-green-600 *,
body.outdoor-mode .bg-indigo-600 *,
body.outdoor-mode [class*="bg-orange-600"] *,
body.outdoor-mode [class*="bg-blue-600"] *,
body.outdoor-mode [class*="bg-red-600"] *,
body.outdoor-mode [class*="bg-emerald-600"] *,
body.outdoor-mode [class*="from-orange-"] *,
body.outdoor-mode [class*="from-blue-"] *,
body.outdoor-mode [class*="from-red-"] *,
body.outdoor-mode [class*="from-emerald-"] *,
body.outdoor-mode #btn-submit *,
body.outdoor-mode button[type="submit"] * {
    color: #ffffff !important;
}

/* 6. Transform Dark Badges to Crisp Pastel Badges with Dark Bold Text */
/* Green / Active Badges */
body.outdoor-mode [class*="bg-emerald-950"],
body.outdoor-mode .bg-emerald-950 {
    background-color: #d1fae5 !important;
    border-color: #6ee7b7 !important;
    color: #065f46 !important;
}
body.outdoor-mode [class*="bg-emerald-950"] * {
    color: #065f46 !important;
}

/* Orange / Amber Badges */
body.outdoor-mode [class*="bg-amber-950"],
body.outdoor-mode [class*="bg-orange-950"],
body.outdoor-mode .bg-amber-950,
body.outdoor-mode .bg-orange-950 {
    background-color: #ffedd5 !important;
    border-color: #fdba74 !important;
    color: #9a3412 !important;
}
body.outdoor-mode [class*="bg-amber-950"] *,
body.outdoor-mode [class*="bg-orange-950"] * {
    color: #9a3412 !important;
}

/* Red / Live Countdown Badges */
body.outdoor-mode [class*="bg-red-950"],
body.outdoor-mode .bg-red-950 {
    background-color: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #991b1b !important;
}
body.outdoor-mode [class*="bg-red-950"] * {
    color: #991b1b !important;
}

/* Blue / Info Boxes */
body.outdoor-mode [class*="bg-blue-950"],
body.outdoor-mode .bg-blue-950 {
    background-color: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #1e40af !important;
}
body.outdoor-mode [class*="bg-blue-950"] * {
    color: #1e40af !important;
}

/* 7. Inputs, Selects, and Textareas */
body.outdoor-mode input,
body.outdoor-mode select,
body.outdoor-mode textarea {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

body.outdoor-mode input::placeholder,
body.outdoor-mode textarea::placeholder {
    color: #94a3b8 !important;
}

body.outdoor-mode #nomor_start {
    background-color: #ffffff !important;
    color: #ea580c !important;
    border-color: #f97316 !important;
}

body.outdoor-mode #nomor_start[readonly] {
    background-color: #f8fafc !important;
    color: #b45309 !important;
}

/* 8. Tables */
body.outdoor-mode table {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

body.outdoor-mode th {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

body.outdoor-mode td {
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

body.outdoor-mode tr:hover {
    background-color: #f8fafc !important;
}

/* 9. Modals & Dropdown Menus */
body.outdoor-mode #success-modal > div,
body.outdoor-mode #modal-quick-team > div,
body.outdoor-mode #modal-edit-peserta > div,
body.outdoor-mode #modal-heat-edit > div,
body.outdoor-mode #modal-event > div,
body.outdoor-mode .modal-card {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

body.outdoor-mode .dropdown-menu,
body.outdoor-mode .nav-dropdown-menu,
body.outdoor-mode #nav-dropdown-pengaturan .dropdown-menu,
body.outdoor-mode #nav-dropdown-balap .dropdown-menu,
body.outdoor-mode #menu-dropdown-pengaturan > div,
body.outdoor-mode #menu-dropdown-balap > div {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12) !important;
}

body.outdoor-mode .dropdown-item {
    color: #1e293b !important;
}

body.outdoor-mode .dropdown-item:hover {
    background-color: #f1f5f9 !important;
    color: #ea580c !important;
}

/* 10. Procedural Graphic Racing Posters (preserve white text on graphic art) */
body.outdoor-mode [class*="bg-gradient-to-br from-"] *,
body.outdoor-mode [class*="from-orange-950"] *,
body.outdoor-mode [class*="from-amber-950"] * {
    color: #ffffff !important;
}

body.outdoor-mode [class*="bg-gradient-to-br from-"] .text-amber-400,
body.outdoor-mode [class*="from-orange-950"] .text-amber-400 {
    color: #facc15 !important;
}

body.outdoor-mode [class*="bg-gradient-to-br from-"] .text-orange-400,
body.outdoor-mode [class*="from-orange-950"] .text-orange-400 {
    color: #fb923c !important;
}

/* 11. General Borders and Dividers */
body.outdoor-mode .border-slate-800,
body.outdoor-mode .border-slate-750,
body.outdoor-mode .border-slate-700,
body.outdoor-mode .border-slate-600,
body.outdoor-mode [class*="border-slate-"] {
    border-color: #cbd5e1 !important;
}

body.outdoor-mode .divide-slate-800 > :not([hidden]) ~ :not([hidden]),
body.outdoor-mode .divide-slate-750 > :not([hidden]) ~ :not([hidden]),
body.outdoor-mode .divide-slate-700 > :not([hidden]) ~ :not([hidden]) {
    border-color: #cbd5e1 !important;
}

/* ==========================================================================
   3D OLYMPIC & MOTOGP PODIUM STYLING
   ========================================================================== */
.podium-pedestal-1 {
    background: linear-gradient(180deg, #fde047 0%, #eab308 40%, #ca8a04 100%);
    box-shadow: 0 10px 30px rgba(234, 179, 8, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.6), inset 0 -4px 8px rgba(161, 98, 7, 0.6);
    border-top: 3px solid #fef08a;
}

.podium-pedestal-2 {
    background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 40%, #94a3b8 100%);
    box-shadow: 0 8px 25px rgba(148, 163, 184, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.8), inset 0 -4px 8px rgba(71, 85, 105, 0.5);
    border-top: 3px solid #ffffff;
}

.podium-pedestal-3 {
    background: linear-gradient(180deg, #fbd38d 0%, #d97706 40%, #b45309 100%);
    box-shadow: 0 8px 25px rgba(217, 119, 6, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.6), inset 0 -4px 8px rgba(146, 64, 14, 0.6);
    border-top: 3px solid #fed7aa;
}

.podium-avatar-ring-1 {
    box-shadow: 0 0 0 4px #eab308, 0 0 25px rgba(234, 179, 8, 0.6);
}

.podium-avatar-ring-2 {
    box-shadow: 0 0 0 4px #94a3b8, 0 0 15px rgba(148, 163, 184, 0.4);
}

.podium-avatar-ring-3 {
    box-shadow: 0 0 0 4px #d97706, 0 0 15px rgba(217, 119, 6, 0.4);
}

/* ==========================================================================
   MOBILE BOTTOM DOCKED NAVIGATION
   ========================================================================== */
.mobile-bottom-nav {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.mobile-nav-btn.active {
    color: #f97316;
}

.mobile-nav-btn.active svg,
.mobile-nav-btn.active .nav-icon {
    transform: translateY(-2px) scale(1.1);
}

/* ==========================================================================
   LIVEONTRACK MOTORSPORT TIMING & DASHBOARD STYLING (liveontrack.com)
   ========================================================================== */
:root {
    --lot-bg-dark: #030712;
    --lot-surface-card: #0b101b;
    --lot-surface-card-hover: #111827;
    --lot-border: #1f2937;
    --lot-border-subtle: rgba(31, 41, 55, 0.6);
    --lot-accent-yellow: #facc15;
    --lot-accent-gold: #eab308;
    --lot-live-red: #ef4444;
}

.lot-scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.lot-scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.lot-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 1360px;
    margin: 0 auto;
    padding: 1rem 0.75rem;
}

@media (min-width: 1024px) {
    .lot-layout {
        flex-direction: row;
        align-items: flex-start;
        padding: 1.25rem 1rem;
        gap: 1.5rem;
    }
}

/* Left Aside: Event Selector */
.lot-aside {
    width: 100%;
    background: #0b101b;
    border: 1px solid #1f2937;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

@media (min-width: 1024px) {
    .lot-aside {
        width: 310px;
        min-width: 310px;
        position: sticky;
        top: 4.5rem;
        max-height: calc(100vh - 6rem);
        overflow-y: auto;
    }
}

.lot-event-card {
    display: block;
    background: #0f172a;
    border: 1px solid #1f2937;
    border-radius: 0.85rem;
    padding: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.lot-event-card:hover {
    border-color: #374151;
    background: #131d31;
    transform: translateY(-1px);
}

.lot-event-card.active {
    border-color: #facc15;
    background: #111827;
    box-shadow: 0 0 20px -3px rgba(250, 204, 21, 0.2), inset 0 0 0 1px rgba(250, 204, 21, 0.4);
}

.lot-event-card.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #facc15;
}

/* Right Main: Event Content Panel */
.lot-main-panel {
    flex: 1;
    min-width: 0;
    background: #0b101b;
    border: 1px solid #1f2937;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
    .lot-main-panel {
        padding: 1.5rem;
    }
}

/* Live Header Banner */
.lot-header-banner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #1f2937;
}

@media (min-width: 640px) {
    .lot-header-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* Competition / Phase Switcher Bar */
.lot-comp-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.35rem 0;
    border-bottom: 1px solid #1f2937;
}

.lot-comp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: 0.65rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
    color: #94a3b8;
    background: #0f172a;
    transition: all 0.2s;
    cursor: pointer;
}

.lot-comp-btn:hover {
    color: #f8fafc;
    background: #1e293b;
}

.lot-comp-btn.active {
    background: #1e293b;
    border-color: rgba(250, 204, 21, 0.6);
    color: #facc15;
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.15);
}

/* Class Filter Horizontal Tabs */
.lot-class-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    overflow-x: auto;
    padding: 0.65rem 0.25rem;
    border-bottom: 1px solid #1f2937;
}

.lot-class-tab {
    padding: 0.4rem 0.1rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    color: #94a3b8;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.lot-class-tab:hover {
    color: #ffffff;
}

.lot-class-tab.active {
    color: #facc15;
    font-weight: 900;
}

.lot-class-tab.active::after {
    content: "";
    position: absolute;
    bottom: -0.65rem;
    left: 0;
    right: 0;
    height: 3px;
    background: #facc15;
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 8px rgba(250, 204, 21, 0.6);
}

/* Leaderboard Grid Table */
.lot-timing-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.lot-timing-th {
    padding: 0.6rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    text-align: left;
    white-space: nowrap;
}

.lot-timing-row {
    background: #0f172a;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.lot-timing-row:hover {
    background: #131d31;
    transform: translateX(2px);
}

.lot-timing-td {
    padding: 0.85rem 0.75rem;
    font-size: 0.8rem;
    vertical-align: middle;
    border-top: 1px solid rgba(31, 41, 55, 0.7);
    border-bottom: 1px solid rgba(31, 41, 55, 0.7);
}

.lot-timing-td:first-child {
    border-left: 1px solid rgba(31, 41, 55, 0.7);
    border-top-left-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
}

.lot-timing-td:last-child {
    border-right: 1px solid rgba(31, 41, 55, 0.7);
    border-top-right-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}

/* Rank Position Badges */
.lot-rank-1 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.5rem;
    font-weight: 900;
    font-size: 1rem;
    background: rgba(234, 179, 8, 0.18);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.5);
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.25);
}

.lot-rank-2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.5rem;
    font-weight: 900;
    font-size: 1rem;
    background: rgba(203, 213, 225, 0.15);
    color: #e2e8f0;
    border: 1px solid rgba(203, 213, 225, 0.4);
}

.lot-rank-3 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.5rem;
    font-weight: 900;
    font-size: 1rem;
    background: rgba(217, 119, 6, 0.18);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.45);
}

.lot-rank-default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.5rem;
    font-weight: 800;
    font-size: 0.85rem;
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
}

/* Racing Number Box (3-Digit #001 format) */
.lot-number-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    min-width: 3.2rem;
    border-radius: 0.45rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 900;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
    background: #030712;
    color: #facc15;
    border: 1.5px solid #374151;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Status Pills */
.lot-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.lot-status-badge.finish {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.lot-status-badge.race {
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.35);
}

.lot-status-badge.dnf {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.35);
}

.lot-status-badge.dns {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.35);
}

/* Telemetry & Timing Checkpoint Accordion */
.lot-telemetry-box {
    background: #080d17;
    border: 1px solid #1f2937;
    border-radius: 0.65rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

/* Outdoor / Circuit Mode Overrides for LiveOnTrack */
body.outdoor-mode .lot-aside,
body.outdoor-mode .lot-main-panel {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
}

body.outdoor-mode .lot-event-card {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.outdoor-mode .lot-event-card.active {
    background: #fffbeb !important;
    border-color: #d97706 !important;
}

body.outdoor-mode .lot-timing-row {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.outdoor-mode .lot-timing-td {
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}

body.outdoor-mode .lot-timing-th {
    color: #475569 !important;
}

body.outdoor-mode .lot-telemetry-box {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}
