:root {
    --bg-black: #000000;
    --status-green: #3EFF3A;
    --white: #FFFFFF;

    /* Global scaling factor (Figma 2423px -> 70vw) */
    font-size: calc(70vw / 2423);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0F0F0F;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 100vh;
    font-family: 'Inria Sans', sans-serif;
    overflow: hidden;
    padding-right: 20px;
}

/* Sidebar Container */
.controls {
    position: fixed;
    left: 0;
    top: 0;
    width: 30vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    z-index: 100;
}

/* Lane View Logic */
.lane-view {
    position: relative;
    width: 250px;
    background-color: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Ensure it doesn't have alignment-breaking margins */
    margin: 0;
}

.lane-bg {
    width: 100%;
    height: auto;
    display: block;
}

.safebox {
    position: absolute;
    top: 0;
    height: 100%;
    border: 2px dashed rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    background-color: rgba(62, 255, 58, 0.12);
    pointer-events: none;
    z-index: 2; /* above lane image, below cars */
    display: block;
    box-sizing: border-box;
    will-change: left, width, background-color;
}

.car-icon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    /* width: 0.7 * (1/3) * png.width */
    width: calc(100% * 0.7 / 3);
    z-index: 5;
}

.front-car {
    cursor: grab;
    touch-action: none;
}

.car-icon img {
    width: 100%;
    height: auto;
    display: block;
}

.bottom-car {
    /* 
       SVG Aspect Ratio: 175 / 86 = 2.0348
       PNG Aspect Ratio: 1334 / 485 = 2.7505
       Car Height = (100% * 0.7 / 3) * 2.0348 = 47.48% (of width)
       Bottom Padding = 0.5 * Car Height = 23.74% (of width)
       Bottom padding as percentage of PNG height:
       (23.74 / 2.7505) = 8.63%
    */
    bottom: 8.63%;
}

.top-car {
    /* Top 1/5 of the lanes png as starting position */
    top: 20%;
    cursor: grab;
    touch-action: none;
}

.top-car:active {
    cursor: grabbing;
}

.value-display {
    position: absolute;
    bottom: -40px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: bold;
    color: #333;
    padding: 0 10px;
}

/* Canvas contents remain in REM (Figma pixels) */
.canvas {
    width: 2423rem;
    height: 607.5rem; /* top half of original 1215rem */
    background-color: var(--bg-black);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    align-self: center;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0));
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0));
}

.group-48 {
    position: absolute;
    left: 50%;
    top: -12rem;
    transform: translateX(-50%) translateZ(0);
    /* Hardware acceleration */
    height: 24rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.demo-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    z-index: 5; /* beneath the bar */
    pointer-events: none;
}

/* Moving the glow to children for reliable live-updates */
/* Optimized Glow: Use box-shadow instead of filter for performance */
.status-bar-outer,
.position_anchor {
    box-shadow: 0 0 12rem var(--status-green);
    /* Remove will-change if strictly necessary, but box-shadow is fast enough */
}

.status-bar-outer {
    position: absolute;
    width: 100%;
    height: 16rem;
    background-color: var(--status-green);
    border-radius: 20rem;
    z-index: 1;
}

.position_anchor {
    position: absolute;
    width: 47rem;
    height: 23rem;
    background-color: var(--status-green);
    border-bottom-left-radius: 8rem;
    border-bottom-right-radius: 8rem;
    left: 50%;
    top: 50%;
    /* Shifting vertically: center + offset */
    transform: translate(-50%, calc(-50% + 5rem));
    z-index: 2;
}