*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    background:#111;
    color:#fff;
    font-family:'Segoe UI',sans-serif;
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    transition:background .3s ease;
}

body.alert-active{
    background:#b30000;
}

.container{
    width:480px;
    max-width:95%;
    text-align:center;
    padding:20px;
}

h1{
    font-size:32px;
    font-weight:300;
    letter-spacing:6px;
    margin-bottom:15px;
}


/* =====================
   GPS STATUS
===================== */

.gps-status{
    display:inline-block;
    padding:10px 18px;
    border-radius:25px;
    margin-bottom:20px;
    font-size:14px;
    font-weight:600;
    letter-spacing:1px;
}

.gps-status.offline{
    background:#333;
    color:#bbb;
}

.gps-status.connecting{
    background:#555;
    color:#fff;
    animation:pulse 1s infinite;
}

.gps-status.online{
    background:#fff;
    color:#111;
}


/* =====================
   WARNING BANNER
===================== */

.warning-banner{
    display:none;
    background:#ff0000;
    color:#fff;
    font-size:24px;
    font-weight:800;
    padding:16px;
    border-radius:8px;
    margin-bottom:20px;
    animation:blink .8s infinite;
    box-shadow:0 0 20px rgba(255,0,0,.8);
}


/* =====================
   SPEEDOMETER
===================== */

.speedometer{
    position:relative;
    margin-bottom:20px;
}

#gauge{
    width:100%;
}

.speed-value{
    position:absolute;
    top:58%;
    left:50%;
    transform:translate(-50%,-50%);
}

.speed-value span{
    font-size:72px;
    font-weight:200;
}

.speed-value small{
    display:block;
    margin-top:5px;
    font-size:16px;
    opacity:.8;
}


/* =====================
   CONTROLS
===================== */

.controls{
    margin-top:20px;
}

.controls label{
    display:block;
    margin-bottom:10px;
    font-size:16px;
}

.controls input{
    width:100%;
    padding:12px;
    background:#222;
    border:1px solid #444;
    color:#fff;
    text-align:center;
    font-size:18px;
    margin-bottom:15px;
}


/* =====================
   SPEED PRESETS
===================== */

.speed-presets{
    display:flex;
    gap:8px;
    margin-bottom:15px;
}

.preset-btn{
    flex:1;
    padding:12px;
    background:#222;
    color:#fff;
    border:1px solid #444;
    cursor:pointer;
    transition:.2s;
}

.preset-btn:hover{
    background:#333;
}

.preset-btn.active{
    background:#fff;
    color:#111;
    border-color:#fff;
    box-shadow:0 0 12px rgba(255,255,255,.7);
}


/* =====================
   BUTTONS
===================== */

button{
    width:100%;
    padding:14px;
    border:none;
    background:#fff;
    color:#111;
    font-size:16px;
    cursor:pointer;
    transition:.2s;
}

button:hover{
    opacity:.9;
}

button:disabled{
    opacity:.6;
    cursor:not-allowed;
}


/* =====================
   TEST MODE
===================== */

.test-section{
    margin-top:30px;
}

.test-section h3{
    margin-bottom:15px;
    font-weight:400;
}

#testSlider{
    width:100%;
}

#testValue{
    margin-top:12px;
    font-size:18px;
}


/* =====================
   ANIMATIONS
===================== */

@keyframes blink{

    0%{
        opacity:1;
    }

    50%{
        opacity:.35;
    }

    100%{
        opacity:1;
    }

}

@keyframes pulse{

    0%{
        opacity:1;
    }

    50%{
        opacity:.5;
    }

    100%{
        opacity:1;
    }

}


/* =====================
   MOBILE
===================== */

@media(max-width:600px){

    h1{
        font-size:24px;
        letter-spacing:4px;
    }

    .speed-value span{
        font-size:58px;
    }

    .warning-banner{
        font-size:18px;
    }

}

.source-status{
    margin-bottom:20px;
    font-size:14px;
    letter-spacing:1px;
    color:#bbb;
}
.sensor-panel{
    margin-bottom:20px;
    padding:15px;
    background:#1b1b1b;
    border:1px solid #333;
    border-radius:8px;
    font-size:13px;
    text-align:left;
}

.sensor-panel div{
    margin:4px 0;
}

.sensor-active{
    color:#00ff88;
}

.sensor-inactive{
    color:#999;
}
#wakeLockStatus{
    margin-top:10px;
    margin-bottom:15px;
    color:#bbb;
    font-size:14px;
}
