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

:root{

    --bg:#111827;

    --card:#1F2937;

    --card-hover:#243244;

    --primary:#3B82F6;

    --primary-hover:#2563EB;

    --danger:#EF4444;

    --danger-hover:#DC2626;

    --text:#F9FAFB;

    --muted:#94A3B8;

    --border:#374151;

}

body{
    min-height:100vh;

    display:flex;

    justify-content:center;

    align-items:center;

    background:linear-gradient(135deg,#111827,#0F172A);

    font-family:Poppins,sans-serif;

    color:var(--text);

    padding:20px;

    overflow:hidden;      
}

.app{

    width:100%;
    max-width:500px;
    

}

.card{

    background:var(--card);

    border:1px solid var(--border);

    border-radius:24px;

    padding:32px;

    box-shadow:0 35px 80px rgba(0,0,0,.6);

    display:flex;

    flex-direction:column;

    max-height:90vh;
}

h1{
    font-family: "Bebas Neue", sans-serif;
    text-align: center;
    font-size: 3rem;
    letter-spacing: 3px;
    font-weight: 400;
    margin-bottom: 30px;
}

.timer{

    display:flex;

    justify-content:center;

    align-items:center;

    gap:10px;

    margin-bottom:18px;

}

.timer span{

    font-size:2rem;

    font-weight:700;

    color:#CBD5E1;

}

.time-box{

    width:72px;

    height:72px;

    display:flex;

    justify-content:center;

    align-items:center;

    border-radius:16px;

    background:#0F172A;
    border:1px solid rgba(255,255,255,.12);

    font-family:"JetBrains Mono",monospace;

    font-size:2rem;

    font-weight:700;

}

.ms{

    width:92px;

    color:#60A5FA;

}



.controls{

    display:grid;

    grid-template-columns:repeat(2,1fr);

    gap:16px;

    margin-bottom:30px;

}

button{

    padding:16px;

    border:none;

    border-radius:14px;

    background:#475569;
    display:flex;
    justify-content:center;
    align-items:center;
    gap:10px;
    color:white;

    cursor:pointer;

    font-size:1rem;

    font-weight:600;

    transition:
    background .25s ease,
    transform .25s ease,
    box-shadow .25s ease;

}

button:hover{

    transform:translateY(-2px);
    transition:transform .3s ease;
    box-shadow:0 8px 18px rgba(0,0,0,.3);

}
.primary{

    background:var(--primary);

}
.pause{
    background:#6366F1;
}

.pause:hover{
    background:#4F46E5;
}

.lap{
    background:#06B6D4;
}

.lap:hover{
    background:#0891B2;
}
.primary:hover{

    background:var(--primary-hover);

}

.danger{

    background:var(--danger);

}

.danger:hover{

    background:var(--danger-hover);

}

.laps{

    border-top:1px solid var(--border);

    padding-top:24px;

}

.laps h2{
    font-family:"Bebas Neue",sans-serif;
    letter-spacing:2px;
    font-size:1.5rem;
}

.empty-state{

    text-align:center;

    padding:18px;

    border-radius:14px;

    border:1px dashed var(--border);

    color:#CBD5E1;

}

#laps li{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:14px 18px;

    border-radius:12px;

    background:#111827;

    border:1px solid rgba(255,255,255,.08);

    animation:slideDown .3s ease;

}

.running .time-box{

    border-color:#3B82F6;

    box-shadow:0 0 18px rgba(59,130,246,.35);

}
.paused .time-box{
    border-color:#F59E0B;
    box-shadow:0 0 12px rgba(245,158,11,.3);
}
@keyframes slideDown{

    from{

        opacity:0;

        transform:translateY(-12px);

    }

    to{

        opacity:1;

        transform:translateY(0);

    }

}
@media(max-width:430px){

  .card{
    max-height:88dvh;
}
     body{

        min-height:100dvh;

        align-items:flex-start;

        padding-top:max(12px, env(safe-area-inset-top));

        padding-bottom:max(12px, env(safe-area-inset-bottom));

        padding-left:16px;

        padding-right:16px;

    }
    .timer{

        gap:6px;

    }

    .time-box{

        width:58px;

        height:58px;

        font-size:1.5rem;

    }

    .ms{

        width:75px;

    }
    h1{

        font-size:2.5rem;

    }
    .controls{

        grid-template-columns:1fr;

    }

}
button:disabled{

    opacity:.75;

    cursor:not-allowed;

    transform:none;

    box-shadow:none;

}
#laps{
    list-style:none;
    margin-top:16px;
    display:flex;
    flex-direction:column;
    gap:12px;
    flex:1;
    max-height:220px;
    overflow-y:auto;
    padding-right:4px;
}
#laps::-webkit-scrollbar{
    width:6px;
}

#laps::-webkit-scrollbar-thumb{
    background:#475569;
    border-radius:10px;
}